You are on page 1of 19

Random Variable

A random variable is a function or rule that assigns a number


to each outcome of an experiment.

Alternatively, the value of a random variable is a numerical


event.

Instead of talking about the coin flipping event as


{heads, tails} think of it as
“the number of heads when flipping a coin”
{1, 0} (numerical events)
Two Types of Random Variables…
Discrete Random Variable
– one that takes on a countable number of values
– E.g. values on the roll of dice: 2, 3, 4, …, 12

Continuous Random Variable


– one whose values are not discrete, not countable
– E.g. time (30.1 minutes? 30.10000001 minutes?)

Analogy:
Integers are Discrete, while Real Numbers are Continuous
Probability Distributions…
A probability distribution is a table, formula, or graph that
describes the values of a random variable and the probability
associated with these values.

Since we’re describing a random variable (which can be


discrete or continuous) we have two types of probability
distributions:
– Discrete Probability Distribution, (chapter 6) and
– Continuous Probability Distribution (Chapter 7)
Probability Notation…
An upper-case letter will represent the name of the random
variable, usually X.

Its lower-case counterpart will represent the value of the


random variable.

The probability that the random variable X will equal x is:


P(X = x)
or more simply
P(x)
Discrete Probability Distributions…
The probabilities of the values of a discrete random variable
may be derived by means of probability tools such as tree
diagrams or by applying one of the definitions of probability,
so long as these two conditions apply:
Example
The Statistical Abstract of India is published annually. It
contains a wide variety of information based on the census as
well as other sources. The objective is to provide information
about a variety of different aspects of the lives of the
country’s residents. One of the questions asks households to
report the number of persons living in the household. The
following table summarizes the data. Develop the probability
distribution of the random variable defined as the number of
persons per household.
Example
Number of Persons Number of Households (millions)
1 31.1
2 38.6
3 18.8
4 16.2
5 7.2
6 2.7
7 or more 1.4
Total 116.0
Example
Probability distributions can be estimated from relative frequencies.
x P(x)
1 31.1/116.0 = .268
2 38.6/116.0 = .333
3 18.8/116.0 = .162
4 16.2/116.0 = .140
5 7.2/116.0 = .062
6 2.7/116.0 = .023
7 or more 1.4/116.0 = .012
Total 1.000
Example
E.g. what is the probability there are 4 or more persons in any given
household?
x P(x)
1 .268
2 .333
3 .162
4 .140
5 .062
6 .023
7 or more .012

P(X ≥ 4) = P(4) + P(5) + P(6) + P (7 or more)


= .140 + .062 + .023 + .012 = .237
EXAMPLE
A random variable has the following probability
distribution:
x :0 1 2 3 4 5 6 7 8
P(x): k 2k 4k 6k 8k 10k 12k 14k 16k
Find
i) k, ii) P(X<3), iii) P( X  3)
Solution
Soln. Since P(x) is a pmf,
i) k+2k+4k+6k+8k+10k+12k+14k+16k=1
k =1/73
ii) P(X=0)+P(X=1)+P(X=2)=7k=7/73
iii)1-P(X<3)=7/73
Population/Probability Distribution…
The discrete probability distribution represents a population

Since we have populations, we can describe them by


computing various parameters.

E.g. the population mean and population variance.


Population Mean (Expected Value)
The population mean is the weighted average of all of its
values. The weights are the probabilities.

This parameter is also called the expected value of X and is


represented by E(X).
Population Variance…
The population variance is calculated similarly. It is the
weighted average of the squared deviations from the mean.

As before, there is a “short-cut” formulation…

The standard deviation is the same as before:


Cumulative distribution function (cdf)
• It is a function that provide the cumulative probability up to a point
for a random variable (r.v).

For a discrete r.v:


• P( X  x) = F(x) =  P( X = x)
X :X  x

F(4)=P(X 4)=1-P(X ≥5)=P(X=5)+P(X=6)+P(X=7)


pmf (example)

x P(x)
0 0.05
1 0.05
The probability distribution of booking 2 0.06
of rooms in a hotel from Waynad 3 0.10
during December is: 4 0.13
5 0.20
6 0.15
7 0.26
Total 1.00
pmf (example)
x P(x) x P(x)
0 0.05 0.00
First find the expected value 1 0.05 0.05
7 2 0.06 0.12
E ( X ) =  =  xi P( xi ) 3 0.10 0.30
i =1 4 0.13 0.52
5 0.20 1.00
= 4.71 rooms
6 0.15 0.90
7 0.26 1.82
Total 1.00  = 4.71
pmf (example)
7
V ( X ) =  =  [ xi − ]2 P( xi )
The E(X) is then 2
used to find i =1
the variance: x P(x) x P(x) [x−]2 [x−]2 P(x)
= 4.2259 0 0.05 0.00 22.1841 1.109205
1 0.05 0.05 13.7641 0.688205
The standard 2 0.06 0.12 7.3441 0.440646
deviation is: 3 0.10 0.30 2.9241 0.292410
4 0.13 0.52 0.5041 0.065533
 = 4.2259 5 0.20 1.00 0.0841 0.016820
= 2.0577 rooms
6 0.15 0.90 1.6641 0.249615
7 0.26 1.82 5.2441 1.363466
Total 1.00  = 4.71 2 =
4.225900
pmf (example)

The histogram shows that the distribution is skewed


to the left and bimodal.
0.30

0.25
The mode is 7 0.20

rooms rented but Probability 0.15

the average is only 0.10

4.71 room rentals. 0.05

0.00
0 1 2 3 4 5 6 7
Num ber of Room s Rented

 = 2.06 indicates considerable variation around .

You might also like