You are on page 1of 10

Math 231

6/4/2012

Probability Rules

Math 231 Probability & Statistics


Summer 2012
More on Counting Methods & Probability
Wei-Min Huang

A Few Useful Things

There are some basic probability relationships that


can be used to compute the probability of an event
without knowledge of all the sample point
probabilities.
The Complement Rule of Probability
The Addition Rule of Probability
The Multiplication Rule of Probability
The Condition Rule of Probability

If outcomes are equally likely in the sample space, then

For any event A,


P(AC ) = 1 P(A).

Probability of an event =

Number of favorable outcomes


Total number of possible outcomes

Let denote the empty set. Then


P( ) = 0.
If A is an event, and A = {E1 , E2 ,..., En }, then
P(A) = P(E1) + P(E2) +.+ P(En).
Addition Rule (for when A and B are not mutually
exclusive):
P( A B) P( A) P( B) P( A B)

Probability Rules
The Addition Rule of Probability
The probability that event A or B will occur
when an experiment is performed is given by
P(A or B)=P(A) + P(B) P(AB)
where P(AB) is the probability that both
events, A and B, will occur.
In set notation, event A or B is A B , the
union of A with B.

Wei-Min Huang
Lehigh University

Section 2.3: Conditional Probability and


Independence
Definition: A probability that is based on part of the
sample space is called a conditional probability.
Let A and B be events with P(B) 0. The conditional
probability of A given B is

P( A | B)

P( A B)
P( B)

Math 231

6/4/2012

Conditional Probability
Using Contingency Table
Experiment: Draw 1 Card. Note Kind, Color
& Suit.
Color
Black

Ace

Total
4

Non-Ace

24

24

48

Total

26

26

52

P(Ace AND Black)

P(Ace | Black) =

P(Black)

2 / 52
26 / 52

Revised
Sample
Space

P(B) = 14/20

P(R|R) = 5/19

P(B|R) = 14/19
P(R|B) = 6/19

B
R

P(B|B) = 13/19

Conditional probability or counting?


Three married couples have purchased theater tickets and are
seated in a row consisting of just six seats. If they take their seats in
a completely random fashion (random order), what is the probability
that David and Jane (husband and wife) end up seating next to one
another?
By conditioning,

4 2 2 1 10 1

(why?)
6 5 6 5 30 3

5! 240 1
2!

6! 720 3

Wei-Min Huang
Lehigh University

Two cards are simultaneously chosen at random from an ordinary deck


of 52 cards (there are 26 red and black cards in a deck of 52 cards).
Find the probability
(a) that both cards are of the same color (i.e., the two cards are either
both red or both black);
26 25 26 25
2 26 25
25

or
52 51 52 51
52 51
51
26 26 26 26

2 0 0 2 2 26 25 25
52 51
51
52

(b) that the two cards are of different colors.

OR we can solve it by counting,

where P(B|A) is the probability of B if A has


occurred, and it is called the conditional
probability of B given A.

Experiment: Select 2 Pens from 20 Pens:


14 Blue & 6 Red. Dont Replace.

Dependent!

when an experiment is performed is given by

26

Tree Diagram

P(R) = 6/20

The probability that both A and B will occur

P(AB)=P(A)*P(B|A),

Red

Type

The Multiplication Rule of Probability

26 26 26 26 2 26 26 26

or
52 51 52 51
52 51
51
26 26

1 1 2 26 26 26
52 51
51
52

2

Conditional probability
4 2 2 1 10 1

(why?)
6 5 6 5 30 3

4 ways for D to be NOT at the end

? D ? ? ? ?
? ? ? D ? ?

? ? D ? ? ?
? ? ? ? D ?

2 ways for D to be at the end

D ? ? ? ? ?
? ? ? ? ? D

Math 231

6/4/2012

Statistical Independence

Independent Events
Events A and B are independent if the probability
of each event is not affected by whether or not the
other event has occurred.

1. Event Occurrence
Does Not Affect Probability
of Another Event

The Multiplication Rule for Independent Events:

Toss 1 Coin Twice

If A, B, C, are independent events, then

2. Causality Not Implied


3. Tests For

