You are on page 1of 41

Discrete Random Variables

• This Chapter is on Discrete Random Variables

• We are going to learn what these are!

• We will look at Cumulative Distribution

• We will also be re-visiting Mean and Variance in


these situations

• We will look at Discrete Uniform Distribution


Discrete Random Variables
Explanation of Discrete Random Variables
Discrete Random Variables are linked to Probability.

A Discrete Random Variable can be obtained by real-world measurement. For


example, rolling a dice.

They must always be numerical values. For example, you could toss a coin and say
‘how many heads?’, the answer being 1 or 0.

However you could not say ‘heads or tails’ as these are not numerical.

The possibilities can only be whole numbers (discrete). There can be others but
these are not the focus of the chapter.

Summary  Discrete random variables allow us to calculate the expected outcomes


of events with given probabilities.

8A
Discrete Random Variables
Notation of Discrete Random Variables
A Capital letter, such as X, will be used for the random variable, and a lower case x for
a particular value of that variable.

P(X = x) means the Probability that the Random variable is equal to a particular value.

Rolling a Dice  ‘X’

P(X = 5) = 1/6
P(X > 4) = 2/6 = 1/3

Tossing a coin once  Number of heads  ‘X’

P(X = 0) = 1/2
P(X = 1) = 1/2

8A
Discrete Random Variables
Discrete Random Variables
A coin is tossed 6 times and the number of heads (X) is noted. What are the possible
values of X?

 0, 1, 2, 3, 4, 5, 6

Which of the following are Discrete Random Variables?

 The average height of a group of boys


 No as height is on a continuous scale

 The number of times a dice is rolled before a 2 appears


 Yes, it is numerical and comes from an experiment

 The number of months in a year


 No as it is fixed and therefore not random

8A
Discrete Random Variables
Discrete Random Variables
You can draw up a table to show the Probability Distribution of a discrete
Random Variable. This should be something you always do first if you are not
given it in the question.

A fair dice is rolled. Show the Probability of getting any number as a Probability
Distribution.

x 1 2 3 4 5 6

P(X = x) 1
/6 1
/6 1
/6 1
/6 1
/6 1
/6

This is the Probability


 P(X = x) = 1/6 for x = 1, 2, 3, 4, 5, 6 Function. It summarises
the data in the table.

8A
Discrete Random Variables
a) H H H
Discrete Random Variables H H T These
Three fair coins are tossed. The number of H T H Probabilities
heads is counted. H T T will always
T H H add up to 1
a) Draw the sample space for this experiment. T H T
T T H
 This shows all possibilities T T T

b) No. Heads, x 0 1 2 3
b) Show this as a Probability Distribution
P(X = x) 1
/8 3
/8 3
/8 1
/8
 The table summarises the Probabilities

 1 , x  0,3
c) Show this as a Probability Function 8

 This summarises the table. It is common c) P ( X  x )   3 , x  1, 2
practice to include a ‘0’ probability at the 8
bottom.  0, otherwise

8A
Discrete Random Variables
Discrete Random Variables
You will need to be able to calculate missing x 1 2 3 4 5
values, based on the Probabilities adding up to P(X = x) 0.2 k 0.1 0.2 3k
1.

Group 0.2 + k + 0.1 + 0.2 + 3k = 1


a) Find the value of k in the table opposite
together
like terms
4k + 0.5 = 1
b) Complete the missing values in the table,
based on the value of k. - 0.5
4k = 0.5
÷4
k = 0.125

x 1 2 3 4 5
P(X = x) 0.2 0.125 0.1 0.2 0.375

8A
Discrete Random Variables
Discrete Random Variables x 1 2 3 4
You will need to be able to calculate
P(X = x) k
/1 k
/2 k
/3 k
/4
missing values, based on the
Probabilities adding up to 1.
k k k k
   1
Make the 1 2 3 4
A tetrahedral (4 sided) dice is denominators
numbered 1, 2, 3 and 4. equal 12k 6k 4k 3k
   1
