Uploaded by Muhammad Abdullah

Chapter 4 (1)

advertisement
Chapter
4
Random
Variables &
Probability
Distributions
1
LEARNING OBJECTIVES
After completing this chapter, you should be able to:
• Interpret the mean and standard deviation for a discrete random variable
• Use the binomial probability distribution to find probabilities
• Describe when to apply the binomial distribution
• Use the Poisson discrete probability distributions to find probabilities
2
INTRODUCTION TO
PROBABILITY DISTRIBUTIONS
• Random Variable
• A random variable is a variable taking on numerical values
determined by the outcome of a random phenomenon.
Random
Variables
Discrete
Random Variable
Continuous
Random Variable
3
DISCRETE RANDOM VARIABLES
• Can only take on a countable number of values
Examples:
• Roll a die twice
Let X be the number of times 4 comes up
(then X could be 0, 1, or 2 times)
• Toss a coin 5 times.
Let X be the number of heads
(then X = 0, 1, 2, 3, 4, or 5)
4
PROBABILITY DISTRIBUTION
• The probability distribution of the random variable tells
• What values the random variable can take
• The probability that it takes each of those values
• Represented by graph, table or formula
• Let 𝑋 be the random variable representing the number of heads observed in a two
coin tossing experiment
x
0
1
2
P(x)
1/4
1/2
1/4
• The probability distribution of 𝑋 is:
5
PROBABILITY DISTRIBUTION –
DISCRETE RANDOM VARIABLE
• Requirements (properties) for a discrete probability distribution
• 𝑝(π‘₯) ≥ 0
for all values of π‘₯
• ∑ 𝑝(π‘₯) = 1 summation over all possible values of π‘₯
• Example: 𝑃(π‘₯) = π‘₯/10 π‘“π‘œπ‘Ÿ π‘₯ = 1,2,3,4
• Valid probability distribution?
• Property 1?
• Property 2?
1/10 + 2/10 + 3/10 + 4/10 = 1
6
EXPECTED VALUE
Expected Value (or mean) of a discrete distribution (Weighted Average)
μ ο€½ E(x) ο€½ οƒ₯ xP(x)
x
Example:Toss 2 coins,
x = # of heads,
compute expected value of x:
E(x) = (0 x .25) + (1 x .50) + (2 x .25)
= 1.0
x
P(x)
0
.25
1
.50
2
.25
7
EXAMPLE 1
• An insurance company sells a $10,000 whole life insurance
policy at annual premium of $290. Historical data reveals
probability of death of a person during next year to be 0.001.
What is the expected gain for company by selling one policy?
8
SOLUTION
• Let π‘₯ = gain, our random variable of interest in this case
Sample Point
Gain, x
Probability
Customer lives
$290
0.999
Customer dies
$(290 − 10000) = −$9710
0.001
• Expected gain = (290)(0.999) + (−9710)(0.001) = $ 280
• If the company were to sell a very large number of one-year $10,000 policies to such
customers, it would (on the average) net $280 per sale in the next year
Note: The expected value does not have to be a possible value …..it’s an average value
9
QUESTION
• Problem Craps is a popular casino game in which a player
throws two dice and bets on the outcome (the sum total
of the dots showing on the upper faces of the two dice).
Consider a $5 wager. On the first toss (called the come-out
roll), if the total is 7 or 11 the roller wins $5. If the
outcome is a 2, 3, or 12, the roller loses $5 (i.e., the roller
wins - $5). For any other outcome (4, 5, 6, 8, 9, or 10), a
point is established and no money is lost or won on that
roll (i.e., the roller wins $0). Make a probability distribution
table representing x, the expected gain of the come-out roll
wager (- $5, $0, or + $5)
10
SOLUTION
11
VARIANCE AND STANDARD
DEVIATION
 Variance of a discrete random variable X
σ ο€½ E(X ο€­ μ) ο€½ οƒ₯ (x ο€­ μ) P(x)
2
2
2
x
 Standard Deviation of a discrete random variable X
σ ο€½ σ2 ο€½
2
(x
ο€­
μ)
P(x)
οƒ₯
x
12
STANDARD DEVIATION
EXAMPLE
 Example:Toss 2 coins, X = # heads,
