STA107H1a.doc
Lecture #1 – Wednesday, September 10, 2003
S AMPLE SPACE
• Nothing is 100% sure – random phenomenon
• Definition: Consider a random action, phenomenon, or event whose outcome is unknown. Then the set of
all possible outcomes is the sample space of the action, phenomenon, or event.
Examples
• Flip a coin with two sides: heads and tails
• S = H,T }
• Roll a die
• S = 1,2,3,4,5}6
• Horse race with 11 horses1(H …11)
• Who wins? – S ={H 1 H2,...,11}
• Who are the first two? – S has 110 elements {(H 1 H2 ,(H 2 H1),..(H 7 H11)}
Counting
• It is of interest the number of elements in S – therefore counting is important
• “Glancing a plate”
• Assumptions: All cars have Ontario plates; 4 letters (26 in total); 3 numbers (10 in total)
• “Watch a random plate”
• S is not describable
• We know S (S is the number of elements in S)
E VENTS
• subsets of the sample space
Examples
• Flip a coin
• E = Iflipa coin and get a h}ad
E = {H} Ì S ={H,T }
• Roll a die
E = I rollan even numbe}
• E = 2,4,6}Ì S = 1,2,3,4,5}6– composite event
• F = {2} – single event
• Horse Race
• First two –S ={H 1H 2),H 2H 1),..H 7H 11)} with 110 elements
E = H 7ins the race}
• – 10 entries
E = H ,7H ,1H , 7 2),...,7H ,11)}
Page 1 of 22 STA107H1a.doc
O PERATIONS W ITHE VENTS (SETS )
Reunion
• “Roll a 2 or 4”
E1= {2}
• E4= {4}
E = E ¨ E = 2,4
1 2
• A, B are sets
• A¨B is the “reunion of A and B” – the set which contains the elements that are in either A or B
Intersection
E1= {ollan even numb}r
• E = {rolla number small t}an 5
2
E ={rollan even number small than 5
E1= 2,4,}
• E2= {1,2,3}4
E = 1 ˙E 2 {2,4
• A, B are sets
• A¨B is the “reunion of A and B” – the set which contains the elements that are in either A or B
Complement
E = {,4,}
• 1
E ={all the elements that arE1=ot1,3,5
c
• Definition: If A is a set, then Acomplement of A – the set containing all the elements which are not in
A, but in S
The Empty Set
• Denoted by Ø
• For any set AØ Ì A
• For any sample spaces Ø Ì S
Ø ¨ A = A
•
Ø ˙ A = Ø
Lecture #2 – Friday, September 12, 2003
O PERATION W ITHS ETS – C ONTINUED
Infinite Sequences of Events (Notation)
• For E 1E 2,..En,
n
• ▯ E i E 1E ¨2 ..¨E n
= 1
Page 2 of 22 STA107H1a.doc
¥
• ▯ E i E 1E ¨ 2 ..¨E n ...
i=
n
• ▯ E i E 1E ˙ 2 ..˙E n
i1
¥
• ▯ E i E 1E ˙ 2 ..˙E n ...
i=
Distributive Laws
• x×a+b )= x×a+ x×b
• F ˙(E 1E 2)= F ˙E 1)¨ (F ˙E 2)
F
F ˙ E F ˙ E 2
1
= E ¨ E ▯
1 2
E
E 1 E2 = F ˙ (E1¨ E 2▯
E)
S
• F ¨(E ˙E )= F ¨E )˙ (F ¨E )
1 2 1 2
F
= E ˙ E ▯
1 2
E
E E2 = F ¨ (E1˙ E 2▯
1 E)
S
• For F ˙ E ¨E )= (F ˙E )¨ (F ˙E ), two things are required to show the equality of two sets A and B
1 2 1 2
• For each point a˛ A , we need to show thata˛B
a˛ F ˙ E(¨1E 2)
a isin F and a is in E or E
1 2
a isin F and isin1E or a isin F and is2n E
\ a F ˙ E1) ( F ˙ E2)
• For each point b˛ B , we need to show that b˛ A
b˛ F ˙ E ¨1F ˙ E 2 )
bisin F and isin 1 or bisin F and is i2 E
bisin F and bisin E or E
1 2
\b˛ F ˙ E ¨ 1 2)
Page 3 of 22 STA107H1a.doc
In General
▯ n ▯ n
• F ˙ ▯▯ Ei = ▯ E iF )
▯i=1 ▯ i=1
F ˙ ( 1E ¨E 2 3) (F ˙E ¨ 1) ( 2) (F ˙E 3)
3 3
• ▯ ▯
F ˙ ▯▯ Ei▯= ▯ (F ˙E i)
▯i1 ▯ i=1
▯ n ▯ n
• F ¨ ▯▯ E i▯= ▯ (F ¨E i)
▯i=1 ▯ i=1
Complements
• For set A, A is the set of points which are not in set A
c
• (Ac) = A
• (E ¨E ) = E c ˙E c – de Morgon’s Law
1 2 1 2
E1 E1
= E ¨ E = E ˙ E c
1 2 1 2
E2 E 2
S S
c c c
• (E 1 ˙ E 2 ) = E 1 ¨ E 2
(E ˙ E )c
1 2
▯ c c cc ▯c
= ▯E 1 ( ˙ E 2 ▯
• ▯ ▯
c c
= ▯E c¨ E c) ▯
▯ 1 2 ▯
c c
= E1 ¨ E 2
P ROBABILITY
• For E 1 E2, E3,
• E is the set of possible outcomes
1
• “E1 is true” or 1E occurs”
• The final outcome of the expression belongs to1E
Examples
• “Roll a die”
Page 4 of 22 STA107H1a.doc
• E 1 {rollan even numbe} ={2,4,} – E1is true if the roll is either 2, 4, or 6
• E 2 {rollis less th}n 3
• If E and E are true, the outcome belongs to the intersection of E ˙{2}=
1 2 1 2
• If 1 , 2 , and3E are three events
• Only E1is true
E1and not in 2 and not in3E
c c
E 1 E 2 ˙ E 3
• Only E2or E3is true
E2and not in 1 and not in3E or 3 and not in1E and not i2 E
(E ˙ E c ˙ E c)¨ (E ˙ E c˙ E c)
2 1 3 3 1 2
• None of them is true
c c c
E 1 ˙ E 2 ˙ E 3
• Exactly two of them is true
E1, E2occur, 3 doesn’t OR E1, 3 occur, 2 doesn’t OR 2 ,3E occur,1E doesn’t
(E ˙ E ˙ E c)¨ (E ˙ E ˙ E c)¨ (E ˙ E ˙ E c)
1 2 3 1 3 2 2 3 1
Lecture #3 – Monday, September 15, 2003
• A= (A ˙ B)¨ (A ˙ Bc)
B
A
S
• If A˙ B =f , then A˙ B = A
B
A
S
Notation
• E ×F = E ˙ F
• E happens but F doesn’t: E-F
• set containing those points which are in E but are not in F – E ˙ F
• Symmetrical difference: D F = E - F )¨ F - E )
• If EDF =f , then E = F
Page 5 of 22 STA107H1a.doc
D E M ORGAN ’S F IRST AND S ECOND L AWS
c
▯ n ▯ n c
1) ▯▯ Ei▯ =▯ Ei
▯i=1 ▯ i=1
n c n
2) ▯ E ▯ = E c
▯▯ i▯ ▯ i
▯i=1 ▯ i=1
A XIOMS OF P ROBABILITY
1) "A Ì S ,P(A)‡ 0
2) P(S)=1
3) For any infinite sequence of evints E such that E iE =fj (mutually exclusive event),
▯¥ ▯ ¥
P ▯▯ E i▯= ▯ P (Ei)
▯i=0 ▯ i=0
• [0,]
P S )=1
P A )‡0, for any eveA Ì S
c
• For A and A ,
• A¨ A = s
c
• A˙ A =f
P A¨ A c)= P(S)=1
•
= P(A)+ P(Ac)
• P:{sebsetsof } =[0,]
• If A Ì B, show P(A) £ (B )
B
A
S
• B = B ˙ A ¨ B ˙ A( c )
P B = P B˙ A ¨ B˙ A c)
c
• = P B˙ A )+ P B ˙ A )
= P A )+ P B ˙ Ac)
• \P (A)£ P B )
Page 6 of 22 STA107H1a.doc
Inclusion-Exclusion Formula
• What is P(A˙ B ) if A˙ B „ 0?
B
A
S
• P (A¨ B )= P(A)+ P(B)- P(A˙ B )
• P (A¨ B¨C )= P(A)+ P(B)+ P(C)- P(A˙ B )- P(A˙C )- P(B ˙C )+ P(A˙ B˙C )
n-1
• In general, (A1¨ ..¨ A n)= P(A1)+..P(A n)- P(A1˙ A 2)-..P(An-1˙ A n)+(-1) P(A1˙ ..˙ A n)
C OUNTING O UTCOMES
• S is a sample space with equal probability outcomes a ,...a }
1 n
1
• P a1) = Pa n)= p = n
• If Ei= {ai},for i =1,2,...,n
n
• ▯ Ei= S
i1
• E i E =ja ˙ia { j = f
n n
P ▯ E ▯= P(E )= n× p =1
▯▯ i▯ ▯ i
• ▯i=1 ▯ i=1
1
\ p = n
1
• If all possible end outcomes are equally likely, the probabilitynof each is
E Ì S
• #of elementsin set E
P E =
n
Lecture #4 – Wednesday, September 17, 2003
S AMPLE SURVEYS
Example
• Pick a person at random (from this university, city, country)
• Percentage of people in Toronto with “quality X” is 30%
• Sample space of this experimentS = (Pi,1or ),i =1,...,2000000
Page 7 of 22 STA107H1a.doc
E = "A person hasX"}
• = P i1,i =1,...,2000000– size of E is the number of elements in E (smaller than 2000000)
• P E )= 30%
Example
• Second Cup (SC) = 60% – “person drinks from Second Cup”
Starbucks (ST) = 70% – “person drinks from Starbucks”
no coffee (NC) = 20% – “person doesn’t drink coffee”
• Sample space:S = (Pi, x,,i = allpeoplein Toro}to
• How many people drink from Second Cup and Starbucks?
• E ={(P ,1)}
i
S
ST 20%
70%
60%
SC
ST ¨SC = peoplewho drink coff}e
P(ST ¨SC )=1-20% = 80%
• P(ST ¨SC )= P(ST)+ P(SC - P(ST ˙SC )
P(ST ˙SC )= P(ST)+ P(SC - P(ST ¨SC )
= 70%+60%-80%
= 50%
• \ 50% of the people drink from Second Cup and Starbucks.
• How many people drink from only Starbucks?
• 70%-50% = 20%
Example
• West Nile Virus (WNV) = 20%
SARS (SRS) = 12%
Without scars (SCS = 30%
SARS and West Nile Virus (SRS + WNV) = 3% SRS 10% SCS
Scars and SARS (SCS + SRS) = 20%
12% 70%
Scars and West Nile Virus (SCS + WNV) = 20%
All (WNV + SRS + SCS) = 1% 1%
3% 5%
WNV 20%
S
• E = He willleavethesame way hecame toToront}
Page 8 of 22 STA107H1a.doc
P E = - P E( )
= - P SRS ¨SCS ¨WNV )
▯P SRS )+ P(SCS )+ PWNV ) ▯
= - - P (SRS ˙SCS )- P(SRS ˙WNV )- P(SCS ˙WNV )▯
• ▯ ▯
▯+ P(SRS ˙SCS ˙WNV ) ▯
=1 1(% 70% 20% 10% 3% 5% 1%- - + )
=1 85%
=15%
L ECTURE #5 – F RIDAY , SEPTEMBER 19, 2003
S AMPLE SURVEYS (C ONTINUED )
Example
Suppose that a town has three local newspaper (A, B, C). Suppose that
• 10% read newspaper A
• 20% read newspaper B
• 5% read newspaper C A 0.07 B
• 8% read newspaper A and B
• 2% read newspaper A and C 0.01 0.09
• 4% read newspaper B and C 0.01
• 1% read newspaper A, B, and C
0.01 0.03
0
C S
1) What is the percentage of people reading only one newspaper?
P onlyone newspaper )= 0.01+0.09+0
= 0.1=10%
2) What is the percentage of people reading exactly two newspapers?
P exactly two newspaper)= 0.07+0.01+0.03
= 0.11=11%
3) What is the percentage of people reading newspapers A or B?
P reading Aor B)= P(A)+ P(B - P A˙ B )
= 0.1+ 0.2-0.08
= 0.22 = 22%
Example
We look at families with 4 children (it’s equally probable to have a girl or a boy):
S ={b,b, g,(b, g,)(g,b,b),b, g, )(g,b, g,(g, g,),g, g, )(b,b,b)}
• Each of these outcomes is equally likely
We are interested only in how many boys a family with kids has:
S ={0b,1b,2b,3}
Page 9 of 22 STA107H1a.doc
• P 0 boys}=1
8
3
• P 1boy =
8
3
• P 2 boys}=
8
1
• P 3boys} =
8
• Note: Look at the sample space with equally likely outcome – allows for probability formula
Example
A tourist wanders on Bloor St. and doesn’t know where he is going. At each intersection he decides at random
to go either east or west. Suppose that he chooses each time by flipping a coin.
• Two possible choices for sample space:
• S1= {1E,2E,3E,4E),1E,2E,3E,2E),..1W,2W,3W,4W )} – describes the whole path
• S2= {0,1E,1W,2E,2W,...,4E,}W – describes the final arrival points
0
1E
1W
2W 0 0 2E
3W 1W 1W 1E 1W 1E 1E 3E
4W 2W 2W 0 2W 0 0 2E 2W 0 0 2E 0 2E 2E 4E
1) After walking a length equal to four blocks, what is the probability that he is back at the starting point, say
Yonge & Bloor?
6 3
P(end where he sta)=d =
16 8
2) What is the probability that he is one block away from the starting point?
P(one block aw)= 0
C OUNTING T ECHNIQUES
Fundamental Principle of Counting
• There are r experiments such that:
• Experiment i hai n possible outcomes no matter what happened in the previous i -1 experiment
– number of outcomes in the i experiment does not depend on the particular outcome of the
previous i -1, but can depend on i
• Total number of possible outcome is t1en1 n ·n r...·n
Page 10 of 22 STA107H1a.doc
Example
Six people, 3 girls (C, D, L) and 3 boys (J, T, X).
1) They are on a boat with six seats. How many ways can the sit on the boat?
6·5·4·3·2·1= 6!
• In general: n!=1·2·..(n -1)·n and 0!=1 by definition
Lecture #6 – Monday, September 22, 2003
C OUNTING T ECHNIQUES (C ONTINUED …)
• In general, the total number of ordered arrangements of n items is n!=1·2·...·n
Example
In how many ways can 3 girls and 3 boys be seated?
• Switching C and D means:
G B B G B B
• different arrangement if names are considered
• same arrangement if names are not considered
C J T D L X
• 6! = 20
3· 3!
Example
In a chess tournament, there are:
• 3 players from Canada (1 ,2C ,3C )
• 2 players from Russia 1R 2 R )
• 4 players from U.S.A. (1 ,2U 3 U 4 U )
• 1 player from China (Ch)
• Individual final ranking: 10!
• Final ranking by country: 10! =12600
3!·2!·4!·1!
• If n items are such th1t n of them belong to Categor2 1, n of them belong to Categorr 2,…, n of them
n!
belong to Category R, the number of possible arrangements is then ,n =n1 +n 2+...+nr
n1!·n2!·...·r!
C OMBINATIONS
I have n objects. I want to select r of them (in an unordered matter). In how many ways can I do this?
• Divide the n objects into 2 categories: the object is selected among the r, the object is not selected among
the r
Page 11 of 22 STA107H1a.doc
n! ▯ ▯
• =▯ ▯ – “n choose r”
r!(n- r)! ▯ ▯
Example
I am a contestant on Fear Factor. A jar in front of me contains 3 snakes (with venom), 5 spiders, and 4 bees.
Magically, they do not attack each other but patiently wait for me to put my hand in the jar. I am crazy
enough to do it. After 1 minute I take it out and see that it has 3 bites; what is chance that all the bites are
from the bees and I’ll get to see the episode aired?
• With labels:
• Snakes: S1, 2,3
• Spiders: S1,Sp2,…,S5
• Bees: B1, 2,B3, 4
• S = {S 1 S2, S3,(S 2S 1S 3 ,..(Sp 1 S2, B1,}
• S = 12 ·11· 10 – all outcomes equally likely
• E = {3bitesarefrom3bees }
number of outcomesin E
P E =
12·11 ·0
4 · ·
• =
12·11 ·0
1
=
55
• Without labels, I lose the order to induce order:
• S = {S,Sp, S ,,..(B, B, B,}
• S = ▯12 ▯= 12! = 2·11·10
▯3 ▯ 3!9!
▯ ▯
▯ ▯ 4!
• E = ▯ ▯ = = 4
▯ ▯ 3!1!
P(
More
Less