s1: chapter 8 discrete random variables

Post on 23-Feb-2016

107 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

S1: Chapter 8 Discrete Random Variables. Dr J Frost (jfrost@tiffin.kingston.sch.uk) . Last modified: 25 th October 2013. Variables and Random Variables. In Chapter 2, we saw that just like in algebra, we can use a variable to represent some quantity, such as height. - PowerPoint PPT Presentation

TRANSCRIPT

S1: Chapter 8Discrete Random Variables

www.drfrostmaths.com Dr J Frost (jfrost@tiffin.kingston.sch.uk)

Last modified: 12th January 2016

Variables and Random VariablesIn Chapter 2, we saw that just like in algebra, we can use a variable to represent some quantity, such as height.

1 2 3 4 5 6

0.3 0.2 0.1 0.25 0.05 0.1

! A random variable represents a single experiment/trial. It consists of outcomes with a probability for each.

i.e. It is just like a variable in statistics, except each outcome has now been assigned a probability.

๐‘ƒ (๐‘‹=๐‘ฅ )

โ€œThe probability thatโ€ฆ โ€ฆthe outcome of the random variable โ€ฆ

โ€ฆwas the specific outcome โ€

A shorthand for is ! (note the lowercase ).Itโ€™s like saying โ€œthe probability that the outcome of my coin throw was headsโ€ () vs โ€œthe probability of headsโ€ (). In the latter the coin throw was implicit.

i.e. is a random variable (capital letter), but is a particular outcome.

Is it a discrete random variable?

The height of a person randomly chosen.

The number of cars that pass in the next hour.

The number of countries in the world.

No Yes

No Yes

No Yes

This is a continuous random variable.

It does not vary, so is not a variable!

Probability Distributions vs Probability Functions

There are two ways to write the mapping from outcomes to probabilities.

๐‘ (๐‘ฅ )={0.1๐‘ฅ , ๐‘ฅ=1,2,3,4ยฟ0 , h๐‘œ๐‘ก ๐‘’๐‘Ÿ๐‘ค๐‘–๐‘ ๐‘’

Probability Functions

The โ€œ{โ€œ means we have a โ€˜piecewise functionโ€™. This just simply means we choose the function from a list depending on the input.

e.g. if , then the probability is

1 2 3 4

0.1 0.2 0.3 0.4?

Probability Distribution

The table form that you know and love.

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 outcome. More compact.

Advantages of distribution: Probability for each outcome more explicit.

?

?

Example

The random variable represents the number of heads when three coins are tossed.

Underlying Sample Space

{ HHH, HHT, HTT, HTH, THH, THT, TTH, TTT }

Probability Distribution

Num heads 0 1 2 3

?

?

Probability Function

?

Exam Question

(Hint: Use your knowledge that )

Edexcel S1 May 2012

p(-1) = 4k, p(0) = k, p(1) = 0, p(2) = kAnd since , 4k + k + 0 + k = 6k = 1Therefore ?

Exercise 8A

The random variable X has a probability function.Show that

The random variable X has a probability function:

where k is a constant.

a) Find the value of k.b) Construct a table giving the probability distribution of .

7a) k = 0.1257b)

5

7

x 1 2 3 4

P(X = x) 0.125 0.125 0.375 0.375?

Probabilities of ranges of values

1 2 3 4 5 60.1 0.2 0.3 0.25 0.1 0.05

???

?

Cumulative Distribution Function (CDF)

How could we express โ€œthe probability that the age of someone is at most 40โ€?

F is known as the cumulative distribution function, where

(note the capital F)

??

0 1 20.25 0.5 0.25

0 1 20.25 0.75 1

If X is the number of heads thrown in 2 throws...

? ? ?

? ? ?

The discrete random variable X has a cumulative distribution function defined by:

; x = 1, 2 and 3

Find the value of k.F(3) = 1. Thus k = 5.

Draw the distribution table for the cumulative distribution function.

Write down F(2.6)F(2.6) = F(2) = 7/8

Find the probability distribution of X.

Example

x 1 2 3F(x) 3/4 7/8 1? ? ?

a

x 1 2 3P(X=x) 3/4 1/8 1/8

b

c

d

? ? ?

?

?

CDF

Shoe Size (x)

p(x)

Shoe Size (x)

F(x)

1

Itโ€™s just like how weโ€™d turn a frequency graph into a cumulative frequency graph.

?

Exam Questions

Edexcel S1 May 2013 (R)

x 1 2 3

P(X = x) 0.4 0.25 0.35= 0.4?

?

Edexcel S1 Jan 2013

F(3) = 1, so (27 + k)/40 = 1, ...x 1 2 3

P(X = x) 0.35 0.175 0.475?

?

Exercise 8B

Q5-8

Expected Value, E[X]Suppose that we throw a single fair die 60 times, and see the following outcomes:

1 2 3 4 5 6

