Discrete Random Variables; Expectation Spring 2014 Jeremy Orloff and Jonathan Bloom

Similar documents
MA 1125 Lecture 14 - Expected Values. Friday, February 28, Objectives: Introduce expected values.

Statistics 100A Homework 3 Solutions

Section 7C: The Law of Large Numbers

Question: What is the probability that a five-card poker hand contains a flush, that is, five cards of the same suit?

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 13. Random Variables: Distribution and Expectation

Ch. 13.2: Mathematical Expectation

Bayesian Updating with Discrete Priors Class 11, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Betting systems: how not to lose your money gambling

Section 6.1 Discrete Random variables Probability Distribution

Chapter 4 Lecture Notes

Elementary Statistics and Inference. Elementary Statistics and Inference. 16 The Law of Averages (cont.) 22S:025 or 7P:025.

V. RANDOM VARIABLES, PROBABILITY DISTRIBUTIONS, EXPECTED VALUE

Ch. 13.3: More about Probability

Random variables, probability distributions, binomial random variable

The Math. P (x) = 5! = = 120.

ST 371 (IV): Discrete Random Variables

Week 5: Expected value and Betting systems

Automatic Bet Tracker!

Solutions: Problems for Chapter 3. Solutions: Problems for Chapter 3

We rst consider the game from the player's point of view: Suppose you have picked a number and placed your bet. The probability of winning is

Probability Models.S1 Introduction to Probability

36 Odds, Expected Value, and Conditional Probability

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 10

Chapter 3: DISCRETE RANDOM VARIABLES AND PROBABILITY DISTRIBUTIONS. Part 3: Discrete Uniform Distribution Binomial Distribution

Statistics and Random Variables. Math 425 Introduction to Probability Lecture 14. Finite valued Random Variables. Expectation defined

6.042/18.062J Mathematics for Computer Science. Expected Value I

The overall size of these chance errors is measured by their RMS HALF THE NUMBER OF TOSSES NUMBER OF HEADS MINUS NUMBER OF TOSSES

THE WINNING ROULETTE SYSTEM by

Probability and Expected Value

Easy Casino Profits. Congratulations!!

Probability: The Study of Randomness Randomness and Probability Models. IPS Chapters 4 Sections

Math Quizzes Winter 2009

REPEATED TRIALS. The probability of winning those k chosen times and losing the other times is then p k q n k.

Definition and Calculus of Probability

Law of Large Numbers. Alexandra Barbato and Craig O Connell. Honors 391A Mathematical Gems Jenia Tevelev

Discrete Math in Computer Science Homework 7 Solutions (Max Points: 80)

Expected Value and the Game of Craps

13.0 Central Limit Theorem

Decision Making under Uncertainty

HONORS STATISTICS. Mrs. Garrett Block 2 & 3

2. How many ways can the letters in PHOENIX be rearranged? 7! = 5,040 ways.

Beating Roulette? An analysis with probability and statistics.

Mathematical goals. Starting points. Materials required. Time needed

6.3 Conditional Probability and Independence

This Method will show you exactly how you can profit from this specific online casino and beat them at their own game.

Probabilistic Strategies: Solutions

Chapter 16: law of averages

WHERE DOES THE 10% CONDITION COME FROM?

Comparison of frequentist and Bayesian inference. Class 20, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Conditional Probability, Independence and Bayes Theorem Class 3, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Binomial lattice model for stock prices

Math 408, Actuarial Statistics I, Spring Solutions to combinatorial problems

(SEE IF YOU KNOW THE TRUTH ABOUT GAMBLING)

Expected Value. 24 February Expected Value 24 February /19

ECE302 Spring 2006 HW3 Solutions February 2,

Week 4: Gambler s ruin and bold play

Elementary Statistics and Inference. Elementary Statistics and Inference. 17 Expected Value and Standard Error. 22S:025 or 7P:025.

3.2 Roulette and Markov Chains

Math 431 An Introduction to Probability. Final Exam Solutions

Expected Value and Variance

X: Probability:

For a partition B 1,..., B n, where B i B j = for i. A = (A B 1 ) (A B 2 ),..., (A B n ) and thus. P (A) = P (A B i ) = P (A B i )P (B i )

Prospect Theory Ayelet Gneezy & Nicholas Epley

R Simulations: Monty Hall problem

Midterm Exam #1 Instructions:

The Normal Approximation to Probability Histograms. Dice: Throw a single die twice. The Probability Histogram: Area = Probability. Where are we going?

MOVIES, GAMBLING, SECRET CODES, JUST MATRIX MAGIC

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Introduction to Matrices

Probability: Terminology and Examples Class 2, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

AMS 5 CHANCE VARIABILITY

FACT A computer CANNOT pick numbers completely at random!

REWARD System For Even Money Bet in Roulette By Izak Matatya

Math/Stats 425 Introduction to Probability. 1. Uncertainty and the axioms of probability

MATH 140 Lab 4: Probability and the Standard Normal Distribution

Random Variables. Chapter 2. Random Variables 1

ECE302 Spring 2006 HW4 Solutions February 6,

Random variables P(X = 3) = P(X = 3) = 1 8, P(X = 1) = P(X = 1) = 3 8.

MONT 107N Understanding Randomness Solutions For Final Examination May 11, 2010

AP Stats - Probability Review

Expected Value and Variance

Chapter 13 & 14 - Probability PART

1 Combinations, Permutations, and Elementary Probability

Would You Like To Earn $1000 s With The Click Of A Button?

Feb 7 Homework Solutions Math 151, Winter Chapter 4 Problems (pages )

Example: Find the expected value of the random variable X. X P(X)

Stochastic Processes and Advanced Mathematical Finance. Ruin Probabilities

THE ROULETTE BIAS SYSTEM

Probability. Sample space: all the possible outcomes of a probability experiment, i.e., the population of outcomes

Midterm Exam #1 Instructions:

Unit 4 The Bernoulli and Binomial Distributions

Thursday, November 13: 6.1 Discrete Random Variables

Question 1 Formatted: Formatted: Formatted: Formatted:

Example. A casino offers the following bets (the fairest bets in the casino!) 1 You get $0 (i.e., you can walk away)

Practical Probability:

Statistics 100A Homework 4 Solutions

In the situations that we will encounter, we may generally calculate the probability of an event

Lecture Note 1 Set and Probability Theory. MIT Spring 2006 Herman Bennett

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

4. Binomial Expansions

Transcription:

Discrete Random Variables; Expectation 18.05 Spring 2014 Jeremy Orloff and Jonathan Bloom This image is in the public domain. http://www.mathsisfun.com/data/quincunx.html http://www.youtube.com/watch?v=9xubhhm4vbm

Board Question: Evil Squirrels One million squirrels, of which 100 are pure evil! Events: E = evil, G = good, A = alarm sounds Accuracy: P(A E ) =.99, P(A G ) =.01. a) A squirrel sets off the alarm, what is the probability that it is evil? b) Is the system of practical use? answer: a) Let E be the event that a squirrel is evil. Let A be the event that the alarm goes off. By Bayes Theorem, we have: P(A E )P(E ) P(E A) = P(A E )P(E ) + P(A E c )P(E c ).99 100 1000000 = 100 +.01 999900.99 1000000 1000000.01. b) No. The alarm would be more trouble than its worth, since for every true positive there are about 99 false positives. May 27, 2014 2 / 28

Big point Evil Nice Alarm 99 9999 10098 No alarm 1 989901 989902 100 999900 1000000 Summary: 99+989901 Probability a random test is correct = =.99 1000000 Probability a positive test is correct = 99.01 10098 These probabilities are not the same! May 27, 2014 3 / 28

Table Question: Dice Game 1 The Randomizer holds the 6-sided die in one fist and the 8-sided die in the other. 2 The Roller selects one of the Randomizer s fists and covertly takes the die. 3 The Roller rolls the die in secret and reports the result to the table. Given the reported number, what is the probability that the 6-sided die was chosen? answer: If the number rolled is 1-6 then P(six-sided) = 4/7. If the number rolled is 7 or 8 then P(six-sided) = 0. Explanation on next page May 27, 2014 4 / 28

