AL 17 00 |
- Outlines
AL 17 01 |
- Permutation
AL 17 02 |
- Arrangement
AL 17 03 |
- Combination
AL 17 04 |
- Arrangement and sample
AL 17 05 |
- Arrangement of n elements in circle pattern
AL 17 06 |
- Probability
AL 17 07 |
- Arrangement of n elements in a line. One special element always at first
AL 17 08 |
- Binomial probability
AL 17 09 |
- Hypergeometric probablity
AL 17 10 |
- Hypergeometric probablity
AL 17 11 |
- Normal distribution
AL 17 12 |
- Examples : C(n,r)
AL 17 13 |
- Examples : Dice and sample spaces
AL 17 14 |
- Examples : Color balls
AL 17 15 |
- Examples : Color number cards
AL 17 16 |
- Examples : Color balls
Answers
|
AE 17 01. Permutation
Defintion and examples
- Definition : arrangement of symbols without repetition
- Formula
- P(n,r) = n*(n-1)*(n-2)*....*(n-r+1)
- P(n,n) = n! = n*(n-1)*(n-2)*.......*3*2*1
- n! is called factorial
- Examples
- P(1,1) = 1
- P(2,2) = 2*1 = 2
- P(3,3) = 3*2*1 = 6
- P(4,4) = 4*3*2*1 = 24
- P(5,5) = 5*4*3*2*1 = 120
- Each time take 2 symbols from A,B,C. How many difference arrangement ?
- AB and BA
- AC and CA
- BC and CB
- Hence there are six different arrangement
- The computation is P(3,2) = 3*2 = 6
- Each time take 2 symbols from A,B,C. Find arrangement if symbol can be same
- AB and BA
- AC and CA
- BC and CB
- AA, BB, CC.
- Hence there are nine different arrangement
- The computation is 3^2 = 9
Prove that P(n,r) = n!/(n-r)!
- P(n,r) = n*(n-1)*.....*(n-r+1)
- P(n,r) = n*(n-1)*.....*(n-r+1)*(n-r)!/(n-r)!
- P(n,r) = n!/(n-r)!
Prove that P(n,0) = 1
Exercise : Find P(10,10)
-
Probability
Program 01 01 : P(n,r)
- Input data : n = 10, r = 10
Go to Begin
AE 17 02. Arrangement
Formula
- 1. Take r from n elements without duplication : P(n,r)
- 2. Take r from n elements with duplication : n^r
Example
- A set a,b,c. Take all three element for arrangement with duplication
- The answer is 3^3 = 27
- List of all arrangement
- aaa, bbb, ccc
- aab, aba, baa, aac, aca, caa
- bbc, bcb, cbb, bba, bab, abb
- cca, cac, acc, ccb, cbc, bcc
- abc, acb, bca, bac, cab, cba
- Hence there are 27 diiferent arrangments
Go to Begin
AL 17 03. Combination
- Definition : A subset of r elements chosen from a set of n elements
- Formula
- C(n,r) = n*(n-1)*(n-2)*....*(n-r+1)/(r!)
- C(n,n) = 1
- Examples
- C(1,1) = 1
- C(2,2) = 1
- C(3,3) = 1
- Each time take 2 symbols from A,B,C. Find arrangement without cosidering position
- AB and BA as one count
- AC and CA as one count
- BC and CB as one count
- Hence there are three different subsets
- The computation is c(3,2) = 3*2/(2!) = 3
Exercise : Find P(20,10)
-
Probability
Program 01 02 : C(n,r)
- Input data : n = 20, r = 10
Go to Begin
AL 17 04. Arrangement and sample
Arrangement
- It is permutation. The sub-set will consider the position of the element
- Example
- Sub-set elements A,B is different from sub-set B,A
- They are two different sub-set
Sample
- It is combination. The sub-set will not consider the position of the element
- Example
- Sub-set elements A,B is same as sub-set B,A
- There is only one sub-set
Go to Begin
AL 17 05. Arrangement of n elements in circle pattern
Formula
Test
- The word GIRL is arranged in circle
- We use four corners of square on circle
- If G stands at any corner, the arrangement will be the same
- Hence the arrangement is
- GIRL GILR
- GRLI GRIL
- GLIR GLRI
-
- The answer is (n-1)! = (4-1)! = 3! = 6
Go to Begin
AL 17 06. Probability
Defintion
- Let S is the probability space with equal weights
- Let E is a sub set of S
- The probability to get an event of E is P = E/S
Example : Throw one dice. What is the probability to get number 3
- A dice has six faces with numbers 1 to 6
- The six numbers are eqaully weighted
- To get the event of number 3 is one the six numbers
- Hence the probability to get 3 is 1/6
Go to Begin
AL 17 07. Arrangement of n elements in a line. One special element always at first
Formula
Go to Begin
AL 17 08. Binomial distribution
Defintion
- B(x) = C(n,r)*(p^r)*(q^(n-r))
- The probability favour event is p and un-favour event is q
- For n trials, r favour cases is expected
- B(x) is the binomial distribution
Example
- Throw two dice once, what is the probablity to get number nine
- Dice A : 3,4,5,6
- Dice B : 6,5,4,3
- Hence the probability is 4/36 = 1/9 = 0.11111
- Throw two dice twice, what is the probablity to get one number nine
- The probability to get 9 is p = 1/9
- The probability not getting 9 is q = (1 - 1/9)
- Number trial is n = 2 and expect event is r = 1
- Hence the probability is B(x)
- = C(2,1)*(p^1)*(q^(2-1))
- = C(2,1)*((1/9)^1)*((8/9)^(2-1))
- = 2*(1/9)*(8/9) = 16/81 = 0.1975
- Throw two dice three times, what is the probablity to get one number nine
- The probability to get 9 is p = 1/9
- The probability not getting 9 is q = (1 - 1/9)
- Number trial is n = 3 and expect event is r = 1
- Hence the probability is B(x)
- = C(3,1)*(p^1)*(q^(3-1))
- = C(3,1)*((1/9)^1)*((8/9)^(3-1))
- = 3*(1/9)*((8/9)^2) = (3*64)/(9*81) = 0.26337
- Throw two dice three times, what is the probablity to get two number nine
- The probability to get 9 is p = 1/9
- The probability not getting 9 is q = (1 - 1/9)
- Number trial is n = 3 and expect event is r = 2
- Hence the probability is B(x)
- = C(3,2)*(p^2)*(q^(3-2))
- = C(3,2)*((1/9)^2)*((8/9)^(3-2))
- = 3*(1/81)*((8/9)) = (3*8)/(9*81) = 0.03292
Exercie
- Questions
- 1. Throw two dice 100 times, what is the probablity to get 1 number nine
- 2. Throw two dice 100 times, what is the probablity to get 2 number nine
- 3. Throw two dice 100 times, what is the probablity to get 3 number nine
- Computer program
- Input data
- 1. n = 100, r = 1, p = 1/9 = 0.1111111
- 2. n = 100, r = 2, p = 1/9 = 0.1111111
- 3. n = 100, r = 3, p = 1/9 = 0.1111111
Go to Begin
AL 17 09. Hypergeometric probability (1)
Definition
- Choosing a sample of r from element N is C(N,r)
- Choosing x objects of type A from n is C(r,x)
- Choosing (r - x) objects of type A from n is C((N-r),(r-x))
- Hence getting x objects of type A fom N will be C(r,x)*C((N-r),(r-x))
- Hence H(x) = C(r,x)*C((N-r),(n-r))/C(N,r)
Example : Find probability to get 6 spades in a hand of bridge
- There are N = 52 cards
- We take r = 13 in a hand
- we expect x = 6, Hence H(x)
- = C(13,6)*C((52-13),(13-6))/(52,13)
- = C(13,6)*C(39,7)/(52,13)
Example : Find probability to get 6 spades and 5 hearts in a hand of bridge
- There are N = 52 cards
- We take r = 13 in a hand
- we expect x1 = 6 and x2 = 5 Hence H(x)
- = C(13,6)*C((13-6),5)*C((52-13),(13-6-5))/(52,13)
- = C(13,6)*C(7,5)*C(39,2)/(52,13)
Exercise
Questions
- 1. A hand of bridge has no spades, find the probablity
- 2. A hand of bridge has 10 spades, find the probablity
Computer program
Input data
- 1. N = 52, n = 13 and x = 0
- 2. N = 52, n = 13 and x = 10
Go to Begin
AL 17 10. Hypergeometric probability (2)
Definition
- Sample sapce N
- Defective samples is n
- Choosing samples s
- Hence getting x defective
- Hence H(x) = C(n,x)*C((N-n),(s-x))/C(N,s)
Example : 10000 samples have 500 defective. Now take 10 samples randomly
- Questions
- What is the probability if there is 0 defective
- What is the probability if there is 1 defective
- What is the probability if there is 2 defective
- What is the probability if there is 3 defective
- Computer program
- Input data
- 1. N = 10000, n = 500, s = 10 and x = 0
- 2. N = 10000, n = 500, s = 10 and x = 1
- 3. N = 10000, n = 500, s = 10 and x = 2
- 4. N = 10000, n = 500, s = 10 and x = 3
Example : Use binomial distribution to solve above question
- Use program 01 03
- Probability to get defective sample p = 500/10000 and q = 1 - p
- B(x) = C(n,x)*(p^x)*(q^(n-x))
- Input data
- 1. Sample n = 10, expect defective sample x = 0 and p = 0.05
- 2. Sample n = 10, expect defective sample x = 1 and p = 0.05
- 3. Sample n = 10, expect defective sample x = 2 and p = 0.05
- 4. Sample n = 10, expect defective sample x = 3 and p = 0.05
Go to Begin
AL 17 11. Normal distribution
Standard normal distribution on computer
- Computer program
- Facts
- N(z gt +a) = 1 - N(z le +a)
- N(z lt -a) = 1 - N(z le +a) since distribution f(z) is symmetrical
- From table we know that N(z le 1) = 0.8413
- Example : From table we know that N(z le 1) = 0.8413
- Find N(z gt +1)
- Find N(z lt -1)
Normal distribution with mean u and standard deviation d
- Computer program
- Convert to standard : Let z = (x - u)/d
- Example : A student grade has mean 80 with d = 10
- Find probability his amrk is between 70 and 90
- Find probability his amrk is greater than 90
- Find probability his amrk is is less than 70
- Solution : Between 70 and 90
- N(70 - u) GE N(x - u) LT N(90 - u)
- N((70 - u)/d) GE N((x - u)/d) LE N((90 - u)/d)
- Let z = (x - u)/d
- Since u = 80 and d = 10
- Hence N(-1) GE N(z) LE N(1)
- Hence N(z) = N(z lt 1) - N(z lt -1)
- Hence N(z) = 0.8413 - (1 - N(1))
- Hence N(z) = 0.8413 - (1 - 0.8413)
- Hence N(z) = 0.8413 - 0.1587 = 0.6826 = 68.26%
- Solution : GT 90
- N((x - 80)/d) LT N((90 - 80)/d)
- Hence N(z GT +1) = 1 - N(z LE 1)
- Hence N(z GT +1) = 1 - 0.8413 = 0.1587 = 15.87%
- Solution : LT 70
- N((x - 80)/d) GT N((70 - 80)/d)
- Hence N(z LT -1) = 1 - N(z LE 1)
- Hence N(z LT -1) = 1 - 0.8413 = 0.1587 = 15.87%
Go to Begin
AL 17 12. Examples : C(n,r)
- 1. Solve C(n,1) = 16.
- 2. Solve C(n,2) = 28.
- C(n,2) = n*(n-1)/(2!) = 28
- Hence n*(n-1) = 56 or n^2 - n - 56 = 0
- (n - 8)*(n + 7) = 0
- Since n is positive, hence n = 8
Binomial distribution
- Questions : Article defective is 5%. Take 10 random sample
- 1. what is the probablity to get 0 defective
- 2. what is the probablity to get 1 defective
- 3. what is the probablity to get 2 defectives
- 4. what is the probablity to get 3 defectives
- Computer program
- Input data
- 1. n = 10, r = 0, p = 0.05
- 2. n = 10, r = 1, p = 0.05
- 3. n = 10, r = 2, p = 0.05
Go to Begin
AL 17 13. Examples : Dice and samples space
Two dice have sample space 6*6 = 36
- (1,1), (1,2), (1,3), (1,4), (1,5), (1,6)
- (2,1), (2,2), (2,3), (2,4), (2,5), (2,6)
- (3,1), (3,2), (3,3), (3,4), (3,5), (3,6)
- (4,1), (4,2), (4,3), (4,4), (4,5), (4,6)
- (5,1), (5,2), (5,3), (5,4), (5,5), (5,6)
- (6,1), (6,2), (6,3), (6,4), (6,5), (6,6)
Example : Throw 3 dice, the probability to get number 6
- Dice A : 1, 1, 1, 1, 2, 2, 2, 3, 3, 4
- Dice B : 1, 4, 2, 3, 3, 1, 2, 2, 1, 1
- Dice C : 4, 1, 3, 2, 1, 3, 2, 1, 2, 1
- Since sample space of 3 dice is 6*6*6
- Hence probablity is 10/(6*6*6)
Example : Throw 3 dice, the probablity to get two same number
- Dice : A, B, C
- A1, B1, C2, C3, C4, C5 and C6 : Sample space = 5
- A2, B2, C1, C3, C4, C5 and C6 : Sample space = 5
- A3, B3, C1, C2, C4, C5 and C6 : Sample space = 5
- A4, B4, C1, C2, C3, C5 and C6 : Sample space = 5
- A5, B5, C1, C2, C3, C4 and C6 : Sample space = 5
- A6, B6, C1, C2, C3, C4 and C5 : Sample space = 5
- Hnace Sample space S2 = C(6,1)*C(5,1) = 6*5 = 30
- For A, B, C dice, the sample space : (A,B,C), (B,C,A) and (C,A,B)
- Sample sapce S3 = C(3,1) = 3
- Hence probabilitye is C(6,1)*(C(5,1)*C(3,1)/(6*6*6) = 90/216
Go to Begin
AL 17 14. Examples : Color balls
Example 1 : 3 red balls and 2 white balls in a bag. Each time take two
- Find probability to have 2 red balls
- Sample space of five balls and take 2 : S = C(5,2) = 10
- Sample space of 3 red balls and take 2 : Sr = C(3,2) = 3
- Hence probability is P = Sr/S = 3/10
- Find probability to have 1 red ball and 1 white ball
- Sample space of 5 balls and take 2 : S = C(5,2) = 10
- Sample space of 3 red balls and take 1 : Sr = C(3,1) = 3
- Sample space of 2 white balls and take 1 : Sw = C(2,1) = 2
- Hence probability is P = (Sr*Sw)/S = (2*3)/10 = 3/5
- Find probability to have 2 white balls
- Sample space of 5 balls and take 2 : S = C(5,2) = 10
- Sample space of 2 white balls and take 2 : Sw = C(2,2) = 1
- Hence probability is P = Sw/S = 1/10
Go to Begin
AL 17 15. Examples : Number cards
Example 1 : Numbers 1,2,3,4,5,6,7,8 on 8 cards and each car has one nmuber
- Each time take two cards, find probability to have sum of numbers being 5
- Sample space S2 = 4 : (1,4), (4,1), (2,3) and (3,2)
- Hence probability is P = S2/C(8,2) = 4/28 = 1/7
- What is max probability to have the sum of two numbers
- 03 : (1,2) Sample 1
- 04 : (1,3) Sample 1
- 05 : (1,4), (2,3) Sample 2
- 06 : (1,5), (2,4) Sample 2
- 07 : (1,6), (2,5), (3,4) Sample 3
- 08 : (1,7), (2,6), (3,5) Sample 3
- 09 : (1,8), (2,7), (3,6), (4,5) Sample 4
- 10 : (2,8), (3,7), (4,6) Sample 3
- 11 : (3,8), (4,7), (5,6) Sample 3
- 12 : (4,8), (5,7) Sample 2
- 13 : (5,8), (6,7) Sample 2
- 14 : (6,8) Sample 1
- 15 : (7,8) Sample 1
- Since total sample space is C(8,2) = 28
- Hence maximum probability at sum = 9 : P = 4/28 = 1/7
- Sum of two cards less than 8
- Card a = 1 and card b = 2,3,4,5,6 : Sample = 5
- Card a = 2 and card b = 1,3,4,5 : Sample = 4
- Card a = 3 and card b = 1,2,4 : Sample = 3
- Card a = 4 and card b = 1,2,3 : Sample = 3
- Card a = 5 and card b = 1,2 : Sample = 2
- Total = 5 + 4 + 3 + 3 + 2 = 17
- probability = 17/28
Go to Begin
AL 17 16. Examples : Color balls
Example 1 : 2 red balls and 2 blue balls. Pick 2 balls each time and put into 2 boxes
Sample space C(4,2)/2 = 3. Why divide by 2 ? Since put into 2 boxes
- 1. (r1,r2), (b1,b2)
- 2. (r1,b1), (b2,r2)
- 3. (r1,b2), (r2,b1)
- 4. (r2,b1), (b2,r1) same as 3
- 5. (r2,b2), (r1,b1) same as 2
- 6. (b1,b2), (r1,r2) same as 1
Probability each box has same color 1/3
Probability each box has different color = 2/3
Formula
- Sample sapce = (4,2)/2 = 6/2 = 3
- Box 1 = (r1,r2) and Box 2 = other 2 balls C(2,2)/1
- Box 1 = (b1,b2) and box 2 = other 2 balls C(2,2)/1
- Sample of different color = 3 - box 1 has same color = 3 - 2*C(2,2)/1
- Since (r1,r2) and (b1,b2) only one case, hence we should add 1
- Hence different color cases = C(4,2)*C(2,2)/(2*1) - 2*C(2,2)/1 + 1
Example 2 : 2 red balls, 2 green balls and 2 blue balls. Pick 2 balls each time
and put into 3 boxes
Sample space = C(6,2)*C(4,2)*C(2,2)/(3*2*1) = (15*6*1)/(3*2*1) = 15
Each box same color : only one case, hence P = 1/15
1st box same color
- 3*C(4,2)*C(2,2)/(2*1)
- 2nd box may have same color
- 3rd box may have same color
- It include all bax same color. Hence 3 cases of same color
1st and 2nd boxes same color
- 3*C(2,2)/1
- It include all bax same color. Hence 3 cases of same color
All box different color = 15 - 3*C(4,2)*C(2,2)/(2*1) + 3*C(2,2)/1 - 1
Example 3 : 2 red balls, 2 green balls, 2 white and 2 blue balls. Pick 2 balls each time
and put into 4 boxes
Sample space = C(8,2)*C(6,2)*C(4,2)*C(2,2)/(4*3*2*1) = (28*15*6*1)/(4*3*2*1) = 105
All box same color P = 1/105
1st box same color : S1 = C(6,2)*C(4,2)*C(2,2)/(3*2*1)
1st 2 boxes same color : S2 = C(4,2)*C(2,2)/(2*1)
1st 3 boxes same color : S3 = C(2,2)/(1)
All box diff color P = 105 - 4*S1 + 6*S2 - 4*S3 + 1
Go to Begin
AL 17 00. Outline
Properties of P(n,r)
- P(n,0) = 1
- P(n,1) = n
- P(n,n) = n!
Properties of C(n,r)
- C(n,0) = 1
- C(n,1) = n
- C(n,n) = 1
- C(n,n-1) = n
Definition of distributions
- 1. Permutation formula : P(n,r)
- 2. Combination formula : C(n,r)
- 3. Binomial distribution : B(x) = C(n,x)*(p^x)*(q^(n-x))
- There are n trials, wish to get x events
- The probablisty to an event is p and q = 1 - p
- 4. Hypergeometric formula : H(x) = C(n,x)*C((N-n,n-x)/C(N,n)
- Sample space is N, take n samples from N
- Expect to have x samples
- 5. Hypergeometric formula : H(x) = C(n,x)*C((N-n,s-x)/C(N,s)
- Sample space is N, defetive samples is n
- Take s sample and expect x defective samples
Arrangement
- Take r different things from n different things without repeating : P(n,r)
- Arrange n different things in circle pattern : P(n,n)/n = (n-1)!
- Arrange n different things in line and special one at 1st position : (n-1)!
- Arrange n different things with repeating : n^n
Go to Begin
|
|