The probability of it landing on a given 12 12 12 12
side is k/x, where k is constant. Now you can
group them
25k
1
a) Draw the Probability Distribution of x 12 12
P(X = x), in terms of k.
25k  12
÷ 25
b) Calculate the value of k 12
k 
25
8A
Discrete Random Variables
Discrete Random Variables
x 1 2 3 4
You will need to be able to calculate missing
values, based on the Probabilities adding up P(X = x) k
/1 k
/2 k
/3 k
/4
to 1.
12
A tetrahedral (4 sided) dice is numbered 1, 2, k 
3 and 4.
25
The probability of it landing on a given side is
k
/x, where k is constant. x 1 2 3 4

P(X = x) 12
/25 6
/25 4
/25 3
/25
a) Draw the Probability Distribution of P(X =
x), in terms of k.

Half of /25 ÷ 3 /25 ÷ 4


12 12
b) Calculate the value of k
12
/25
c) Draw the finished Probability Distribution

8A
Discrete Random Variables
Probability of multiple values
x 1 2 3 4 5 6
A discrete random variable X has the
Probability Distribution to the right P(X = x) 0.1 0.2 0.3 0.25 0.1 0.05

Calculate:

a) P (1  X  5)  0.2  0.3  0.25 ‘Probability X is bigger


than 1 and less than 5’
 0.75
b)
P (2  X  4)  0.2  0.3  0.25 ‘Probability X is bigger
than or equal to 2 and
 0.75 less than or equal to 4’
c)
P (3  X  6)  0.25  0.1  0.05 ‘Probability X is bigger
than 3 and less than or
 0.4
equal to 6’
d)
P ( X  3)  0.1  0.2 ‘Probability X is less
than 3’
 0.3
8B
Discrete Random Variables
Probability of multiple values
You can also find the Cumulative x 1 2 3 4 5 6
Distribution Function.
P(X = x) 0.1 0.2 0.3 0.25 0.1 0.05
 If a value for X is x, the Probability F(x) 0.1 0.3 0.6 0.85 0.95 1
that X is less than or equal to x is
written as F(x). Add the probabilities as you go along

 F(x) can be calculated by adding


together probabilities that are equal to ‘The probability of X
or less than x. So F(1) = 0.1 being less than or equal
to 1 is 0.1’
It can be included in the Probability
Distribution table. ‘The probability of X
F(4) = 0.85 being less than or equal
to 4 is 0.85’
You should see that F(x) = 1 for the
highest value of x

8B
Discrete Random Variables
The Possibilities
Probability of multiple values
Two fair coins are tossed. X is the HH HT TH TT
number of heads showing on the coins.
Draw up a sample space and then a
Probability Distribution table. Include No.
the Cumulative Distribution Function. 0 1 2
heads, x
P(X = x) 0.25 0.5 0.25
F(x) 0.25 0.75 1

8B
Discrete Random Variables
F (3)  1 3 is the
Probability of multiple values
highest value
A discrete random variable X has a
Cumulative Distribution Function F(x) (3  k )
1 Use x = 3
defined by: 8
x8
(x  k) (3  k )  8
F ( x)  ; x  1, 2 and 3
8 -3
k 5
a) Find the value of k.

b) Draw the Cumulative Distribution x 1 2 3


Function table.
F(x) 6
/8 7
/8 1
c) What is the value of F(2.6)?
( x  5)
7 ‘Probability X is F ( x) 
P ( X  2.6)  8
8 less than or equal
to 2.6’
8B
Discrete Random Variables
Probability of multiple values x 1 2 3
A discrete random variable X has a
F(x) 6
/8 7
/8 1
Cumulative Distribution Function F(x)
defined by:
P(X = x) 6
/8 1
/8 1
/8

To the right is the Cumulative