Dice Solution This is a Bayes formula problem. For concreteness let s suppose the roll was a 4. What we want to compute is P(6-sided roll 4). But, what is easy to compute is P(roll 4 6-sided). Bayes formula says P(roll 4 6-sided)P(6-sided) P(6-sided roll 4) = P(4) (1/6)(1/2) = = 4/7. (1/6)(1/2) + (1/8)(1/2) The denominator is computed using the law of total probability: 1 1 1 1 P(4) = P(4 6-sided)P(6-sided) + P(4 8-sided)P(8-sided) = +. 6 2 8 2 Note that any roll of 1,2,... 6 would give the same result. A roll of 7 (or 8) would give clearly give probability 0. This is seen in Bayes formula because the term P(roll 7 6-sided) = 0. May 27, 2014 5 / 28

Reading Review Random variable X assigns a number to each outcome: X : Ω R X = a denotes the event {ω X (ω) = a}. Probability mass function (pmf) of X is given by p(a) = P(X = a). Cumulative distribution function (cdf) of X is given by F (a) = P(X a). May 27, 2014 6 / 28

Example from class Suppose X is a random variable with the following table. values of X : -2-1 0 1 2 pmf p(a): 1/5 1/5 1/5 1/5 1/5 cdf F (a): 1/5 2/5 3/5 4/5 5/5 The cdf is the probability accumulated from the left. Examples. F ( 1) = 2/5, F (1) = 4/5, F (1.5) = 4/5, F ( 5) = 0, F (5) = 1. Properties of F (a): 1. Nondecreasing 2. Way to the left, i.e. as a ), F is 0 3. Way to the right, i.e. as a, F is 1. May 27, 2014 7 / 28

