Download presentation
Presentation is loading. Please wait.
Published byHoratio Knight Modified over 8 years ago
1
INTRODUCTION TO ECONOMIC STATISTICS Topic 5 Discrete Random Variables These slides are copyright © 2010 by Tavis Barr. This work is licensed under a Creative Commons Attribution- ShareAlike 3.0 Unported License. See http://creativecommons.org/licenses/by-sa/3.0/ for further information.http://creativecommons.org/licenses/by-sa/3.0/
2
Discrete Random Variables ● What is a random variable? ● Probability distributions ● Mean and variance of a discrete random variable ● Binomial Distribution ● Poisson Distribution
3
What is a Random Variable? ● Describing every outcome of an experiment may not be an efficient way of working with the information. – Example: We test a new drug on lab rats. – We have all kinds of vital information on every rat, but maybe all we care about is whether a given rat survived ● Random Variables summarize what is interesting about an experiment.
4
What is a Random Variable? (cont'd) ● A random variable is a mapping from outcomes of an experiment to the real number line, such that: 1.Every outcome gets mapped to one and only one number; but 2.more than one outcome may get mapped to the same number.
5
Example of a Random Variable Fuzzy vague sample space 01234567 Real Number Line Random Variable Example: Consider the experiment of flipping a coin five times. Some resulting random variables: – How many times did it land on Heads? – How many times did it land on Tails? – “1” if it landed on the same face every time, “0” if not
6
Probability Distribution A probability distribution is a list of all possible values of a random variable and a probability associated with each outcome. Example: Taxis are only allowed to carry 4 passengers. The probability that they are carrying a given number is: NumberProbability 0.30 1.35 2.15 3.10 4guess!
7
Discrete vs. Continuous ● Discrete random variables usually take on a finite number of outcomes, so the outcomes and associated probabilities can be listed in a table ● Continuous random variables take on a range of values, i.e., an infinite number of possible outcomes ● We'll deal with discrete random variables first and get to continuous ones in a couple of weeks
8
Mean of a Discrete Random Variable If {X 1, X 2,...X N } are the values that the variable can take on, and {P(X 1 ),P(X 2 ),...P(X N )} are the associated probabilities, then the formula for the mean is:
9
Population Mean vs. Weighted Sample Mean ● Remember the formula for the sample mean with a weighted sample: ● Probabilities always add up to one ● So if we treated our probabilities as weights, the population mean is like a kind of weighted mean ● It's a population parameter, though, not a sample feature
10
Population Mean – Example Formula: Example: Our beloved New York Taxicabs # of passengersProb.X i ·P(X i ) 0.30.00 1.35.35 2.15.30 3.10.30 4.10.40 Sum1.35
11
Variance of a Discrete Random Variable If {X 1, X 2,...X n } are the values that the variable can take on, and {P(X 1 ),P(X 2 ),...P(X n )} are the associated probabilities, then the formula for the variance is:
12
Population Variance – Example Formula: Example: Our beloved New York Taxicabs (=1.35) # PsgProb.X i -(X i - ) 2 (X i - ) 2 P(X i ) 0.30-1.351.8225.5468 1.35-.35.1225.0429 2.15.65.4225.0634 3.101.652.7225.2723 4.102.657.0225.7023 Sum1.6277
13
Median and Mode of a Random Variable ● The median is the value where there is at most a 50 percent probability that the variable lies above or below that value ● The mode is the value with the highest probability NumberProbability 0.30 1.35 2.15 3.10 4.10 ● Median is 1 since less than 50% are below 1 and less than 50% are above 1 ● Mode is also 1 since it's the number with the highest prob.
14
Binomial Distribution ● A Bernoulli trial is an experiment that can have two outcomes – True or False – Yes or no – Heads or tails ● A dummy or indicator variable is a random variable created from a Bernoulli Trial that assigns “1” to one outcome and “0” to the other
15
Binomial Distribution – Formula ● Binomial variable asks question: – Suppose we have n independent Bernoulli trials. – Probability of “Yes”/”True”/”Success” is p. – What is the probability of k successes? – Here, n and p are parameters and k is an outcome. ● Answer:
16
Binomial Distribution Example 1 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: Suppose we toss a coin five times. What is probability of it landing heads three times?
17
Binomial Distribution Example 1 ● N Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: Suppose we toss a coin five times. What is probability of it landing heads three times? – n = 5, p =.5; we want to know P(X=3)
18
Binomial Distribution Example 1 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: Suppose we toss a coin five times. What is probability of it landing heads three times? – n = 5, p =.5; we want to know P(X=3)
19
Binomial Distribution Example 1 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: Suppose we toss a coin five times. What is probability of it landing heads three times? – n = 5, p =.5; we want to know P(X=3)
20
Binomial Distribution Example 1 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: Suppose we toss a coin five times. What is probability of it landing heads three times? – n = 5, p =.5; we want to know P(X=3)
21
Binomial Distribution Example 2 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – Suppose a workplace is 40 percent women. – There are six managers;managers are promoted at random. – What is the probability of them all being men?
22
Binomial Distribution Example 2 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – Suppose a workplace is 40 percent women. – There are six managers;managers are promoted at random. – What is the probability of them all being men? ● Here, n = 6, p =.4, and we want to know P(X=0)
23
Binomial Distribution Example 2 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – Suppose a workplace is 40 percent women. – There are six managers; they are promoted at random. – What is the probability of them all being men? ● Here, n = 6, p =.4, and we want to know P(X=0)
24
Binomial Distribution Example 2 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – Suppose a workplace is 40 percent women. – There are six managers; they are promoted at random. – What is the probability of them all being men? ● Here, n = 6, p =.4, and we want to know P(X=0)
25
Binomial Distribution Example 3 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – 10% of microchips are defective. – We pull a batch of 10 chips – What is the probability of at least one defective?
26
Binomial Distribution Example 3 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – 10% of microchips are defective. – We pull a batch of 10 chips – What is the probability of at least one defective? ● Much easier to figure out probability of none defective ● Here, n = 10, p = 0.10, and we want to use k = 0
27
Binomial Distribution Example 3 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – 10% of microchips defective; look at 10 chips – What is the prob. of at least one defective? ● Much easier to figure out prob. of none defective ● Here, n = 10, p =.10, and we want to use k = 0
28
Binomial Distribution Example 3 ● n Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – 10% of microchips defective; look at 10 chips – What is the prob. of at least one defective? ● Much easier to figure out prob of none defective ● Here, n = 10, p =.10, and we want to use k = 0
29
Binomial Distribution Example 3 ● N Bernoulli trials, each with prob. p of success ● Pr of k successes: ● Example: – 10% of microchips defective; look at 10 chips – What is the prob of at least one defective? ● Much easier to figure out prob of none defective ● Here, n = 10, p =.10, and we want to use k = 0
30
Binomial Distribution – Mean and Variance ● If X is binomially distributed with parameters n and p, then: – Its mean is np – Its variance is np(1-p) ● Examples: – The mean no. of women promoted should be...
31
Binomial Distribution – Mean and Variance ● If X is binomially distributed with parameters n and p, then: – Its mean is np – Its variance is np(1-p) ● Examples: – The mean no. of women promoted should be 6·0.4 = 2.4. The std. deviation: – The mean no. of defective microchips should be...
32
Binomial Distribution – Mean and Variance ● If X is binomially distributed with parameters n and p, then: – Its mean is np – Its variance is np(1-p) ● Examples: – The mean no. of women promoted should be 6·0.4 = 2.4. The std. deviation: – The mean no. of defective microchips should be 10·.1 = 1. The std. dev.:
33
Poisson Distribution ● Poisson Distribution maps how many times a given event happens in a time interval. – Number of people arriving at a line every hour – Number of auto fatalities that happen in a day ● If the mean number of times the event happens every hour (or day or year) is... – What is the expected number of times? – How likely is it that the event will happen once? Twice? Fifteen times?....
34
Poisson Distribution – Amnesia ● Poisson distribution assumes amnesia: How many times it has already happened is irrelevant to whether it will happen again. – How many people have had an auto accident on a given day does not affect the probability of an additional person getting into an accident – How many people have already arrived at a bus stop in an hour does not affect the probability of one more person arriving during that hour
35
Poisson Distribution – Formula If X is a random variable following the Poisson distribution with mean, then the probability that X will take on a particular value t is P(X = t) = e -t /t! Where e = 2.7182818....
36
Poisson Distribution Example 1 ● Probability that a Poisson variable with mean equals some number t: P(X = t) = e -t /t! ● Example: – On some stretch of highway, there is a mean of two accidents per day. – What is the probability that here will be one accident? – What is the probability that there will be at least one accident?
37
Poisson Distribution Example 1 ● Probability that a Poisson variable with mean equals some number t: P(X = t) = e -t /t! ● Example: – On some stretch of highway, there is a mean of two accidents per day. – What is the probability that there will be exactly one accident? ● Here, µ=2, and we want to know P(X=1), i.e., t = 1
38
Poisson Distribution Example 1 ● Probability that a Poisson variable with mean equals some number t: P(X = t) = e -t /t! ● Example: – On some stretch of highway, there is a mean of two accidents per day. – What is the probability that there will be exactly one accident? ● Here, =2, and we want to know P(X=1), i.e., t = 1 ● P(X = 1) = e -t /t! = e -2 2 1 /1! = 0.135 · 2/1 = 0.27
39
Poisson Distribution Example 1 ● Probability that a Poisson variable with mean equals some number t: P(X = t) = e -t /t! ● Example: – Mean of two accidents per day; what is the probability that there will be at least one accident? ● Here, =2, and we want to know P(X>0), i.e., t = 1,2,3,4...
40
Poisson Distribution Example 1 ● Probability that a Poisson variable with mean equals some number t: P(X = t) = e -t /t! ● Example: – Mean of two accidents per day; what is the probability that there will be at least one accident? ● Here, =2, and we want to know P(X>0), i.e., t = 1,2,3,4... ● This is impossible so we compute P(X>0) = 1-P(X=0)
41
Poisson Distribution Example 1 ● Probability that a Poisson variable with mean equals some number t: P(X = t) = e -t /t! ● Example: – Mean of two accidents per day; what is the probability that there will be at least one accident? ● We want to know P(X>0), i.e., t = 1,2,3,4... ● This is impossible; we compute P(X>0) = 1-P(X=0) ● P(X = 0) = e -t /t! = e -2 2 0 /0! = 0.135·1/1 = 0.135
42
Poisson Distribution Example 1 ● Probability that a Poisson variable with mean equals some number t: P(X = t) = e -t /t! ● Example: – Mean of two accidents per day; what is the probability that there will be at least one accident? ● We want to know P(X>0), i.e., t = 1,2,3,4... ● This is impossible; we compute P(X>0) = 1-P(X=0) ● P(X = 0) = e -t /t! = e -2 2 0 /0! = 0.135·1/1 = 0.135 ● P(X > 0) = 1 – P(X = 0) = 1 – 0.135 = 0.865
43
Poisson Distribution Example 2 ● Example: – A mean of three people arrive in a line in an average minute. In one given minute, what is the probability that at least three people will arrive?
44
Poisson Distribution Example 2 ● Example: – A mean of three people arrive in a line in an average minute. In one given minute, what is the probability that at least three people will arrive? ● Here, µ=3, and we want to know P(X ≥ 3), i.e. t = 3,4,5....
45
Poisson Distribution Example 2 ● Example: – A mean of three people arrive in a line in an average minute. In one given minute, what is the probability that at least three people will arrive? ● Here, µ=3, and we want to know P(X ≥ 3), i.e. t = 3,4,5.... ● P(X≥3) = 1- P(X<3) = 1-P(X=0) - P(X=1) - P(X=2)
46
Poisson Distribution Example 2 ● Example: – A mean of three people arrive in a line in an average minute. In one given minute, what is the probability that at least three people will arrive? ● We want to know P(X ≥ 3), i.e. t = 3,4,5.... ● P(X ≥ 3) = 1 - P(X<3) = 1 - P(X=0) - P(X=1) - P(X=2) ● P(X = 0) = e -3 3 0 /0! = 0.0497·1/1 = 0.0497
47
Poisson Distribution Example 2 ● Example: – A mean of three people arrive in a line in an average minute. In one given minute, what is the probability that at least three people will arrive? ● We want to know P(X ≥ 3), i.e. t = 3,4,5.... ● P(X ≥ 3) = 1 - P(X<3) = 1 - P(X=0) - P(X=1) - P(X=2) ● P(X = 0) = e -3 3 0 /0! = 0.0497·1/1 = 0.0497 ● P(X = 1) = e -3 3 1 /1! = 0.0497·3/1 = 0.1491
48
Poisson Distribution Example 2 ● Example: – A mean of three people arrive in a line in an average minute. In one given minute, what is the probability that at least three people will arrive? ● We want to know P(X ≥ 3), i.e. t = 3,4,5.... ● P(X ≥ 3) = 1 - P(X<3) = 1 - P(X=0) - P(X=1) - P(X=2) ● P(X = 0) = e -3 3 0 /0! = 0.0497·1/1 = 0.0497 ● P(X = 1) = e -3 3 1 /1! = 0.0497·3/1 = 0.1491 ● P(X = 2) = e -3 3 2 /2! = 0.0497·9/2 = 0.2237
49
Poisson Distribution Example 2 ● Example: – A mean of three people arrive in a line in an average minute. In one given minute, what is the probability that at least three people will arrive? ● We want to know P(X ≥ 3), i.e. t = 3,4,5.... ● P(X ≥ 3) = 1 - P(X<3) = 1 - P(X=0) - P(X=1) - P(X=2) ● P(X = 0) = e -3 3 0 /0! = 0.0497·1/1 = 0.0497 ● P(X = 1) = e -3 3 1 /1! = 0.0497·3/1 = 0.1491 ● P(X = 2) = e -3 3 2 /2! = 0.0497·9/2 = 0.2237 ● P(X≥3) = 1 -.0497 -.1491 -.2237 = 1 - 4225 =.6775
50
Poisson Distribution – Mean If X is a Poisson distributed variable with mean, then its expected value is also. – This may sound obvious, but it doesn't immediately follow that the formulas compute that way.
51
Poisson Distribution – Variance Less obviously, its variance is also. – The random variable in our first example has mean 2 and variance 2 – The random variable in our second example has mean 3 and variance 3
52
Poisson Approximation to Binomial ● When x is more than about 50, x! Becomes too big for most computers ● When n is large and p small, we can use a Poisson variable with =np to approximate a Binomial
53
Poisson Approximation to Binomial ● When n is large and p small, we can use a Poisson variable with =np to approximate a Binomial – Example: ● 52 cards in a deck;.0769 (4/52) are Aces ● If we draw 5 cards, what is the chance of drawing exactly one Ace?
54
Poisson Approximation to Binomial ● When n is large and p small, we can use a Poisson variable with =np to approximate a Binomial – Example: ● 52 cards in a deck;.0769 (4/52) are Aces ● If we draw 5 cards, what is the chance of drawing exactly one Ace? ● Here, n = 5, p =.0769, we want to know P(X=1)
55
Poisson Approximation to Binomial ● When n is large and p small, we can use a Poisson variable with =np to approximate a Binomial – Example: ● 52 cards in a deck;.0769 (4/52) are Aces ● If we draw 5 cards, what is the chance of drawing exactly one Ace? ● Here, n = 5, p =.0769, we want to know P(X=1) ● So we use Poisson with = np = 5·.0769 =.3845
56
Poisson Approximation to Binomial ● When n is large and p small, we can use a Poisson variable with =np to approximate a Binomial – Example: ● 52 cards in a deck;.0769 (4/52) are Aces ● If we draw 5 cards, what is the chance of drawing exactly one Ace? ● Here, n = 5, p =.0769, we want to know P(X=1) ● So we use Poisson with = np = 5·.0769 =.3845
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.