Distribution Function from the previous
question. The first value
To getisfrom
To get
6
/8from
to 7/8 to
always the7same
/8, we added
1, we 1added
/8 1
/8
a) Calculate the Probability Distribution
7 6 18 7 1
   
8 8 88 8 8

8B
Discrete Random Variables
Calculating the Expected value No. sets 0 1 2 3
The table shows the number of Frequency 10 75 10 5
television sets per household, in a
survey of 100.
x
a) Calculate the mean for this data n
0  75  20  15
100
110
100

1.1
8C
Discrete Random Variables
Calculating the Expected value No. sets 0 1 2 3
The table shows the number of Frequency 10 75 10 5
television sets per household, in a
survey of 100. Mean = 1.1 sets

a) Calculate the mean for this data

b) Draw the probability distribution x 0 1 2 3


for X where X is the number of TV
sets for a house picked at random. p(x) 0.1 0.75 0.1 0.05
xp(x) 0 0.75 0.2 0.15
c) Calculate E(X), the expected value
of X.
E ( X )   xp( x)
E(X) is sometimes E ( X )  0  0.75  0.2  0.15
called ‘the mean
of X’ E ( X )  1.1
8C
Discrete Random Variables
Calculating the Expected value
If we know the probability distribution for a variable X, we can calculate the
expected value of X

The expected value is not necessarily a value which is possible

It is effectively the mean of the distribution (this will become clearer as we do


some questions)

Notation
E( X ) ‘The expected value of x’

E ( X )   xP ( X  x)

E ( X )   xp ( x) ‘The sum of (x multiplied by


the probability of x)’

8C
Discrete Random Variables
x 1 2 3 4
Finding the expected value of x
P(X = x) /25
12 6
/25 4
/25 /25
3

In order to calculate Standard


Deviation in these types of
question, we need to see how to E ( X )   xp ( x)
work out E(X2).
12 6 4 3
E ( X )   xp( x ) E ( X )  (1 ) (2  ) (3  ) (4  )
25 25 25 25
48
E( X ) 
a) Find the value of E(X) 25
E ( X )  1.92

8C
Discrete Random Variables
The random variable X has the
following probability x 1 2 3 4 5
distribution.
p(x) 0.1 p 0.3 q 0.2
a) Given that E(X) = 3, write
down 2 equations involving p
All the probabilities
and q.
add up to 1

0.1  p  0.3  q  0.2  1 Group


together the
p  q  0.6  1 numbers
Subtract 0.6
p  q  0.4

8C
Discrete Random Variables
The random variable X has the
following probability x 1 2 3 4 5
distribution.
p(x) 0.1 p 0.3 q 0.2
a) Given that E(X) = 3, write
down 2 equations involving p
and q.
E ( X )   xp( x)
p  q  0.4
Work out 3  (1 0.1) (2  p)(3  0.3)  (4  q ) (5  0.2)
each
2 p  4q  1 bracket 3  0.1  2 p  0.9  4q  1
Group
numbers
3  2 p  4q  2
Subtract 2
1  2 p  4q

8C
Discrete Random Variables
The random variable X has the
following probability x 1 2 3 4 5
distribution.
p(x) 0.1 p
0.3 0.3 q
0.1 0.2
a) Given that E(X) = 3, write
down 2 equations involving p p  q  0.4
1
and q.
2 2 p  4q  1
x2
b) Use your equations to find
the values of p and q.
3 2 p  2q  0.8
4 2 p  4q  1

4 - 3 2q  0.2
q  0.1
p  0.3
8C
x 1 2 3 4
The Variance of X
The Variance of a set of data, P(X = x) /25
12 6
/25 4
/25 /25
3

X, is given by;

Var ( X )  E ( X 2 )  E ( X )2 E ( X )   xp ( x)

‘The expected value of X2 12 6 4 3


E ( X )  (1 ) (2  ) (3  ) (4  )
subtract the expected value of 25 25 25 25
X, squared’
48
E( X ) 
a) Calculate E(X) and E(X2) for 25
the following set of data…
E ( X )  1.92