compute standard deviation (recall E(x) = 1)
σο€½
2
(x
ο€­
μ)
P(x)
οƒ₯
x
σ ο€½ (0 ο€­ 1)2 (.25)  (1 ο€­ 1)2 (.50)  (2 ο€­ 1)2 (.25) ο€½ .50 ο€½ .707
Possible number of heads =
0, 1, or 2
13
EXPECTED VALUE AND
VARIANCE – EXAMPLE II
• Suppose you have an option of participating in one of these games:
• πΊπ‘Žπ‘šπ‘’ 𝐴 :You win 𝑅𝑠. 2 with probability 2/3 and lose 𝑅𝑠. 1 with probability
1/3
• πΊπ‘Žπ‘šπ‘’ 𝐡 :You win 𝑅𝑠. 1002 with probability 2/3 and lose 𝑅𝑠. 2001 with 1/3
• Which one would you choose and why?
14
SOLUTION
• Game A : You win
Rs. 2 with
probability 2/3 and
loose Rs. 1 with
probability 1/3
π‘₯
𝑝(π‘₯)
π‘₯𝑝(π‘₯)
2
2/3
4/3
−1
1/3
−1/3
1
𝐸(π‘₯)
=1
∑
15
SOLUTION
• Game B :You win Rs. 1002 with probability 2/3 and loose
Rs. 2001 with 1/3
𝑦
𝑝(𝑦)
𝑦𝑝(𝑦)
1002
2/3
668
−2001
1/3
−667
∑
1
𝐸(𝑦) = 1
16
EXPECTED VALUE AND
VARIANCE
•
Game A : You win Rs. 2 with probability 2/3 and loose Rs. 1 with probability 1/3
π‘₯
𝑝(π‘₯)
π‘₯𝑝(π‘₯)
(π‘₯ − πœ‡)
(π‘₯ − πœ‡)2
(π‘₯ − πœ‡)2 𝑝(π‘₯)
2
2/3
4/3
1
1
2/3
−1
1/3
−1/3
−2
4
4/3
∑
1
πœ‡ =1
π‘‰π‘Žπ‘Ÿ[π‘₯] = 2
𝑠. 𝑑 = Rs 1.4
17
EXPECTED VALUE AND
VARIANCE
Game B : You win Rs. 1002 with probability 2/3 and loose Rs. 2001 with 1/3
•
𝑦
𝑝(𝑦)
𝑦𝑝(𝑦)
(𝑦 − πœ‡)
(𝑦 − πœ‡)2
(𝑦 − πœ‡)2 𝑝(𝑦)
1002
2/3
668
1001
1002001
668000
−2001
1/3
−667
−2002
4008004
1336001
∑
1
πœ‡ = 1
π‘‰π‘Žπ‘Ÿ[𝑦] = 2004002
𝑠. 𝑑. = 𝑅𝑠 1416
18
Probability
Distributions
Ch. 4
Discrete
Probability
Distributions
Continuous
Probability
Distributions
Binomial
Uniform
Poisson
Normal
Ch. 5
Exponential
19
THE BINOMIAL DISTRIBUTION
Probability
Distributions
Discrete
Probability
Distributions
Binomial
Poisson
20
BINOMIAL RANDOM VARIABLE
• Consider an experiment with only two outcomes
• True/False
• Head/Tail
• Independent repeated trials
• Bernoulli trials
21
BINOMIAL RANDOM VARIABLE
• A Binomial Experiment consists of a fixed number of Bernoulli
trials
• Denoted as B(n, p)
• n is the number of trials
• p is the probability of success
22
EXAMPLE
• Toss a fair coin 5 times and call Heads a success
• Our random variable in this case is the number of Heads we
observe in the five tosses
• Binomial Experiment
• B(5, 0.5)
• n is the number of trials
• p is the probability of success
23
BINOMIAL RANDOM VARIABLE
Characteristics of a Binomial Random Variable
•
The experiment consists of n identical trials
•
Only two possible outcomes on each trial
•
We denote 𝑆 for success and 𝐹 for failure
24
BINOMIAL RANDOM VARIABLE
• The probability of success (𝑆) remains the same from trial to trial
•
Success (𝑆) denoted by 𝑝
•
Failure (𝐹) is denoted by π‘ž, π‘€β„Žπ‘’π‘Ÿπ‘’ π‘ž = 1 − 𝑝
•
p & q remain constant, from trial to trial
•
The trials are independent
•
Binomial random variable π‘₯ is the number of successes (𝑆’𝑠) in 𝑛 trials
25
BINOMIAL RANDOM VARIABLE EXAMPLE
You randomly select three bonds out of possible ten for an investment portfolio.
Unknown to you, seven out of ten shall maintain their present value and the
other three will lose value due to change in their ratings. Let 𝒙 be the number of
three bonds you select that loose value.
• Is 𝒙 a Binomial Random Variable or is this experiment a Binomial Experiment?
• The probability that the first bond you pick is one of those that will lose value is
3/10 and that the second one you pick is also one that will lose value is 2/9
(because we have already picked up one of those losing bonds).Thus the choices
you make are dependent, therefore the variable 𝒙 is not a binomial variable.
26
BINOMIAL RANDOM VARIABLE –
EXAMPLE
Before marketing a new product, a consumer survey is usually conducted to determine whether the product is
likely to be successful. Suppose a company develops a diet soda and conducts a taste preference survey in
which 100 randomly selected customers state their preferences among the new soda and existing leading
sellers. Let x be the number of the 100 who choose the new soda over the two (existing) others.
•
Is π‘₯ a Binomial Random Variable or is this experiment a Binomial Experiment?
•
Surveys that use random sampling techniques and produce dichotomous responses are
classic binomial experiments. Each respondent has to pick either of the two options:
whether they like the new soda or not. The sample is a very small proportion of the
totality of customers, so the responses would practically be independent of each other.
Thus x is a binomial variable.
27
AND ANOTHER
An FMCG company plans to conduct a survey to determine the fraction of
households in DHA that would use their new product.They divide DHA in equal
sized blocks (in terms of population) and then randomly choose a block to survey all
the households in it. Let x be the number of households in the sampled block that
would use the company’s new product.
•
This survey also produces dichotomous responses – Yes to using a product or No to
using a product. However, the method is not simple random sampling. For it to be a
binomial experiment, it needs to be independent trials and a condition for that is to
have random sample, which will produce unbiased results. In this case, people living in
the same neighborhood are likely to have similar income, education, thus the model is
not a binomial model.
28
BINOMIAL PROBABILITY
DISTRIBUTION
𝑛 π‘₯ 𝑛−π‘₯
𝑝 π‘₯ =
𝑝 π‘ž
π‘₯
𝑝 = π‘ƒπ‘Ÿπ‘œπ‘π‘Žπ‘π‘–π‘™π‘–π‘‘π‘¦ π‘œπ‘“ π‘Ž 𝑠𝑒𝑐𝑐𝑒𝑠𝑠 π‘œπ‘› π‘Ž 𝑠𝑖𝑛𝑔𝑙𝑒 π‘‘π‘Ÿπ‘–π‘Žπ‘™
π‘ž = π‘ƒπ‘Ÿπ‘œπ‘π‘Žπ‘π‘–π‘™π‘–π‘‘π‘¦ π‘œπ‘“ π‘“π‘Žπ‘–π‘™π‘’π‘Ÿπ‘’ = 1 − 𝑝
𝑛 = π‘π‘’π‘šπ‘π‘’π‘Ÿ π‘œπ‘“ π‘‘π‘Ÿπ‘–π‘Žπ‘™π‘ 
π‘₯ = π‘π‘œ. π‘œπ‘“ 𝑠𝑒𝑐𝑐𝑒𝑠𝑠𝑒𝑠 𝑖𝑛 𝑛 π‘‘π‘Ÿπ‘–π‘Žπ‘™π‘ 
𝑛
𝑛!
=
π‘₯
π‘₯! 𝑛 − π‘₯ !
(combination rule)
29
MEAN & VARIANCE FOR A
BINOMIAL RANDOM VARIABLE
π‘€π‘’π‘Žπ‘›: πœ‡ = 𝑛 𝑝
π‘‰π‘Žπ‘Ÿπ‘–π‘Žπ‘›π‘π‘’: 𝜎 2 = 𝑛 𝑝 π‘ž
π‘†π‘‘π‘Žπ‘›π‘‘π‘Žπ‘Ÿπ‘‘ π·π‘’π‘£π‘–π‘Žπ‘‘π‘–π‘œπ‘›: 𝜎 = 𝑛 𝑝 π‘ž
30
BINOMIAL PROBABILITY
DISTRIBUTION
• Toss a coin 5 times in a row. Note number of tails. What’s the
probability of 3 tails?
p( x) ο€½
n!
p x (1 ο€­ p ) n ο€­ x
x !(n ο€­ x)!
p (3) ο€½
5!
0.53 (1 ο€­ 0.5)5ο€­3
3!(5 ο€­ 3)!
ο€½ 0.3125
31
BINOMIAL PROBABILITY
DISTRIBUTION - EXAMPLE
You’re a telemarketer selling service contracts. You’ve sold 20 in your last
100 calls (p = 0.20). If you call 12 people tonight, what’s the probability
of
A. No sales?
B. Exactly 2 sales?
C. At most 2 sales?
D. At least 2 sales?
32
SOLUTION
(n = 12, p = .20)
A. p(0) = .0687
B. p(2) = .2835
33
SOLUTION
C. p(at most 2)
= p(0) + p(1) + p(2)
= .0687 + .2062 + .2835
= .5584
D. p(at least 2)
= p(2) + p(3)...+ p(12)
= 1 – [p(0) + p(1)]
= 1 – .0687 – .2062 = .7251
34
BINOMIAL PROBABILITY - R
•
Probability Function
dbinom(x, size=n, prob=p)
where π‘₯ is the number of successes in 𝑛 trials, and 𝑝 is the probability of success in a
single trial
•
For cumulative probability
pbinom(x, size=n, prob=p)
35
BINOMIAL PROBABILITY
πΆπ‘’π‘šπ‘’π‘™π‘Žπ‘‘π‘–π‘£π‘’ π‘π‘Ÿπ‘œπ‘π‘Žπ‘π‘–π‘™π‘–π‘‘π‘¦
The function 𝐹(π‘₯) = 𝑃(𝑋 ≤ π‘₯), is called a cumulative
probability distribution. For a discrete random variable 𝑋,
the cumulative probability distribution 𝐹(π‘₯) is determined
π‘₯
𝐹 π‘₯ =
𝑓(π‘š) = 𝑓(0) + 𝑓(1) + β‹― + 𝑓(π‘₯)
π‘š=0
36
BINOMIAL PROBABILITY
π‘π‘œπ‘‘π‘’:
Probability mass function, 𝑓(π‘₯), of a discrete random variable 𝑋 is
distinguished from the cumulative probability distribution, 𝐹(π‘₯), of
a discrete random variable 𝑋 by the use of a lowercase 𝑓 and an
uppercase 𝐹.
Example:
Notation 𝑓(3) means 𝑃(𝑋 = 3), while the notation 𝐹(3) means 𝑃(𝑋 ≤ 3)
37
EXAMPLE
Roll 12 dice simultaneously, and let 𝑋 denote the number of
6’𝑠 that appear.We wish to find the probability of getting
seven, eight, or nine 6’𝑠. If we let 𝑆 =
{𝑔𝑒𝑑 π‘Ž 6 π‘œπ‘› π‘œπ‘›π‘’ π‘Ÿπ‘œπ‘™π‘™}, then 𝑃(𝑆 ) = 1/6 and the rolls
constitute Bernoulli trials; thus 𝑋~π‘π‘–π‘›π‘œπ‘š(𝑠𝑖𝑧𝑒 =
12; π‘π‘Ÿπ‘œπ‘ = 1/6) and our task is to find 𝑃(7 ≤ 𝑋 ≤ 9).
9
𝑃 7≤𝑋≤9 =
π‘₯=7
12
π‘₯
1
6
π‘₯
5
6
12−π‘₯
38
SOLUTION
𝑃 𝑋≥7 =
π‘₯=7
𝑃 𝑋≥8 =
π‘₯=8
𝑃 𝑋≤9 =
π‘₯=9
12
7
1
6
7
5
6
12−7
12
8
1
6
8
5
6
12−8
12
9
1
6
9
5
6
12−9
𝑃 7≤𝑋 ≤9 =𝑃 𝑋 ≥7 +𝑃 𝑋 ≥8 +𝑃 𝑋 ≤9
= 0.001291758
39
QUESTION
• A machine that produces stampings for automobile engines
is malfunctioning and producing 10% defectives. The
defective and non defective stampings proceed from the
machine in a random manner. If the next five stampings are
tested, find the values of p(0), p(1), p(2), p(4) and p(5).
Calculate the mean m and standard deviation s. Locate m
and the interval m - 2s to m + 2s on the graph. If the
experiment were to be repeated many times, what
proportion of the x observations would fall within the
interval m - 2s to m + 2s?
•
40
SOLUTION
41
BINOMIAL PROBABILITY - R
π»π‘œπ‘€ π‘‘π‘œ π‘‘π‘œ 𝑖𝑑 𝑖𝑛 𝑅:
π‘‘π‘π‘–π‘›π‘œπ‘š(7, 𝑠𝑖𝑧𝑒 = 12, π‘π‘Ÿπ‘œπ‘ = 1/6) + π‘‘π‘π‘–π‘›π‘œπ‘š(8, 𝑠𝑖𝑧𝑒 = 12, π‘π‘Ÿπ‘œπ‘
= 1/6)
+ π‘‘π‘π‘–π‘›π‘œπ‘š(9, 𝑠𝑖𝑧𝑒 = 12, π‘π‘Ÿπ‘œπ‘ = 1/6)
[1] 0.001291758
π‘π‘π‘–π‘›π‘œπ‘š(9, 𝑠𝑖𝑧𝑒 = 12, π‘π‘Ÿπ‘œπ‘ = 1/6) − π‘π‘π‘–π‘›π‘œπ‘š(6, 𝑠𝑖𝑧𝑒 = 12, π‘π‘Ÿπ‘œπ‘
= 1/6)
[1] 0.001291758
42
POISSON DISTRIBUTION
Probability
Distributions
Discrete
Probability
Distributions
Binomial
Hypergeometric
Poisson
43
POISSON DISTRIBUTION
•
Apply the Poisson Distribution when:
•
You wish to count the number of times an event occurs in a given
continuous interval
•
The probability that an event occurs in one subinterval is very small
and is the same for all subintervals
•
The number of events that occur in one subinterval is independent
of the number of events that occur in the other subintervals
•
There can be no more than one occurrence in each subinterval
•
The average number of events per unit is  (lambda)
44
EXAMPLE
• If the average number
of people who buy
cheeseburgers from a
fast-food chain on a
Friday night at a single
restaurant location is
200, a Poisson
distribution can
answer questions such
as, "What is the
probability that more
than 300 people will
buy burgers?"
45
POISSON DISTRIBUTION
FORMULA
ο€­λ
e λ
P(x) ο€½
x!
x
where:
x = number of successes per unit
 = expected number of successes per unit
