This action might not be possible to undo. Are you sure you want to continue?
1
ST 361: Statistics for Engineers
Discrete Random Variables
Kimberly Weems
ksweems@ncsu.edu
5260 SAS Hall
Statistics
Random Variables
• Motivating Ex.: Assume that all men’s basketball teams playing
this season are equally strong. We are interested in the number
of points scored by NC State in each game.
• Before each game, we know the population of possible values.
– Each value occurs with some probability.
– However, we do not know what will be the number of points
scored by NC State during the next game.
• The outcome is random, hence a random variable.
Statistics
Random Variables
• Ex: in an experiment to measure the speed of light, the
inaccuracies of the measurement process make the potential
population of measurements infinite, yet the observer must settle
for a finite sample of measurements.
Statistics
Random Variables
• Ex: The possible outcomes are 1,2,3,4,5,and 6. The outcomes
can be equally likely (die is perfect cube), but cannot say
what will come up. As before, the outcome is random.
• A variable that associates a number with the outcome of a
random experiment is called a random variable.
• Formal defn: A random variable (rv) = a function that assigns
a real number to each outcome in the sample space of a
random experiment.
4
Statistics
Continuous & Discrete Random Variables
• A discrete random variable is a random variable with a finite
(or countably infinite) range. They are usually integer counts,
e.g., number of errors or number of bit errors per 100,000
transmitted (rate).
• A continuous random variable is a random variable with an
interval (either finite or infinite) of real numbers for its range.
Its precision depends on the measuring instrument.
5
Statistics
Examples of Discrete & Continuous RVs
• Discrete rv’s:
– Number of scratches on a surface.
– Proportion of defective parts among 100 tested.
– Number of transmitted bits received in error.
– Number of common stock shares traded per day.
• Continuous rv’s:
– Electrical current and voltage.
– Physical measurements, e.g., length, weight, time, temperature,
pressure.
6
Statistics
Example: Voice Lines
• A voice communication system for a business contains 48
external lines. At a particular time, the system is observed,
and some of the lines are being used.
• Let X denote the number of lines in use.
Then, X can assume any of the integer values 0 through 48.
The system is observed at a random point in time. If 10 lines
are in use, then x = 10.
7
Statistics
Probability Distributions
• Recall: A random variable X associates the outcomes of a
random experiment to a number on the number line.
The probability distribution of the random variable X is a
description of the probabilities with the possible numerical
values of X.
• A probability distribution of a discrete random variable can be:
1. A list of the possible values along with their probabilities.
2. A formula that is used to calculate the probability in
response to an input of the random variable’s value.
8
Statistics
Probability mass function
• The probability distribution of a discrete random variable is
called a probability mass function (pmf).
• Gives as a list of values along with their probabilities:
• Representation (for discrete with finite number of values):
Value of X x
1
x
2
… ….. …. x
n
Probability p(x
1
) p(x
2
) …. …… …. p(x
n
)
Statistics
Probability distribution of a discrete
random variable
A Probability Mass Function satisfies
• For all values x:
• We have:
• To give a probability mass function, specify the values
and their corresponding probabilities.
( ) ( ) p x P X x = =
0 ( ) 1 p x s s
( ) 1
x
p x =
¿
Statistics
Cumulative Distribution Function
The cumulative distribution function is built from the probability
mass function (and vice versa).
11
( ) ( ) ( )
( )
( ) ( )
The cumulative distribution function of a discrete random variable ,
denoted as ( ), is:
(1)
(2) 0 1
(3) If , then
i
i
x x
X
F x
F x P X x p x
F x
x y F x F y
s
= s =
s s
s s
¿
Statistics
Summary Numbers of a Probability
Distribution
• The mean is a measure of the center of a probability
distribution.
• The variance is a measure of the dispersion or variability of a
probability distribution.
• The standard deviation is another measure of the dispersion. It
is the positive square root of the variance.
12
Statistics
Mean Defined
13
( )
( ) ( )
The or of the discrete random variable X,
denoted as or
mean expected
, is
value
x
E X
E X x p x
µ
µ = = ·
¿
The mean is the weighted average of the possible values of X,
the weight of each value x represents how likely the occurrence
of value x is. It represents the center of the distribution. It is
also called the arithmetic mean.
Ex. If p(x) is the pmf representing the loading on a long, thin
beam, then E(X) is the fulcrum or point of balance for the beam.
Statistics
Variance Defined
14
( )
( ) ( ) ( ) ( ) ( )
2
2 2
2 2 2
The of X, denoted as or , is variance
x x
V X
V X E X x p x x p x
o
o µ µ µ = = ÷ = ÷ · = · ÷
¿ ¿
The variance is the measure of dispersion or scatter in the
possible values for X.
It is the average of the squared deviations from the distribution
mean.
Statistics
Variance Defined
15
•The mean is the balance point. Distributions (a) & (b) have
equal mean, but (a) has a larger variance.
Statistics
Variance Formula Derivations
16
( ) ( ) ( )
( )
( )
( ) ( ) ( )
( )
( )
2
2 2
2 2
2 2 2
2 2
is the formula
2
2
2
is the form
definitional
computatio ul l a na
x
x
x x
x
x
V X x p x
x x p x
x p x xp x p x
x p x
x p x
µ
µ µ
µ µ
µ µ
µ
= ÷
= ÷ +
= ÷ +
= ÷ +
= ÷
¿
¿
¿ ¿ ¿
¿
¿
•The computational formula is easier to calculate manually.
Statistics
Ex. Digital Channel
There is a chance that a bit transmitted through a digital transmission
channel is an error. X is the number of bits received in error of the next 4
transmitted. Use table to calculate the mean & variance.
17
x p(x ) x *p(x ) (x 0.4)
2
(x 0.4)
2
*p(x ) x
2
*p(x )
0 0.6561 0.0000 0.160 0.1050 0.0000
1 0.2916 0.2916 0.360 0.1050 0.2916
2 0.0486 0.0972 2.560 0.1244 0.1944
3 0.0036 0.0108 6.760 0.0243 0.0324
4 0.0001 0.0004 12.960 0.0013 0.0016
Totals = 0.4000 0.3600 0.5200
= Mean = Variance (σ
2
) = E(x
2
)
= μ σ
2
= E(x
2
)  μ
2
= 0.3600
Definitional formula
Computational formula
Statistics
Particular class of Discrete Random
Variables
1. Flip a coin 10 times. X = # heads obtained.
2. A worn tool produces 1% defective parts. X = # defective
parts in the next 25 parts produced.
3. A multiplechoice test contains 10 questions, each with 4
choices, and you guess. X = # of correct answers.
4. Of the next 20 births, let X = # females.
5. Assume your favorite basketball team plays 10 games (of
equal difficulty). Let X = the number of times that it wins the
game.
Statistics
Binomial Random Variables
These examples are binomial experiments having the following
characteristics:
1. Fixed number of trials (n).
2. Each trial is termed a success (S) or failure (F). X is the # of
successes.
3. The probability of success in each trial is constant (p).
4. The outcomes of successive trials are independent.
Statistics
Binomial distribution
Commonly used discrete distribution
Bernoulli trial [definition]
• Single trial with only 2 possible outcome (S or F)
• The probability of success is p.
Binomial variable
• Consider n Bernoulli independent trials
• Each trial has the same probability of “success” p
• X counts the number of successes in these n trials.
( , ) X Bin n p
( ) X Bernoulli p
Statistics
Binomial distribution
The probability mass function of X is:
Let’s calculate p
k
=Pr(X=k), and k=0,1,…n
[Recall that X counts the number of successes in n trials ]
1) probability of an outcome comprised of k successes and (nk)
failures
.
Value of X 0 1 … ….. …. n
Probability p
0
p
1
…. …… …. p
n
, ,..., , ,...,
k n k
S S S F F F
÷
Statistics
Binomial distribution
The probability mass function of X is:
Let’s calculate p
k
=Pr(X=k), and k=0,1,…n
[Recall that X counts the number of successes in n trials ]
1) probability of an outcome comprised of k success and (nk)
failures
2) the number of such outcomes:
.
Value of X 0 1 … ….. …. n
Probability p
0
p
1
…. …… …. p
n
(1 )
k n k
p p
÷
÷
!
!( )!
n
n
k k n k
 
