Professional Documents
Culture Documents
Counting Methods
– Multiplicative, Combination,
Conditional Probability,
Statistical Independence
Example:
If a dice is thrown multiple times, each throw is independent
from the other throws.
If we throw 3 dice:
The total no. of outcomes from throwing 3 dice
= 6x6x6
= 216
Counting Methods - Dr Gan 3
Permutations in R: prod(n-k+1:n)
Permutation
Permutation (order is important): the no. of possible arrangements when
𝑘 objects are to be selected from a total of 𝑛 objects and arranged in
order (with (𝑛 – 𝑘) objects left over)
n! = n(n-1)(n-2)…(1)
𝑃 =𝑛 𝑛−1 𝑛−2 … 𝑛−𝑘+1
𝑛−𝑘 !
=𝑛 𝑛−1 𝑛−2 … 𝑛−𝑘+1
𝑛−𝑘 !
𝑛−𝑘 𝑛−𝑘−1 … 3 2 1
= 𝑛 𝑛−1 𝑛−2 … 𝑛−𝑘+1
𝑛−𝑘 !
𝑛!
=
𝑛−𝑘 !
Where
• n! = n(n-1)(n-2)…(1)
• 0! = 1 by definition
Counting Methods - Dr Gan 4
What is the probability of selecting the first letter to be A and the second
to be B?
1
𝑃 𝐴𝐵 =
12
Combinations in R: choose(n,k)
Combinations
Combination (order is not important): the no. of combinations
of n items taken 𝑘 items at a time is calculated using:
!
𝐶 =
! !
Where
• n! = n(n-1)(n-2)…(1)
• 0! = 1 by definition
!
! !
Combinations = =
!
=
! !
Example
A sample space contains 6As and 4 Bs. What is the probability that a randomly
selected set of 3 will include 1 A and 2 Bs?
!
𝐶 =
! !
The total number of outcomes in the sample space:
10!
𝐶 = = 120
3! 10 − 3 !
The number of ways to select 1 A from the 6 available:
6!
𝐶 = =6
1! 6 − 1 !
The number of ways to select 2 Bs from the 4 available:
4!
𝐶 = =6
2! 4 − 2 !
The number of outcomes that satisfy the condition of 1A and 2 Bs is = 6 × 6 = 36
Therefore, the probability that a randomly selected set of 3 will include 1A and
2 Bs is: 𝑃(𝑠𝑒𝑙𝑒𝑐𝑡𝑖𝑛𝑔 𝑎 𝑠𝑒𝑡 𝑜𝑓 1𝐴 2𝐵𝑠) = = = 0.3
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 𝑖𝑛 𝑒𝑣𝑒𝑛𝑡 𝐴 (𝑚)
𝑃 𝐴 =
Counting Methods - Dr Gan 𝑡𝑜𝑡𝑎𝑙 𝑠𝑎𝑚𝑝𝑙𝑒 𝑠𝑝𝑎𝑐𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒 (𝑛) 8
Conditional Probability
P(A∩B) P(A∩B)
P(A|B) = P(B|A) =
P(B) P(A)
P(B|A)P(A)
⇒ P(A|B) =
P(B)
P(B|A)P(A)
⇒ P(A|B) =
P(B)
Counting Methods - Dr Gan 10
10
11
b) Gender
c) Throwing of a dice:
S[1 2 3 4 5 6]
A[ 1 3 5]
B[2 4 6]
12
Think:
• results in quiz 1 and quiz 2
• weather and stock market
13
A test of independence
When events A and B are independent,
P(A∩B)
P(A|B) = = P(A) (if P(B)>0)
P(B)
P(A∩B)
P(B|A) = = P(B) (if P(A)>0)
P(A)
14
P(B) = =
P(A) = =
P(A)P(B) = =
If A occurs, B cannot occur => mutually exclusive events are not independent
events.
Probability - Dr Gan 15
15
- The End -
16
• Two independent events can only be mutually exclusive if either one of them is zero,
i.e. P(AnB)=P(A)P(B) => independent and if P(AnB)=0=> mutually exclusive then it
means either P(A) or P(B) is zero to make P(AnB)=0.
• If the neither P(A) or P(B) is zero, then P(AnB) will not be zero which means that the
two events are not mutually exclusive.
17
Extra Example:
In throwing a fair dice, the sample space is S:
S={2,4,6,1,3,5}
P(B) = 1/6
P(A) = 3/6 = 1/2
=> P(A ∩ B) = 0 => they are mutually exclusive
Probability - Dr Gan 18
18