Download Discrete Random Variables

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Probability wikipedia , lookup

Statistics wikipedia , lookup

Randomness wikipedia , lookup

Transcript
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
 P(X = x) = 1/6 for x = 1, 2, 3, 4, 5, 6
This is the Probability
Function. It summarises
the data in the table.
8A
Discrete Random Variables
Discrete Random Variables
a)
Three fair coins are tossed. The number of
heads is counted.
a) Draw the sample space for this experiment.
 This shows all possibilities
b) Show this as a Probability Distribution
 The table summarises the Probabilities
c) Show this as a Probability Function
 This summarises the table. It is common
practice to include a ‘0’ probability at the
bottom.
b)
H
H
H
H
T
T
T
T
H
H
T
T
H
H
T
T
H
T
H
T
H
T
H
T
No. Heads, x
P(X = x)
These
Probabilities
will always
add up to 1
0
1
1/
3/
8
8
2
3
3/
1/
8
8
 1 , x  0,3
8

c) P( X  x)   3 , x  1, 2
8
 0, otherwise
8A
Discrete Random Variables
Discrete Random Variables
You will need to be able to calculate missing
values, based on the Probabilities adding up to
1.
a) Find the value of k in the table opposite
b) Complete the missing values in the table,
based on the value of k.
x
1
2
3
4
5
P(X = x)
0.2
k
0.1
0.2
3k
0.2 + k + 0.1 + 0.2 + 3k = 1
Group
together
like terms
4k + 0.5 = 1
- 0.5
4k = 0.5
÷4
k = 0.125
x
P(X = x)
1
2
0.2 0.125
3
0.1
4
5
0.2 0.375
8A
Discrete Random Variables
Discrete Random Variables
You will need to be able to calculate
missing values, based on the
Probabilities adding up to 1.
A tetrahedral (4 sided) dice is
numbered 1, 2, 3 and 4.
The probability of it landing on a given
side is k/x, where k is constant.
x
1
2
3
4
P(X = x)
k/
1
k/
2
k/
3
k/
4
Make the
denominators
equal
Now you can
group them
a) Draw the Probability Distribution of
P(X = x), in terms of k.
x 12
b) Calculate the value of k
÷ 25
k k k k
1
  
1 2 3 4
12 k 6k 4k 3k
1



12 12 12 12
25k
1
12
25k  12
k 
12
25
8A
Discrete Random Variables
Discrete Random Variables
You will need to be able to calculate missing
values, based on the Probabilities adding up
to 1.
A tetrahedral (4 sided) dice is numbered 1, 2,
3 and 4.
The probability of it landing on a given side is
k/ , where k is constant.
x
a) Draw the Probability Distribution of P(X =
x), in terms of k.
b) Calculate the value of k
x
1
2
3
4
P(X = x)
k/
1
k/
2
k/
3
k/
4
k 
12
25
x
1
2
3
4
P(X = x)
12/
25
6/
25
4/
25
3/
25
12
12
Half of /25 ÷ 3 /25 ÷ 4
12/
25
c) Draw the finished Probability Distribution
8A
Discrete Random Variables
Probability of multiple values
A discrete random variable X has the
Probability Distribution to the right
x
1
2
3
4
5
6
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
 0.75
b)
P(2  X  4)  0.2  0.3  0.25
 0.75
c)
P (3  X  6)  0.25  0.1  0.05
 0.4
d)
P( X  3)
 0.1  0.2
 0.3
‘Probability X is bigger
than 1 and less than 5’
‘Probability X is bigger
than or equal to 2 and
less than or equal to 4’
‘Probability X is bigger
than 3 and less than or
equal to 6’
‘Probability X is less
than 3’
8B
Discrete Random Variables
Probability of multiple values
You can also find the Cumulative
Distribution Function.
 If a value for X is x, the Probability
that X is less than or equal to x is
written as F(x).
 F(x) can be calculated by adding
