outline random processes random variables probability histograms law of large numbers

33
Outline Outline Random processes Random variables Probability histograms Law of Large numbers

Upload: meghan-townsend

Post on 16-Jan-2016

232 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Outline Random processes Random variables Probability histograms Law of Large numbers

OutlineOutline

Random processes Random variables Probability histograms Law of Large numbers

Page 2: Outline Random processes Random variables Probability histograms Law of Large numbers

Random phenomenonRandom phenomenon

In random phenomena, the outcomes can occur with a certain probability, but we cannot predict which outcome will occur with certainty:

Tossing a coin

Waiting less or longer than 5 minutes for the L

Blood type of a selected donor.

Number of users of an Internet application at a given time.

Page 3: Outline Random processes Random variables Probability histograms Law of Large numbers

Random phenomena can be represented in a mathematical framework by

RANDOM VARIABLESRANDOM VARIABLES

For instance X = number of heads in 4 tosses of a coin. These are the possible outcomes:

HHTTHTHT

HTTT HTTH HHHTTHTT THHT HHTHTTHT THTH HTHH

TTTT TTTH TTHH THHH HHHHX=0 X=1 X=2 X=3 X=4

A probability value can be associated to each value of X.

Page 4: Outline Random processes Random variables Probability histograms Law of Large numbers

X 0 1 2 3 4

Probability 0.0625 0.25 0.375 0.25 0.0625

The outcome of 4 tosses of a coin changes from time to time, so the value of X (number of heads in 4 tosses) will change accordingly.

So if X=0, then no head comes up, so the probability is 1/16If X=1, then only one head come up, the probability is _1/4__If X=2, then 2 heads come up, the probability is _6/8__If X=3, then 3 heads come up, the probability is _1/4__If X=4, then 4 heads come up, the probability is _1/16__

HHTTHTHT

HTTT HTTH HHHTTHTT THHT HHTHTTHT THTH HTHH

TTTT TTTH TTHH THHH HHHHX=0 X=1 X=2 X=3 X=4

Page 5: Outline Random processes Random variables Probability histograms Law of Large numbers

Probability Histograms for discrete variablesProbability Histograms for discrete variables

The probability table associated to a random process or a random variable can be displayed as a probability histogram.

X 0 1 2 3 4

Probability 0.0625 0.25 0.375 0.25 0.0625

For example the probability histogram of the number of heads in 4 tosses of a coin is displayed below:

0 1 2 3 4

Chance 40 (%)

30

20

10

A probability histogram represents probabilities NOT data.The total area under the histogram is equal to 1

Page 6: Outline Random processes Random variables Probability histograms Law of Large numbers

Thus a random variable is a variable whose numerical values represent to the outcomes of a random phenomenon.

A discrete random variable has probability distribution given below in the probability table

X x1 x2 x3 x4 … xk

Probability p1 p2 p3 p4 … pk

With p1+p2+…pk =1

Page 7: Outline Random processes Random variables Probability histograms Law of Large numbers

Thus a random variable is a variable whose numerical outcomes are associated to the outcomes of a random phenomenon.

A discrete random variable has probability distribution given below probability table

X x1 x2 x3 x4 … xk

Probability p1 p2 p3 p4 … pk

The expected value is

kkX pxpxpxpx ...332211

The standard deviation is

kXkXXX pxpxpxpxXES 23

232

221

