You are on page 1of 10

Chapter 3

Random Variables

By

Dr. A. Mustafa
Chapter 3. Random Variables. By Dr. A. Mustafa 1
Definition 1. A function whose value is a real number determined by each element in the
sample space is called a random variable.

We shall use a capital letter, say X, to denote a random variable

Definition 2. If a sample space contains a finite number of possibilities or an unending


sequence with as many elements as there are whole numbers, it is called a discrete sample
space, and a random variable defined over this space is called a discrete random variable.

Definition 3. If a sample space contains an infinite number of possibilities equal to the


number of points on a line segment, it is called a continuous sample space, and a random
variable defined over this space is called a continuous random variable.

1-The Discrete Random Variable


A discrete random variable assumes each of its values with a certain probability. We can
write
f(x)=P[X= x]

Definition 4. The function f(x) is a probability function or a probability distribution of the


discrete random variable X if, for each possible outcome x,
1. f(x) ≥ 0.
2. ∑ f ( x ) = 1 .
x

3. P(X = x ) = f ( x ) .

Example 1. Find the probability distribution of the sum of the numbers when a pair of
dice are tossed.
Solution Let X be a random variable whose values x are the possible totals. Then x
take the values 2, 3, 4, … , 12 , the probability distribution of the random variable X is
given by
f(x) = P( X = x) ; x = 2, 3, … , 12.
.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬
Chapter 3. Random Variables. By Dr. A. Mustafa 2
Therefore
x 2 3 4 5 6 7 8 9 10 11 12
f(x) 1 2 3 4 5 6 5 4 3 2 1
36 36 36 36 36 36 36 36 36 36 36

Definition 5. The cumulative distribution F(x) of a discrete random variable X with


probability distribution f(x) is given by

F( x ) = P[X ≤ x ] = ∑ f (t)
t≤x

Example 2. Find the cumulative distribution of the number of heads when a coin is
tossed four times.
Solution Since there are 24= 16 points in the sample space.
Let X be a random variable whose values x are the possible number of heads. Then x can
take the values 0, 1, 2, 3, 4. Thus the probability distribution
f(x) = P[ X = x]
x 0 1 2 3 4
f(x) 1 4 6 4 1
16 16 16 16 16
And the cumulative distribution of X is given by
F(0) = f(0) = 1/16
F(1) = f(0) + f(1) = 5/16
F(2) = f(0) + f(1) + f(2) = 11/16
F(3) = f(0) + f(1) + f(2) + f(3) = 15/16
F(4) = f(0) + f(1) + f(2) + f(3) +f(4) = 1
Hence

.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬


Chapter 3. Random Variables. By Dr. A. Mustafa 3
⎧0 for x < 0
⎪1 / 16 for 0 ≤ x < 1

⎪⎪5 / 16 for 1 ≤ x < 2
F( x ) = ⎨
⎪11 / 16 for 2 ≤ x < 3
⎪15 / 16 for 3 ≤ x < 4

⎪⎩1 for x ≥ 4

Now, f(2) = F(2) – F(1) = 11/16 – 5/16 = 3/8.

It is often helpful to look at a probability distribution in graphic form. One can plot the
points (x, f(x)) of Example 2 to obtain Figure 1 and 2.
f(x)

6/16
5/16
4/16
3/16
2/16
1/16

0 1 2 3 4 x
Figure 1 Bar chart.

f(x)

6/16
5/16
4/16
3/16
2/16
1/16

0 1 2 3 4 x
Figure 2 Probability histogram.

The graph of the cumulative distribution of Example 2, is given as

.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬


Chapter 3. Random Variables. By Dr. A. Mustafa 4

F(x)

3/4

1/2

1/4

0 1 2 3 4 x
Figure 3. Discrete cumulative distribution.

2- The Continuous Random Variable


A continuous random variable has a probability of zero of assuming exactly any of its
values. The probability distribution of a continuous random variable cannot be given in
tabular form, it does have a formula.
In dealing with continuous variables, f(x) is usually called the density function.
Definition 6. The function f(x) is a probability density function for the continuous random
variable X, defined over the set of real numbers R, if
1. f(x) ≥ 0 for all x ∈ R .

2. ∫ f ( x ) dx = 1.
−∞

b
3. P(a < X < b ) = ∫ f ( x ) dx.
a

Example 3. Let the random variable X have the probability density function

⎧x2
⎪ , − 1< x < 2
f (x) = ⎨ 3
⎪0, elsewhere.

1. Verify condition 2
2. Find P( 0 < X ≤ 1).
.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬
Chapter 3. Random Variables. By Dr. A. Mustafa 5

Solution
2
∞ 2
x2 x3 8 1
1. ∫ f ( x ) dx = ∫ dx = = + =1
−∞ −1 3 9 −1
9 9
1 1
x2 1
2. P(0 < X ≤ 1) = ∫ f ( x ) dx = ∫ dx =
0 0 3 9

Definition 7. The cumulative distribution function F(x) of a continuous random variable


X, with density function f(x) is given by
x
F( x ) = P( X ≤ x ) = ∫ f ( t ) dt.
−∞

As an immediate consequence of Definition 7, one can write the two results


P[a < X < b] = F(b) − F(b) ,

and
d
f (x ) = F( x ) ,
dx
if the derivative exists.

Example 4. For the density function of Example 3.6 find F(x) and use it to evaluate P(
0 < X ≤ 1).
Solution
x
x x
t2 t3 x3 +1
F( x ) = ∫ f ( t ) dt = ∫ dt = = .
−∞ −1 3 9 −1
9