together probabilities that are equal to
or less than x.
It can be included in the Probability
Distribution table.
You should see that F(x) = 1 for the
highest value of x
x
1
2
3
4
5
6
P(X = x)
0.1
0.2
0.3
0.25
0.1
0.05
F(x)
0.1
0.3
0.6
0.85 0.95
1
Add the probabilities as you go along
So F(1) = 0.1
‘The probability of X
being less than or equal
to 1 is 0.1’
F(4) = 0.85
‘The probability of X
being less than or equal
to 4 is 0.85’
8B
Discrete Random Variables
The Possibilities
Probability of multiple values
Two fair coins are tossed. X is the
number of heads showing on the coins.
Draw up a sample space and then a
Probability Distribution table. Include
the Cumulative Distribution Function.
HH
HT
TH
TT
No.
heads, x
0
1
2
P(X = x)
0.25
0.5
0.25
F(x)
0.25
0.75
1
8B
Discrete Random Variables
A discrete random variable X has a
Cumulative Distribution Function F(x)
defined by:
F ( x) 
(x  k)
; x  1, 2 and 3
8
3 is the
highest value
F (3)  1
Probability of multiple values
(3  k )
1
8
x8
Use x = 3
(3  k )  8
-3
k 5
a) Find the value of k.
b) Draw the Cumulative Distribution
Function table.
x
1
2
3
F(x)
6/
8
7/
8
1
c) What is the value of F(2.6)?
7
P( X  2.6) 
8
‘Probability X is
less than or equal
to 2.6’
( x  5)
F ( x) 
8
8B
Discrete Random Variables
Probability of multiple values
A discrete random variable X has a
Cumulative Distribution Function F(x)
defined by:
To the right is the Cumulative
Distribution Function from the previous
question.
a) Calculate the Probability Distribution
x
1
2
3
F(x)
6/
8
7/
8
1
P(X = x)
6/
8
1/
8
1/
8
6/ from
7/ to
The first To
value
getisfrom
To get
8 to
8
7
1
1
always the /same
1, we added
/8
/8
8, we added
7 6 18 7 1
 
 
8 8 88 8 8
8B
Discrete Random Variables
Calculating the Expected value
The table shows the number of
television sets per household, in a
survey of 100.
a) Calculate the mean for this data
No. sets
0
1
2
3
Frequency
10
75
10
5
x
n
0  75  20  15
100
110
100
1.1
8C
Discrete Random Variables
Calculating the Expected value
The table shows the number of
television sets per household, in a
survey of 100.
No. sets
0
1
2
3
Frequency
10
75
10
5
Mean = 1.1 sets
a) Calculate the mean for this data
b) Draw the probability distribution
for X where X is the number of TV
sets for a house picked at random.
x
0
1
2
3
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) is sometimes
called ‘the mean
of X’
E( X )   xp( x)
E ( X )  0  0.75  0.2  0.15
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
Finding the expected value of x
In order to calculate Standard
Deviation in these types of
question, we need to see how to
work out E(X2).
E( X )   xp( x)
a) Find the value of E(X)
x
1
P(X = x)
12/
25
2
6/
25
3
4/
25
4
3/
25
E( X )   xp( x)
6
12
4
3
E ( X )  (1 )  (2  ) (3  ) (4  )
25
25
25
25
E( X ) 
48
25
E ( X )  1.92
8C
Discrete Random Variables
The random variable X has the
following probability
distribution.
a) Given that E(X) = 3, write
down 2 equations involving p
and q.
x
1
2
3
4
5
p(x)
0.1
p
0.3
q
0.2
All the probabilities
add up to 1
0.1  p  0.3  q  0.2  1
p  q  0.6  1
p  q  0.4
Group
together the
numbers
Subtract 0.6
8C
Discrete Random Variables
The random variable X has the
following probability
distribution.
x
1
2
3
4
5
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
2 p  4q  1
Work out
each
bracket
Group
numbers
Subtract 2
3  (1 0.1)(2  p )(3  0.3)  (4  q ) (5  0.2)
3  0.1  2 p  0.9  4q  1
3  2 p  4q  2
1  2 p  4q
8C
Discrete Random Variables
The random variable X has the
following probability
distribution.
x
1
2
3
4
5
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
and q.
b) Use your equations to find
the values of p and q.
1
x2
4 - 3
p  q  0.4
2
2 p  4q  1
3
2 p  2q  0.8
4
2 p  4q  1
2q  0.2
q  0.1
p  0.3
8C
The Variance of X
The Variance of a set of data,
X, is given by;
x
1
P(X = x)
12/
25
2
6/
25
3
4/
25
4
3/
25
Var ( X )  E ( X 2 )  E ( X )2
E( X )   xp( x)
‘The expected value of X2
subtract the expected value of
X, squared’
6
12
4
3
E ( X )  (1 )  (2  ) (3  ) (4  )
25
25
25
25
a) Calculate E(X) and E(X2) for
the following set of data…
E( X ) 
48
25
E ( X )  1.92
8C
Discrete Random Variables
Finding the expected value of x2
In order to calculate Standard
Deviation in these types of
question, we need to see how to
work out E(X2).
E( X )   xp( x)
E ( X 2 )   x 2 p ( x)
a) Find the value of E(X)
E ( X )  1.92
b) Calculate E(X2)
E ( X 2 )  4.8
x
1
P(Xx=2 x)
12/
P(X = x)
12/
125
25
2
6/
425
6/
25
3
4/
925
4/
25
4
3/
1625
3/
25
E ( X 2 )   x 2 p ( x)
12
6
4
3
) (4  ) (9  ) (16  )
25
25
25
25
120
E( X 2 ) 
25
E ( X 2 )  (1
E ( X 2 )  4.8
Note that E(X2)
IS NOT E(X)
squared!
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
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’
a) Calculate E(X) and E(X2) for
the following set of data…
 E(X) = 2 1/6