21 )(...)()()().(.

Page 8: Outline Random processes Random variables Probability histograms Law of Large numbers

Blockbuster rentalBlockbuster rental

X= number of videotapes rented by one customer from Blockbuster

X 0 1 2 3 4 5 6

Probability 0.04 0.26 0.36 0.20 0.08 0.04 0.02

Page 9: Outline Random processes Random variables Probability histograms Law of Large numbers

How do you compute the probability table of random How do you compute the probability table of random variables? variables?

The law of large numbersThe law of large numbers

A coin lands heads with probability =0.5

P(fair coin=heads)=0.5

If we toss a coin many times, say 1,000 times, we would expect to get 1,000/2 = 500 heads.

This rarely happens in nature. We will most likely see, for example 503 heads, 498 heads, 510 heads or 490 heads. This is because of chance variability:

“random” error = number of heads – half the number of tosses

Page 10: Outline Random processes Random variables Probability histograms Law of Large numbers

Example:Example:

For instance, in 1000 tosses we get 550 heads.

The error = 500 – 550= 50 tosses (in absolute terms)

But if we consider the percentages:

the “random” error is 50/1000=0.05 or 5% of the number of tosses

Page 11: Outline Random processes Random variables Probability histograms Law of Large numbers

Suppose 4 coins were tossed 1600 times each. The “random error” number of heads – half the number of tosses

was plotted against the number of tosses

Number of Tosses

Num

ber

of h

eads

min

usha

lf th

e nu

mbe

r of

toss

es

After 1600 tosses of a coin, the random errors for the four coins were: 30 = 830 – 800 –26= 774 – 800 –14= 786 –800 8= 808 – 800

After 400 tosses of a coin, the chance errors for the four coins were: 10 = 210 – 200 –8 = 192 – 200 –12 = 188 – 200 3= 203 – 200

Page 12: Outline Random processes Random variables Probability histograms Law of Large numbers

Number of Tosses

Per

cent

ages

of h

eads

–50%

Suppose 4 coins are tossed 1600 times each. Here are the percentages of heads plotted against the number of tosses

If a coin is tossed 400 times the percentage of heads is 50% give or take 4%If a coin is tossed 1600 times the percentage of heads is 50% give or take 2%

Page 13: Outline Random processes Random variables Probability histograms Law of Large numbers

The law of large numbersThe law of large numbers

“The longer a random process is repeated under the same conditions, the closer the observed proportion of each outcome occurrence is to the actual probability of occurrence.”

Casinos & insurance companies found their business on the law of large numbers!

A convenient way of representing a random phenomenon is through a random variable.

We can associate a variable to each random process. The values of such a variable are the possible outcomes of the random process.

Page 14: Outline Random processes Random variables Probability histograms Law of Large numbers

The law of large numbers: The law of large numbers: If the process is repeated many times, empirical histograms will converge to probability histograms. Suppose we toss 4 coins 20 times, 100 times and 1,000 times, and we count the number of heads. The empirical histograms below show the observed proportions of heads.

0 1 2 3 4

Chance 40

(%) 30

20

10

0 1 2 3 4

Percent 40

30

20

10

0 1 2 3 4

Percent 40

30

20

10

0 1 2 3 4

Percent 40

30

20

10

In 20 repetitions In 100 repetitions

In 1,000 repetitions Probability histogram

3/20

7/20 7/20

1/20 4/20

Page 15: Outline Random processes Random variables Probability histograms Law of Large numbers

Another example of random variableAnother example of random variableThe probability of being able to log on to a certain computer from a remote terminal is 0.7. Let X be the number of attempts that must be made before gaining access to the computer. Suppose your dial-up connection tries up to 5 times. The random process is described by the following table:

Attempts X 0 1 2

Probability 0.7 0.21 0.063

Attempts X 3 4 5

Probability 0.0189 0.00567 0.00243

The value X=0 means that the connection is established at the first attempt, X= 5 means that there was no connection after 5 attempts. (Try to compute the probabilities in the table)

6

5

4

3

2

1

0 1 2 3 4 5

Probability Probability histogram

Page 16: Outline Random processes Random variables Probability histograms Law of Large numbers

The observed proportions of attempts to log on to a computer for 25 times, 500 times and 5,000 times are displayed below (Obtained from simulations).

0.6

0.5

0.4

0.3

0.2

0.1

0 1 2 3 4 5

Histogram for 5,000 repetitions.

It has converged to the probability

histogram0.6

0.5

0.4

0.3

0.2

0.1

0 1 2 3 4 5

Histogram for 500 repetitions

0.6

0.5

0.4

0.3

0.2

0.1

0 1 2 3 4 5

Histogram for 25 repetitions

10/25

4/25

8/25

2/25

0/251/25

Proportion

Proportion

Proportion

Page 17: Outline Random processes Random variables Probability histograms Law of Large numbers

Expected value and standard deviationExpected value and standard deviation

A random process is observed. It produces a number, then another and another…

For instance consider the number of heads in 100 tosses. You might get 57, which is 7 heads above the expected value of 50Toss a coin 100 times again, you might get 55, which is 5 heads above 50Again… you might get 48, which is 2 heads below 50….and so on….

The numbers delivered by the process vary around the expected value, the amount off being similar in size to the standard deviation.

Thus in 100 tosses the expected value for the number of heads is 50. The standard deviation is a measure of the chance error.

We will now define these two quantities.

Page 18: Outline Random processes Random variables Probability histograms Law of Large numbers

The expected valueThe expected value

The number of heads in 4 tosses of a coin would be a number around 2.In statistical terms: The expected value of the number of heads in 4 tosses of a coin is 2.

It is calculated by multiplying each possible value by its probability, then adding all the products.

X 0 1 2 3 4

Probability 0.0625 0.25 0.375 0.25 0.0625

Expected value of X= 0*0.0625+1*0.25+2*0.375+3*0.25+4*0.0625=

= 0 + 0.25 + 0.75 +0.75 + 0.25 = 2

Page 19: Outline Random processes Random variables Probability histograms Law of Large numbers

Expected value and Probability HistogramExpected value and Probability Histogram

The expected value is the mean (average) of the probability histogram.The expected value is the mean (average) of the probability histogram.

0 1 2 3 4

Chance 40 (%)

30

20

10

The expected value of the number of heads in 4 tosses of a coin is 2.

X=2

Page 20: Outline Random processes Random variables Probability histograms Law of Large numbers

Average (expected) number of attempts

Attempts X 0 1 2

Probability 0.7 0.21 0.063

Attempts X 3 4 5

Probability 0.0189 0.00567 0.00243

6

5

4

3

2

1

0 1 2 3 4 5

Probability histogram

The expected value is computed by X= 0*0.7+1*0.21+2*0.63+3*0.0189+4*0.00567

+5*0.00243=1.56

X=1.56

Page 21: Outline Random processes Random variables Probability histograms Law of Large numbers

Expected value and expected payoff in gamblingExpected value and expected payoff in gambling

A game is fair if the expected value for the net gain equals 0: on the average players neither win or lose.

Keno: In the game Keno, there are 80 balls, numbered 1 to 80. On each play, the casino chooses 20 balls at random. Suppose you bet $1 on 17 in each Keno play. When you win, the casino gives you your dollar back and 2 dollars more When you lose, the casino keeps your dollar. The bet pays 3 to 1.Is the bet fair?

Create the random variable:Event Probability

X=+3 You win, 17 is among the 20 balls

20/80=0.25

X=–1 You lose, 17 is not among 20 balls

60/80=0.75

The expected value of X is –1*0.75+3*0.25=0. The game is fair!

Page 22: Outline Random processes Random variables Probability histograms Law of Large numbers

American RouletteAmerican Roulette The roulette wheel has 38 slots numbered 0,00, and 1 to 36.

A straight bet: bet on a single number – pays 35 to 1. A color bet: bet either on red or black – pays 1 to 1 (lose if 0, 00 comes up)A 4-number bet : bet on the four numbers in a square – pays 8 to 1.These are just a few possible bets, what is the expected payoff? Which bet would you expect to pay better?

Page 23: Outline Random processes Random variables Probability histograms Law of Large numbers

A straight bet: bet on a single number – pays 35 to 1. The random variable X that represents the bet is the dollar amount.

The expected payoff is the expected value μX=35*1/38+(–1)*37/38=–2/38=–0.0526In the long run, you will lose 5 cents for each dollar you bet.

A color bet: bet either on red or black – pays 1 to 1 (lose if 0, 00 comes up).

The expected payoff is the expected value μX=1*18/38+(–1)*20/38=–2/38=–0.0526In the long run, you will lose 5 cents for each dollar you bet.

The bet X on 17 Event Probability

X =35 Win, 17 comes out 1/38

X=–1 Lose, 17 does not come out 37/38

The bet X on red Event Probability

X =1 Win, a red number comes out 18/38

X=–1 Lose, a black number comes out 20/38

Page 24: Outline Random processes Random variables Probability histograms Law of Large numbers

A measure of the random error: the standard A measure of the random error: the standard deviationdeviation

In 4 tosses, the number of heads might be 3, which is 1 heads above the expected value of 2, or 1 which is 1 heads below 2…and so on

The number of heads in 4 tosses of a coin will be: number of heads X= expected value +chance error

So if we observe 3 heads, the chance error is +1; if we observe 1 head, the chance error is –1.

The chance error is measured by the standard deviation. The standard deviation is calculated

nxnxx pxpxpx 22

221

21 )(...)()(

Page 25: Outline Random processes Random variables Probability histograms Law of Large numbers

X 0 1 2 3 4

Probability 0.0625 0.25 0.375 0.25 0.0625

Deviations 0–2= –2 1–2 = –1 2–2=0 3–2=1 4–2=2

Square Deviations

(-2)2=4 (-1)2=1 (0)2=0 (1)2=1 (2)2=4

Products 4*0.0625= 0.25

1*0.25=0.25

0*0.375=0 1*0.25=0.25

4*0.0625= 0.25

The expected value is

Step 3: sum the products:(0.25+0.25+0.25+0.25)=1

Step 4: Take the square root

The standard deviation of X is sqrt(1)=1

The observed number of heads in 4 tosses of a coin is likely to be around 2, give or take 1.

2X

Xx

Page 26: Outline Random processes Random variables Probability histograms Law of Large numbers

Standard deviation and probability histogramsStandard deviation and probability histograms

The standard deviation measures the spread of the probability histogram.The standard deviation measures the spread of the probability histogram.

0 1 2 3 4

Chance 40 (%)

30

20

10

The standard deviation of the number of heads in 4 tosses of a coin is 0.5.

X=2

X–1s.e.=2 – 1=1X+1s.e.=2+1=3

1 s.e. 1 s.e.

Remark: Observed values are rarely more than 2 or 3 standard deviations away!!

Page 27: Outline Random processes Random variables Probability histograms Law of Large numbers

Standard deviation for number of attemptsStandard deviation for number of attempts

Attempts X 0 1 2

Probability 0.7 0.21 0.063

Attempts X 3 4 5

Probability 0.0189 0.00567 0.00243

6

5

4

3

2

1

0 1 2 3 4 5

Probability histogram

The expected value is X= 1.56

X=1.56

The S.D. = [(0–1.56)2*0.7+(1–1.56)2*0.21+(2–1.56)2*0.063+….+(5–1.56)2*0.00243]

= (1.70+0.066+0.012+0.039+0.034+0.029)= 1.37

Page 28: Outline Random processes Random variables Probability histograms Law of Large numbers

Standard deviations of bets for the American roulette.

A straight bet: The bet X on 17 Event Probability

X =35 Win, 17 comes out 1/38

X=–1 Lose, 17 does not come out 37/38

The bet X on red Event Probability

X =1 Win, a red number comes out 18/38

X=–1 Lose, a black number comes out 20/38

The expected payoff is the expected value μX =–0.0526

The standard deviation is =sqrt[(35–(–0.0526))2*1/38+ (–1+0.0526)2*37/38]=5.763

A color bet:

The expected payoff is the expected value μX=– 0.0526

The standard deviation is =sqrt[(1–(–0.0526))2*18/38+ (–1+0.0526)2*20/38]=0.997

Page 29: Outline Random processes Random variables Probability histograms Law of Large numbers

Thus the three bets have the same expected payoffs, but different standard deviations.

The straight bet has the highest standard deviation, it is the riskiest bet!!If you bet one dollar on the same number for many times, on average your gain will be a value in (μX–2S.D., μX+2S.D.), that is (-11.58$, 11.47$). You can lose or win up to 11 times your bet!!

In the color bet, the standard deviation is small. If you bet one dollar on red for many times, on average your gain will be a value in (-2.047$, 1.94$). You can lose or win up to 2 times your bet!

The standard deviation is measuring the risk in each bet!!!

Page 30: Outline Random processes Random variables Probability histograms Law of Large numbers

Remarks on random processesRemarks on random processes

An observed value should be somewhere around the expected value; the difference is random error.

The likely size of the random error is the standard deviation.

Observed values are rarely two or three standard deviations away from the expected value.

The standard deviation of random variables measures the random error.

The standard deviation “makes more sense” if the probability histogram of the random variable is bell-shaped, (similar to the normal distribution).

Page 31: Outline Random processes Random variables Probability histograms Law of Large numbers

Repetitions of a processRepetitions of a process

Suppose we play Keno 10 times. What is our expected payoff?

Event Probability

X=+3 You win, 17 is among the 20 balls 20/80=0.25

X=–1 You lose, 17 is not among 20 balls 60/80=0.75

In each game, the expected payoff is the expected value of X, X=0 and the standard deviation is 1.732.

What’s the expected payoff after 10 games? The payoff is the sum of the money won or lost in ten games. The expected gain in 10 plays of Keno is just the expected value X of 1 game times 10. The expected payoff in 10 plays of Keno is 10*0=0. In 10 plays, players are expected neither to win or lose.The standard deviation of 10 plays of Keno is the standard deviation of 1 play times the square root of 10, that is, in 10 plays the S.E. is 1.732* 10 =5.48. In 10 plays the gambler’s expected gain is 0, give or take 5.48.

Page 32: Outline Random processes Random variables Probability histograms Law of Large numbers

Sum of random variablesSum of random variablesThe betting problem is an example of a sum of random variables. In a game, the outcome of the random process is the (positive/negative) win X, the total win in 10 plays is the sum of the outcomes in each play.

Consider a random process, represented by the random variable X with expected value X and standard deviation σX .

Suppose the process is repeated under the same conditions n times,

The sum of the outcomes X has Expected value: X

* (total number of repetitions)= X * n

Standard deviation: nX

Page 33: Outline Random processes Random variables Probability histograms Law of Large numbers

ExampleExample

A coin is tossed 100 times, what is the expected number of heads?

Let X be head in one toss of a coin. So X = head 1 0

Probability 0.5 0.5

The expected value of X is X = 1*0.5+0.5*0=0.5 and

The standard deviation is sqrt{(1-0.5)2*0.5+(0-0.5)2*0.5}=0.5

In n=100 times the expected number of heads is X *n=0.5*100=50

With standard deviation equal to 0.5*sqrt(100) = 5

Notice that the standard deviation increases with the number of tosses

(repetitions of the process).