P(ABC )=P(A)*P(B)*P(C)*

P(A | B) = P(A)
P(A and B) = P(A)*P(B)

Probability Rules- Summary

Probabilities for independent


events

Complement rule: P(A')= 1- P(A)


For any A,B : P(A)=P(AB)+P(AB)
Addition rule: for any events A and B:
P(AB) = P(A) + P(B) P(AB)

p3

p 2 (1 p)

P
P

for 2 mutually exclusive events (AB=f)


P(AB) = P(A) + P(B)
For any 2 events with P(B) > 0 multiplication rule
P(AB) = P(A|B) P(B)
For 2 independent events
P(AB) = P(A) P(B)

p(1 p)

1 p

Sample

Examples

Example

1. If 4 boys and 3 girls are seated in a row of 7 chairs at random,


(a) what is the probability that all 3 girls are seating next to each other on the
left end of the row? 3!4!/7!
(b) what is the probability that all 3 girls are seating next to each other?
3!(1+4)!/7!

Of the microprocessors manufactured by a certain


process, 20% are defective. A sample of six
microprocessors are chosen at random. Assume they
function independently.

2. Randomly arrange the digits in the number 33322 to form a 5-digit number,
what is the probability that the resulting number is odd? 4!/(2!2!) / 5!
3. A balanced six-sided die is tossed twice. What is the probability that both
tosses show the same outcome? 6/36 or C(6,1)(1/36)=6(1/36) [2 different
approaches]

a. What is the probability that they all work?


b. What is the probability that exactly two of them
work? 6!/(2!4!)(1/2)^6 = 15/64
c. How many do you expect which are working in the
sample?

4. In a poker hand consisting of 5 cards, find the probability of holding 2 kings?


C(4,2)C(48,3)/C(52,5)

17

Wei-Min Huang
Lehigh University

5. The digits 0 through 9 are lined up at random. What is the


probability that the digits 0, 1, and 2 are adjacent and in
increasing order? (1+6)!/10!

Math 231

6/4/2012

More examples:
1. Three people line up at the Cup ice-cream store. Each buys an ice cream and
the choices are independent of one another. If 50% of all people order
vanilla, 20% order chocolate, and 30% order strawberry,
(a) find the probability that they all order different flavors; 3!(.5)(.3)(.2)
(b) find the probability that they all order the same flavors. (.5)^3 + (.2)^3 +
(.3)^3
2. A man had 3 fair coins in his pocket; he takes all 3 coins from his pocket by
taking one coin at a time and putting each coin on a table. Let X be the
number of tails showing after he took all 3 coins from his pocket. Determine
the probability distribution of X; i.e., find P(X=k) for all possible values of
k.
P(X = k) = C(3,k)*(1/2)^k*(1/2)^(3-k), k = 0, 1, 2, 3
3. (Do it in a different way) A balanced six-sided die is tossed twice. What is
the probability that both tosses show the same outcome?

More examples:
4. Suppose that 70% vehicles passing through a check point are from within the
state. If three vehicles pass the check point, find the probability that at least
one is from out of state. 1 P(none from out of state) = 1 (.7)^3
or do it directly
C(3,1)(.3)(.7)^2 + C(3,1)(.3)^3(0.7) + C(3,3)(.7)^3
= 3(.3)(.7)^2 + 3(.3)^2(0.7) + (.7)^3
5. A fair coin is tossed repeatedly until the first head appears. What is the
probability that at least three tosses are required?
1 P( at most two tosses are required) = 1 [1/2 + (1/2)(1/2)] = 1/4
or do it directly
(1/2)^3 + (1/2)^4 + (1/2)^5 + .. = (1/2)^3[1 + (1/2) + (1/2)^2 + .]
= (1/8)[ 1/(1 )] = (1/8)(2)= 1/4

C(6,1)(1/6)(1/6) = 6/36

Section 2.4: Random Variables


Definition: A random variable assigns a
numerical value to each outcome in a sample
space.

Random Variables
Definition

Definition: A random variable is discrete if its


possible values form a discrete set.
This means that if the possible values are arranged in
order, there is a gap between each value and the
next one. The set of possible values may be
infinite; for example, the set of all integers is a
discrete set.
21

Random Variables
Examples of Random Variables

Wei-Min Huang
Lehigh University

Example : Random Variable


Consider a random experiment
in which a fair coin is tossed
three times.
Let X be the number of heads.
Let H represent the outcome of
a head and T the outcome of a
tail.

Math 231

6/4/2012

Numerical Labeling
Sample
Space

TTT

TTH

THT

THH

HTT

HTH

HHT

HHH

Number
of heads
k

Probability Mass Function


The description of the possible values of X
and the probabilities of each has a name: the
probability mass function.
Definition: The probability mass function
(pmf) of a discrete random variable X is the
function p(x) = P(X = x). The probability
mass function is sometimes called the
probability distribution.

Example continued
The probability mass function of X:
P(X = 0) = P(TTT) = (1/2)(1/2)(1/2) = 1/8
P(X = 1) = P(HTT, THT, TTH) = 3(1/2)(1/2)(1/2) = 3/8
P(X = 1) = P(HHT, HTH, THH) = 3(1/2)(1/2)(1/2) = 3/8
P(X = 3) = P(HHH) = (1/2)(1/2)(1/2) = 3/8

k
0
1
2
P(X=k) 1/8 3/8 3/8

3
1/8

Remark: Think of tossing a fair coin 10 times and denote the


resulting number of heads by Y. What is P(Y = 3)?

A person has 3 similar keys in her pocket and only one of


them can open her apartment door. She randomly takes one
key at a time from her pocket and try to open her apartment
door. The key which can't open the door is not putting back
to the pocket. Find the probabilities that k keys she needs to
use to open the door.
Can you draw the tree-diagram for this experiment?
P(X = 1) = 1/3;
P(X=2) = (2/3)(1/2) = 1/3;
P(X=3) = (2/3)(1/2)(1/1) = 1/3

List: HHHTTTTTTT, HHTHTTTTTT, ., TTTTTTTHHH


(How many are there?)

Law of Total Probability

Try it!
An experiment consists of rolling a fair die and
tossing a fair coin. Let
A = the event that the die lands 6 and
B = the event that the coin lands tails.
Find P(A U B).
Are A and B mutually exclusive?
Are A and B independent?

Law of Total Probability:


If A1,, An are mutually exclusive and
exhaustive events, and B is any event, then

P( B) P( A1 B)

P( An B)

Equivalently, if P(Ai) 0 for each Ai,

P( B) P( B A1 ) P( A1 )

P( B An ) P( An )
30

Wei-Min Huang
Lehigh University

Math 231

6/4/2012

Example

First Steps Toward a Solution

Customers who purchase a certain make of car can


order an engine in any of three sizes. Of all cars
sold, 45% have the smallest engine, 35% have the
medium-size one, and 20% have the largest. Of cars
with the smallest engine, 10% fail an emissions test
within two years of purchase, while 12% of the those
with the medium size and 15% of those with the
largest engine fail. What is the probability that a
randomly chosen car will fail an emissions test
within two years?

Let B denote the event that a car fails an


emissions test within two years. Let A1
denote the event that a car has a small engine,
A2 the event that a car has a medium size
engine, and A3 the event that a car has a large
engine. Then P(A1) = 0.45, P(A2) = 0.35, and
P(A3) = 0.20. Also, P(B|A1) = 0.10, P(B|A2) =
0.12, and
P(B|A3) = 0.15. What is the probability that a
car fails an emissions test with two years?

31

Conditional Probability to
Bayes Theorem

32

Bayes Rule
Bayes Rule: Let A1,, An be mutually exclusive
and exhaustive events, with P(Ai) 0 for each Ai.
Let B be any event with P(B) 0. Then

Definition

P( Ak | B)

P( B | Ak ) P( Ak )
n

P( B | A ) P( A )
i 1

34

Solution (Try to draw the tree-diagram, it helps)

Example

Let D represent the event that a person actually has the


disease, and let + represent the event that the test gives a
positive signal. We wish to find P(D|+). We know
P(D) = 0.005, P(+|D) = 0.99, and P(+|DC) = 0.01.
Using Bayes rule:

The proportion of people in a given community who


have a certain disease is 0.005. A test is available to
diagnose the disease. If a person has the disease, the
probability that the test will produce a positive signal
is 0.99. If a person does not have the disease, the
probability that the test will produce a positive signal
is 0.01. If a person tests positive, what is the
probability that the person actually has the disease?

P( | D) P( D)
P( | D) P( D) P( | D C ) P( D C )
0.99(0.005)

0.332
0.99(0.005) 0.01(0.995)

P( D | )

35

Wei-Min Huang
Lehigh University

36

Math 231

6/4/2012

Bayess Theorem
Using Contingency Table

Bayess Theorem Using Contingency Table

Fifty percent of borrowers repaid their loans. Out of those


who repaid, 40% had a college degree. Ten percent of
those who defaulted had a college degree. What is the
probability that a randomly selected borrower who has a
college degree will repay the loan?

P R ) .50

