Chapter Two 2. Random Variables and Probability Distributions
Chapter Two 2. Random Variables and Probability Distributions
Chapter Two
2. Random Variables and Probability Distributions
Definition: A variable whose numerical value is determined by the outcome (or result) of a
random experiment is called a random variable or a chance variable. A random variable X
can also be regarded as a real-valued function defined on the sample space S of a random
experiment such that for each point X of the sample space, f(X) is the probability of
occurrence of the event represented by X. or
-the value of the random variable is not known until the experiment outcome is observed
Random variable can be either Discrete or Continuous depending on the numerical value it
assumes.
Discrete Random Variables: - are random variables that may assume either a
finite whole number of values or an infinite sequence of whole numbers such as 0,
1, and 2…is referred to as a discrete random variable.
Continuous Random Variables: - are variables that assume any numerical value
in an interval or collection of intervals
Probability Distribution: - the probability distribution for a random variable describes how
probabilities are distributed over the values of the random variable.
If a random variable X assumes the discrete set of values x 1, x2, …, xn, then the function f
defined by f(xi) = P(X = xi) – probability that X assumes the value say xi = p(xi) – is called
probability function (or density function) and P(X = xi) is called the probability of xi . The
list of pairs of values xi and P(xi) is called the probability distribution of X.
1
Statistics for Economists JJU, Department of Economics
1. 0 ≤ P ( x i ≤ 1)
n
2. ∑ P( x¿¿ i)=1 ¿
i=1
Example1: Suppose we tossed a fair coin three times successively. What are the values of X
(xi) and its corresponding probability, where xi shows the number of heads?
Solution: The sample Space, S = {HHH, HHT, HTH, THH, TTH, THT, HTT, TTT}.
Then xi 0 1 2 3
f (xi) 1/8 3/8 3/8 1/8
Example 2: Suppose that a fair die is thrown once. The outcomes are number of dots. What
are the values of xi and its corresponding probability distribution?
Let x be a random variable that represents the number of dots of the die
xi 1 2 3 4 5 6
f (xi) 1/6 1/6 1/6 1/6 1/6 1/6
If x1, x2, x3, … xn are different values of X given in increasing order then the cumulative
probability of the first K values is given by:
k
P( X < x k )=F ( x k )=∑ f (x i)
i=1
2
Statistics for Economists JJU, Department of Economics
0 , x x1
f (x ) , x1 x x2
1
f ( x1 ) f ( x2 ) , x2 x x3
F ( x)
.
.
f ( x1 ) ... f ( xn ) , xn x
Properties of F(X): The values F(X) of the distribution function of a discrete random
variable X satisfy the conditions:
F(-∞ ) = 0 and F(∞ ) =1;
If a <b, then F(a) ¿ F(b) for any real numbers a and b
Example: Consider tossing of a coin three times successively.
a) Obtain the probability of distribution of a random variable X, where X represents
the number of heads
b) Obtain the cumulative distribution function for the random variable X
Solution:
a) S = {HHH, HHT, HTH, THH, TTH, THT, HTT, TTT}
Then; the probability distribution of getting heads is given by:
Xi 0 1 2 3
f (xi) 1/8 3/8 3/8 1/8
3
Statistics for Economists JJU, Department of Economics
0 , for x <0
{
1
for 0 ≤ x <1
8
F ( x )= 4 , for 1 ≤ x <2
8
7
, for 2≤ x <3
8
1 , for x ≥ 3
c) F(0)=f(0)=1/16
F(1)=f(0)+f(1)=1/16+4/16=5/16
F(2)=f(0)+f(1)+f(2)=F(1)+f(2)=5/16+6/16=11/16
F(3)= f(0)+f(1)+f(2)+f(3)=F(2)+f(3)=11/16+4/16=15/16
F(4)= f(0)+f(1)+f(2)+f(3)+f(4)=F(3)+f(4)=15/16+1/16=1
Alternatively;
4
Statistics for Economists JJU, Department of Economics
0 , for x <0
{
1
for 0 ≤ x<1
16
5
, for 1 ≤ x <2
F ( x )= 16
11
, for 2 ≤ x <3
16
15
, for 3≤ x <4
16
1 , for x ≥ 4
x2
Example4: The probability density function (pdf) of a continuous random variable X is given
by:
f ( x )= 2 x , 0 ≤ x ≤ 1
{0 , elsewhere
0 0
5
Statistics for Economists JJU, Department of Economics
1
2
1
2 2
1 1 2 [ x2 ]= 1 − 1 = 5
b) P (
3
≤ x ≤ )=∫
2 1
( 2 x ) dx=
1 () ()
2 3 36
3
3
2
−x
Solution: P(1 ≤ x ≤2)=∫ (x e )dx, using the integration by parts and
1
2 2
−x −x 2
Then ∫ (x e )dx=-xe -∫ (−e )dx= [-xe −e ¿
−x −x −x
1 1
1
P (X 1 ≤ X ≤ X K ¿=∫ f (x )dx
−∞
f ( x )= 2 x , 0 ≤ x ≤ 1
{ 0 , elsewhere
6
Statistics for Economists JJU, Department of Economics
x
2
F(x) =∫ (2 x ) dx=x
0
Thus,
0 , for x< 0
{
F ( x )= x 2 , 0 ≤ x ≤1
1 , for x> 1
Example7: (a) Find the constant C such that the function
(a) Since f (x) satisfies property, (1) if c ¿ 0, it must satisfy property 2 in order to be a density
function. Now
∞ 3
1
∫ f (x )dx=1⇒∫ cx 2 dx=1⇒ 9 c=1⇒ c=
−∞ 0 9
2
1 7
P(1< x<2)=∫ x 2 dx =
(b) 1 9 27
In case f(x) is continuous, which we shall assume unless otherwise stated, the probability that X is
equal to any particular value is zero. In such case we can replace either or both of the signs < by ¿
thus
7
P( 1≤X ≤2)=P( 1≤X <2 )=P(1< X ≤2)=P( 1< X <2)=
27
Another method
7
Statistics for Economists JJU, Department of Economics
(c) P (−3<X ¿ 4 ) =
¿
∫ ¿ f (u)du =
−3
∫ ∫
¿ 0du +
−3
¿ 2e−2u du ¿
0
= −e−2u ¿ 40 = 1−e−8 ¿
Another method
P(-3 < X < 4) = P(X < 4) - P(X < -3)
= F(4) – F(-3)
= (1 - e-8) – (0) = 1 – e-8
Exercise
1. Check that the following function represents the PDF
2
f ( x )= 3 x , 0 ≤ x ≤1
{
0 ,elsewhere
2. Find the value of K for which f (x) is a valid PDF
2
f ( x )= k x ,0 ≤ x ≤ 2
{
0 , elsewhere
2.3. Expected value and Variance of Random Variable
2.3.1. Expected Value of Random variable
The mean of a probability distribution is a measure of its centrality or location, as is the mean
or average of a frequency distribution. It is a weighted average, with the values of the
random variable weighted by their probabilities. The mean is also known as the expected
value (or expectation) of a random variable, because it is the value that is expected to occur,
on average.
The expected value of a discrete random variable X is equal to the sum of each value of the
random variable multiplied by its probability.
E ( X ) xiP ( xi )
all x
8
Statistics for Economists JJU, Department of Economics
E (aX b) (ax b) f ( x)
axf ( x) bf ( x)
a xf ( x) b f ( x)
aE ( x) b, ( f ( x) 1)
c) The mathematical expectation of the sum of two or more random variables is
equal to the sum of the expectations of individual random variables
i.e. E ( X + Y ) = E ( X ) + E ( Y )
d) If X and Y are independent random variables, then E (XY) = E(X)* E (Y)
Note: E (XY) ≠E (X). E (Y) for dependent random variables
e) The expected value of the ratio of two random variables is not equal to the ratio
of the expected value of their random variables
X E (X )
E( )≠
Y E(Y )
Example7: Suppose a random variable X has the following distribution, what is the expected
value of X?
xi 2 4 6 8
f(xi) 0.1 0.2 0.3 0.4
Solution:
E (x) xif (xi)
= 2(0:1) + 4(0:2) + 6(0:3) + 8(0:4) = 6
Example8: A real-estate agent sells 0, 1, or 2 houses each working week with
respective probabilities 0.5, 0.3, and 0.2. Compute the expected value of the number of
houses sold per week?
Solution:
E (x) xif (xi)
= 0(0:5) + 1(0:3) + 2(0:2) = 0.7
Definition
The expectation E(X) for a continuous random variable X is defined by the following integral
when it exists:
9
Statistics for Economists JJU, Department of Economics
∞
E ( X ) =μx =∫ xf ( x)dx
−∞
2 2
1 1 x3 2 4
μx=∫ x ( x)dx=∫ x 2=
0 2 0 2
=
6 0 3 { }
Example10: Consider the following function
−3 x
f ( x )= k e for x> 0
{
0 elsewhere
Obtain the expected value of the random variable X
Solution: First determine the value of K
∞ ∞
¿¿
1
¿ =1 , k=3
3k
Thus,
−3 x
f ( x )= 3 e for x >0
{
0 elsewhere
Now, the expected value can be obtained using the usual formula
∞ ∞
E ( X ) =μx =∫ xf ( x ) dx=∫ x ( 3 e−3 x ) dx=¿
−∞ 0
−3 x −3 x 3 −3 x t
¿ lim ( ¿ e − e ) =lim ¿ ¿ ¿
t→∞ 3 9 0 t→∞
1
E ( X )=
3
Exercise
10
Statistics for Economists JJU, Department of Economics
1. The probability of a business will get a profit of $20,000 is 0.2 and the probability of
making a loss of $1000 will be 0.8. Should the firm invest his money or not?
2. One hundred lottery tickets are sold each at one birr. Suppose prize-1 is 50 birr, prize-
2 is 20 birr and prize-3 is 10 birr. The chance of getting:
50 birr is 0.01,
20 birr is 0.01,
10 birr is 0.01, and
No birr is 0.97.
Then what will be the expectation this lottery game?
Theorem: Let X be a discrete random variable with probability mass function p(x) and g(X)
be a real valued function of X. Then the expected value of g(X) is given by
Eg ( X )=∑ g ( x) P( x)
x
And if X is a continuous random variable with probability density function f(x) and g(x) a
real valued function of X. then, thee expected value of g(x) is given by
∞
E [g ( X ) ]=∫ g (x) f (x )dx
−∞
Example11: What is the expected value of g(X) = 2 + 3X, where X is a random variable
obtained by rolling a die?
1
f ( x )=P ( X =x )= 6
E(aX + b) = aE(X) + b
{ , for x=1,2,3,4,5,6
0 , otherwise
11
Statistics for Economists JJU, Department of Economics
¿ E ( X 2 ) −μ2
¿ ∑ X 2 f ( x )−¿ μ2 ¿
x
12
Statistics for Economists JJU, Department of Economics
Example12:Mr.Tujar buys a stock whose return (including both dividends and change in
price of stock) depends on whether the nation’s GNP is rising, constant, or falling. If the GNP
is rising, the return is 20 percent (i.e., 20 cents per Birr); if it is constant, the return is 5
percent; and if it is falling, the return is -10 percent. If he believes that it is equally likely that
the GNP will rise, remain constant, or fall. What is the expected value of the return from this
stock? And what are the variance and standard deviation of this stock’s return.
Solution: If it is equally likely that the GNP will rise, remain constant or fall, the probability
of each of these outcomes must equal 1/3. Thus, the expected value is:
3
E ( X ) =∑ xiP( xi)=20 (1/3)+5 (1/3)+−10 (1/3)=5 percent
i=1
1
f (x)=¿ { 4
2≤x≤6 ¿ ¿¿¿
Solution:
6
x x 2 6 36 4
E ( x) x f ( x) dx [ ] 4
2 4 8 2 8 8
x 4
6 2
4
E ( x ) x
2 2 2
x
f ( x) dx dx
2 4 3
13
Statistics for Economists JJU, Department of Economics
1
{
f (x)= ¿ x 0<x<2 ¿ ¿¿
2
Check Point
4
E( X )=
Mean = 3
2 2 2 2
4 4 4 1
2
2
E ( x ) x f ( x ) dx x xdx
3 3 0 3 2 9
2 2
9 3
Properties of Variance
1. The variance of the product of a constant and a random variable x is equal to the
constant squared times the variance of the random variable x. That is, Var(cx) =
c2var(X)
2. The variance of the sum (or difference) of two independent random variables equals
the sum of their individual variances. That is , Var (x ± y) = Var(x) ± Var(y)
3. If x and y are independent random variables
2 22
var(x+y)=var(x)+var(y) or δ =δ +δ ¿
x+y x y
var(x−y)=var(x)+var(y)or δ2x−y =δ2x +δ2y ¿ ¿¿¿¿¿
Moments
For X a discrete random variable, the rth moment about the origin is defined as:
14
Statistics for Economists JJU, Department of Economics
x
r
μr =E( X r ) i
f ( xi )
= i
(Note that the first moment about zero is the mean of X or μ = E( X )=μ )
r
If X is a continuous random variable with probability density f(x), then, provided the
following integrals exist, we may correspondingly define
μr E ( X ') x f ( x )dx;
r
And
μ = E [( X −μ ) ]=∫
r
r +∞
−∞
( x−μ )r f ( x )dx ; the rth moment around the mean
15