Therefore,
2 1 1
P(0 < X ≤ 1) = F(1) − F(0) = − = .
9 9 9

3- Mathematical Expectation
Definition 8. Let X be a random variable with probability distribution f(x). The expected
value of X or the mathematical expectation of X is

.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬


Chapter 3. Random Variables. By Dr. A. Mustafa 6
⎧∑ x f ( x ) if X is discrete
⎪x
E[X] = ⎨ ∞
⎪ ∫ x f ( x ) dx if X is continuous
⎩− ∞

Example 5. Find the expected number of chemists on a committee of size 3 selected at


random four chemists and three biologists.

Solution Let X represents the number of chemists on the committee. The probability
distribution of X is given by
⎛ 4⎞⎛ 3 ⎞
⎜⎜ ⎟⎟ ⎜⎜ ⎟
⎝ x ⎠ ⎝ 3 − x ⎟⎠
f (x) = , x = 0, 1, 2, 3.
⎛7⎞
⎜⎜ ⎟⎟
⎝ 3⎠
x 0 1 2 3
f(x) 1/35 12/35 18/35 4/35
xf(x) 0 12/35 36/35 12/35

Therefore,
12 36 12 60
E[X ] = ∑ x f ( t ) = 0 + + + = = 1.7
x 35 35 35 35

Example 6.
Let X be the random variable that denotes the life in hours of a certain type of tube. The
probability density function is given by
⎧ 20,000
⎪ , x > 100
f (x ) = ⎨ x 3
⎪⎩0 , elsewhere

Find the expected life of this type of tube.


∞ ∞
20,000
Solution E[X] = ∫ x f ( x ) dx = ∫ dx = 200
−∞ 100 x2

Theorem 1. Let X be a random variable with probability distribution f(x). The expected
value of the function g(X) is
.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬
Chapter 3. Random Variables. By Dr. A. Mustafa 7
⎧∑ g( x ) f ( x ) if X is discrete
⎪⎪ x
E[g(X)] = ⎨ ∞
⎪ ∫ g( x ) f ( x ) dx if X is contiuous.
⎪⎩−∞

Example 7. Let X be a random variable with probability distribution as follows:

x 0 1 2 3
f(x) 1/3 1/2 0 1/6

Find the expected value of Y= (X-1)2.

Solution

[
E (X − 1) =
2
] 3
∑ (x − 1)
x =0
2
f (x )

= (−1) 2 f (0) + (0) 2 f (1) + (1) 2 f (2) + (2) 2 f (3) = 1

4- Laws of Expectation

Theorem 2. If a and b are constant, then E[aX + b] = a E[X] + b

Corollary 1.
1.Setting a = 0, we see that E(b) = b.
2. Setting b = 0, we see that E(aX) = a E(X}

5- The variance
The variance is of special importance because it tells us something about the variability of
the measurements about the mean that is given as follows
Var (X) = σ 2 = E[(X − μ ) ]
2

The positive square root of the variance is a measure called the standard deviation. An
alternative and preferred formula for σ 2 is given by
[ ]
σ2 = E X 2 − μ2

.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬


Chapter 3. Random Variables. By Dr. A. Mustafa 8
Since μ = E[X] .

Example 8. Find the mean and variance of the random variable X, where X has the
density function
⎧2( x − 1) , 1 < x < 2
f (x ) = ⎨
⎩0 , elsewhere

Solution
∞ 2
5
μ = E[X ] = ∫ x f ( x ) dx = ∫ 2x ( x − 1)dx = 3
−∞ 1

and

[ ]
∞ 2
17
E X2 = ∫ x f ( x ) dx = ∫ 2x (x − 1)dx =
2 2

−∞ 1 6

Therefore,

[ ]
σ2 = E X2 − μ2 =
17 25 1
6
− =
9 18
Theorem 3. If X is a random variable and b is a constant, then
Var ( X + b) = Var ( X )

Theorem 4. If X is a random variable and a is any constant, then


Var (aX ) = a 2 Var ( X )

.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬


Chapter 3. Random Variables. By Dr. A. Mustafa 9
EXERCISES 3

1- From a box containing four black balls and two green balls, three balls are drawn in
succession, each ball being replaced in the box before the next draw is made. Find the
probability distribution for the number of green balls.
2- A continuous random variable X that can assume values between x = 1 and x = 3 has a
density function given by f(x) = 1/2.
(a) Show that the area under the curve is equal to 1
(b) Find P(2 < X < 2.5)
(c) Find P(X ≤ 1.6).
3- A continuous random variable X that can assume values between x = 2 and x = 5 has a
density function given by f ( x ) = 2(1 + x ) / 27 . Find P( X < 4) , P(3 < X < 41.6)
4- Let X represents the outcome when a balanced die is tossed. Find E(Y), where
Y = 2X 2 − 5.

5- From a group of five men and three women a committee of size 3 is selected at
random. If X represent the number of women on the committee, find the mean and
variance of X.
6- Let X be a random variable with the following probability distribution
x -3 6 9
P[X = x] 1/6 1/2 1/3

Find E[X] and E[X 2 ] and then, using the laws of expectation, evaluate
(a) E[ (2X + 1)2 ]
(b) E[ (X − E[X])2 ]

.‫ ولم اوصى بوضعة فى المكتبات‬http://www.freewebs.com/mansstat‫ھذا التلخيص قمت به ليوضع على الموقع‬

You might also like