P C | R ) .4

P C | R ) .10

PR | C) ?

PR | C)

NBA Final: expected games to be played?


Most likely how many games they need to play to
end the championship?
What was the average number of games to end the
championship for the past 20 years?
How many games do we expect them to play to end
the final?

Repay

Repay

Total

College

.2

.05

.25

College

.3

.45

.75

Total

.5

.5

1.0

(continued)

P C | R ) P R )

P C | R ) P R ) P C | R ) P R )

.4 ).5)
.2

.8
.4 ).5) .1).5) .25

NBA Final: How many ways can it


end?
For the two NBA final teams A and B, how
many ways can the championship end (4 out
of 7 games)?
For example,
AAAA, ABAAA,
BBBB, BBBAB,.

NBA Final: Probability distribution of the number of games

NBA Final: How many ways can the Series end?

played

(Wrong! Wrong! Wrong!)

4 games to be played =

3!
2
3!0!

Suppose that each time teams A and B play, they have the same 50-50
chances to win. We also assume the plays are independent.

5 games to be played =

4!
8
3!1!

P(4 games to be played) =

6 games to be played =

5!
20
3!2!

P(5 games to be played) =

7 games to be played =

6!
40
3!3!

P(6 games to be played) =


P(7 games to be played) =

So there are 2 + 8 + 20 + 40 = 70 ways to end the Series.

