exactly one defective

Download Report

Transcript exactly one defective

Chapter 4: Probability
(Cont.)
In this handout:
• Total probability rule
• Bayes’ rule
• Random sampling from finite population
• Rule of combinations
Partitions
• Definition: A collection of events {S1, S2, …, Sn} is
a partition of a sample space S if
1. S = S1  S2  …  Sn
2. S1, S2, …, Sn are mutually exclusive events.
• Example:
Recall the example of rolling two dice.
Define S2={sum = 2}, S3={sum = 3}, …, S12={sum = 12}.
Then {S2, S3, …, S12} is a partition of the sample space.
Total probability rule
Assume the set of events {S1, S2, …, Sn} is a partition of a
sample space S. Assume P(Si) > 0 for every i, 1 ≤ i ≤ n.
Then for any event A,
n
P ( A)   P ( S i )  P ( A | S i )
i 1
S1
AS1
S2
S3
AS2
AS3
S4
AS4
Total probability rule
Example: A diagnostic test for a certain disease is known to be 95%
accurate. It is also known from previous data that only 1% of the
population has the disease. What is the probability that a person
chosen at random will be tested positive?
Solution: Let
T+ denote the event that a person is tested positive;
T- denote the event that a person is tested negative;
D denote the event that a person has the disease.
Then
P( D)  0.01, P( D )  0.99, P(T  | D)  0.95, P(T  | D )  0.95
Applying the formula of total probability:
P(T  )  P(T  | D)  P( D)  P(T  | D )  P( D )
 0.95  0.01  0.05  0.99  0.059
Bayes’ rule
Assume the set of events {S1, S2, …, Sn} is a partition of a
sample space S. Assume P(Si) > 0 for every i, 1 ≤ i ≤ n.
Fix any event A. Then for any given j, 1 ≤ j ≤ n,
P( S j | A) 
P( S j )  P( A | S j )
n
 P( S )  P( A | S )
i 1
i
i
Example (cont.): If a person tested positive then what is the
probability he has the disease?

P
(
T
| D)  P( D)

P( D | T ) 
P(T  | D)  P ( D)  P (T  | D )  P( D )
0.95  0.01

 0.16
0.95  0.01  0.05  0.99
Random sampling from finite population
When sampling from a large population, listing all the possible choices
becomes a tedious job. Then a counting rule is very useful:
Note: C(N,r) is another way to denote “N choose r”.
Example: Randomly select 4 members from a group of 11 students to
work on a project. How many distinct 4-person teams can be
chosen?
11 1110  9  8
  
 330
 4  1 2  3  4
Random sampling from finite population
Example(cont.):
 The probability that students A,B,C,D are chosen to work on the
project is 1/330.
 Suppose the group consists of 5 juniors and 6 seniors. How many
samples of 4 have exactly 3 juniors?
Think of selecting a sample as a 2-step process:
• 1 senior can be chosen 6 different ways;
• 3 juniors can be chosen C(5,3) different ways.
Thus, the whole sample can be chosen 6∙C(5,3) different ways.
Examples on Combinations
 Suppose that 3 cars in a production run of 40 are defective.
A sample of 4 is to be selected to be checked for defects.
Questions:
1) How many different samples can be chosen?
2) How many samples will contain
exactly one defective car?
3) What is the probability that a randomly chosen sample
will contain exactly one defective car?
4) How many samples will contain
at least one defective car?
Solution:
1) C(40, 4) = (40∙39∙38∙37) / (1∙2∙3∙4) = 91,390
Examples on Combinations
2) How many samples will contain
exactly one defective car?
Think of selecting a sample as a 2-step process:
Step 1: Choose the defective cars;
Step 2: Choose the good cars.
There are C(3,1) ways to choose 1 defective car.
There are C(37,3) ways to choose 3 good cars.
Then the number of samples containing exactly 1 defective car is
C(3,1) ∙ C(37,3) = 3∙(37∙36∙35) / (1∙2∙3) = 23,310
3) What is the probability that a randomly chosen sample
will contain exactly one defective car?
The probability = 23,310 / 91,390 = .255
Examples on Combinations
4) How many samples will contain at least one defective car?
There are 2 ways to answer this question,
either by the addition rule
or by the difference rule.
The solution by the difference rule is less intuitive but shorter. Let’s
solve it by the difference rule.
(# of samples with ≥1 defective cars)
= (all possible samples)
– (# of samples with no defective cars) .
But (# of samples with no defective cars)
= (# of samples with only good cars) = C(37,4)=66,045
Thus, (# of samples with ≥1 defective cars)
= 91,390 – 66,045 = 25,345
Figure 4.4 (p. 157)
Probability versus statistical inference.