Professional Documents
Culture Documents
DEFINITION 1
Variable : defined as a characteristics or attribute that can assume different values.
Various letters of alphabet, such as X,Y or Z, are used to represent variables and its
corresponding small letter, 𝑥 , 𝑦, 𝑧 is used to represent a particular value of the random
variables.
DEFINITION 2
Random Variables: variables that possible values are numerical outcomes of a random
experiment. The value depends on chance.
Example :
If two coins are tossed, a letter ‘Y ’ can be used to represent the number of heads, in
this case 0, 1 or 2.
If the temperature (T) at 8.00 am is 43o and at noon it is 53o, then the values of the
temperature (T) assumes are said to be random, since they are due to various
atmospheric conditions at the time the temperature was taken.
NOTES!!
Since the variables are associated with probability, they are called random variables.
Example :
(b) The length of time a student spends in the library each week.
A set of all possible values that a random variable can take on together with the associated
probabilities is known as probability distribution.
Probability distribution function of the discrete random variable is denoted as 𝑃(𝑋 = 𝑥).
i. P(X=x) = f(x)
ii. 0 ≤ P(X=x) ≤ 1
iii. P( X x) 1
all x
NOTE!!!
P( X x) 1
all x
shows that X is a random variable.
The probability distribution can be presented in the form of table, graph and function:
Example:
The probability distribution function, if two fair coins are tossed is presented as below:.
a) Table
x 0 1 2
P X x 0.25 0.5 0.25
Notes!
We can check it is a probability distribution by finding the sum of the probabilities.
It should be 1.
SM025 | Mathematics 2 | 2023/2024 4
TOPIC 8: RANDOM VARIABLES
b) Graph
c) Function
ì1
ïï , x = 1
(
P X = x = í2)
ï 1 , x = 0,2
ïî 4
Example 1:
A fair die is rolled. If X represent the number on the die, show that X is a discrete random
variable.
Solution:
1
P(X = x) = 6 , for x = 1, 2, 3,4,5,6
Simply Means:
1 1 1 1 1 1
P(X = 1) = 6 , P(X = 2) = 6 , P(X = 3) = 6 , P(X = 4) = 6 , P(X = 5) = 6 , P(X = 6) = 6 .
1 1 1 1 1 1
P( X x) 6 6 6 6 6 6 1
all x
Example 2:
For the following probability distribution function, find the value of constant a.
P(Y = y) = a y , for y = 1, 2, 3, 4
Solution:
SM025 | Mathematics 2 | 2023/2024 5
TOPIC 8: RANDOM VARIABLES
Example 3:
The probability distribution function of a discrete random variable X is given by
x 1 2 3
P X x 2k 4k 9k 1
Example 4:
A fair die is rolled. If X represents the number on the die, show that X is a discrete random
variable.
Find P X 3 and P(1 X 5) .
Solution:
SM025 | Mathematics 2 | 2023/2024 6
TOPIC 8: RANDOM VARIABLES
Example 5:
3 fair coins are tossed. Let X be a discrete variable that is 'the number of head obtained when
the three coins are tossed’. Show that X is a random variable.
Solution:
Example 6:
The discrete random variable W has probability distribution function as shown
w -3 -2 -1 0 1
P(W = w) 0.1 0.25 0.3 0.15 d
Solution:
SM025 | Mathematics 2 | 2023/2024 7
TOPIC 8: RANDOM VARIABLES
Example 7:
A bag contains four pieces of red towels and three yellow towels. The towels are to be drawn
at random one by one without replacement from the bag until a piece of red towel is obtained.
If X is the total number of towels drawn from the bag:
(a) Obtain the probability distribution of X.
(b) Find P(1 X 3) .
Solution:
SM025 | Mathematics 2 | 2023/2024 8
TOPIC 8: RANDOM VARIABLES
Example 8:
Given the following probability distribution function, f(𝑥) for 𝑋.
Show that X is a random variable.
2
, for 𝑥 = 0,1,2,3
9
𝑓(𝑥) = { 1
, for 𝑥 = 4,5
18
Solution:
SM025 | Mathematics 2 | 2023/2024 9
TOPIC 8: RANDOM VARIABLES
Example 9:
The probability distribution function of a discrete random variable X is given by
P( X x) kx 2 for x 0,1, 2,3, 4 .
Solution:
SM025 | Mathematics 2 | 2023/2024 10
TOPIC 8: RANDOM VARIABLES
DEFINITION
The cumulative distribution function, F(t) is obtained by summing all the probabilities up to a
particular value, t .
F(t) = P(X t) = P( X x)
x x1
t = x1, x2,....,xn
NOTES!
i. P( X a ) F ( a )
ii. P( X a ) 1 P X a 1 F ( a )
iii. P( X a ) 1 P X a
iv. P(a X b) F (b) F (a)
v. If m is the median, P( X m) 0.5
Example:
For the following random variable X, where X is the score on an unbiased dice is given as
x 1 2 3 4 5 6
P( X = x) 1 1 1 1 1 1
6 6 6 6 6 6
a) Table Form
x 1 2 3 4 5 6
F( x) 1 1 1 2 5 1
6 3 2 3 6
b) Function Form:
0, x 1
1
, 1 x 2
6
1
, 2 x3
3
1
F ( x) , 3 x 4
2
2
3 , 4 x5
5 , 5 x6
6
1, x6
SM025 | Mathematics 2 | 2023/2024 11
TOPIC 8: RANDOM VARIABLES
c) graph:
Example 1 :
The probability distribution for random variable X is shown in the table. Construct the
cumulative distribution table and sketch the graph of cumulative distribution function.
x 0 1 2 3 4 5
P(X=x) 0.03 0.04 0.06 0.12 0.4 0.35
Solution:
SM025 | Mathematics 2 | 2023/2024 12
TOPIC 8: RANDOM VARIABLES
Example 2 :
The cumulative distribution function F(x) of a discrete random variable X is shown as below:
x 1 2 3 4 5
F x 0.2 0.32 0.67 0.9 1
a) Find:
(i) P X 3 (ii) P X 2
(iii) P 2 X 4 (iv) the median.
Example 3 :
The cumulative distribution function of a discrete random variable X is given in the table
below:
x 1 2 3 4 5
F(x) 0.05 0.3 0.6 0.75 1
Solution:
SM025 | Mathematics 2 | 2023/2024 14
TOPIC 8: RANDOM VARIABLES
μ = E (X ) = Σ x .P (X = x)
Var X , 2 E X 2 E ( X )
2
EX
2
where EX2 x P X x .
2
all x
Similarly E g X g x P X x .
all x
Example 1:
A random variable X has values x = -1,0,1,2 with the following probability distribution:
x -1 0 1 2
P(X=x) 1 1 1 1
3 3 6 6
Solution:
SM025 | Mathematics 2 | 2023/2024 15
TOPIC 8: RANDOM VARIABLES
Example 2:
A discrete random variable X has the following probability distribution:
x 1 2 t
P(X=x) 0.1 0.2 0.7
Solution:
SM025 | Mathematics 2 | 2023/2024 16
TOPIC 8: RANDOM VARIABLES
E (a) a
E (aX b) aE ( X ) b
Var (a) 0
Var (aX ) a 2Var ( X )
Var (aX b) a 2Var ( X ) where a is any constant.
Example 3:
A random variable X has probability distribution function
x
P( X x) , for x = 0, 1, 2, 3,4.
10
Find:
a) E(X) and Var (X)
b) E (3X) and Var (3X)
c) E (4+5X) and Var (4+5X)
d) E (1-X) and Var (1-X)
Solution:
SM025 | Mathematics 2 | 2023/2024 17
TOPIC 8: RANDOM VARIABLES
Example 4:
A computer is programmed to produce a sequence of integers, R, in the range 0 to 5
inclusive , with probability as shown below.
x 0 1 2 3 4 5
P( X = x) k 1 2 3 4 5
30 30 30 30 30
1
i) Show that k =
2
ii) Calculate the mean and variance of R
iii) Sketch the graph of probability distribution function.
Solution:
SM025 | Mathematics 2 | 2023/2024 18
TOPIC 8: RANDOM VARIABLES
Example 5:
The distribution of the number of muffins, X, bought by a customer at a particular shop is given below
x 1 2 3 4 5 6 >6
Probability 1 2 3 a 2 1 0
12 12 12 12 12
Solution:
SM025 | Mathematics 2 | 2023/2024 19
TOPIC 8: RANDOM VARIABLES
The probability that a continuous random variable X assumes a value within a certain interval [a,b] is
given by the area under the curve between the two limits of the interval. P(a £ X £ b) is area under
the curve from a to b.
The function f (x) that represents the probability distribution curve is called The Probability Density
Functions, f (x).
i) f(x) ≥ 0
ii)
f ( x)dx 1,
b
iii) P(a X b) f ( x)dx
a
NOTES!!
For Continuous Random Variables,
P(a X b) P(a X b)
P(a X b)
P(a X b)
Example 1:
Given
3 2
x , 1 x 2
f ( x) 7
0, otherwise
(a) Show that the function is the probability density function (p.d.f)
3
(b) P X
2
Solution:
SM025 | Mathematics 2 | 2023/2024 20
TOPIC 8: RANDOM VARIABLES
Example 2:
A continuous random variable X has probability density function
f ( x) kx3 , for 0 x 4 .
Find:
(a) the value of k
(b) P(1 X 3)
(c) P( X 2)
Solution:
SM025 | Mathematics 2 | 2023/2024 21
TOPIC 8: RANDOM VARIABLES
Example 3:
A random variable X has the following probability density function:
2(1 − 𝑥) , 0 £ 𝑥 < 1
𝑓(𝑥) = {
0, other
Solution:
SM025 | Mathematics 2 | 2023/2024 22
TOPIC 8: RANDOM VARIABLES
Example 4:
For the following probability density function of random variable X :
x
2, 0 x 1
x
f ( x) 1 , 3 x 6
6
0, others
a) Show that f (x) is a continuous random variable
b) Find P(0 X 4)
Solution:
SM025 | Mathematics 2 | 2023/2024 23
TOPIC 8: RANDOM VARIABLES
Example 5:
A random variable X has the following probability density function:
x
, 0 x 10
f ( x) 50
0, others
Solution:
SM025 | Mathematics 2 | 2023/2024 24
TOPIC 8: RANDOM VARIABLES
Example 6:
The continuous random variable X has probability density function
k ( x 1 ) , 0 x 2
f ( x ) 2k , 2 x3
0
, otherwise
Solution:
SM025 | Mathematics 2 | 2023/2024 25
TOPIC 8: RANDOM VARIABLES
If X is a continuous random variable with probability density function (p.d.f), f (x) defined for
a £ X £ b , then the cumulative distribution function is given by F(t) where
t
F (t ) P( X t ) f ( x)dx
NOTES!!
i. P(X ≤ a ) = F (a)
𝑚
F (m) = P(X m) = ∫−∞ 𝑓(𝑥)𝑑𝑥 = 0.5
a m x
b
d
f ( x) F ( x)
dx
SM025 | Mathematics 2 | 2023/2024 26
TOPIC 8: RANDOM VARIABLES
Example 1:
If X is a continuous random variable with probability density function
1
f (x) = x, where 0 x 4 .
8
Solution:
SM025 | Mathematics 2 | 2023/2024 27
TOPIC 8: RANDOM VARIABLES
Example 2:
If X is a continuous random variable with the following probability density function, find the
cumulative distribution function F(x).
1
2 , 1 x 2
1
f ( x) , 4 x 6
4
0, others
Solution:
SM025 | Mathematics 2 | 2023/2024 28
TOPIC 8: RANDOM VARIABLES
Example 3:
From the following cumulative distribution functions, determine the probability density function
0, x2
F ( x) 6 x x 8, 2 x 3
2
x3
1,
Solution:
SM025 | Mathematics 2 | 2023/2024 29
TOPIC 8: RANDOM VARIABLES
Example 4:
X is a continuous random variable with probability density function
1
f (x) = x, where 0 ≤ x ≤ 4.
8
Find the median.
Solution:
Example 5:
X is a continuous random variable with probability density function
1
f ( x) 4 x for 1 x 3 .
4
Find:
(a) the cumulative distribution function, F(x).
(b) 𝑃(|𝑋| ≤ 2)
(c) the median m .
Solution:
SM025 | Mathematics 2 | 2023/2024 30
TOPIC 8: RANDOM VARIABLES
Example 6:
The probability density function of a continuous random variable X is defined as
3
( x 2 )2 , 2 x 0
16
3
( x 2 )2
f(x) 16 , 0 x2
0 , otherwise
(a) Obtain the cumulative distribution function , F(x).
(b) Sketch the graphs f and F respectively.
(c) Find P( X > 1 ).
(d) Find the median from F(x).
Solution:
SM025 | Mathematics 2 | 2023/2024 31
TOPIC 8: RANDOM VARIABLES
Example 7:
The continuous random variable X has a cumulative distribution function given by
0 , x0
x 3
F(x) = , 0 x 3
27
1 , x3
Solution:
SM025 | Mathematics 2 | 2023/2024 32
TOPIC 8: RANDOM VARIABLES
Example 8:
The cumulative distribution function, F (x), of a continuous random variable X is defined as follows:
0, x 2
1
2 x , 2 x 0
12
x
F ( x) a , 0 x4
6
b x , 4 x6
12
1, 6 x
The expected value, E(X) and variance, Var (X) for continuous random variables as the following:
EX x f x dx
Var X , 2 E X 2 E ( X )
2
EX2
where
x 2 f ( x)dx .
Similarly E g X g ( x) f ( x)dx
*properties of E(X) and Var (X) are same for discrete and continuous random variable.
Example 1:
For the probability density function
1 1
x, 2 x 6
f ( x) 4 8
0, others
Solution:
SM025 | Mathematics 2 | 2023/2024 34
TOPIC 8: RANDOM VARIABLES
Example 2:
The continuous random variable has probability density function
1
f ( x ) x, where 0 x4.
8
Find:
a) E(X) b) E(X 2 )
c) Var (X) d) Var (3X + 2)
e) Standard deviation of X
Solution:
SM025 | Mathematics 2 | 2023/2024 35
TOPIC 8: RANDOM VARIABLES
Example 3:
Example 4:
A continuous random variable X has the following probability density function
2
( x 1) , 2 x 5
f ( x ) 7
0 , otherwise
Find:
(a) E ( X + 1 )
(b) E ( 2X )
(c) E ( 10 – X )
(d) E ( 3X 2 – 5 )
Solution:
SM025 | Mathematics 2 | 2023/2024 37
TOPIC 8: RANDOM VARIABLES
Example 5:
The continuous random variable Y has probability density function:
k (3 y 2 2), 2 y 3
f ( y)
0, otherwise
b) Find 𝑃(𝑌 ≥ 2)
c) Find 𝐸(2𝑌 + 2)
Solution:
SM025 | Mathematics 2 | 2023/2024 38
TOPIC 8: RANDOM VARIABLES
Example 6:
X is a continuous random variable with probability density function f(x).
∞
If ∫−∞ 𝑥 2 . 𝑓(𝑥)𝑑𝑥 = 29 and Var (3X) = 36 ,
Solution:
-End of Topic 8-