Wei-Min Huang
Lehigh University

3
2
3 2
70
70
4
2
3 8
70
70
5
2
3 20
70
70
6
2
3 40
70
70

The 70 possible outcomes are NOT equally likely.

Math 231

6/4/2012

What is the expected number of games to be played in


NBA 2005 Final?

Correct Answer: Probability distribution of the number of games


to be played
Suppose that each time teams A and B play, they have the
same 50-50 chances to win.
P(4 games to be played) =

3 1
2
2
3 2 16

P(5 games to be played) =

4 1
4
2
3 2 16

P(6 games to be played) =

6
5 1
5
2
3 2 16

6 1
5
2
3 2 16
6

P(7 games to be played) =

Suppose that each time teams A and B play, they have the same
50-50 chances to win.
4P(4 games to be played) + 5P(5 games to be played) +
6P(6 games to be played) + 7 P(7 games to be played) =
4

2
4
5
5 93
5 6 7 5.8125 (not a whole number)
16 16 16
16 16

The average number of games to end the championship


for the past 20 years is approximately 5.8125.

An Interesting Game
I have three containers, one with a prize and
the other two empty.
You choose one, but it is not opened yet.
I open one of the other two containers,
showing that it is empty.
I ask you if you want to change your choice
of container or not.
Should you?

Probability Distribution: Example

Roll two fair dice (six sided) and add up


the digits (pips) facing up. From the 36
possible pairs of the 2 dice, we have the
following possible outcomes (not equally
likely outcomes):
S = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}

Wei-Min Huang
Lehigh University

-40 -20 Gain/Los 0 20 40

S
i
m
u
l
a
t
i
o
n
o
f
G
a
m
e

C
h
a
n
g
e

D
o
n
'
t
c
h
a
n
g
e

2
0

4
0

6
0

8
0

1
0
0

T
r
i
a
l

