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

Lect8 PDF

Uploaded by

Nuradriana09
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

Lect8 PDF

Uploaded by

Nuradriana09
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

TOPIC 8:TOPI

RANDOM VARIABLES SM025 TOPIC 8:TOPI


RANDOM VARIABLES SM025

8. RANDOM VARIABLES Types of random variables


Learning Outcomes: Discrete random variable Continuous random variable
 Has countable number of possible  Has uncountable number of
8.1 DISCRETE RANDOM VARIABLES outcomes that can be listed possible outcomes represent by
a) Construct probability distribution table and probability distribution function. (Lecture 1) interval on the number line
b) Find the cumulative distribution function. Examples: Examples:
c) Find probabilities from: (Lecture 2)  The number of cars sold at a  Time taken by workers to learn a
i. probability distribution table or function; and dealership during a given month. job.
ii. cumulative distribution function.
 The number of employees  Amount of water consumed by a
d) Find the expectation and variance of discrete random variables.
working at a company. family in each month of a year.
 The number of complaints  the height of students in a college.
8.2 CONTINUOUS RANDOM VARIABLES received at the office of an airline
a) Find the: (Lecture 3)
on a given day.
i. probability density function;
ii. cumulative distribution function. (Lecture 4)
b) Find the probabilities from probability density function and cumulative distribution function.
c) Find the probability density function from a cumulative distribution function and vice versa. Discrete random variables
(Lecture 5)
d) Compute the expectation and variance of continuous random variables.
Discrete random variables
8.1 DISCRETE RANDOM VARIABLES

Introduction to random variables Probability distribution function (pdf), Cumulative distribution function (cdf),

Definitions

Random variables (X) - function that assigns a numerical value to each simple event Probability Distribution Function
in a sample (eg: X, Y etc)
- ‘random’ indicates that X is determined by chance
 Discrete probability distribution - list of all the possible values of random variable
(associated with probability)
X with their corresponding probabilities.

 If X is a discrete random variable which takes values x1 , x2 , ......xk , then P( X  xi ) is


Random values (x) - characteristics or attribute that can assume different values i. e
the particular value of the random variable (eg: x, y etc) the respective probability of X, that is P( X  x1 ), P( X  x2 ),....., P( X  xk ) .

 The probability distribution of a discrete random variable possesses the following


characteristics:
Example 1
1. 0  P  X  xi   1
If two coins are tossed and a letter X is used to represent the number of heads.
k
2.  P X  x  1
i
Possible outcomes TT HT TH HH i 1

x 0 1 1 2
Therefore, x =

Nurul Ain Jalaludin_KMM Page 1 Nurul Ain Jalaludin_KMM Page 2


TOPIC 8:TOPI
RANDOM VARIABLES SM025 TOPIC 8:TOPI
RANDOM VARIABLES SM025

 The probability distribution can be presented in the forms of Cumulative Distribution Function
(a) table
(b) piecewise function  Cumulative distribution function of X, denoted by F  x  , is given by
(c) graph
F ( xn )  P( X  xn )
 mode = value of x that has the highest probability, P( X  x) xn
 to find probability = refer to the probability distribution table   P( X  x)  P  X  x1   P  X  x2   ....  P  X  xn 
x  x1

Example 2
Construct the probability distribution function, if two fair coins are tossed. Let X represents Median, m - value when (a) P  X  m   0.5 (using pdf)

the number of tail obtained. Then, sketch the graph of probability distribution function. (b) F  m   0.5 (using cdf)
Solution

 The cumulative distribution can be presented in the forms of


(a) table
(b) piecewise function
(c) graph

Example 6
The probability distribution function of a discrete random variable X is given in the table
below.

x 0 1 2 3
1 3 3 1
P  X  x
8 8 8 8

(a) Find the cumulative distribution function, F  x  .


(b) Sketch the graph F  x  .
(c) Find the median.

Solution

Nurul Ain Jalaludin_KMM Page 3 Nurul Ain Jalaludin_KMM Page 7


TOPIC 8:TOPI
RANDOM VARIABLES SM025 TOPIC 8:TOPI
RANDOM VARIABLES SM025

Methods to find probability from cumulative distribution function: Expectation of X (Discrete Random Variable)
(a) use cumulative distribution function formula
(b) convert cumulative distribution function to probability distribution function Expectation (or expected value or mean or average ) =  or E(X).

