Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 17

Supplier search

Finding a Supplier

A purchasing agent is evaluating potential suppliers of an important electrical


component for one of her company's products. There are eight firms which
make components that could possibly fit her company's needs. Her plan is to
visit the firms in sequence, together with a company engineer, to test the
components. When she finds a supplier with a satisfactory component, she will
place an order.

Actually, only two of the eight firms make satisfactory components. How likely is
it that she will have to visit precisely two firms (i.e., that the first visited will
offer an unsatisfactory component, and the second a satisfactory one)?

Pr( first unsatisfactory AND second satisfactory )


= Pr( first unsatisfactory ) Pr( second satisfactory | first unsatisfactory )
= 6/8 2/7 = 21.43%

Via simulation:

before visit good left bad left good found? first good first good is found
1 2 6 0 0 on visit
2 2 5 1 2 2
3 1 5 0 0
4 1 4 0 0
5 1 3 0 0 Is the first good
6 1 2 1 0 found on visit 2?
7 0 2 0 0 1
8 0 1 0 0
$H$28 monitored cell
21.60% mean
0.411491 sample standard deviation
0 minimum
1 maximum
50,000 number of simulation runs

Page 1
Supplier search

0.36% margin of error (95% confidence)

Extension 1:

2 good firms
6 bad firms Spreadsheet notes: In order to make the formulas a bit
easier to read, I've given names to the "good firms"
k Pr( first good firm on visit k ) and "bad firms" parameters. Click on cell B41 to see
1 25.00% 25.00% its name, "good_firms", appear at the upper-lefthand
2 21.43% 21.43% corner of the screen.
3 17.86% 17.86%
4 14.29% 14.29% Double-click on cell D46 to see the formula with
5 10.71% 10.71% the cell names color-coded to the named cells.
6 7.14% 7.14%
7 3.57% 3.57% The "F5" key displays a list of all the named cells
8 - - in a workbook. Double-clicking on any displayed
total 100.00% 100.00% name will take you to that cell.

The middle column above builds the answer step-by-step, using the decomposition:

Pr( first good item on visit k ) = Pr( no good items on first k-1 visits AND good item on visit k )
= Pr( no good items on first k-1 visits )Pr( good item on visit k | no good items on first k-1 visits )
= [1 - sum of previous entries] ( 2 / (8 - (k-1)) )

Instead of summing the previous entries, we could directly compute

Pr( no good items on first k-1 visits ) = COMBIN(b,k-1)/COMBIN(g+b,k-1)

where g and b are the total numbers of good and bad suppliers, respectively.
This approach is used in the last column above.

Extension 2:

The second method of breaking the problem down also allows us to also handle the case where,
for purposes of supply reliability, she seeks more than one acceptable supplier:

Page 2
Supplier search

Pr( rth good item on visit k ) = Pr( r-1 good items on first k-1 visits and good item on visit k )
= Pr( r-1 good items on first k-1 visits )Pr( good item on visit k | r-1 good items on first k-1 visits )
= [formula below]( ( 2 - (r-1) ) / (8 - (k-1)) )

Pr( r-1 good items on first k-1 visits )


= ( number of ways of getting r-1 good items, and k-r bad ones, in k-1 visits )
/ ( number of ways of performing k-1 visits )
= COMBIN(g,r-1)*COMBIN(b,k-r) / COMBIN(g+b,k-1)

The table below solves this more-general problem: Any of the blue-colored cells
can be changed to explore various cases.

2 good firms (g)


6 bad firms (b)
1 good suppliers needed (r)
2 k
21.43% Pr( finding last required good supplier on visit k )

Page 3
Sick agents

Sick Agents

A real estate sales office has found (from past experience) that each of its five
sales agents has (independently) a 25% chance of calling in sick after a
three-day weekend. What is the probability that two agents will call in sick
immediately after the (3-day) Labor Day weekend?

If the agents are Andy, Bill, Chuck, Dave, and Ed, then the two who call in sick
could be Andy and Bill, or Andy and Chuck, or Dave and Ed. There are
COMBIN(5,2) = 10 ways to select the two who call in sick.

For any of these ways, the chance that those two call in sick is (0.25) 2, and the
chance that the other three show up for work is (0.75) 3. Therefore, the chance that
precisely two call in sick is