8C
Discrete Random Variables
Finding the expected value of x2 x 1 2 3 4

P(Xx=2 x) 12
/125 6
/425 4
/925 /25
3
16
In order to calculate Standard
Deviation in these types of P(X = x) 12
/25 6
/25 4
/25 /25
3

question, we need to see how to


work out E(X2). E ( X 2 )   x 2 p( x)
E ( X )   xp( x ) E ( X 2 )  (1
12 6 4 3
) (4  ) (9  ) (16  )
25 25 25 25
E ( X 2 )   x 2 p( x) 120
E( X 2 ) 
a) Find the value of E(X) 25
E ( X )  1.92 E ( X 2 )  4.8
Note that E(X2)
b) Calculate E(X2) IS NOT E(X)
squared!
E ( X 2 )  4.8
8C
Discrete Random Variables
The Variance of X
The Variance of a set of data,
X, is given by;

Var ( X )  E ( X 2 )  E ( X ) 2

‘The expected value of X2


subtract the expected value of
X, squared’

8D
Discrete Random Variables
x 1 2 3 4
The Variance of X
x2 1 4 9 16
The Variance of a set of data,
X, is given by; P(X=x) /3
1
/3
1 1
/6 /6
1

Var ( X )  E ( X 2 )  E ( X ) 2
E ( X )   xp( x)
‘The expected value of X2 1  1  1  1 
subtract the expected value of E ( X )   1   2     3    4 
X, squared’ 3  3  6  6 
1 2 3 4
E( X )  3  3  6  6
a) Calculate E(X) and E(X2) for
the following set of data… 13
 E(X) = 2 1/6 E( X )  6
1
E( X )  62
8D
Discrete Random Variables
x 1 2 3 4
The Variance of X
x2 1 4 9 16
The Variance of a set of data,
X, is given by; P(X=x) /3
1
/3
1 1
/6 /6
1

Var ( X )  E ( X 2 )  E ( X ) 2
E ( X 2 )   x 2 p( x)
‘The expected value of X2 1  1  1  1 
subtract the expected value of 2  1   4  
E ( X )  3   3   6   6 9   16 
X, squared’        
1 4 9 16
a) Calculate E(X) and E(X2) for
E( X )  3  3  6  6
2

the following set of data… 35


2
 E(X) = 2 1/6 E( X )  6
 E(X2) = 5 5/6
5
2
E( X )  65
8D
Discrete Random Variables
x 1 2 3 4
The Variance of X
The Variance of a set of data, X, is x2 1 4 9 16
given by;
P(X=x) 1
/3 1
/3 1
/6 /6
1

Var ( X )  E ( X 2 )  E ( X ) 2
‘The expected value of X subtract
2
Var ( X )  E ( X 2 )  E ( X ) 2
the expected value of X, squared’
2
5  1
a) Calculate E(X) and E(X2) for the Var ( X )  5   2 
following set of data… 6  6
 E(X) = 2 1/6
 E(X2) = 5 5/6 5 25
Var ( X )  5  4
6 36
b) Calculate the Variance of X
 1.14 (2dp) 5
Var ( X )  1 1.14 to 2dp 
36
8D
Discrete Random Variables
Calculating E(X) and Var(X) for
functions of X

A rule relating E(X) and E(aX + b)


is; So whatever the value in
front of X is..
… Multiply E(X) by that
amount
E (aX  b)  aE ( X )  b
And whatever the value
of b is…
… Add it on afterwards

8E
Discrete Random Variables
Calculating E(X) and Var(X) for
functions of X

A rule relating Var(X) and Var(aX + b)


is; So whatever the value in
front of X is..
… Multiply Var(X) by the
square of that amount
Var (aX  b)  a 2Var ( X )
And whatever the value
of b is…
Ignore it as it will not
affect the spread of
data…

8E
Discrete Random Variables
Calculating E(X) and Var(X) for a) E(3X)
functions of X  Multiply E(X) by 3
 12
