Contact Session 3b (Discrete Random Variable)
Contact Session 3b (Discrete Random Variable)
1
Variables and Random Variables
Earlier, we saw that just like in algebra, we can use a variable to represent some
quantity, such as height.
i.e. It is just like a variable in statistics,
! A random variable represents a single except each outcome has now been
assigned a probability.
experiment/trial. It consists of outcomes with
a probability for each.
1 2 3 4 5 6
0.3 0.2 0.1 0.25 0.05 0.1
3
Probability Distributions vs Probability Functions
There are two ways to write the mapping from outcomes to probabilities.
{
e.g. if , then the
𝑝 ( 𝑥 ) = 0.1 𝑥 , 𝑥 =1 , 2 , 3 , 4 probability is
¿ 0 , 𝑜𝑡h𝑒𝑟𝑤𝑖𝑠𝑒
Advantages of probability function:
Can have a rule/expression based on the outcome.
Particularly for continuous random variables (in S2), it
would be impossible to list the probability for every
Probability Distribution
outcome. More compact.
1 2 3 4
0.1 0.2 0.3 0.4
The table form that you know and love.
Advantages of distribution:
Probability for each outcome more explicit.
4
Example
The random variable represents the number of heads when three
coins are tossed.
{ HHH,
HHT,
HTT, Probability Function
HTH,
THH,
THT,
TTH,
TTT }
5
Question
(Hint: Use your knowledge
that )
6
Exercise (Solve Now)
The random variable X has a probability function
.
Show that
7
Exercise
The random variable X has a probability function:
where k is a constant.
8
Probabilities of ranges of values
1 2 3 4 5 6
0.1 0.2 0.3 0.25 0.1 0.05
9
Cumulative Distribution Function (CDF)
How could we express “the If X is the number of heads
probability that the age of someone thrown in 2 throws...
is at most 40”?
0 1 2
0.25 0.5 0.25
10
Example
The discrete random variable X has a cumulative distribution function
defined by:
; x = 1, 2 and 3
1
p(x)
F(x)
x 1 2 3
P(X = x) 0.4 0.25 0.35
= 0.4
1 2 3 4 6 8
0.1 0.6 0.3 0.5 0.25 0.25
𝐸 ( 𝑋 )= 2.2 𝐸 ( 𝑋 )=5.5
Tip: Suppose you treated the probabilities as
frequencies then found the mean of the ‘frequency
table’. What do you notice?
10 20 30
𝐸 ( 𝑋 )= 20
Tip: If the distribution is ‘symmetrical’, i.e. both the outcomes
and probabilities are symmetrical about the centre, then the
expected value is this central value. 15
Harder Example
1 2 3 4 5
Probabilities add to 1:
Expected value:
16