x
1
2
3
4
x2
1
4
9
16
1/
1/
1/
P(X=x)
3
3
6
1/
6
E( X )   xp( x)
1  1  1  1 
E ( X )    1   2     3    4 
3  3  6  6 
1 2 3 4
E( X )  3  3  6  6
13
E( X )  6
1
2
E( X )  6
8D
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’
a) Calculate E(X) and E(X2) for
the following set of data…
 E(X) = 2 1/6
 E(X2) = 5 5/6
x
1
2
3
4
x2
1
4
9
16
1/
1/
1/
P(X=x)
3
3
6
1/
6
E ( X 2 )   x 2 p ( x)
1  1  1  1


1


9


4


16

E ( X )  3   3   6   6

 
 
 

1 4 9 16
2
E( X )  3  3  6  6
35
2
E( X )  6
5
2
5
E( X )  6
2
8D
Discrete Random Variables
The Variance of X
The Variance of a set of data, X, is
given by;
x
1
2
3
4
x2
1
4
9
16
1/
1/
1/
P(X=x)
3
3
6
1/
6
Var ( X )  E ( X 2 )  E ( X )2
X2
‘The expected value of
subtract
the expected value of X, squared’
a) Calculate E(X) and E(X2) for the
following set of data…
 E(X) = 2 1/6
 E(X2) = 5 5/6
b) Calculate the Variance of X
 1.14 (2dp)
Var ( X )  E ( X 2 )  E ( X )2
5  1
Var ( X )  5   2 
6  6
2
5
25
Var ( X )  5  4
6
36
5
Var ( X )  1
36
1.14 to 2dp
8D
Discrete Random Variables
Calculating E(X) and Var(X) for
functions of X
A rule relating E(X) and E(aX + b)
is;
E (aX  b)  aE ( X )  b
So whatever the value in
front of X is..
… Multiply E(X) by that
amount
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
Var (aX  b)  a 2Var ( X )
front of X is..
… Multiply Var(X) by the
square of that amount
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
functions of X
E (aX  b)  aE ( X )  b
Var (aX  b)  a Var ( X )
2
A random variable X has E(X) = 4, and
Var(X) = 3
Calculate:
a) E(3X) = 12
b) E(X – 2) = 2
c) Var(3X) = 27
d) Var (X - 2) = 3
e) E(X2)
a) E(3X)
 Multiply E(X) by 3
 12
