Chapter 3: Elements of Probability: ST2334 Probability and Statistics (Academic Year 2014/15, Semester 1)
Chapter 3: Elements of Probability: ST2334 Probability and Statistics (Academic Year 2014/15, Semester 1)
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 1 / 57
Outline
1 Introduction
4 Axioms Of Probability
6 Conditional Probability
7 Bayes’ Formula
8 Independence
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 2 / 57
Introduction I
Learning Outcomes
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 3 / 57
Introduction II
Mandatory Reading
/ Section 3.1 – Section 3.8
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 4 / 57
Sample Spaces
Definition
An experiment is any action or process
whose outcome is subject to
uncertainty/randomness
Definition
The sample space of an experiment, denoted by S, is the set/collection of
all possible outcomes of that experiment. Usually, we denote an
outcome/element of S by ω
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 5 / 57
Example 1: Sample Spaces
The simplest experiment to which probability (prob) applies is one with 2
possible outcomes, e.g.,
1 When we flip/toss a coin & see which side faces up, S = {H , T },
where H & T denote head facing up & tail facing up, respectively
2 In an experiment of examining a light bulb to see if it is defective,
S={ , }
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 6 / 57
Example 2: Sample Spaces
1 When we roll a die & see the upturned #, the sample space is
S = {1, 2, . . . , 6}
S={ , , , , , , , }
3 The amount of time between successive customers arriving at a
check–out counter is of interest. For such an experiment,
S = {t : t ≥ 0}
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 7 / 57
Events
To develop a mathematical framework for understanding an
experiment & studying prob, set theory is naturally adopted in the
mathematical theory of prob
Interested in not only the individual outcomes of S but also various
collections of outcomes from S
Definition
An event A is any collection of outcomes contained in the sample
space (i.e., any subset of S written as A ⊂ S). An event is simple if it
consists of exactly 1 outcome & compound if it consists of > 1 outcome
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 8 / 57
Example 3: Events
Toss 2 coins: S = {HH , HT , TH , TT }
The event that 2 heads are observed, A = {HH }, is a simple event as Ê
A ⊂ S & Ë A contains only 1 outcome
The event that 1 head is observed, B = {HT , TH }, is a compound event
Examine 3 fuses: Different compound events include, e.g.,
A ={ , , }
= the event that exactly 1 of the 3 fuses is not defective
B={ , , , }
= the event that at most 1 fuse is defective
C={ , }
= the event that all 3 fuses are in the same condition
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 9 / 57
Algebra of Events I
Definition
Given any event E , F ⊂ S,
1 The complement of E, denoted by E c , A , or E 0 , is the set of all outcomes in
S that are not contained in E
2 The union of A & B, denoted by E ∪ F & read “E or F”, is the event
consisting of all outcomes that are either in A or B or in both events
3 The intersection of E & F, denoted by E ∩ F (or, simply EF) & read “E & F”,
is the event consisting of all outcomes that are both in E & F
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 10 / 57
Algebra of Events II
Definition
Let ∅ denote the null event, the event consisting of no outcomes
whatsoever
Definition
When E ∩ F = ∅, E & F are said to be mutually exclusive or disjoint
events. It follows that E & E c must be disjoint for any event E ⊂ S
Definition
When E ∪ F = S, E & F are said to be exhaustive events. It follows that E
& E c must be exhaustive
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 11 / 57
Venn Diagrams I
Venn diagrams: a useful tool for visualizing set operations
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 12 / 57
Venn Diagrams II
Union: E ∪ F is the shaded area
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 13 / 57
Venn Diagrams III
E & F are mutually exclusive or disjoint events:
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 14 / 57
Example 4: Venn Diagrams
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 15 / 57
Example 5: Venn Diagrams & Algebra of Events
Ac = {5, 6}
A ∪B = {0, 1, 2, 3, 4, 5, 6} = S (i.e., A & B are exhaustive )
A ∪C = {0, 1, 2, 3, 4} = A (indeed, C is a subset of A )
A ∩B = {3, 4}
A ∩C = {1, 2}
(A ∩ C ) c
= {0, 3, 4, 5, 6}
B ∩C = ∅ (i.e., B & C are disjoint )
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 16 / 57
Extensions to ≥ 3 Events
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 17 / 57
Algebra For ≥ 3 Events
2 Distributive Laws:
(A ∪ B ) ∩ C = (A ∩ C ) ∪ (B ∩ C ) (A ∩ B ) ∪ C = (A ∪ C ) ∩ (B ∪ C )
3 DeMorgan’s laws:
n c n
n c n
[ \ \ [
Ei = Eic Ei = Eic
i =1 i =1 i =1 i =1
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 18 / 57
Axioms of Probability
Definition
Probability of an event E is defined by a function P from subsets of S to
the real numbers that satisfies the following axioms of probability
Ê If E ⊂ S, then P (E ) ≥ 0
Ë P (S ) = 1
Ì For any countably many sequence of disjoint events
E1 , E2 , . . . , En , . . ., ∞
[ X ∞
P Ei = P (Ei )
i =1 i =1
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 19 / 57
Relative–Frequency Interpretation of Probability
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 20 / 57
Some More Properties Regarding Probability
P (A ∪ B ) = P (A ) + P (B ) − P (AB )
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 21 / 57
Example 6: Addition Law
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 22 / 57
How to Compute Probabilities?
[ X X
P (A ) = P {ωi } = P ({ωi }) = pi
ω i ∈A ω i ∈A {i =1,...,N :ωi ∈A }
(1)
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 23 / 57
Sample Spaces Having Equally Likely Outcomes
Assume that
1 the sample space is finite (e.g., S = {1, 2, . . . , N })
2 all the N outcomes are equiprobable or equally likely to occur (a
reasonable attribute in many experiments)
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 24 / 57
Example 7: Tossing 2 Fair Coins
S = {HH , HT , TH , TT } with cardinality N = 4
Let A denote the event that at least 1 head is observed
As A = {HH , HT , TH } = {HH } ∪ {HT } ∪ {TH }
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 26 / 57
Basic Principle of Counting
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 27 / 57
Example 8: Basic Principle of Counting
Draw a card from a deck of playing cards: 2 experiments with
m = 4 & n = 13 outcomes (as a card is defined by 4 different suits,
«, ª, ¨, ©, & 13 different face values, A, K, Q, J, 10, 9, ... , 3, 2)
þ 4 × 13 = 52 possible outcomes
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 28 / 57
Permutations & Combinations
Very often, we would like to address how many ways there are to
select a subset of size r from a group of n distinct/distinguishable
objects {c1 , c2 , . . . , cn }
e.g., when n = 6 & r = 4:
It depends on
1 whether we are allowed to duplicate objects:
Sampling without replacement versus Sampling with replacement
2 whether the sequence/order from which the r objects are selected
matters or not
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 29 / 57
Permutations
Permutation
A permutation is an ordered arrangement of objects. Selecting a sample
of size r (= 0, 1, . . . , n) from a set of size n objects, there are
1 nr permutations under sampling with replacement
n!
2
n Pr ≡ = n(n − 1)(n − 2) · · · (n − r + 1) permutations under
(n − r )!
sampling without replacement
n! is called n factorial
When n is a +ve integer, n! = n(n − 1)(n − 2) · · · 1. We have the
convention 0! = 1
n!
The total # of ways in arranging n distinct objects is = n!
(n − n)!
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 30 / 57
Example 9: Permutations
Refer to the picture at Page 29, how many different ordered arrangements
of 4 M&M’s selected from 6 M&M’s of different colors are there?
6! 6!
= = 6(5)(4)(3) = 360
(6 − 4)! 2!
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 31 / 57
Example 10: Permutations
There are 10 teaching assistants (TAs) available for grading papers in a
test. The test consists of 5 questions, & the Professor wishes to select a
different TA to grade each question (at most 1 question per assistant). In
how many ways can the TAs be chosen for grading?
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 32 / 57
Example 11: Permutations
There are n rewards to be distributed randomly by a teacher to n students
so that each student gets 1 reward. Suppose that 1 of the rewards is the
top prize. The students will queue up to receive a reward from the teacher.
Shall a student queue first so as to increase his/her chance of getting the
top prize?
Combination
A combination is an unordered arrangement/collection of objects. For a
set of n distinct
! objects & a subset of size r, there are
n n!
n Cr ≡ ≡ different combinations under sampling without
r (n − r )!r !
replacement when r = 0, 1, . . . , n
!
n
The expression, n Cr or , is read as “n choose r” & also called
r
binomial coefficient
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 34 / 57
Example 12: Combinations
Solution:
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 35 / 57
Example 13: Bridge Hand
A bridge hand consists of any 13 cards selected from a 52–card deck
without regard to order, wherein the 52 cards are distinct
!
52 52!
There are = = 635, 013, 559, 600 different bridge hands
13 13!39!
Since there are 13 cards in each of the 4 suits («, ª, ¨, ©), the # of
! consisting entirely of « or ¨ (no ª or © cards) is
hands
26 26!
= = 10, 400, 600
13 13!13!
Suppose that a bridge hand is dealt from a well–shuffled deck (i.e.,
every bridge hand/combination of 13 cards from S of cardinality
≈ 635 billion is equally likely to occur). So,
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 36 / 57
Example 14: Three of a Kind
A 5–card poker hand is said to be a “three of a kind” if it
consists of 3 cards of the same denomination & 2 other cards
of 2 different denominations other than the one for the previous
3 cards. What is the prob that a person is dealt a “three of a
kind”?
52
Solution: Note that all 5 possible poker hands are equally likely (i.e.,
order from which the 5 cards are drawn are irrelevant)
1 # of combinations to choose
the 3 cards of the same denomination, &
1244
2
2 1 1 # of combinations to choose the other 2 cards
1341244
1 3 2 1 1
Prob of a “three of a kind” is 52 ≈ .02113
5
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 37 / 57
Conditional Probability: A Motivating Example I
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 38 / 57
Conditional Probability: A Motivating Example II
Of course, it is intuitive that the chance of him/her getting
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 39 / 57
Conditional Probability
Definition
Let A & B be 2 events with P (B ) > 0. The
conditional probability of A given B is defined to be
P (AB )
P (A |B ) = ∈ [0, 1]
P (B )
Suppose that of all individuals buying a certain digital camera, on the spot,
60% also buy a memory card, 40% buy an extra battery, & 30% buy both.
Consider randomly selecting a buyer, & let A be the event that a memory
card is purchased & B be the event that an extra battery is purchased.
Then, we have P (A ) = .6, P (B ) = .4, P (AB ) = .3. Given that the selected
buyer purchased an extra battery, prob that a memory card was also
purchased is
P (AB ) .3
P (A |B ) = = = .75
P (B ) .4
P (A c B ) P (B ) − P (AB ) .1
P (A c |B ) = = = = .25
P (B ) P (B ) .4
Note : P (A |B ) , P (A ) & P (A |B ) + P (A c |B ) = 1
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 41 / 57
Example 16: Conditional Probability II
A bin contains 25 light bulbs, of which 5 are good & function at
least 30 days, 10 are partially defective & will fail in the second
day of use, while the rest are totally defective & won’t light up at
all. Given that a randomly chosen bulb initially lights up, what is
the prob that it will still be working after one week?
P (GT c ) P (G ) 5/25 1
P (G |T c ) = = = =
c
P (T ) c
P (T ) 15/25 3
Note : P (G |T c ) , P (G ) = 5/25
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 42 / 57
Example 17: Conditional Probability And Reduced
Sample Space
A fair coin is flipped twice. All outcomes in
S = {HH , HT , TH , TT }
P (AB ) 1/4 1
P (A |B ) = = =
P (B ) 1/2 2
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 43 / 57
Law of Total Probability I
Definition
A collection of events B1 , B2 , . . . , Bn is called a partition of size n if
Ê Bi Bj = ∅ for i , j & Ë ∪ni=1 Bi = S
The idea :
1 break A into 4 (or, in general, n) “smaller” events, namely,
A ∩ B1 , . . . , A ∩ B4 (or A ∩ Bn )
2 compute probs of the 4 (or n) intersections by multiplication law
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 45 / 57
Example 18: Law of Total Probability
Of the items produced daily by a factory, 40% come from line 1 & 60%
from line 2. Line 1 has a defect rate of 8%, where line 2 has a defect rate
of 10%. If an item is chosen at random from the day’s production, find the
prob that it will not be defective
D: item is defective
Solution: Define events: L1: item comes from line 1
L :
2 item comes from line 2
From the question, we have P (L1 ) = 1 − P (L2 ) = .4,
P (D c |L1 ) = 1 − P (D |L1 ) = .92, & P (D c |L2 ) = 1 − P (D |L2 ) = .9. Then,
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 46 / 57
Example 19: Law of Total Probability & Tree Diagram I
A chain of video stores sells 3 different brands of DVD players. Of its DVD
player sales, 50% are brand 1 & 30% are brand 2. Each manufacturer
offers 1–year warranty on parts & labor. It is known that 25% of brand 1’s
players require warranty repair work, whereas the corresponding
percentages for brands 2 & 3 are 20% & 10%, respectively. What is the
prob that a randomly selected purchaser has a DVD player that will need
repair while under warranty?
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 48 / 57
Example 19: Law of Total Probability & Tree Diagram III
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 49 / 57
Bayes’ Formula
Bayes’ Formula
Let B1 , B2 , . . . , Bn be a partition with P (Bi ) > 0 for all i. Then, for any event
A with P (A ) > 0,
P (Bj )P (A |Bj )
P (Bj |A ) = Pn j = 1, 2, . . . , n
i =1 P (Bi )P (A |Bi )
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 50 / 57
Example 20: Bayes’ Formula
Refer to Example 19 about DVD players at Page 47, if a
customer returns to the store with a DVD player that needs
warranty repair work, what is the prob that it is a brand 1
player? a brand 2 player? a brand 3 player?
Solution: One should apply the Bayes’ formula based on the partition
{A1 , A2 , A3 } to compute these required conditional probs. With
P (B ) = .205 obtained at Page 47, we have
P (A1 )P (B |A1 ) .5(.25)
P (A1 |B ) = = = .61
P (B ) .205
P (A2 )P (B |A2 ) .3(.2)
P (A2 |B ) = = = .29
P (B ) .205
P (A3 )P (B |A3 ) .2(.1)
P (A3 |B ) = = = .1
P (B ) .205
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 52 / 57
Independence I
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 53 / 57
Independence II
Definition
Events A & B are said to be independent (indept) if
P (AB ) = P (A )P (B ), or equivalently,
P (A ) = P (A |B ), or equivalently,
P (B ) = P (B |A )
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 54 / 57
Independence III
Indep of 2 Events
If A & B are indept, then so are Ê A & B c , Ë A c & B, & Ì A c & B c
Definition
Three events A , B & C, are said to be mutually indept if all the following 4
conditions hold:
P (ABC ) = P (A )P (B )P (C )
P (AB ) = P (A )P (B )
P (AC ) = P (A )P (C )
P (BC ) = P (B )P (C )
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 55 / 57
Example 22: Independence
1 Draw a card from a deck of playing cards: Let A = {it is an ace} &
D = {it is a ©}. Intuitively, knowing the card being an ace should give
no information about its suit. Verify this with: P (A ) = 4/52 = 1/13,
P (D ) = 13/52 = 1/4 &
1 1 1
P (AD ) = P ({it is ©A}) = = × = P (A )P (D )
52 13 4
þ A & D are indept
2 Toss 2 coins: Suppose that A = {1st coin lands a head},
B = {2nd coin lands a head} & C = {exactly 1 head is observed}
It is clear that P (B |A ) = P (B ) as whatever happens to the 1st coin
does not influence the 2nd coin þ A & B are indept
Suppose that the coins are fair (i.e., P (A ) = P (B ) = .5). Compute
P (C ) = P ({HT , TH }) = 2/4 = .5 & thus
P (AC ) P ({HT }) .25
P (A |C ) = = = = .5 = P ( A )
P (C ) P ({HT , TH }) .5
þ A & C are indept
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 56 / 57
Example 23: Tossing 2 Dices
Toss 2 fair dice:
1 Let A6 denote the event that the sum of 2 dice is 6, & B denote the
event that
( the 1st die equals 4
A6 = { , , , , }
Then,
B = { , , , , , }
So, A6 B = { }, &
1 5 1
= P (A6 B ) , P (A6 )P (B ) = ×
36 36 6
þ A6 & B are dependent
2 Let A7 denote the event that the sum of 2 dice is 7. Then,
P (A7 ) = P ({ , , , , , }) = 6/36 = 1/6 &
P (A7 B ) = P ({ }) = 1/36. Hence,
1 1 1
= P (A7 B ) = P (A7 )P (B ) = ×
36 6 6
þ A7 & B are indept
Monday & Thursday, 12nn-2pm (UT AUD 3) Dr. HO Man-Wai ([email protected]) ST2334(NUS) Ch.3 57 / 57