(a) use cdf formula n


1. E(X) =  xi P( X  xi )
i 1
1. P  X  a   P  X  a   P  X  a  1
2. E X 2    x P  X  x
2

 F  a   F  a  1
all x

3. Eg  X    g x P X  x .
all x

 Eg: P  X  3  F (3)  F (2)


2. P  X  a   1  P  X  a  Properties of expectation
 1 F a
1. E(a) = a, where a is constant.
2. E(aX) = a E(X), where a is a constant.
 Eg: P( X  4)  1  F (4) 3. E(aX  b) = a E(X)  b, where a and b are constants.
3. P( X  a)  PX  a  1
 F a  1
Note: The above properties of expectation are true for both discrete and continuous
random variables.
 Eg: P ( X  4)  F (3)
4. P  a  X  b   P  X  b   P  X  a 
Example 10
 F b  F  a 
The probability distribution of a discrete random variable X is given in the table below.

 Eg: P(5  X  7)  F (7)  F (5)


x 1 2 3
P( X = x) 1 2 3
5. Pa  X  b  PX  b  1  PX  a  1
6 6 6
 F b  1  F a  1
Find
 Eg: P(4  X  6)  F (5)  F (3) (a) E(X). (d) E(X2).
(b) E(2). (e) E(5X2 + 2).
6. P  a  X  b   P  X  b  1  P  X  a 
(c) E(5X – 2). (f) If Y=3X+1, find E(Y).
 F  b  1  F  a  Solution

 Eg: P(4  X  6)  F (5)  F (4)


7. P  a  X  b   P  X  b   P  X  a  1
 F (b)  F (a  1)
 Eg: P(2  X  6)  F (6)  F (1)

Nurul Ain Jalaludin_KMM Page 9 Nurul Ain Jalaludin_KMM Page 13


TOPIC 8:TOPI
RANDOM VARIABLES SM025 TOPIC 8:TOPI
RANDOM VARIABLES SM025

8.2 CONTINUOUS RANDOM VARIABLES

Continuous random variables

Probability density function (pdf), Cumulative distribution function (cdf),

Probability density function

 Continuous random variables are theoretical representations of continuous variables


such as height, mass or time.
Variance of Discrete Random Variable  A continuous random variable is specified by its probability density function which is
written as f ( x ) .
1. Variance = Var (X) or 2  This function is defined over the range  ,  .

Var (X) = E (X2) – [ E(X) ]2


If the probability density function for all x and then X is known

*Note: Variance of X is always positive as a continuous random variable.

2. Standard deviation = 

Standard deviation of X = Var ( X )

Properties of variance

1. Var (a) = 0 , where a is constant.


2. Var ( aX) = a2 Var (X) , where a is a constant.
3. Var ( aX  b) = a2 Var (X) , where a and b are constants.

Note: The above properties of variance are true for both discrete and continuous random
variables.

Nurul Ain Jalaludin_KMM Page 15 Nurul Ain Jalaludin_KMM Page 18


TOPIC 8:TOPI
RANDOM VARIABLES SM025 TOPIC 8:TOPI
RANDOM VARIABLES SM025

Notes: Cumulative Distribution Function

1. If X is a continuous random variable with probability density function f ( x ) , then Cumulative distribution function for a continuous random variable X with probability density
b function, f ( x ) is a function F ( x ) where
P(a  X  b)   f ( x)dx .
a

y x
y = f (x) F ( x)  P( X  x)   f (t )dt


Notice that the link with the formula for the discrete random variables, P(X=x) is replaced by

P (a x b) f (x ) and Σ by  .

x Notes:
0 a b 1. F ( x ) is in fact given by the area under the curve y = f (x ) from -∞ up to x as
b
Notice that  f ( x)dx is in fact the area enclosed by the curve y  f (x ) , x-axis, the indicated by the shaded region.
a

line x= a and x=b.


y
2. As P( X  k )  0 , where k is constant, then
P ( a  X  b)  P (a  X  b)
 P (a  X  b )
y = f (x)
 P (a  X  b ) F (x)
b 0 x x
  f ( x)dx
a

Unlike discrete distribution, we do not need to worry about inequalities. 2. F (-∞) = 0 and F(∞) =1

