SOCI208 Module 6 - Discrete RVs: Uniform & Binomial
1. Discrete Uniform Probability Distributions
Many man-made random generators produce outcomes that are uniformly distributed,
i.e. each outcome has an equal probability of occurrence. Examples
are a deck of cards (pick a card at random and record the suite), roulette,
flipping a coin, a standard die, the dice used in Dungeon and Dragon, etc.
1. Discrete Uniform Probability Function
The discrete uniform probability function is
P(x) =1/s
where
x = a+1, a+2, ..., a+s
a+1, s are integers, with s>0
(a+1 and s are the parameters of the specific discrete uniform
probability distribution; the reason for the contorted formulation is that
it allows specifying a uniform distribution over any range of integers.)
Example: a standard die has a+1=1 and s=6; the resulting probability
distribution is shown in Table 1.
Table 1. Probability Distribution, Expectation, and Variance
for the Throw of One Die
x |
1 |
2 |
3 |
4 |
5 |
6 |
Total |
P(x) |
0.167 |
0.167 |
0.167 |
0.167 |
0.167 |
0.167 |
1.000 |
x*P(x) |
0.167 |
0.333 |
0.500 |
0.667 |
0.833 |
1.000 |
3.500 |
(x-3.5)^2*P(x) |
1.042 |
0.375 |
0.042 |
0.042 |
0.375 |
1.042 |
2.917 |
Exhibit: Discrete uniform probability distribution
(NWW Figure 7.1 p. 188) [m6001.gif]
2. Characteristics of Discrete Uniform Probability Distributions
The expectation and variance of a discrete uniform probability distribution
are
E{X} = (a+1) + (s - 1)/2
s2{X} = (s2 - 1)/12
Example: for the standard die E{X} = 1 + (6 - 1)/2 = 1 + 2.5 = 3.5, same
as calculated directly in Table 1; s2{X}
= (36 - 1)/12 = 35/12 = 2.917, same as calculated directly in Table 1.
2. Binomial Probability Distributions
1. Bernouilli RV
A Bernouilli random trial is a random trial that has two
qualitative basic outcomes.
A Bernouilli RV is obtained by arbitrarily assigning
one outcome the value 1 and the other the value 0. Then p
denotes the probability that the outcome is 1, 1-p the probability
that the outcome is 0. The Bernouilli RV is denoted with the symbol
B.
The probability distribution of a Bernouilli RV B is shown in Table
2.
Table 2. Probability Distribution of Bernouilli RV B
b |
0
|
1
|
Total
|
P(B=b) |
1 - p
|
p
|
1.0
|
bP(B=b) |
(0)(1 - p) = 0
|
(1)p = p
|
p
|
((b-E{B})2)P(B=b) |
(0-p)2(1-p) = p2(1-p)
|
(1-p)2p
|
p(1-p)
|
Thus
E{B} = p
s2{X} = p(1-p)
Example: Sample an individual from a population and record value of dichotomous
outcome, such as sex (M, F); assign arbitrarily value of 0 or 1 to the
outcome, such as M: 0, F: 1; to keep you sanity call this variable FEMALE,
not
SEX or GENDER! (Why?) Suppose the proportion of females in the population
is 57%. Then P(B=1) = p = .57, P(B=0) = 1-p = .43.
2. Bernouilli Process
A Bernouilli process is a sequence B1, B2,
..., Bn of independent and identically distributed (i.i.d.)
Bernouilli RVs.
Example: (NWW p. 190) Agricultural experiment with n plants treated
for a fungus. At the end of experiment, each plant is a Bernouilli
RV with fungus present (Bi = 1) or fungus absent (Bi
= 0). If outcome for each plant is independent of others and probability
of fungus present is the same for each, the n specimens constitute a Bernouilli
process.
3. Binomial RV
A binomial RV is the number of 1 outcomes ("successes") in a Bernouilli
process or, equivalently, the sum of the Bernouilli RVs in the Bernouilli
process.
A binomial RV X is the sum of n i.i.d. Bernouilli RVs,
so that
X = B1 + B2 + ... + Bn
4. Binomial Probability Function
The binomial probability function is
P(x) = (n!/(x!(n-x)!))px(1 - p)n - x
where x = 0, 1, ..., n and 0 < p < 1.
The two parts of the binomial probability function are
-
px(1 - p)n - x is the probability of a specific sequence
containing x 1's and (n - x) 0's
-
(n!/(x!(n-x)!)) (the binomial coefficient) is the number
of ways to form a sequence of n Bernouilli trials containing x 1's and
(n - x) 0's
The notation a! is called a factorial; a! = (a)(a-1)(a-2)...(2)(1); 0!
= 1.
The rationale for the binomial formula is explained in the next exhibit
with the use of a probability tree.
Exhibit: Derivation of binomial probability
function (NWW Figure 7.2 p. 194) [m6002.gif]
5. Calculating Binomial Probabilities
1. Using the Binomial Formula
Consider a binomial RV with n=3 and p=.2. What is the probability
of exactly 2 successes, using the binomial formula?
-
the probability of a sequence with exactly 2 successes is (.2)2(.8)
= .032
-
the number of sequences with exactly 2 successes is 3!/(2!1!) = (3.2.1)/(2.1.1)
= 3
-
thus the probability of exactly 2 successes is (.032)(3) = .096
2. Using NWW Table C.5
See discussion in NWW p. 194.
3. Using SYSTAT's ndf and ncf Functions
The SYSTAT binomial density function ndf(x,n,p) returns the probability
of x successes in n trials with probability of success p.
Example: reconstruct the probability distribution for the binomial
p=0.2, n=3 shown in NWW Figure 7.3 (a) p. 196).
>calc ndf(0,3,0.2)
0.512
>calc ndf(1,3,0.2)
0.384
>calc ndf(2,3,0.2)
0.096
>calc ndf(3,3,0.2)
0.008
>rem just reproduced NWW Figure 7.3 (a) p. 196
Table 3. Binomial Probability Distribution for p=.2,
n=3
x |
0 |
1 |
2 |
3 |
Total |
P(x) |
0.512 |
0.384 |
0.096 |
0.008 |
1.000 |
P(X<=x) |
0.512 |
0.896 |
0.992 |
1.000 |
The SYSTAT cumulative binomial function ncf(x,n,p) returns P(X <=
x) in n trials with probability p.
Example:
Find P(X <= 1) in n trials with p=.2
>calc ncf(1,3,0.2)
0.896
Find P(X > 1) in n trials with p=.2
>calc 1 - ncf(1,3,0.2)
0.104
4. Using STATA
As an exercise try figuring out how to use the STATA functions binomial(n,k,p)
and invbinomial(n,k,p). And when you do come by and explain
it to me. Thanks.
6. Characteristics of Binomial Probability Distributions
1. Mean and Variance
The expectation and variance of a binomial probability distribution are
E{X} = np
s2{X} = np(1 - p)
Q - Prove these formulas. (Hint: Look at Table 2, and remember about
sums of independent RVs.)
2. Shape and Convergence
The parameters p and n determine the shape of the binomial distribution,
as shown in the next exhibit.
It will be shown later that as n increases the binomial distribution
tends to a normal distribution; the convergence is faster when p is close
to .5, slower when p is either close to 0 or close to 1.
Exhibit: Three binomial probability distribution
(NWW Figure 7.3 p. 196) [m6003.gif]
3. Poisson Probability Distributions
Skip this topic. But you will need the Poisson distribution in SOCI211,
so remember there is a discussion in NWW Section 7.3, pp. 196-199.
Exhibit: Three Poisson probability distribution
(NWW Figure 7.4 p. 199) [m6004.gif]
4. Hypergeometric Probability Distributions
Skip this topic.
5. Calculations for Discrete Probability Distributions
See Appendix 1 for instructions on using the
calculator facilities of the programs SYSTAT (calc) and STATA (display)
Last modified 22 Sep 2002