Random Variables and Distributions
Download
Report
Transcript Random Variables and Distributions
Random Variables and
Distributions
Lecture 5: Stat 700
Basics of Random Variables and
Probability Distributions
• Consider again the experiment of tossing three fair coins
simultaneously. The sample space and corresponding
probabilities are given by:
• S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}
• Probabilities ={1/8, 1/8, 1/8, 1/8, 1/8, 1/8, 1/8, 1/8}
• In a practical setting, “H” may represent “success” of a
medical operation; “T” represents “failure.”
• In this situation we may not really be interested in the
elementary outcomes of S, but rather our interest might be
on the total number of “H” that occurred in the outcome.
Notion of a Random Variable
• When interest is on some numerical characteristic
of the outcomes of the experiment, then we are led
into consideration of random variables.
• Definition: A random variable, denoted by X, Y,
etc., is a function or procedure that assigns a
unique numerical value to each of the outcomes of
the experiment. The set of possible distinct values
of the variable is called its Range.
A Simple Example
• In the coin-tossing experiment described earlier, if we let X
denote the random variable counting the number of “H” in
the outcome, then the values of X associated with each of
the 8 possible outcomes are:
• X(HHH) = 3, X(HHT) = 2, X(HTH) = 2, X(THH) = 2,
X(HTT) = 1, X(THT) = 1, X(TTH) = 1, X(TTT) = 0
• Therefore, Range of X = {0, 1, 2, 3}.
• One of the advantages of dealing with random variables
instead of the elementary events of the experiment is that
we will be dealing with numbers, which we could add,
multiply, etc., instead of crude outcomes that we could not
do arithmetic operations.
Types of Random Variables
• Random variables can be classified into either
discrete or continuous variables.
• Discrete variables are those whose range has a
finite number or at most a countable number of
values; while
• Continuous variables are those whose range
contains an interval of the real line, hence has an
uncountable number of values.
• The variable X in the example is clearly a discrete
random variable.
Probability Distribution Function
• Definition: Given a discrete random variable X whose
range is R = {x1, x2, x3, …}, its probability function,
denoted by p(x), is a table, a graph, or a mathematical
formula which provides the probabilities for each of the
possible values in its range. In formal notation,
p ( x j ) P( X x j )
P( X takesvalue x j ), for x j in R.
Determining the Probability Function
• For a discrete random variable X, the value of
p(xj) is obtained by summing up the probabilities
of all the elementary events whose X-value is xj.
• A simple illustration makes this immediately
transparent.
• For the variable X which counts the number of
“H” that occur in the toss of three fair coins, we
obtain the probability function as follows:
Probability Function for X in Example
• The range of X is R = {0,1, 2, 3}. We have:
• p(0) = P(X = 0) = P(TTT) = 1/8 = .125
• p(1) = P(X = 1) = P(HTT) + P(THT) + P(TTH) = 1/8 + 1/8
+ 1/8 = 3/8 = .375
• p(2) = P(X = 2) = P(HHT) + P(HTH) + P(THH) = 1/8 +
1/8 + 1/8 = 3/8 = .375
• p(3) = P(X = 3) = P(HHH) = 1/8 =.125
• In formula form:
• p(x) = (3Cx)(1/8), x=0,1,2,3.
• In tabular and graphical forms the probability function can
be presented via:
Tabular/Graphical Presentation of the
Probability Function of X
x = Value of X
0
1
2
3
p(x) = P(X = x)
1/8 = .125
3/8 = .375
3/8 = .375
1/8 = .125
Bar Graph Depicting p(x)
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
0
1
2
3
Properties and Utilities of Probability
Functions
• Note that the sum of the probabilities, which are all
nonnegative, in a probability function equals 1. This is so
because we take into account all the possible outcomes,
that is, the sample space, and its probability is 1. That is,
p(x) satisfies
• p(x) > 0 for all x, and all x {p(x)} = 1.
• The shape of the distribution could be obtained from the
graph of the probability function.
• For example, the probability distribution for the variable X
is symmetric with high points at the values of 1 and 2.
Utilities … continued
• The probability function of a random variable serves as a
theoretical model of the population of values of the
variable, with this population being the collection of the
outcomes of the experiment when it is repeated many,
many, many times.
• Numerical characteristics of the probability function, such
as the mean, variance, and standard deviation, will be
called parameters.
• The probability function can be used to compute the
probabilities that the variable takes values in a certain set
of interest.
• For instance, in the example, P(X < 2) = p(0) + p(1) + p(2)
= 1/8 + 3/8 + 3/8 = 7/8.
Parameters of a Discrete Probability
Distribution
• As mentioned earlier, a probability distribution serves as a
theoretical model of a population.
• Characteristics of a probability distribution are therefore
called parameters, and they are usually denoted by Greek
letters.
• We now discuss four important parameters of discrete
probability distributions. These are:
• Mean () and Median ()
• Variance (2) and Standard Deviation ().
Median of a Discrete Random Variable
• Given a discrete random variable X whose
probability distribution function is p(x), its
median, denoted by , is any value such that
P( X ) 0.5
and
P( X ) 0.5.
A Simple Example
• For the variable X denoting the number of “H” that occur
in the toss of three fair coins, we therefore have:
• Mean = = (0)(1/8)+(1)(3/8)+(2)(3/8)+(3)(1/8) = 12/8 =
1.5.
• For its median, we could take = 1.5, since notice that P(X
< 1.5) = p(0) + p(1) = 1/8 + 3/8 = 0.5, and also, P(X > 1.5)
= p(2) + p(3) = 1/8 + 3/8 = 0.5.
• However, note that the median is not unique since any
value of between 1 and 2, exclusive, will satisfy the
definition of being a median.
Interpretations
• As in the case of the sample statistics we have the
following interpretations:
• The mean, , serves as the “center of gravity” or
“balancing point” for the probability distribution;
while
• The median is a value that divides the probability
distribution into a 50:50 split.
• Other properties, like sensitivity of the mean to
extreme values also holds for these parameters.
Variance of a Discrete Random Variable
• Given a discrete random variable X taking values
{x1, x2, x3, …} whose probability distribution is
p(x), its variance, denoted by 2, is given by:
2
2
(
x
)
p( x j )
j
all x j
2
x j p( x j ) ( ) 2 .
all x j
Variance … continued
• The first formula is called the definitional formula, which
indicates that the variance is the mean of the squared
deviations from the mean ().
• The second formula is called the computational or the
machine formula, and is easier to implement in practice.
• The variance is always nonnegative, and becomes zero if
and only if the random variable takes only one value (we
say in this case that it is a degenerate variable). The larger
the value of the variance, the more variability in the
distribution.
• The variance has squared units of measurements.
Standard Deviation of a Discrete
Random Variable
• Since the variance has squared units of
measurements, to obtain a measure of variation
whose units are the same as the variable, we define
the standard deviation () to be the positive square
root of the variance.
• Formally, it is defined via:
.
2
Illustration of Computation of the
Variance and Standard Deviation
• Going back to the variable X which counts the number of
“H” in a toss of three fair coins, we have, by recalling that
= 1.5 and using the definition, that:
• 2 = Var(X) = (0 - 1.5)2(1/8) + (1 - 1.5)2(3/8) + (2 1.5)2(3/8) + (3 - 1.5)2(1/8) = (2.25)(.125) + (.25)(.375) +
(.25)(.375) + (2.25)(.125) = 0.75.
• We could also use the computational formula to get:
• 2 = Var(X) = [(0)2(.125) + (1)2(.375) + (2)2(.375) +
(3)2(.125)] - (1.5)2 = [0 + .375 + 1.5 + 1.125] - 2.25 = 3 2.25 = 0.75.
• Therefore, = StdDev(X) = (.75)(1/2) = .866.
Spreadsheet-Type Computation of the
Parameters
utation of Variance and Standard Deviation
x
0
1
2
3
Sums
p(x)
0.125
0.375
0.375
0.125
1
Using Computational formula
x*p(x)
0
0.375
0.75
0.375
1.5
{(x-Mean)^2}*p(x)
0.28125
0.09375
0.09375
0.28125
0.75
Variance
Standard Deviation
0.75
0.866025404
{x^2}*p(x)
0
0.375
1.5
1.125
3