Académique Documents
Professionnel Documents
Culture Documents
Probability Distributions
This presentation is given as supplementary information to
help us to understand the origin of the Binomial and Poisson
probability mass distributions.
You can download this presentation (and check for updates) from
http://www1.gantep.edu.tr/~andrew/eee283/BinomialPoissonLong.pdf
Dr Andrew Beddall
Version 3 (07/10/2013)
Content
- Permutations and Combinations
- The Binomial Coefficient
- Probability (set theory)
- Probability (experiment)
- Distributions of Outcomes
- Bernoulli Trials
- The Binomial pmf
- The Poisson pmf
2
Permutations and Combinations
are the arrangement of elements under different rules.
We are interested in counting how many arrangements there are.
If order does not count then there are ABC BAC CAB
3!/2!(3-2)! = 6/2(1) = 3 combinations: ACB BCA CBA
we will investigate each case in more detail next ....
3
Permutations and Combinations are the arrangement of elements.
We are interested in counting how many arrangements there are.
PERMUTATIONS: COMBINATIONS:
arrangements where arrangements where
order is counted order is not counted
repetition repetition repetition repetition
is counted is not counted is not counted is counted
For a set of nFor a set of n For a set of n For a set of n
elements, elements there are elements there is elements,
select k n! permutations. one combination. select k
elements Select k elements Select k elements elements
there are there are there are there are
nk P(n,k) = n! / (n-k)! C(n,k) = P(n,k) / k! (n+k-1)!
permutations. permutations. = n! / k!(n-k)! k!(n-1)!
combinations. combinations.
Examples for each arrangement type This result (the binomial We will not
will be given in the following pages. coefficient) is important. study this case.
4
PERMUTATIONS: arrangements where order is counted
Example 1:
Take the set of n=3 elements
{ A, B, C } there are We do not allow repetition of
n! = 3! = 6 permutations: elements, but different ordering
of the elements is counted.
ABC BAC CAB
ACB BCA CBA
7
Example 2 (more elements):
Take the set of n=4 elements ABCD ABDC ACBD ACDB ADBC ADCB
BACD BADC BCAD BCDA BDAC BDCA
{ A, B, C, D } there are CABD CADB CBAD CBDA CDAB CDBA
n! = 4! = 24 permutations. DABC DACB DBAC DBCA DCAB DCBA
Explanation:
First select an element: there are 4 choices
select another element: there are 3 choices
select another element: there are 2 choices
select another element: there is 1 choice.
there are (4)(3)(2)(1) = 4! = 24 permutations
in general for n elements their are n! permutations
We do not allow repetition of elements, but the order of the elements is counted.
8
Example 3 (select k elements):
Take the set of n=4 elements { A, B, C, D }
Select k=2 elements
keep only the first two elements,
there are
remove repeated arrangements.
P(n,k) = n! / (n-k)!
= 4!/(4-2)! ABCD ABDC ACBD ACDB ADBC ADCB
= 24 / 2 BACD BADC BCAD BCDA BDAC BDCA
= 12 permutations. CABD CADB CBAD CBDA CDAB CDBA
DABC DACB DBAC DBCA DCAB DCBA
Explanation:
First select an element: there are 4 choices
select another element: there are 3 choices AB AC AD
BA BC BD
Thats all.
CA CB CD
there are (4)(3) = 12 permutations. DA DB DC
In general that is
(n)(n-1)(n-2)... k terms We do not allow repetition of
= n!/(n-k)! permutations elements, but the order of the
elements is counted.
9
Example 4 (more elements):
ABCDE ABCED ABDCE ABDEC ABECD ABEDC
Take the set of n=5 elements ACBDE ACBED ACDBE ACDEB ACEBD ACEDB
{ A, B, C, D, E } ADBCE ADBEC ADCBE ADCEB ADEBC ADECB
AEBCD AEBDC AECBD AECDB AEDBC AEDCB
There are 5! = 120 permutations. BACDE BACED BADCE BADEC BAECD BAEDC
BCADE BCAED BCDAE BCDEA BCEAD BCEDA
BDACE BDAEC BDCAE BDCEA BDEAC BDECA
Select k=2 elements
BEACD BEADC BECAD BECDA BEDAC BEDCA
there are (5)(4) = 20, i.e. CABDE CABED CADBE CADEB CAEBD CAEDB
P(n,k) = n! / (n-k)! CBADE CBAED CBDAE CBDEA CBEAD CBEDA
= 5!/(5-2)! CDABE CDAEB CDBAE CDBEA CDEAB CDEBA
CEABD CEADB CEBAD CEBDA CEDAB CEDBA
= 20 permutations.
DABCE DABEC DACBE DACEB DAEBC DAECB
DBACE DBAEC DBCAE DBCEA DBEAC DBECA
AB BA CA DA EA DCABE DCAEB DCBAE DCBEA DCEAB DCEBA
AC BC CB DB EB DEABC DEACB DEBAC DEBCA DECAB DECBA
AD BD CD DC EC EABCD EABDC EACBD EACDB EADBC EADCB
AE BE CE DE ED EBACD EBADC EBCAD EBCDA EBDAC EBDCA
ECABD ECADB ECBAD ECBDA ECDAB ECDBA
EDABC EDACB EDBAC EDBCA EDCAB EDCBA
We do not allow repetition of elements, but the order of the elements is counted.
10
COMBINATIONS: arrangements where order is not counted
For a set of n elements there is one combination.
Repetition (of elements) Select k elements there are
is not counted C(n,k) = P(n,k) / k! = n! / k!(n-k)! combinations.
Example 1: 4! = 24 permutations
Take the set of n=4 elements { A, B, C, D }
ABCD ABDC ACBD ACDB ADBC ADCB
We do not allow repetition of elements, BACD BADC BCAD BCDA BDAC BDCA
and the order of the elements is not CABD CADB CBAD CBDA CDAB CDBA
counted; so there is only one combination, DABC DACB DBAC DBCA DCAB DCBA
i.e. ABCD
AB BA CA DA
Select k=2 elements, there are P(4,2) =
AC BC CB DB
(4)(3) = 12
C(n,k) = P(n,k) / k! AD BD CD DC
permutations
= n! / k!(n-k)! = 4!/2!(4-2)!
= 6 combinations.
AB C(4,2) =
We divide by k! because there are k! AC BC (4)(3)/2! = 6
ways we can order the combinations AD BD CD combinations
but order is not counted.
11
Example 2 (more elements):
Take the set of n=5 5! = 120 permutations
elements { A, B, C, D, E } ABCDE ABCED ABDCE ABDEC ABECD ABEDC
Select k=2 elements ACBDE ACBED ACDBE ACDEB ACEBD ACEDB
ADBCE ADBEC ADCBE ADCEB ADEBC ADECB
AEBCD AEBDC AECBD AECDB AEDBC AEDCB
P(5,4) = (5)(4) = 20 permutations BACDE BACED BADCE BADEC BAECD BAEDC
AB BA CA DA EA BCADE BCAED BCDAE BCDEA BCEAD BCEDA
BDACE BDAEC BDCAE BDCEA BDEAC BDECA
AC BC CB DB EB
BEACD BEADC BECAD BECDA BEDAC BEDCA
AD BD CD DC EC CABDE CABED CADBE CADEB CAEBD CAEDB
AE BE CE DE ED CBADE CBAED CBDAE CBDEA CBEAD CBEDA
CDABE CDAEB CDBAE CDBEA CDEAB CDEBA
CEABD CEADB CEBAD CEBDA CEDAB CEDBA
AB DABCE DABEC DACBE DACEB DAEBC DAECB
AC BC DBACE DBAEC DBCAE DBCEA DBEAC DBECA
AD BD CD DCABE DCAEB DCBAE DCBEA DCEAB DCEBA
AE BE CE DE DEABC DEACB DEBAC DEBCA DECAB DECBA
EABCD EABDC EACBD EACDB EADBC EADCB
C(5,2) = n! / k!(n-k)! = 5!/2!(5-2)! EBACD EBADC EBCAD EBCDA EBDAC EBDCA
= 120/12 = 10 combinations ECABD ECADB ECBAD ECBDA ECDAB ECDBA
EDABC EDACB EDBAC EDBCA EDCAB EDCBA
We do not allow repetition of elements, and the order of the elements is not counted.
12
The Binomial Coefficient
The number of combinations C(n,k) where
order is not counted and repetition (of elements) is not counted
is called the Binomial Coefficient.
See http://en.wikipedia.org/wiki/Binomial_coefficient
k terms
e.g.
13
Some properties:
14
Probability (set theory)
In set theory we can define a set S of all possible outcomes of a
random process, and assign to the outcomes a set of probabilities P.
15
Now consider throwing two dice
Solution:
there is one such outcome in 36
and so the probability is 1/36.
16
Now consider throwing three dice
{111 112 113 114,115,116, 411,412,413,414,415,416,
The set of all possible 121,122,123,124,125,126, 421,422,423,424,425,426,
outcomes is: 131,132,133,134,135,136, 431,432,433,434,435,436,
141,142,143,144,145,146, 441,442,443,444,445,446,
There are 151,152,153,154,155,156, 451,452,453,454,455,456,
63 = 216 permutations 161,162,163,164,165,166, 461,462,463,464,465,466,
(order is counted). 211,212,213,214,215,216, 511,512,513,514,515,516,
221,222,223,224,225,226, 521,522,523,524,525,526,
Now what is the probability 231,232,233,234,235,236, 531,532,533,534,535,536,
of obtaining exactly two 4s? 241,242,243,244,245,246, 541,542,543,544,545,546,
251,252,253,254,255,256, 551,552,553,554,555,556,
261,262,263,264,265,266, 561,562,563,564,565,566,
Solution:
311,312,313,314,315,316, 611,612,613,614,615,616,
there are 15 such 321,322,323,324,325,326, 621,622,623,624,625,626,
outcomes out of 216, so 331,332,333,334,335,336, 631,632,633,634,635,636,
the probability 341,342,343,344,345,346, 641,642,643,644,645,646,
P(k=2) = 15/216. 351,352,353,354,355,356, 651,652,653,654,655,656,
361,362,363,364,365,366, 661,662,663,664,665,666}
Note that: P(k=0) = 125/216, P(k=1) = 75/216, P(k=2) = 15/216, P(k=3) = 1/216
17
Probability (experiment)
If a random process is repeated n times (i.e. there are n trials) and event A
occurs n(A) times then the probability of event A is defined as a relative
frequency below:
number of occurrences of event A
number of trials
18
Of course we cannot throw a die 109 times,
the experiment is a computer simulation:
//
// Computer simulation of the statistics of throwing a die.
//
#include <iostream>
#include <cstdlib>
int main() {
const int n = 1000000000; // Number of trials
int m = 0; // Number of "4"s
Output:
1000000000 166667244 0.166667244 P(4) = 1/ 5.99998 (11 seconds)
19
The same simulation in MATLAB (108 die throws)
%
% Computer simulation of the statistics of throwing a die.
%
format long
n = 100000000; % Number of trials
A = randi(6,n,1); % Random outcomes 1,2,3,4,5,6
m = sum(A==4); % Count the number of "4"s.
disp(n)
disp(m)
disp(m/n)
Output:
100000000 16669207 0.16669207 P(4) = 1/ 5.9991
20
The program is rewritten here to find the probability of outcomes
when three dice are thrown:
//
// Computer simulation of the statistics of throwing three die.
//
#include <iostream>
#include <cstdlib>
int main() {
const int n = 1000000000; // Number of trials
int k[4] = {0}; // Number of "4"s 0,1,2 or 3
for (int i=0; i<n; i++) { // Perform n trials
int m=0;
for (int j=0; j<3; j++) { // Loop over the three dice
int a = rand() % 6 + 1; // Random outcomes 1,2,3,4,5,6
if (a==4) m++; // Count the number of "4"s.
}
k[m]++;
}
Output:
k=0 P(k)=0.578697
for (int i=0; i<4; i++) k=1 P(k)=0.347231
std::cout << "k=" << i << " P(k)=" k=2 P(k)=0.069445
<< double(k[i])/n << std::endl; k=3 P(k)=0.004627
} (29 seconds)
21
The same simulation in MATLAB (108 die throws)
%
% Computer simulation of the statistics of throwing three die.
%
format long
n = 10000000; % Number of trials
A = randi(6,n,3)==4; % Random outcomes 1,2,3,4,5,6
sum( A(:,1)+A(:,2)+A(:,3) ==0 )/ n
sum( A(:,1)+A(:,2)+A(:,3) ==1 )/ n
sum( A(:,1)+A(:,2)+A(:,3) ==2 )/ n
sum( A(:,1)+A(:,2)+A(:,3) ==3) / n
Output:
k=0 P(k)=0.578886
k=1 P(k)=0.347049
k=2 P(k)=0.069463
k=3 P(k)=0.004602
22
Distributions of Outcomes (three dice)
Lets look again at the outcomes of the experiment P(k)
k=0 P(k) = 0.578697 0.6
23
Bernoulli Trials
A Bernoulli trial has only two possible outcomes,
for example outcome A and outcome B (which is not A).
The probability of outcome A ocurring k-times in n trials can be
calculated as follows:
One possible outcome is: A1.A2.A3....Ak . B1.B2.B3....Bn-k
k terms
For example:
for (n=3,k=2) = 3!/2!(1!) = 3 A1A2B1 , A1B1A2 , B1A1A2
And for
25
The Binomial pmf
Combining Bernoulli trials and the Binomial coefficient we get:
For example throw of three dice, the probability of obtaining exactly two 4s:
This is the value we calculated earlier by forming and counting the list of all
outcomes, and by experiments.
26
Experiment
A die is thrown 5 times and the number, k, of outcomes 4 is recorded.
This is repeated n = 100,000,000 times to obtain the probability of k-outcomes.
+ 16 (0.05)1 (0.95)15
30
Derivation of the Poisson pmf from the Binomial pmf
In the Binomial pmf set n large, and small k << n
Binomial pmf
Binomial
k terms
Poisson pmf
31
For convenience the Poisson pmf is often used in place of the binomial pmf.
But remember it is an approximation (though sometimes a good one).
We should use the Binomial pmf with n=5 and k=2 and = 1/6,
32
Properties (the Binomial pmf properties with the limit 0, and =n)
mean = variance 2 = ( =2 = ) skewness = 1/
33
Example
100 million people access a web site (at a random time) once a year.
What is the probability of the web site receiving more than 3 hits in a one-second period?
Solution:
We have n = 108 , and = 1 / (365 24 3600) = 3.171 10-8 per second.
We can use the Poisson pmf with = n = 3.171