Concept Question: cdf and pmf X a random variable. values of X : 1 3 5 7 cdf F (a):.5.75.9 1 1. What is P(X 3)? a).15 b).25 c).5 d).75 2. What is P(X = 3) a).15 b).25 c).5 d).75 1. answer: (d).75. P(X 3) = F (3) =.75. 2. answer: (b) P(X = 3 =.75 -.5 =.25. May 27, 2014 8 / 28

CDF and PMF.9 1.75.5 F (a) 1 3 5 7 a.5 p(a).25.15 1 3 5 7 a May 27, 2014 9 / 28

Deluge of discrete distributions Bernoulli(p) = 1 (success) with probability p, 0 (failure) with probability 1 p. In more neutral language: Bernoulli(p) = 1 (heads) with probability p, 0 (tails) with probability 1 p. Binomial(n,p) = # of successes in n independent Bernoulli(p) trials. Geometric(p) = # of tails before first heads in a sequence of indep. Bernoulli(p) trials. (Neutral language avoids confusing whether we want the number of successes before the first failure or vice versa.) May 27, 2014 10 / 28

Concept Question 1. Let X binom(n, p) and Y binom(m, p) be independent. Then X + Y follows: a) binom(n + m, p) b) binom(nm, p) c) binom(n + m, 2p) d) other 2. Let X binom(n, p) and Z binom(n, q) be independent. Then X + Z follows: a) binom(n, p + q) b) binom(n, pq) c) binom(2n, p + q) d) other 1. answer: (a). Each binomial random variable is a sum of independent Bernoulli(p random variables, so their sum is also a sum of Bernoulli(p) r.v. s. 2. answer: (d) This is different from problem 1 because we are combining Bernoulli(p) r.v. s with Bernoulli(q) r.v. s. This is not one of the named random variables we know about. May 27, 2014 11 / 28

Board Question: Find the pmf X = # of successes before the second failure of a sequence of independent Bernoulli(p) trials. Describe the pmf of X. Answer is on the next slide. May 27, 2014 12 / 28

Solution X takes values 0, 1, 2,.... The pmf is p(n) = (n + 1)p n (1 p) 2. For concreteness, we ll derive this formula for n = 3. Let s list the outcomes with three successes before the second failure. Each must have the form F with three S and one F in the first four slots. So we just have to choose which of these four slots contains the F : {FSSSF, SFSSF, SSFSF, SSSFF } 4 In other words, there are 1 = 4 = 3 + 1 such outcomes. Each of these outcomes has three S and two F, so probability p 3 (1 p) 2. Therefore p(3) = P(X = 3) = (3 + 1)p 3 (1 p) 2. The same reasoning works for general n. May 27, 2014 13 / 28

Dice simulation: geometric(1/4) Roll the 4-sided die repeatedly until you roll a 1. Click in X = # of rolls BEFORE the 1. (If X is 9 or more click 9.) Example: If you roll (3, 4, 2, 3, 1) then click in 4. Example: If you roll (1) then click 0. May 27, 2014 14 / 28

Fiction Gambler s fallacy: [roulette] if black comes up several times in a row then the next spin is more likely to be red. Hot hand: NBA players get hot. May 27, 2014 15 / 28

Fact P(red) remains the same. The roulette wheel has no memory. (Monte Carlo, 1913). The data show that player who has made 5 shots in a row is no more likely than usual to make the next shot. May 27, 2014 16 / 28

Gambler s fallacy On August 18, 1913, at the casino in Monte Carlo, black came up a record twenty-six times in succession [in roulette]. [There] was a near-panicky rush to bet on red, beginning about the time black had come up a phenomenal fifteen times. In application of the maturity [of the chances] doctrine, players doubled and tripled their stakes, this doctrine leading them to believe after black came up the twentieth time that there was not a chance in a million of another repeat. In the end the unusual run enriched the Casino by some millions of francs. May 27, 2014 17 / 28

Hot hand fallacy An NBA player who made his last few shots is more likely than his usual shooting percentage to make the next one? http://psych.cornell.edu/sites/default/files/gilo.vallone.tversky.pdf May 27, 2014 18 / 28

Memory Show that Geometric(p) is memoryless, i.e. P(X = n + k X n) = P(X = k) Explain why we call this memoryless. Explanation given on next slide. May 27, 2014 19 / 28

Proof that geometric(p) is memoryless In class we looked the tree for this distribution. Here we ll just use the formula that define conditional probability. To do this we need to find each of the probabilities used in the formula. P(X n) = p n : If X n then the sequence of the sequence of trials must start with n successes. So, the probability of starting with n successes in a row is p n. That is P(X n) = p n. P(X = n + k): We already know P(X = n + k) = p n+k (1 p). Therefore, P( X = n + k ' X n ' ) P(X = n + k X n) = P(X b) P(X = n + k) = P(X n) p n+k (1 p) = p n = p k (1 p) = P(X = k) QED. May 27, 2014 20 / 28

Computing expected value Definition: E (X ) = x i p(x i ) 1. E (ax + b) = ae (X ) + b 2. E (X + Y ) = E (X ) + E (Y ) 3. E (h(x )) = h(x i ) p(x i ) i i A discussion of what E(X ) means and the example given in class are on the next slides. May 27, 2014 21 / 28

Meaning of expected value What is the expected average of one roll of a die? answer: Suppose we roll it 5 times and get (3, 1, 6, 1, 2). To find the average we add up these numbers and divide by 5: ave = 2.6. With so few rolls we don t expect this to be representative of what would usually happen. So let s think about what we d expect from a large number of rolls. To be specific, let s (pretend to) roll the die 600 times. We expect that each number will come up roughly 1/6 of the time. Let s suppose this is exactly what happens and compute the average. value: 1 2 3 4 5 6 expected counts: 100 100 100 100 100 100 The average of these 600 values (100 ones, 100 twos, etc.) is then 100 1 + 100 2 + 100 3 + 100 4 + 100 5 + 100 6 average = 600 1 1 1 1 1 1 = 1 + 2 + 3 + 4 + 5 + 6 = 3.5. 6 6 6 6 6 6 This is the expected average. We will call it the expected value May 27, 2014 22 / 28

Class example We looked at the random variable X with the following table top 2 lines. 1. X : -2-1 0 1 2 2. pmf: 1/5 1/5 1/5 1/5 1/5 3. E (X ) = -2/5-1/5 + 0/5 + 1/5 + 2/5 = 0 4. X 2 : 4 1 0 1 4 5. E (X 2 ) = 4/5 + 1/5 + 0/5 + 1/5 + 4/5 = 2 Line 3 computes E (X ) by multiplying the probabilities in line 2 by the values in line 1 and summing. Line 4 gives the values of X 2. Line 5 computes E (X 2 ) by multiplying the probabilities in line 2 by the values in line 4 and summing. This illustrates the use of the formula E (h(x )) = h(x i ) p(x i ). Continued on the next slide. i May 27, 2014 23 / 28

Class example continued Notice that in the table on the previous slide, some values for X 2 are repeated. For example the value 4 appears twice. Summing all the probabilities where X 2 = 4 gives P(X 2 = 4) = 2/5. Here s the full table for X 2 1. X 2 : 4 1 0 2. pmf: 2/5 2/5 1/5 3. E (X 2 ) = 8/5 + 2/5 + 0/5 = 2 Here we used the definition of expected value to compute E (X 2 ). Of course, we got the same expected value E (X 2 ) = 2 as we did earlier. May 27, 2014 24 / 28

Board Question: Interpreting Expectation a) Would you accept a gamble that offers a 10% chance to win $95 and a 90% chance of losing $5? b) Would you pay $5 to participate in a lottery that offers a 10% percent chance to win $100 and a 90% chance to win nothing? Find the expected value of your change in assets in each case? Discussion on next slide. May 27, 2014 25 / 28

