Conditional Probability
Conditional Probability
Introduction to Probability
a bc b a c cab
so 6
a e b be a cba ways
We could have figured this out with the following reasoning in the
first spot choose the first letter 3 options in the second spot choose
one of the 2 remaining letters 2 options and the last letter in the
goes
third spot I option We get 3 2 1 6 ways This number is
3 factorial
denoted by 3
Product Rule
we have 3 3 9 outcomes
W
W G W
G
B B
W
W G
G G
B B
W W
Case 1 B G Case 2 B b
B
Exercise 1 How many words of size 4 are there
2 If the letters are picked randomly what is the probability
that no letter is repeated
Exercise 1 How many words of size 4 are there
2 If the letters are picked randomly what is the probability
that no letter is repeated
Solution 1 26 26 26 x 26 26
looking for the number of permutations of n objects There are n options for
the first spot n 1 for the second and I for the last By the product
rule there are thus n n 1 2.1 total possibilities
Def The number n n n 1 n 2 3.2.1 denotes the number of
permutations of all the elements of a set of cardinality n
In general permuting means that the order of elements matters Now what
if we want to permute te objects out of a set of n elements
elements is
given by
pun n ren
Ch r
Example From of 10 people
a 6 will pose for a
photo
group
The number of possible photos we can take is
10 x 9 x 8 x 7 x 6 x 5
10 9.8 7 6.5.4 3 2 7 10 9 8.7.6
or Po 19 J
4 3 2 I
Note that the order matters here which is why we for Palo
go
Note that order does not need to be mentioned literally when a certain
distinction between the chosen objects is imposed an ordered arrangement
is in question For example if we want to select a committee of
3 people a president VP and treasurer out of 10 people then we have
B to LO x 9x 8
elements is
given by
Cnn
r
n
Ch r I ren
So in general
1 Pi
x S 8 6 560
92 3 31
without replacement what is the probability that at least one card is a king
Exercise In how many can 2 maths books and 3 biology books
ways
be selected from 8 maths and 6 biology books
Solution
There are Eways
to select the 2 maths books and 5 ways to
select 3 bio books Using the product rule the total number of ways is
x S 8 6 560
92 3 31
without replacement what is the probability that at least one card is a king
Solution
Considerthe event E at least one king It is easier to study E no king
Total outcomes E
Favourable outcomes of E Y chosen out of 48 4 kings
ni nai ing hi ne ne
10
E 7 3
317 1
t
II 3 3 3
11
1,44 2 34650
1141612
I SamplingModels
ordered
sample
without replacement
Kan unordered sample
We quickly considerthe 6 cases The first 3 cases are known to us
2 Sampling
without replacementand without ordering k n
k N K
The last case is more complicated We give the proof in a later section when
we consider its corresponding allocation model Only this part is new
4 Sampling
with replacement and without ordering
th
1
II
Example The number of ways to choose 3 scoops of ice cream from a place
3
that only has 2 flavours n 2 k 3 is ith 13
4 4
I Allocation Models
distinguishable objects
without exclusion
indistinguishable objects
distinguishable objects
with exclusion
Ren
indistinguishable objects
It turns out that there is a perfect correspondence between the 4 sampling
models and the 4 allocation models Suppose we want to
sample k balls
from a n balls The boxes correspond to the balls in the
jar containg jar
and the objects correspond to the balls drawn from the
jar
In this context sampling
with replacement means we can draw the same ball
many
times i.e the box can contain more than one ball no exclusion
Allocation
Sampling
with replacement ordered without exclusion
distinguishable
with replacement
unordered without exclusion indistinguishable
withoutreplacement ordered with exclusion distinguishable
without replacement unordered with exclusion indistinguishable
This allows us to compute the formulae for allocation models
Allocation
Sampling
with without
replacement
n
Ith exclusion
n
it
without with
replacement
Pan y exclusion
Phin
I
In a 11am
1 26
Fyi
3
We can thus
map
all the outcomes he the permutations of h 1 bars and k
stats Out of n I k spots choose k spots for the stars Hence the
number of outcomes is
th
ni
as desired
Exercise let f IR s IR beanalytic function of to variables How
an
many partial
derivatives of order 5 exist
Solution Partial derivatives do not depend on order of differentiation We thus
Exercise We have seen in the above that the number of ways to allocate 5
4 5
indistinguishable ball into 4 boxes no exclusion is Ith 1 E
Now how many are there to do this s t no box remains empty
ways
Solution Put one of the 5 balls into each of the 4 boxes so that none
remain empty
W a
W W A
W
There is one ball left How many
ways are there to allocate this one ball
1
to 4 boxes 4 The answer is 4
1st
1
I Examples
The only way to master combinatorics is through
practice A lot of practice
We start with an
interesting paradox
Exercise The Birthday Problem How should one randomly
many people
collect so the chance that at least 2 people share the same birthday
is at least o 5
I Examples
The only way to master combinatorics is through
practice A lot of practice
We start with an
interesting paradox
Exercise The Birthday Problem How should one randomly
many people
collect so the chance that at least 2 people share the same birthday
is at least 0.5
PN 365
We thus want NS.t 1
N I 0 5
365
computing software
N 23 This means that in a class
Using a we
get
of only 23 students there is a 50 chance that 2 sharethe same birthday
Exercise 1 How words of size 4 are such that exactly one letter
many
is
repeated twice
Solution
Stl Choose 3 letters to be used 3
St 2 Of those 3 pick which letter is to be repeated
twice E
St 3 Now arrange them
Y MISSISSIPPI
We
get 3 x x
Y 93600 different words
4
We get 4 2 2
1950
3 Hander How many 4 letter words of exactly 2 letters are there
3 Hander How many 4 letter words of exactly 2 letters are there
Solution
E E
2 St 1 Choose which color 3 3
Sf 2 Choose 5 of this color 5
IPC All of one color 3 15
E
3 Stl Choose 2 White balls E
St 2 Choose 3 out of the 10 Black Red balls 5
IP 2 white I 5
5
4 Plz white 2 Black E E i
Solution R
Choose 2 spots for the remaining red balls out of the 9 spots
The number of favourable outcomes is E
The total number of outcomes is I choose 3 spots for the red balls
9
Pl 6thdraw is red 12 7 9 3
19 3 2 10 2
2 If all numbers
appear
then exactly one of the numbers occurs twice
St 1 Choose which number occurs twice E
St 2 Shuffle MISSISSIPPI 7
2
Stl Pick one to appear 3 times Stl Pick 2 numbers tapper twice
St2 Shuffle 8
St 2 Shuffle 83
2 2
Pl all appear 9 8 6 Ez
68
What if n 9 Hint 3 disjoint cases
Exercise An ordinary deck of 52 card is randomly dealt to 4 players s r
each player receives B cards Compute the
probability of the event
E each player receives an ace
Solution
The total number of to allocate 52 cards in 4 distinct
ways groups
of 13 cards each is
gz
Ir 13,13 13,13 93413113
13
Now there are 4 aces and 48 other cards To compute the favourable cases
Stl Choose an ace for 1stplayer Y
SEZ Choose 12 other cards for 1stplayer Y
St 3 Choose an ace for 2ndplayer
St 4 Choose 12 other cards
for 2ndplayer
St 5 Choose
ace for 3rdplayer k
St 6 Choose 12 cards for 3rd
player
Y
St 7 Remaining cards go to 4th i 1
IE 9 1 F E 4 IN E 4 40
4
42
4 98 13
PIE
52
that are occupied by 4 aces but it does not matter which ace is
in which position In this case we only care about the position of aces
I Y or Mississippi
In this scenario the first 13 spots to the first player the next
go
13 spots to the second and so on
St 1 Choose
spot of 1st ace among
1st B B 13
St 2 Choose
spot of 2nd ace among
2nd B B 13
St 3 Choose spot of 3rd ace among 3rd 13 B 13
St4 Choose
spot of 4th ace among 4th B R 13 11 13
134 4 48 134
PL E same answer
5421
52
Consider all couds to be distinguishable and as before the first B
cards to the first second 13 to the 2ndplayer and so on
go
Ir 52
Stl Choose which ace to which player Pu
goes 4
St 2 3 4 5 Repeat the 4 steps of 172 3 7 1 1 134
4 13 98
PCE same answer
52
let Ei be the event that box i stays empty i 1,2 3 The event we wantis
MEIN EJ AMBI E U E U Ez
10
For each i IP Ei 210310
3 distinguishable balls without exclusion
For each i PC Ei NE 119310
g 43
8339 0.948
7 1
q y
To convince yourself why this is case compute the probability of the
the
allocation lo o d in each of the 2 cases
Solution
1
1 The total number of cases is 111 1915 4
To count the number of favourable cases
Stl Choose which 2 uns remain empty E
St 2 Place a ball in the other 3 and distribute
the remaining 7 balls on 3 wins IT
IPLExactly 2 wins empty
E E
2 The event consists of 3 disjoint cases
Case Ans 4 and 5 Combined receive 0 balls
1 3 1
Distribute 10 balls on 3 boxes 1
and
k 3 s 3 8
get
PYat
s
most 3 balls
Exercise A class contains 8 boys and 4 girls We line them randomly
up
in a straight line What is the probability that exactly 2 girls
come together and that the 2 other girls are separated
example BG GB GB B GBB BB
Exercise A class contains 8 boys and 4 girls We line them
up randomly
in a straight line What is the probability that exactly 2 girls
come together and that the 2 other girls are separated
example BG GB GB B GBB BB
Solution
In this sort of problems it is best to think about the situation as an
allocation problem The 8 boys are considered to be separators for 9
boxes The
girls constitute 4 indistinguishable balls The event we
want to study is equivalent to one box containing exactly 2 balls
2 other boxes containing exactly 1 ball each the others remaining empty
4 49 1
Total Cases Irl Y
Favourable Cases Stl Choose box balls
containing 2 I 9
St 2 Choose 2 others with I balleach
IP event 9 E