6.discrete Probability Distribution
6.discrete Probability Distribution
1 2 3 4 5 6 x
The mean value of X is given by the average of the 1st and last
values of x, so,
1 6
35
2
However, we could also use the formula for the mean of any
discrete distribution of a random variable:
xf ( x)
1
For f ( x) P( X x) , x 1, 2, 3, 4, 5, 6
6
we would get
1 1 1
1 2 . . . 6
6 6 6
1
21
6
35
The Variance of the Uniform Distribution
We can find the variance for any discrete random variable X using
Var ( X )
2
x 2 f ( x) 2
e.g. The random variable X has p.d.f. given by
1
f ( x) P( X x) , x 1, 2, 3, 4, 5, 6
6
1 1 1
So, Var ( X ) 1 2 ... 6
2 2 2 2
6 6 6
We found earlier that 3·5, so
91
Var ( X ) 3 52 2 92
6
The Bernoulli Process
Bernoulli process must possess the following
properties:
1. The experiment consists of repeated trials.
10 1 1 10 1
4 6 10
1 5
0 3
3
f ( x) 1 1 0.5787 0.4213
0 6 6
Examples
– Twelve pregnant women selected at random, take a home
pregnancy test. This test give correct result with 0.8
probability. What is the probability that 10 women find a
correct result?
12
f ( x) 0.8 0.2 66* 0.107 * 0.04 0.283
10 2
10
15 25
• The binomial distribution derives its name from the fact that
the n + 1 terms in the binomial expansion of (q+p)n
correspond to the various values of b(x; n, p) for x = 0, 1, 2, . . .
, n. That is
Finding Mean and Variance
• Let the outcome of jth trial be represented by indicator
variable Ij which assumes the value 0 and 1 with probabilities
q and p
• In binomial experiment number of success can be written as
the sum of the n independent indicator variable
• X= I1 + I2 +…+ In
• Mean of Ij = [x • P(x)] = 0.q + 1.p = p
• µ = E(X) = E(I1)+E(I2) +… +E(In)=p+p+…+p=np
2
• Ij =E[(Ij – p)2]=E(Ij2) – p2 = (02)q+(12)p- p2 =p(1-
p)=pq
• For n independent variable variance would be
pq+pq+…+pq=npq
Python for Binomial Distribution
• You are tossing 20 times, probability of head is 0.5. Now
you are repeating this experiment for 50 times. How many
head appears each time?
from numpy import random, mean
x = random.binomial(n=20, p=0.5, size=50)
mean_head = mean(x)
print(x)
print (mean_head)
[10 11 10 9 8 10 9 9 7 12 12 8 10 12 9 11 12 8 11 14 10 11 8 9
8 11 14 10 11 9 6 10 11 9 11 10 13 15 10 13 9 10 7 10 6 13 6 7
16 9]
10.08
Visualization
from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns
sns.distplot(random.binomial(n=20, p=0.5, size=50), kde=False)
plt.show()
Areas of Application
– Quality control measure in industrial process
• here are many possible arrangements of success and failure, however, last
attempt must be a success. So from the first six attempts there must be 4
success and 2 failures.
• (a) What is the probability that team A will win the series in 6 games?
• (b) What is the probability that team A will win the series?
a) b∗(6; 4, 0.55) =5C3*0.554(1 − 0.55)6−4 = 0.1853
• The probability that a single outcome will occur during a very short time
interval or in a small region is proportional to the length of the time interval or
the size of the region.
• The probability that more than one outcome will occur in such a short time
interval or fall in such a small region is negligible.
e ( t ) ( t ) x
p( x, t )
x!
e ( t ) ( t ) x
p ( x, t )
x!