26.37% =COMBIN(5,2)*(0.25)^2*(0.75)^3

5 number of agents
25.00% Pr( an individual agent calls in sick )

k Pr( k call in sick )


0 23.73%
1 39.55%
2 26.37%
3 8.79%
4 1.46%
5 0.10%
sum 100.00%

Via simulation:

sick?
0 Andy $B$42 monitored cell
0 Bill 26.43% mean
0 Chuck 0.440964 sample standard deviation
0 Dave 0 minimum
1 Ed 1 maximum
1 total 50,000 number of simulation runs
0.39% margin of error (95% confidence)
0 Is total = 2?

Page 4
Fords

Identifying the Culprit

A witness to a hit-and-run accident identifies the fleeing vehicle as a Ford.


20% of the vehicles in town are Fords. However, when shown a sample of
photographs, the witness correctly identifies Fords only 90% of the time, and
calls non-Fords Fords 30% of the time. How likely is it that the fleeing vehicle
was actually a Ford?

20.00% cars which are Fords


80.00% car which aren't Fords

90.00% Pr( calls car a Ford | car is Ford )


30.00% Pr( calls car a Ford | car isn't Ford )

18.00% Pr( car is a Ford and is called a Ford )


24.00% Pr( car isn't a Ford and is called a Ford )

42.00% Pr(car is called a Ford)

42.86% Pr( car is a Ford | it's called a Ford )

18% is a Ford and is called a Ford


"Ford"
90%

10%
Ford
"not Ford"
is called a Ford
2%
20%

80%
24%
"Ford"
not Ford
30%

70%
"not Ford"
56%

Page 5
Fords

Page 6
Ace of Spades

The "Ace of Spades" (and babies)

A two-card hand is dealt from a small deck containing only the four aces and
four deuces. What is the probability of getting at least one ace? What is the
probability of getting the Ace of Spades? What is the probability that a hand
contains two aces, given that it contains at least one? What is the probability
that a hand contains two aces, given that it contains the Ace of Spades?

8 cards in deck
4 aces in deck
2 cards in hand

28 hands
6 hands with no aces
22 hands with at least one ace
16 hands with exactly one ace
6 hands with at least two aces

27.27% Pr(hand contains at least 2 aces | it contains at least one)

7 hands with the Ace of Spades


4 hands with the Ace of Spades, and no other ace
3 hands with the Ace of Spades, and at least one more ace

42.86% Pr(hand contains at least 2 aces | it contains the Ace of Spades)

This problem is a bit of a brain-teaser: Why should the knowledge that


there's an ace in the hand lead to different beliefs than the knowledge that
there's a specific ace?

Consider a couple with two children, and assume that each child is
(independently) equally likely to be a boy or a girl.

What's the probability that both children are boys? Clearly, 25%.

Assume you're told that there is at least one boy. Now, what is the chance
that both are boys? Well, there were originally four equally-likely possibilities:
The first-born is a boy and the second-born is a girl, the first-born is a girl and
the other a boy, both are boys, or both are girls. The last case has been ruled
out, so the answer is 1/3 = 33.33%.

But what if, instead, you're told that the first-born (the oldest) is a boy? The
other is equally likely to be a boy or a girl, so the chance that they're both
boys is 50%. (If you're told only that the second-born is a boy, the chance
that both are boys is again 50%.)

This is very similar to what you'll see if you're considering a two-card hand 200 cards in deck
dealt from a deck of 200 cards, where 100 are aces (and precisely one is th 100 aces in deck

Page 7
Ace of Spades

"Ace of Spades"). 2 cards in hand

If you're told that the first-dealt card is the Ace of Spades, then there's a 19,900 hands
nearly-50% chance that the second is an ace. Similarly, if you're told that the 4,950 hands with no aces
second-dealt card is the Ace of Spades, again the chance of the other being 14,950 hands with at least one ace
an ace is nearly 50%. 10,000 hands with exactly one ace
4,950 hands with at least two aces
Therefore, obviously, if you're told that one of the two cards is the Ace of
Spades, the chance that both are aces is nearly 50%. 33.11% Pr(hand contains at least 2 aces | it c

The "Ace of Spades" designation is irrelevant! If you're told "the first-dealt 199 hands with the Ace of Spades
is an ace," or "the second-dealt is an ace," again, the chance of two aces 100 hands with the Ace of Spades, and no
is nearly 50%. 99 hands with the Ace of Spades, and at

But if all you're told is that at least one of the cards is an ace, then, of the fo 49.75% Pr(hand contains at least 2 aces | it c
roughly-equally-likely chances that the deal went "ace-other", "other-ace",
"ace-ace", or "other-other," only the last case has been ruled out, and
therefore, the chance that both are aces is only roughly 1/3.

Page 8
Ace of Spades

ith at least one ace


ith exactly one ace
ith at least two aces

contains at least 2 aces | it contains at least one)

ith the Ace of Spades


ith the Ace of Spades, and no other ace
ith the Ace of Spades, and at least one more ace

contains at least 2 aces | it contains the Ace of Spades)

Page 9
Promotion awareness

Promotion Awareness and Buying Behavior

A large company has done a careful analysis of a price promotion that it is


currently testing. Some 20% of the people in a large sample of individuals in
the test market were both aware of the promotion and made a purchase.
Further, 80% were aware of the promotion, and 25% of all people in the
sample were purchasers of the product.

What is the probability that a person will make a purchase, given that he or she
is aware of the price promotion?

Are the events "made a purchase" and "aware of the price promotion" independent?
Why or why not?

20% aware and bought Yes, awareness and buying behavior are independent,
80% aware since Pr(aware AND bought) = Pr(aware)Pr(bought) .
25% bought The promotion appears to be completely ineffective.

bought didn't buy


aware 20% 60% 80% In practical terms, 25% of those unaware of the
not aware 5% 15% 20% promotion were purchasers anyway and only
25% 75% 100% 25% of those who were aware made purchases.

Page 10
Learning in stages

Learning from Observations

In the setup of a manufacturing process, a machine is either correctly or


incorrectly adjusted. The probability of a correct adjustment is 0.90. When
correctly adjusted, the machine operates with a 5% defect rate. However, if it is
incorrectly adjusted, the defect rate is 75%.

(a) After the machine starts a production run, what is the probability that a defect
is observed when one part is tested?

(b) Suppose that one part selected by an inspector is found to be defective. What
is the probability that the machine is incorrectly adjusted?

(c) Before your recommendation is followed, a second part is tested and found to good
be good. Using your revised probabilities from (b) as the most recent prior
probabilities, compute the revised probability of an incorrect adjustment given that the
correct
second part is good. defectiv
90%
90.00% Pr( setup is correct )
10.00% Pr( setup is incorrect )
10%

5.00% Pr(defective | setup correct ) 4.75% Pr( defective, then good | setup correct ) good
incorrect
75.00% Pr(defective | setup incorrect ) 18.75% Pr( defective, then good | setup incorrect )

12.00% Pr( defective ) 6.15% Pr( defective, then good ) defectiv

37.50% Pr( setup correct | defective ) 69.51% Pr( setup correct | defective, then good )
62.50% Pr( setup incorrect | defective ) 30.49% Pr( setup incorrect | defective, then good )

51.25% Pr( second good | first defective )


def,gd
69.51% Pr( setup correct | defective, then good )
30.49% Pr( setup incorrect | defective, then good )
correct
The real point of this exercise is to demonstrate that, whether we "learn" else
step-by-step, or all at once, we end up with the same conclusion. 90%

10%
The two sections below are set up to show how the computations above can be def,gd
extended to cases where more than just two items are tested. incorrect

Learning, one step at a time: Learning, all at once:


else
Pr(setup was correct) 4 trials
prior new 3 good
beliefs observed Pr(obs) beliefs 15.90% Pr(these observations)
90.00% d 12.00% 37.50% 97.05% Pr(setup was correct | observations)
37.50% g 51.25% 69.51%
69.51% g 73.66% 89.65%
89.65% g 87.76% 97.05%

Page 11
Learning in stages

97.05% d 7.06% 68.70%


68.70% g 73.09% 89.29%
89.29% g 87.51% 96.94%
96.94% g 92.86% 99.18%
99.18% g 94.42% 99.78%
99.78% d 5.15% 96.83%

Page 12
Learning in stages

first test second test | first is defective

0.90.95 0.3750.95
good good
95% 95%

5% 5%
correct correct
defective defective
0.90.05 0.3750.05
90% 37.5%

10% 62.5%
0.10.25 0.6250.25
good good
incorrect incorrect
25% 25%

75% 75%
defective defective
0.10.75 0.6250.75

two tests, then "learn"


0.90.050.95
def,gd
5%95%

else
correct
else
else
90%

10%
0.10.750.25
def,gd
incorrect
75%25%

else
else
else

Page 13
Dry holes

Suffering through Dry Holes (and notes on "data tables")

A Bayesian approach can be used to revise probabilities that a prospect field will
produce oil (Oil & Gas Journal, January 11, 1988). In one case, geological
assessment indicates a 25% chance that the field will produce oil. Further, there is
an 80% chance that a particular well will strike oil, given that oil is present in the
prospect field.

Suppose that one well is drilled on the field and comes up dry. What is the
probability that the prospect field will produce oil?

If two wells come up dry, what is the probability that the field will produce oil?

The oil company would like to keep looking as long as the chances of finding oil
are greater than 1%. How many dry wells must be drilled before the field will be
abandoned?

25% Pr( oil really there) 2


25%(20%)
20% Pr( dry hole | oil there ) 2 dry
2 k (number of test wells drilled ) vary this 2
(20%)

4.00% Pr( k consecutive dry holes | oil there ) else


oil
100.00% Pr( k consecutive dry holes | NOT oil there )
76.00% Pr( k consecutive dry holes ) at least 1 wet else
25%

1.00% Pr( k consecutive dry holes & oil there )


75.00% Pr( k consecutive dry holes & NOT oil there ) 75%
76.00% Pr( k consecutive dry holes )
no oil
2 dry
1.316% Pr( oil there | k consecutive dry holes ) 75%
100%

1.316% In the box to the left is an Excel "data table". Data tables
0 provide a quick way to see how a speadsheet result varies as
1 some parameter of the problem is varied.
2
3 I wanted to tabulate values that would appear in cell B30 as
4 the number entered in cell B20 took different values.

To do this, I put the formula "=B30" in cell C33. In the column


immediately to the left, starting one row down (i.e., starting at
B34), I listed values that I wanted to successively plug into
cell B20 (the values 0, 1, 2, 3, and 4).

Then I highlighted the rectangle B33:C38, i.e., the entire


boxed-in range of cells.

Finally, I selected Data / Table from the menu. The menubox to


the right appeared.
(This is just a picture, not the actual menu.)

Page 14
Dry holes

I clicked in "Column input cell", then clicked cell B20 and "OK."

Excel filled in my table: If you click on any of cells C34:C38,


you'll see the "formula" {=TABLE(,B20)} .

This formula instructs Excel, each time it recalculates my In Excel 2007, select Data, (Da
spreadsheet, to successively put each value in the first Data Table to get here.
column of the table into cell B20, and record the resulting value
from C33 (really, from B30) in the second column of the table.

Notes:

The table is "live." This means that you can change any of
the first-column inputs and the table will update itself
automatically: Try putting a "4" in cell B34, for example.

You can also change the formula being tabulated. Try


changing cell C33 to "=B24" as an example. Or try entering
"=1+B20^2". 0
1
Tables can have more than one tabulated formula: In the 2
example to the right, I've tabulated all three of the formulas 3
just mentioned 4

If you want a horizontal table, just click on the "Row input cell"
box instead. 1.316%

And finally, if you want to track the changes in a single cell as 1.316%
the values in two other cells are varied, put the formula to be 0
tabulated in the upper-lefthand corner of the "table rectangle", 1
and give both row (B18) and column (B20) inputs: The table to 2
the right shows how our hopes of finding oil vary with both our 3
initial beliefs and our exploratory-well experiences. 4

Page 15
Dry holes

2 oil is there AND


25%(20%)
first two holes are dry
2
0%)

se

wet else first two holes are dry

y
75%
%

This example explains the use of data tables in Excel 2007 and earlier.

The use via the command ribbon in Excel 2010 and 2013
is explained in this week's "Mad Cow" example.

1.316%
0
1
2
3
4

Page 16
Dry holes

In Excel 2007, select Data, (Data Tools) What-If Analysis,


Data Table to get here.

multi-column table
1.316% 2 5
1
2
5
10
17

horizontal table
0 1 2 3 4

two-dimensional table
5% 20% 25% 80%

Page 17

You might also like