Experiment:Roll two fair dice (six sided)


36 equally likely outcomes
1,1)

1, 2 )
1,3)
S
1, 4 )
1,5 )

1, 6 )

2,1)
2, 2 )
2,3)
2, 4 )
2,5)
2, 6 )

3,1)
3, 2 )
3,3)
3, 4 )
3,5)
3, 6 )

4,1)
4, 2 )
4,3)
4, 4 )
4,5)
4, 6 )

5,1)
5, 2 )
5,3)
5, 4 )
5,5 )
5, 6 )

6,1)
6, 2 )
6,3)
6, 4 )
6,5 )

6, 6 )

Math 231

6/4/2012

Example
We assign probabilities by looking at how
many different ways can that outcome
occur in a general roll (36 pairs) and
applying the Additive Rule.
P(2) = P[ (1,1)] = 1/36
P(3) = P[ (1,2) (2,1)] = 1/36 + 1/36 = 2/36
P(4) =P[(1,3)(3,1)(2,2)] =1/36+1/36+1/36 =
3/36

Probability distribution
Concept of probability distribution is
important.

P(x)

9 10 11 12

1 2 3 4 5 6 5 4 3 2 1
36 36 36 36 36 36 36 36 36 36 36

Playing Rule

More preview:
1. Three people line up at the Cup ice-cream store. Each buys an ice cream and the
choices are independent of one another. If 50% of all people order vanilla, 20%
order chocolate, and 30% order strawberry,
(a) find the probability that they all order different flavors;
(b) find the probability that they all order the same flavors.
2. A man had 3 fair coins in his pocket; he takes all 3 coins from his pocket by taking
one coin at a time and putting each coin on a table. Let X be the number of tails
showing after he took all 3 coins from his pocket. Determine the probability
distribution of X; i.e., find P(X=k) for all possible values of k.
3. (Do it in a different way) A balanced six-sided die is tossed twice. What is the
probability that both tosses show the same outcome?
4. Suppose that 70% vehicles passing through a check point are from within the state. If
three vehicles pass the check point, find the probability that at least one is from out
of state.

Comeout Roll
Win on 7 or 11
Lose on 2, 3, or 12
If 4, 5, 6, 8, 9, or 10 is rolled this number becomes the
point; proceed to Point Roll

Point Roll
Win if point is rolled before rolling a 7
If not point or 7, then continue rolling

5. A fair coin is tossed repeatedly until the first head appears. What is the probability
that at least three tosses are required?

Dice Probability
In rolling two balanced dice there are 36 possible
outcomes.

P(sum
P(sum
P(sum
P(sum
P(sum
P(sum

is 2) = P(sum
is 3) = P(sum
is 4) = P(sum
is 5) = P(sum
is 6) = P(sum
is 7) = 6/36

Wei-Min Huang
Lehigh University

is 12) = 1/36
is 11) = 2/36
is 10) = 3/36
is 9) = 4/36
is 8) = 5/36

Probability of player winning on Comeout Roll: (Is the following obvious?)

pr(7) pr(11)

6
2
8

36 36 36

Probability of player establishing a point and then winning:

pr( 4) * pr (4before7) pr( 5) * pr (5before7)


pr( 6) * pr (6before7) pr(8) * pr(8 before 7)
pr(9) * pr(9 before 7) pr(10) * pr(10 before 7)
3 3 4 4 5 5 5 5 4 4 3 3 9648

36 9 36 10 36 11 36 11 36 10 36 9 35640

Overall probability of player winning:


8
9648 244

36 35640 495

Math 231

6/4/2012

The probability of winning the game of craps is 0.492929


for the player.
Thus the game is slightly advantageous to the house.
This conclusion of course assumes that the two dice in
question are perfect cubes.
Suppose that is not the case.

Mean for Discrete Random Variables


Let X be a discrete random variable with
probability mass function p( x) P( X x) .
The mean or expected value of X is given by
X xP( X x) ,
x
where the sum is over all possible values of X.
The mean of X is sometimes called the
expectation, or expected value, of X and may
also be denoted by E(X) or by .

56

Wei-Min Huang
Lehigh University

10

You might also like