Frequency 9 11 10 8 12 10

What is the mean outcome based on our sample?

But using the actual probabilities of each outcome (i.e. 1/6 for each), what would we expect the average outcome to be?

3.5

! If is the random variable, is known as the expected value of .

It represents the mean outcome we would expect if we were to do our experiment lots of times.

?

?

Throw a lot of times.

For our fair die: ?

Quickfire E[X]Find the expected value of the following distributions (in your head!).

1 2 3

0.1 0.6 0.3

๐ธ ( ๐‘‹ )=2.2

4 6 8

0.5 0.25 0.25

๐ธ ( ๐‘‹ )=5.5

10 20 30

๐ธ ( ๐‘‹ )=20

? ?

?

Bro Tip: Suppose you treated the probabilities as frequencies then found the mean of the โ€˜frequency tableโ€™. What do you notice?

Bro 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.

Harder Example

1 2 3 4 5

Given that , find the values of and .

Probabilities add to 1:Expected value:

Solving simultaneous equations:

?Hint: Can you think of TWO ways we could get an equation relating and ?

To and beyond

Remember with the mean for a sample, we could find the โ€œmean of the squaresโ€ when finding variance, e.g. ? We just replaced each value with its square.

Unsurprisingly the same applies for the expected value of a random variable.Just replace with whatever is in the square brackets. Sorted!

1 2 3

0.1 0.5 0.4

๐ธ (๐‘‹ 2 )=(12ร—0.1 )+(22ร—0.5 )+ (32ร—0.4 )=5.7??

Variance

We know how to find it for experimental data. How about for a random variable?

Mean of the Squares Minus Square of the Mean

๐ธ (๐‘‹ 2 ) โ€“ ๐ธ ( ๐‘‹ )2? ? ?

1 2 3

0.1 0.5 0.4(We already worked out that )

๐‘‰๐‘Ž๐‘Ÿ ( ๐‘‹ )=๐Ÿ“ .๐Ÿ•โˆ’๐Ÿ .๐Ÿ‘๐Ÿ=๐ŸŽ .๐Ÿ’๐Ÿ

๐‘‰๐‘Ž๐‘Ÿ ( ๐‘‹ )=ยฟ

?

Exam Questions

Edexcel S1 May 2010

Edexcel S1 Jan 2009

a = 1/4

= 1

E[X2] = 3.1 So Var[X] = 3.1 โ€“ 12 = 2.1

= 1

= P(X <= 1.5) = P(X <= 1) = 0.7

E[X2] = 2. So Var[X] = 2 โ€“ 12 = 1

???

???

Exercise 8D

Coding!Oh dear god, not again...

Suppose that we have a list of peoples heights x. The mean height is 1.5m and the variance 0.2m. We use the coding :

Recap

Itโ€™s no different with expected values. What do we expect these to be in terms of the original expected value E[X] and the original variance Var[X]?

E[X + 10] = E[X] + 10E[3X] = 3E[X]

Var[3X] = 9Var[X]

???

Adding 10 to all values adds 10 to the expected value.

??

Quickfire CodingExpress these in terms of the original and .

๐ธ (4 ๐‘‹+1 )=4๐ธ ( ๐‘‹ )+1?

??

??

?

?

Exercise 8E

E[X] = 2, Var[X] = 6Finda) E[3X] = 3E[X] = 6 d) E[4 โ€“ 2X] = 4 โ€“ 2E[X] = 0f) Var[3X + 1] = 9Var[X] = 54

The random variable Y has mean 2 and variance 9.Find:a) E[3Y+1] = 3E[Y] + 1 = 7c) Var[3Y+1] = 9Var[Y] = 81e) E[Y2] = Var[Y] + E[Y]2 = 13f) E[(Y-1)(Y+1)] = E[Y2 โ€“ 1] = E[Y2] โ€“ 1 = 12

2

5

???

??

??

Bro Exam Tip: This has come up in exams multiple times.

S2 Preview

If X is the throw of a fair die, this obviously is its distribution...

We call this a discrete uniform distribution.?

If had say an -sided fair die, then:

๐ธ (๐‘‹ )=๐‘›+12

๐‘‰๐‘Ž๐‘Ÿ (๐‘‹ )=๐‘›2โˆ’112

You wonโ€™t have exam questions on these, but youโ€™ll revisit them in S2.

?

?

ExampleDigits are selected at random from a table of random numbers.a) Find the mean and standard deviation of a single digit.b) Find the probability that a particular digit lies within one standard deviation of the

mean.

a) Our digits are 0 to 9. We have useful formulae when the numbers start from 1 rather than 0. If the digit is R, let X = R + 1Then E[R] = E[X โ€“ 1] = E[X] โ€“ 1 = 11/2 โ€“ 1 = 4.5

Var[R] = Var[X โ€“ 1]= Var[X]= = 8.25So = 2.87 (to 2sf)

b) We want

?

?

top related