0% found this document useful (0 votes)
37 views

Random Variables

The document discusses random variables and their probability distributions. It defines a random variable as a numerical description of the outcome of an experiment. Random variables can be either discrete or continuous. A discrete random variable can take on a finite or infinite set of numerical values, while a continuous random variable can take any value within a given interval. The document then discusses probability distributions for random variables. A discrete random variable has a probability mass function (PMF) that specifies the probability of each possible value. A continuous random variable has a probability density function (PDF) where the area under the curve for a given interval equals the probability that the random variable falls within that interval. Examples of both discrete and continuous probability distributions and their properties are provided
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Random Variables

The document discusses random variables and their probability distributions. It defines a random variable as a numerical description of the outcome of an experiment. Random variables can be either discrete or continuous. A discrete random variable can take on a finite or infinite set of numerical values, while a continuous random variable can take any value within a given interval. The document then discusses probability distributions for random variables. A discrete random variable has a probability mass function (PMF) that specifies the probability of each possible value. A continuous random variable has a probability density function (PDF) where the area under the curve for a given interval equals the probability that the random variable falls within that interval. Examples of both discrete and continuous probability distributions and their properties are provided
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

CONCEPT OF 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

(i) Verify that it is probability mass function.


(ii) Find the probability that there will be 3 or more calls.
SOLUTIONS
(i) The sample space for tossing four fair coins:
S = {HHHH, HHHT, HHTT, HHTH, HTHH, HTHT, HTHH, HTTT,
THHH, THHT, THTT, THTH, TTHH, TTHT, TTHH, TTTT}

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

probability that a continuous random assumes a particular value, a is zero.


EXAMPLES OF PDF
(i) Let x be a continuous random variable with probability density function,
 1 x  k , 0  x  3
f ( x)   6
 0 , elsewhere

Evaluate k and hence find P(1  x  2)


(ii) Determine the value of and hence compute the probabilities, P(1  x  2) and
P( x  2) .

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  xdx
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 , 0x3
 6 =2
 3
Hence, f ( x)   1 (4  x), 3  x  4
2

 0 , elsewhere
Cumulative distribution functions

• CDF for Discrete random • CDF for continuous


variables (pmf)
The cumulative distribution function (cdf) for a random variable x, denoted, F ( x) is random variables (pdf)
defined by F ( x)  P( X  x) .
If x is a discrete random variable with probability mass function, p( x) then,
x
F ( x)   p(t) , which is a step function. If X is, however, a continuous random variable with probability density function, f ( x)
t
x
, then F(x) =  f (t ) dt ,


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:

(i) F (a)  F(b), wherever a  b, and


(ii) The limit of F(x) to the left is 0 and to the right is 1. That is,
lim F ( x)  0 and lim F ( x)  1
x x 
examples

Given the probability mass function,

x 0 1 2 3
p( x) 1 1 1 1
4 8 2 8

Find the cumulative distribution function


Find the cumulative distribution functions of the following probability densit
 1 x , for 0  x  2
(i) f ( x)   2
 0, elsewhere
solution
3
F ( x)  P( X  x)   p ( x)
x 0

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

F (3)  P( X  3)  p(0)  p(1)  p(2)  p(3)  1  1  1  1  1  1 x2 , for 0  x  2


4 8 2 8 4
 1 , if x  2 and 0, elsewhere.
Hence the cumulative distribution is
0 1 2 3  1 x2 , 0  x  2
X  4
F ( x) 1 3 7 1 Hence, F ( x )   1 , x2
4 8 8  0 , x0

EXPECTATION OF RANDOM VARIAVLES
Expected Value and Variance of
Random Variables
 The expectation or expected value (or simply the mean) of the random variable, x is
defined by
(i)  = E ( x)   x p( x), if x is discrete.
x

b
(ii)  = E ( x)   x f ( x) dx, if x is continuous and    x   .

 The variance of the random variable, x with probability distribution, p( x) or f ( x ) is


defined by
 2  Var ( x)  E[( x   )2 ]  E ( x 2 )   2 , where

  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

The standard deviation of x is the square root x... That is,


 = Var (x)
examples
(a) Compute the expected value () and standard deviation (2) of the random
variable, x with the following probability distribution:
(i)
x 1 2 3 4 5
p( x) 0.1 0.3 0.2 0.3 0.1

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

probability distribution, p( x) or f ( x) is obtained by the equation:


m
(i)  p( x)  12 (or close to it), if x is discrete.
x

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

maximizes the probability distribution function, p( x) or f ( x ). If there is only one


such x, it is called the mode of the distribution.
examples

The weekly demand x for kerosene at a certain supply station has the probability
distribution,
 x , 0  x 1

f ( x)   1 , 1  x  2
2

 0 , otherwise.
(i) Determine the mean, median and the variance.
(ii) Find the mean and median of the distribution,
 1 ( x 1), x  3, 4, 5
p ( x)   9
 0 , elsewthere
solution
Let m be the median. Then,
 1 ( x 1) , x  3, 4, 5
 x , 0  x 1
1 1
(ii) p ( x)   9
 x dx  1 2 x 1
2


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)3  1 (2)2  1 (1)2


3 4 4 =
1
 x dx  
0
3
2

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

Let y have the probability distribution,


 y , 0  y  12

f ( y )    (4  y ) , 1 2  y  4
 0
 , elsewhere

(i) Find the value of, and


(ii) Use it to determine the mean, median and the standard deviation.
solution
(i) To find  we have,  y , 0  y  12

Hence, f ( y)   17 ( y  y) , 1 2  y  4
 f ( y) dy  1
4
 0 , elsewhere
0 
1 1 4
  E ( y ) =  y 2dy   1 y (4  y) dy

4
y dy +  1 (4  y) dy  1
2 2
(ii)
0
0 7 1
2
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

 174  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

4m  1 m2  9  m2 – 8m + 9 = 0 Hence, the standard deviation,  = 0.79167 = 0.88976


2
Solving we have m = 1.35.
THANK YOU

You might also like