=

÷
\ .
Statistics
Binomial distribution
Let’s calculate p
k
=Pr(X=k), and k=0,1,…n
[Recall that X counts the number of successes in n trials ]
1) probability of an outcome comprised of k success and (nk)
failures
2) the number of such outcomes:
The Binomial PMF is:
(1 )
k n k
p p
÷
÷
!
!( )!
n
n
k k n k
 
=

÷
\ .
( ) (1 )
k n k
k
n
p P X k p p
k
÷
 
= = = ÷

\ .
Statistics
Factorials
0!=1
1!=1
2!=1X2=2
3!=1X2X3=6
4!=1X2X3X4=24
5!=1X2X3X4X5=120
General formula :
[this formula is helpful for canceling]
! ( 1)! n n n = ÷
Statistics
Example 316: Digital Channel
The chance that a bit transmitted through a digital transmission
channel is received in error is 0.1. Assume that the transmission
trials are independent. Let X = the number of bits in error in the
next 4 bits transmitted. Find P(X=2).
Statistics
Example 316: Digital Channel
•Let E denote a bit in error
•Let O denote an OK bit.
•Sample space & x listed in table.
•6 outcomes where x = 2.
•Prob of each is 0.1
2
*0.9
2
= 0.0081
•
•P(X=2) = 6*0.0081 = 0.0486
Outcome x Outcome x
OOOO 0 EOOO 1
OOOE 1 EOOE 2
OOEO 1 EOEO 2
OOEE 2 EOEE 3
OEOO 1 EEOO 2
OEOE 2 EEOE 3
OEEO 2 EEEO 3
OEEE 3 EEEE 4
( ) ( ) ( )
2 2
4
2 0.1 0.9
2
P X
 
= =

\ .
Statistics
Mean/Variance of the Binomial RV
• If X has a Bin(n, p) distribution, the probability mass function
of X is given by
for k = 0,1,2,…,n
The Mean and Variance of X are:
μ
X
= n·p , and σ
2
X
= n·p·(1p)
• Example: X has Bin(5, 0.6) distribution.
Then the mean is μ
X
= 5· 0.6 = 3 ;
the variance is σ
2
X
= 5 0.6· 0.4 = 1.2
( ) ( )
1
n k
k
n
P X k p p
k
÷
 
= = ÷

\ .