E (aX  b)  aE ( X )  b
2
b) E(X - 2)
Var (aX  b)  a Var ( X )  Subtract 2 from E(X)
2
A random variable X has E(X) = 4, and
Var(X) = 3 c) Var(3X)
 Multiply Var(X) by 32
Calculate: a) E(3X)
= 12
 27
b) E(X – =2)2
c) Var(3X)
= 27 d) Var(X - 2)
d) Var (X - =2)3
 Do nothing as it will not affect
e) E(X2) spread…
3
8E
Discrete Random Variables
Calculating E(X) and Var(X) for
functions of X
Var ( X )  E ( X 2 )  E ( X ) 2
E (aX  b)  aE ( X )  b
2
2
Var (aX  b)  a Var ( X ) 3  E ( X )  42
2
A random variable X has E(X) = 4, and 3  E ( X )  16
Add
Var(X) = 3
16
19  E ( X 2 )
Calculate: a) E(3X)
= 12
b) E(X – =2)2
c) Var(3X)
= 27
d) Var (X - =2)3
e) E(X=2)19

8E
Discrete Random Variables
Longer Example Question x 0 10 20
Two fair 10p coins are x2 0 100 400
tossed. The random variable
X represents the value of P(X=x) 1
/4 1
/2 1
/4
the coins that land heads
up.
E ( X )   xp( x)
a) Calculate E(X) and Var(X)
1  1  1 
E ( X )    0     10     20 
 E(X) = 10 4  2  4 

E ( X )  10

When the data is symmetrical, E(X) is


just the middle value!
8E
Discrete Random Variables
Longer Example Question x 0 10 20
Two fair 10p coins are x2 0 100 400
tossed. The random variable
X represents the value of P(X=x) 1
/4 1
/2 1
/4
the coins that land heads
up.
E ( X 2 )   x 2 p( x)
a) Calculate E(X) and Var(X)
1  1  1 
2
E( X )    0 
   100 
 4  400 
 E(X) = 10 4  2   
 E(X2) = 150
E ( X 2 )  150

8E
Discrete Random Variables
Longer Example Question x 0 10 20
Two fair 10p coins are x2 0 100 400
tossed. The random variable
X represents the value of P(X=x) 1
/4 1
/2 1
/4
the coins that land heads
up.
2 2
a) Calculate E(X) and Var(X)
Var ( X )  E ( X )  E ( X )
2
Var ( X )  150  10
 E(X) = 10
 E(X2) = 150 Var ( X )  50
 Var(X) = 50

8E
Discrete Random Variables
Longer Example Question S = X – 10
Two fair 10p coins are tossed.
The random variable X E(S) = E(X) – 10
represents the value of the
coins that land heads up.
E(S) = 10 – 10
E(S) = 0
a) Calculate E(X) and Var(X)

 E(X) = 10
 E(X2) = 150 T = 1/2X – 5
 Var(X) = 50
E(T) = 1/2E(X) – 5
b) Two random variables S and E(T) = (1/2 x 10) – 5
T are defined as follows…
E(T) = 0
S = X – 10
T = 1/2X – 5

Show that E(S) = E(T)


8E
Discrete Random Variables
Longer Example Question S = X – 10
Two fair 10p coins are tossed.
The random variable X Var(S) = Var(X)
represents the value of the
coins that land heads up.
Var(S) = 50

a) Calculate E(X) and Var(X)


T = 1/2X – 5
 E(X) = 10 Var(T) = (1/2)2Var(X)
 E(X2) = 150
 Var(X) = 50 Var(T) = (1/4)Var(X)
Var(T) = 12.5
b) Two random variables S and
T are defined as follows…
E(S) and E(T) were the same for both, so on
average both will give the same overall result…
S = X – 10
T = 1/2X – 5 Var(S) is bigger than Var(T), so results for S will
be more varied…
c) Find Var(S) and Var(T)
8E

You might also like