b) E(X - 2)
 Subtract 2 from E(X)
2
c) Var(3X)
 Multiply Var(X) by 32
 27
d) Var(X - 2)
 Do nothing as it will not affect
spread…
3
8E
Discrete Random Variables
Calculating E(X) and Var(X) for
functions of X
E (aX  b)  aE ( X )  b
Var ( X )  E ( X 2 )  E ( X )2
3  E ( X )  42
2
Var (aX  b)  a Var ( X )
2
A random variable X has E(X) = 4, and
Var(X) = 3
Calculate:
a) E(3X) = 12
b) E(X – 2) = 2
c) Var(3X) = 27
d) Var (X - 2) = 3
e) E(X2) = 19
3  E ( X )  16
2
Add
16
2
E
(
X
)
19 
8E
Discrete Random Variables
Longer Example Question
Two fair 10p coins are
tossed. The random variable
X represents the value of
the coins that land heads
up.
a) Calculate E(X) and Var(X)
 E(X) = 10
x
0
10
20
x2
0
100
400
P(X=x)
1/
4
1/
2
1/
4
E( X )   xp( x)
1  1
 1

E ( X )    0    10     20 
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
Two fair 10p coins are
tossed. The random variable
X represents the value of
the coins that land heads
up.
a) Calculate E(X) and Var(X)
 E(X) = 10
 E(X2) = 150
x
0
10
20
x2
0
100
400
P(X=x)
1/
4
1/
2
1/
4
E ( X 2 )   x 2 p ( x)

1  1
 1


400


100

0
E( X )  

 
 4

 
4  2
2
E ( X 2 )  150
8E
Discrete Random Variables
Longer Example Question
Two fair 10p coins are
tossed. The random variable
X represents the value of
the coins that land heads
up.
a) Calculate E(X) and Var(X)
 E(X) = 10
 E(X2) = 150
 Var(X) = 50
x
0
10
20
x2
0
100
400
P(X=x)
1/
1/
4
Var ( X )  E ( X )  E ( X )
2
Var ( X )  150  10
1/
2
4
2
2
Var ( X )  50
8E
Discrete Random Variables
Longer Example Question
Two fair 10p coins are tossed.
The random variable X
represents the value of the
coins that land heads up.
a) Calculate E(X) and Var(X)
 E(X) = 10
 E(X2) = 150
 Var(X) = 50
b) Two random variables S and
T are defined as follows…
S = X – 10
E(S) = E(X) – 10
E(S) = 10 – 10
E(S) = 0
T = 1/2X – 5
E(T) = 1/2E(X) – 5
E(T) = (1/2 x 10) – 5
E(T) = 0
S = X – 10
T = 1/2X – 5
Show that E(S) = E(T)
8E
Discrete Random Variables
Longer Example Question
Two fair 10p coins are tossed.
The random variable X
represents the value of the
coins that land heads up.
S = X – 10
a) Calculate E(X) and Var(X)
T = 1/2X – 5
 E(X) = 10
 E(X2) = 150
 Var(X) = 50
Var(T) = (1/2)2Var(X)
b) Two random variables S and
T are defined as follows…
S = X – 10
T = 1/2X – 5
c) Find Var(S) and Var(T)
Var(S) = Var(X)
Var(S) = 50
Var(T) = (1/4)Var(X)
Var(T) = 12.5
E(S) and E(T) were the same for both, so on
average both will give the same overall result…
Var(S) is bigger than Var(T), so results for S will
be more varied…
8E