Discussion Framing bias / cost versus loss. The two situations are identical, with an expected value of gaining $5. In a study, 132 undergrads were given these questions (in different orders) separated by a short filler problem. 55 gave different preferences to the two events. Of these, 42 rejected (a) but accepted (b). One interpretation is that we are far more willing to pay a cost up front than risk a loss. (See Judgment under uncertainty: heuristics and biases by Tversky and Kahneman.) Loss aversion and cost versus loss sustain the insurance industry: people pay more in premiums than they get back in claims on average (otherwise the industry wouldn t be sustainable), but they buy insurance anyway to protect themselves against substantial losses. Think of it as paying $1 each year to protect yourself against a 1 in 1000 chance of losing $100 that year. By buying insurance, the expected value of the change in your assets in one year (ignoring other income and spending) goes from negative 10 cents to negative 1 dollar. But whereas without insurance you might lose $100, with insurance you always lose exactly $1. May 27, 2014 26 / 28

Board Question Suppose (hypothetically!) that everyone at your table got up, ran around the room, and sat back down randomly (i.e., all seating arrangements are equally likely). What is the expected value of the number of people sitting in their original seat? (We will explore this with simulations in Friday Studio.) Neat fact: A permutation in which nobody returns to their original seat is called a derangement. The number of derangements turns out to be the nearest integer to n!/e. Since there are n! total permutations, we have: n!/e P(everyone in a different seat) = 1/e 0.3679. n! It s surprising that the probability is about 37% regardless of n, and that it converges to 1/e as n goes to infinity. May 27, 2014 27 / 28

Solution Number the people from 1 to n. Let X i be the Bernoulli random variable with value 1 if person i returns to their original seat and value 0 otherwise. Since person i is equally likely to sit back down in any of the n seats, the probability that person i returns to their original seat is 1/n. Therefore X i Bernoulli(1/n) and E (X i ) = 1/n. Let X be the number of people sitting in their original seat following the rearrangement. Then X = X 1 + X 2 + + X n. By linearity of expected values, we have n n E (X ) = E (X i ) = 1/n = 1. i=1 i=1 It s neat that the expected value is 1 for any n. If n = 2, then both people either retain their seats or exchange seats. So P(X = 0) = 1/2 and P(X = 2) = 1/2. In this case, X never equals E (X ). The X i are not independent (e.g. for n = 2, X 1 = 1 implies X 2 = 1). Expectation behaves linearly even when the variables are dependent. May 27, 2014 28 / 28