You are on page 1of 9

AB1202

Statistics and Analysis


Week 2 Review

Counting Methods
– Multiplicative, Combination,
Conditional Probability,
Statistical Independence

Simple sample spaces


• Experiments where all sample space elementary
outcomes are equally likely to occur, then,

𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 𝑖𝑛 𝑒𝑣𝑒𝑛𝑡 𝐴 (𝑚) 1 𝑚


𝑃 𝐴 = = =
𝑡𝑜𝑡𝑎𝑙 𝑠𝑎𝑚𝑝𝑙𝑒 𝑠𝑝𝑎𝑐𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒 (𝑛) 𝑛 𝑛

Counting Methods - Dr Gan 2

Week 2 Review – Dr Gan Chui Goh 1


Multiplicative
Applicable when an experiment has multiple steps with each
step independent of the other steps.

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

Week 2 Review – Dr Gan Chui Goh 2


Example
Suppose that two letters are to be selected from A, B, C, D and arranged
in order. How many permutations are possible?
n = 4 and k = 2
!
The number of permutations is, 𝑃 = = = 4x3 = 12
!
The permutations are: Permutation in R:
AB AC AD BA BC BD prod(n-k+1,n)
CA CB CD DA DB DC = prod(3:4)or prod(4:3)

What is the probability of selecting the first letter to be A and the second
to be B?
1
𝑃 𝐴𝐵 =
12

Counting Methods - Dr Gan 5

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 = =
!
=
! !

Counting Methods - Dr Gan 6

Week 2 Review – Dr Gan Chui Goh 3


Example
Suppose that two letters are to be
selected from A, B, C, D and arranged in order.
How many combinations are possible?
n = 4 and k = 2
!
The number of combinations is 𝐶 = = =6
! !
The combinations are
AB (same as BA) BC (same as CB)
AC (same as CA) BD (same as DB)
AD (same as DA) CD (same as DC)

What is the probability of selecting the letter A and the letter B?


1
𝑃 𝐴𝐵 =
6
Counting Methods - Dr Gan 7

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

Week 2 Review – Dr Gan Chui Goh 4


Example
A sample space contains 6As and 4 Bs. What is the probability that a randomly
selected set of 3 will include less than 3 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 probability that a randomly selected set of 3 will include less than 3 Bs is:
𝐶 𝐶 +𝐶 𝐶 +𝐶 𝐶
𝑃 1𝐴 2𝐵𝑠 + 𝑃 2𝐴𝑠 1𝐵 + 𝑃 3𝐴𝑠 𝑛𝑜 𝐵 =
𝐶
6x6 + 15x4 + (20x1)
=
120
= = 0.97
Counting Methods - Dr Gan 9

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(A|B) P(B) = P(B|A) P(A)

P(B|A)P(A)
⇒ P(A|B) =
P(B)
Counting Methods - Dr Gan 10

10

Week 2 Review – Dr Gan Chui Goh 5


In a steamboat buffet restaurant, if 75% of the customers
take chilli sauce, 80% take soya sauce, and 65% take both.
What are the probability that a customer who takes soya
sauce also takes chilli sauce?
P(A∩B)
P(A|B) =
P(B)
P(C∩S) 0.65
P(C|S) = = = 0.8125
P(S) 0.8

Counting Methods - Dr Gan 11

11

Mutually Exclusive Events


Are these mutually exclusive events?

a) Subject grade: PASS or FAIL

b) Gender

c) Throwing of a dice:
S[1 2 3 4 5 6]
A[ 1 3 5]
B[2 4 6]

Counting Methods - Dr Gan 12

12

Week 2 Review – Dr Gan Chui Goh 6


Independent Events
When two events are independent, knowing whether one of them occurs
makes it neither more probable nor less probable that the other occurs.

Think:
• results in quiz 1 and quiz 2
• weather and stock market

Counting Methods - Dr Gan 13

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)

P(A∩B) = P(A|B) P(B)


⇒ P(A∩B) = P(A) P(B)

Example: P(A) = ; P(B) = ; P(A∩B) =


Are event A and B independent?
P(A)P(B) = X =
P(A∩B) = P(A) P(B) ⇒ they are independent

Counting Methods - Dr Gan 14

14

Week 2 Review – Dr Gan Chui Goh 7


Extra Example:
In throwing a fair dice, the sample space is S:
S = {1, 2, 3, 4, 5, 6}

These two events are defined as follows:


Event A is even number, A = { 1 , 3 , 5 }
Event B is odd number, B = { 2, 4, 6 }

P(A ∩ B) = 0 => they are mutually exclusive

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 -

Counting Methods - Dr Gan 16

16

Week 2 Review – Dr Gan Chui Goh 8


The probability of a person passing the test doe not affect that of another person, hence
they are independent.

• 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.

Counting Methods - Dr Gan 17

17

Extra Example:
In throwing a fair dice, the sample space is S:
S={2,4,6,1,3,5}

These two events are defined as follows:


A={1,3,5}
B={6}

P(B) = 1/6
P(A) = 3/6 = 1/2
=> P(A ∩ B) = 0 => they are mutually exclusive

If A occurs, B cannot occur => probability of A occurs affect the probability of B


occurring.

Therefore, a mutually exclusive events are not independent events.

Probability - Dr Gan 18

18

Week 2 Review – Dr Gan Chui Goh 9

You might also like