a 3. P ( X< a) = P( X ≤ a ) = F(a)
3. P  X  a  P  X  a   f ( x)dx


4. P( X  a )  P( X  a )  1  F (a )

4. P  X  a   P  X  a    f ( x)dx
a 5. P(a≤X≤b) =P(a<X≤b)
=P(a≤X<b)
5. mode = value of x that has the highest f(x) (from the pdf graph) =P(a<X<b)
= F (b) – F (a)
6. The probability density function can be presented in the forms of
(a) piecewise function
(b) graph

Nurul Ain Jalaludin_KMM Page 19 Nurul Ain Jalaludin_KMM Page 24


TOPIC 8:TOPI
RANDOM VARIABLES SM025 TOPIC 8:TOPI
RANDOM VARIABLES SM025

6. median = middle value (exactly half the data lying below that value and half lying above Example 6
that value).
X is a continuous random variable with probability density function
In the context of a probability density function, the median will be that point below
which the area is 0.5 and above which the area is also 0.5 .  ax , 0  x  1
1
In other words, the median divides the area under the curve into halves. 
f ( x)   a  3  x  , 1  x  3
2
If the median is m, then  0 , otherwise
m Find (a) the value of a.
(a) P(X  m) =  f ( x)dx  0.5 (using pdf)
 (b) F ( x ) .
(b) F (m) = 0.5 (using cdf) Solution

y
y = f (x)

a m x
b

7. Cumulative distribution function can be presented in the forms of


(a) piecewise function
(b) graph

Example 4
1
X is a continuous random variable with probability density function f (x ) = x,
8
where 0 ≤ x ≤ 4.
(a) Find the cumulative distribution function, F(x).
(b) Sketch the graphs of F ( x ) and f ( x ) .
(c) Calculate P(2 < X < 3) .
(d) Find the median of F ( x ) and mode.
Solution

Nurul Ain Jalaludin_KMM Page 25 Nurul Ain Jalaludin_KMM Page 29


TOPIC 8:TOPI
RANDOM VARIABLES SM025 TOPIC 8:TOPI
RANDOM VARIABLES SM025

Finding the probability density function from a cumulative distribution function and vice Expectation of X (Continuous Random Variable)
versa
Expectation (or expected value or mean or average) =  or E(X).

x
F ( x)   f (t)dt 1.

E ( X )   xf ( x) dx



integrate
2.   
E X 2    x 2 f ( x)dx

3.
differentiate

d
f ( x)   F ( x)  Properties of expectation
dx
1. E(a) = a, where a is constant.
2. E(aX) = a E(X), where a is a constant.
Example 7 3. E(aX  b) = a E(X)  b, where a and b are constants.

The continuous random variable X has a cumulative distribution function given by


0 , x0 Example 9
 x 3
F(x) =  , 0  x  3
 27 The probability density function of a continuous random variable X is defined as follows
 1 , x3
 x
 3, 0  x 1
(a) Find the probability density function, f(x).

(b) Sketch the function y  f ( x ) .  1 , 1 x  3
Solution f  x   3
1
 (4  x), 3  x  4
3
 0, otherwise
Find
(a) E ( X ) . (d) E (3 X  2) .
(b)  E ( X ) .
2
(e) E(2 X 2  5 X  1) .
(c) E ( X 2 ) .
Solution

Nurul Ain Jalaludin_KMM Page 30 Nurul Ain Jalaludin_KMM Page 33


TOPIC 8:TOPI
RANDOM VARIABLES SM025

Variance of Continuous Random Variable

1. Variance = Var (X) or 2


Var (X) = E (X2) – [ E(X) ]2

*Note : Variance of X is always positive

2. Standard deviation = 
Standard deviation of X = Var ( X )

Properties of variance

1. Var (a) = 0 , where a is constant.


2. Var ( aX) = a2 Var (X) , where a is a constant.
3. Var ( aX  b) = a2 Var (X) , where a and b are constants.

Note: The above properties of variance are true for both discrete and continuous random
variables.

Example 10
X is a continuous random variable with probability density function f(x).

x f ( x)dx  29 and
2
If Var (3X) = 36 ,


find the mean of X.

Solution

Nurul Ain Jalaludin_KMM Page 35

You might also like