Random Variables
Random Variables
LECTURER:
DR. YARHANDS DISSOU ARTHUR
Random Variables
• A random variable is a numerical description of the
outcome of an experiment.
• The random variable can either be defined such
that each possible experimental outcome generate
one and only one numerical value for the random
variable.
• The numerical value that the random variable takes
on depends on the outcome of the experiment.
• The random variable can either be classified as
discrete or continuous depending on the numerical
values it can assume.
Discrete Random Variable
• A random variable is called a discrete random
variable if its assume either a finite number of
values or infinite sequence of values.
Examples of discrete random variables
• The number of units sold.
• The number of defects observed.
• The number of customer that enter a bank during a
particular working day.
The distinguishing feature of a discrete random
variable is the separation between the successive
value it may assume.
Continuous Random Variables
• A random variable is called a continuous random
variable if it may take on all values in a certain
interval or collection of intervals.
• Examples of continuous random variable include :
Weight
Time
Temperature
Percentage of project completed after 6 month.
• The feature that distinguishes a continuous
random variable is the lack of separation between
the successive values the random variable may
assume.
Random Variables
• Types of Probability Distributions
• A probability distribution is described as either
discrete or continuous
Discrete Distributions: The probability distribution
for a discrete random variable X is a formula, table,
graph or any device that specifies the probability
associated with each possible value of X.
DISCRETE RANDOM VARIABLES
CONT’D
The probability that X takes a discrete value, denoted, P( X x) or p(x) is called
probability mass function (pmf), if the following properties are satisfied:
(i) p( x) P( X x)
(ii) 0 p(x) 1 or p(x) 0, for all x, meaning, probability that the random variable X
assumes a value x is always between 0 and 1, inclusive.
(iii) p( x) 1, the sum of all probabilities is equal to 1.
x
EXAMPLES
• (a) Construct probability distributions for the following
random variables:
• (i) The number of heads when four fair coins are tossed.
• (ii) The difference between the results of two fair dice
rolled together
b) The number of telephone calls received in an office between 12.00 noon and 1.00 pm
has the probability function given by
x 0 1 2 3 4 5 6
p( x) 0.05 0.20 0.25 0.20 0.10 0.15 0.05
The random variable, X is the number of heads occurring in that experiment which
assumes the values, X = 0, 1, 2, 3, 4. The required probability distributions is
X 0 1 2 3 4
p(x) 1 3 6 5 1
16 16 16 16 16
4
where p( x) = 116 316
x 0
6
16
5 1 =1
16 16
and p(x) > 0, for each x.
SOLUTION CONT’D
(ii) The sample space for the experiment is given by the table below.
D1 D2
1 2 3 4 5 6
1 0 1 2 3 4 5
2 1 0 1 2 3 4
3 2 1 0 1 2 3
4 3 2 1 0 1 2
5 4 3 2 1 0 1
6 5 4 3 2 1 0
The possible values of this random variable (difference between the results of the two
rolled dice), y are 0, 1, 2, 3, 4, and 5. The required probability distribution is
Y 0 1 2 3 4 5
p (y ) 6 10 8 6 4 2
36 36 36 36 36 36
5
1
where p( y ) =
y 1 36
(6 + 10 + 8 + 6 + 4 + 2) = 1 and p(y) > 0, for all y. The line
histogram is given by
CONTINUOUS PROBABILITY
DISTRIBUTION
Continuous Probability Distributions: The relative frequency behaviour of continuous
random variable, X is modelled by a function, f(x) which is more often called
probability density function (pdf). The graph of f(x) is a smooth curve defined over a
range of interval the random variable, X assumes.
The area under the graph of f(x) gives the probability that x falls in an interval. Thus, the
probability that X assumes a value within the interval [a, b] is the area bounded by x = a, x
= b, x = 0 and f(x).
f ( x)
f ( x)
a b x
Figure 4.1: Graph of probability density function
That is, from the diagram above,
b
P(a x b) = a
f ( x)dx shaded area in Figure 4.1.
PDF
The probability distribution, f ( x) is said to be probability density function of the
continuous random variable, x if for an interval of real numbers [a, b] the following
properties are satisfied:
(i) f ( x) 0, for any value of x.
(ii)
f ( x)dx = 1
b
(iii) P(a x b) = f ( x)dx, where a x b . If a b , then
a
a
P(a x a) = P( x a) = f ( x)dx 0,
a
kx , 0 x 3, k 0
f ( x) 3k (4 x) , 3 x 4
0
, otherwise
(i) Given the probability density function,
SOLUTIONS
1 x k, 0 x 3
f ( x) 6
0 , elsewhere
then,
3
(i) 0
f ( x ) dx = 1
0
3
1 6 x k dx 1
x 2 kx
3
1 = 1
12 0
112 (3) 2
3k 3
0
0 1
3 3k 1
4
3k 1
4
k = 1
12
1 ( 2 x 1) , 0 x 3
Hence, f ( x ) 12
0 , elsewhere
2
P (1 x 2)
1
1
12
( 2 x 1) dx
= 1
12
x2 x
2
1
= 1
12
2 2
2 12 1
= 1
12 6 2 = 1
3
SOLUTION CONT’D
(ii) For f(x) is probability density function, f(x) ≥ 0 for all values of x and k > 0. We also
2
show that, P(1 x 2) =
1
f ( x)dx
4
f ( x)dx = 1 2
2
0
= 1 x dx = x 2
3 4
1 6 12 1
kxdx + 3k (4 x)dx = 1
0 3
12
= 1 22 1 = 1
4
2 3 2 4
kx x
+ 3k 4 x = 1 4
2 0 2 3 P( x 2) =
2
f ( x)dx
16 x dx 12 4 xdx
3 4
9k =
+ 3k [(16 – 8) – (12 – 9/2)] = 1 2 3
2
2 3 2 4
9k 3k
=1 = x 1 4x x
12 2 2 23
2 2
6k = 1 = 1 9 4 1 16 8 1 12 9
12 2 2 2
k 1
6 =5 1
12 4
1 x , 0x3
6 =2
3
Hence, f ( x) 1 (4 x), 3 x 4
2
0 , elsewhere
Cumulative distribution functions
dF ( x)
where -∞ ≤ x ≤ ∞, f ( x) = and P( x1 x x2 ) F ( x2 ) F ( x1 ).
dx
In each case, F ( x) is a monotonic increasing function with the following properties:
x 0 1 2 3
p( x) 1 1 1 1
4 8 2 8
F (0) P( X 0) p(0) 1
4
1 x , 0 x 2
(i) f ( x) 2
F (1) P( X 1) p(0) p(1) 1 1 3 0 , elsewhere
4 8 8
x x
F (2) P( X 2) p(0) p(1) p(2) 1 1 1 7 F ( x) f (t )dt 1 t dt
4 8 2 8 0 0 2
b
(ii) = E ( x) x f ( x) dx, if x is continuous and x .
x p ( x)
2
(i) Var(x) =
x
= x 2 p( x) 2 , if x is discrete.
x
x
2
(ii) Var(x) = f ( x) dx
b
= x 2 f ( x) dx 2 , if x is continuous.
a
6 x(1 x), 0 x 1
(ii) f ( x)
0 , elsewhere
Median and Mode of Probability
Distributions
The median of a distribution of the random variable x is that value of x = m such that
P( x m) or P( x m) = 0.5 or close to it. The median of the random variable, x with
m
(ii) a
f ( x) dx 1 , if x is continuous and is such that a x b .
2
The mode of a distribution of random variable x is that value of x m0 that
0 0 2 0 , otherwise
Given f ( x) 1 , 1 x 2 m 1
2 2 2 0
1 dx 1 x dx 5
E (x) = x p( x) x p(x)
1
0 , otherwise m
1 x 1 1 x 3
2 1 2 2
E (x) = x f ( x) dx
2
2 4 5
0 1 m 1 0 m = 1
2 2 = (3 1) (4 1) (5 1)
1 2
9 9 9
= x 2 dx 1 2 x dx The variance, Var ( x)
= 6 12 20 = = 4.22
0 1 1 38
Var( x) E ( x 2 ) 2
1
= 1 x3 1 x 2
3 0 4 1
2
2
= x 2 f ( x) dx 2
9 9
0
1
1 dx 13
2 12
2
For the median, m we have P(x m) 0.5 or 0.5
1 2
P(x 4) = p(3) + p(4) or P(x 5) = p(5)
= 1 1 1 = 1 x4 1
4 0 2x 1
169
144
3 4
= 1 8 1 169 = 1 (2) 1 (3) or = 1 (4)
= 13 1.083 4 6 6 144 9 9 9
12
35
= = 0.243 = 5 0.56 or = 4 0.44
144 9 9
Hence m = 4 since P(x 4) closer to 0.5 than P(x 4).
Example 2
1
4
1 1 4 y y 2 dy
2
1 4 = 13 y 3 7
1 y2 2 4 y 1 y2 1 0 2
2 0 2 12
=
1 1 2 1 3
2y y 4
3
1 4(4) 1 (4)2 4 1 1 1 1 (16 8) 2 1 1
2 24 7 1
2
8 2 2 2 2 8 8
=
1 1
32 64 1 1
24 7 3 2 24
49 7 1
8 8 7 256 3
1.5
168 2
Solution cont’d
Let m be the median. Then For the standard deviation, , we have
0
1
2
y dy 1 y 2 1
2 0
2
1
8 2 Var ( x) E ( x 2 ) 2
y dy 1 1 4 y dy 1
1 m
y2 4
y dy 1 1 y 2 (4 y) dy (1.5) 2
2
3
0 2 7 2 =
0 2 7
174 y dy 12 18
m
1 4
1 1 4 1
1 2
= y 4 y 3 y 4 2.25
2
1 4 y 1 y2 3
7 2 12 8
m
4 0 7 3 4 1 2
7 2
7 8 8
1 4m 1 m2 1 2 1 3 =
73
24
- 2.25 =
19
24
= 0.79167