e = base of the natural logarithm system (2.71828...)
𝑋𝑃(πœ‡
)
46
POISSON DISTRIBUTION
CHARACTERISTICS
• Mean
μ ο€½ E(x) ο€½ λ
 Variance and Standard Deviation
σ ο€½ E[( X ο€­  ) ] ο€½ λ
2
2
σο€½ λ
where
 = expected number of successes per unit
47
• Leah's answering machine receives about six
telephone calls between 8 a.m. and 10 a.m. What
is the probability that Leah receives ONE call in
the next 15 minutes?
• Let X = the number of calls Leah receives in 15
minutes. (The interval of interest is 15 minutes
or 1/4 hour.)
EXAMPLE
• π‘₯=0,1,2,3
• If Leah receives, on the average, six telephone
calls in two hours, and there are eight 15 minute
intervals in two hours, then Leah receives
• (1/8)*6=0.75 calls in 15 minutes, on average. So, πœ‡
=0.75 for this problem.
• 𝑋∼𝑃(0.75)
• The result is 𝑃(π‘₯=1)= .35427
48
POISSON DISTRIBUTION
EXAMPLE
• Example: Customers arrive at a rate of 72 per hour. What is
the probability of 4 customers arriving in 3 minutes?
• Solution:
• 72 customers per hour means:
• 3.6 customers per 3 minutes interval
49
SOLUTION
• Solution:
• 72 customers per hour means:
• 3.6 customers per 3 minutes interval
πœ†π‘₯ 𝑒 −πœ†
𝑝 π‘₯ =
π‘₯!
(3.6)4 𝑒 −3.6
𝑝 4 =
= 0.1912
4!
50
Download