Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

Week 10

Discrete & Continuous Random


variable
Aneela Zafar
Random Variable
• Random variable is a variable that assumes numerical values associated with
the random outcome of an experiment, where one (and only one) numerical
value is assigned to each sample point. Or
• A random variable is a numerical outcome of a random process or random
event
Example: three tosses of a coin
S = {HHH,THH,HTH,HHT,HTT,THT,TTH,TTT}
• Random variable X = number of observed Heads
• Possible values for X = {0,1, 2, 3}
Two Types of Random Variables
• A discrete random variable can assume a countable number of values.
e.g Number of steps to the top of the Eiffel tower
• A continuous random variable can assume any value along a given interval of a
number line.
e.g The time a tourist stays at the top once he gets there.
Probability Distribution for Discrete
Random Variables
The set of ordered pairs (x, f (x)) is a probability function, probability mass function, or
probability distribution of the discrete random variable X if, for each possible outcome x,
• f(x)≥0
• Σf(x) = 1
• P(X=x)=f(x)

Example
Find the probability distribution for the number of heads when two coins are
tossed.
Solution: Let X be the r.v, that denotes the number of heads. Then the values of x are
0,1,2 and their probabilities are:
S={HH,HT,TH,TT}
f(0)=P(X=0)=P(TT)=1/4 X P(X)
f(1)=P(X=1)=P(HT,TH)=2/4=1/2 0 1/4
f(2)=P(X=2)=P(HH)=1/4 1 2/4
2 1/4
The mean, or expected value, of a discrete random variable is
Mean=E(X)=ΣXP(X)
Variance of A Discrete Random Variable
Variance=E(X)2-[E(X)]2
= ΣX2P(X)-[ΣXP(X)]2
Practice Question
• Find the probability distribution for the
number of heads when two coins are tossed.
Also find Mean and variance of the random
variable.
•• Continuous
  random variables have a non-countable number
of values.
• Can’t list the entire probability distribution, so we use a
density curve instead of a histogram. E.g. normal density
curve.

The function f(x) is probability density function(pdf) for the


continuous random variable x defined over the set of real
numbers if
• f(x)≥0 for all x ɛ R

• P(a < X< b) =


Mean and Variance of continuous random variable

•• The
  expectation of a continuous random variable X with
probability density function f is the number
•  
EXAMPLE:
Find the expected value of the random variable X having the p.d.f.
f(x) = 2 (1 – x), 0 < x < 1
= 0,elsewhere.
Also find the variance.
SOLUTION:
•  

Now substituting values in var(X)


• Practice Question
Home Assignment
1) Find the probability distribution for the number of heads when three coins
are tossed.
2) Find mean and variance.
Number of 0 1 2 3
Heads (X)

Probability f(x) 1/8 3/8 3/8 1/8

3) Find mean and variance.


X 0 1 2
P(X=x) 1/4 1/2 1/2
Assignment Questions

Question 1: A random variable X is of continuous type with p.d.f.


•   f(x)=2x, 0<x<1,
=0, elsewhere
Find its mean and variance

Question 2: Find the mean and Variance of the random variable X having the p.d.f
f(x)=2(1-x) , 0<x<1
=0, elsewhere
Find its mean and variance

Question 3: A random variable X has a density function given by


f(x)= ) 0<x<1,
=0, elsewhere
Find its mean and variance

Question 4: Given the following function


f(x)= 0<x<2
=0, elsewhere
compute its mean.
Some Important properties of Expected Values

• E(a)=a where a is any constant


• E(ax+b)=aE(X)+b
• E(X+Y)=E(X)+E(Y)
• E(X-Y)=E(X)-E(Y)
• E(XY)=E(X).E(Y) If X & Y are independent

Some Important results about variance

• Var (X) can not be negative


• Var(a)=0 where a is any constant
• Var(ax)=a2Var(X)
• Var(aX+b)=a2Var(X) where a & b are constants

You might also like