3680 Lecture 04

Download Report

Transcript 3680 Lecture 04

Math 3680
Lecture #4
Discrete Random
Variables
Let X denote the number of spots that appear when a fair die
is thrown. Then we would expect that
fX(1) = P(X = 1) = 1/6
fX(2) = P(X = 2) = 1/6
fX(3) = P(X = 3) = 1/6
fX(4) = P(X = 4) = 1/6
fX(5) = P(X = 5) = 1/6
fX(6) = P(X = 6) = 1/6
The variable X is called a random variable. In this case, X is
discrete (as opposed to continuous). The function f is called
the probability mass function.
Example: A fair die is rolled once.
If it lands six, you win $4. Otherwise, you lose $1.
Let M denote the amount of money you win.
Find the distribution of M.
Note: To specify a distribution, you must list
– The possible values (the range), and
– The probabilities associated with each value.
Probability distributions
may be graphically
represented by
probability histograms.
This time, the area of
each rectangle
represents a probability
instead of a frequency.
Definition: EXPECTED VALUE:
 E ( X )   x j f ( x j )
j
Example:
a) Compute E(X) and E(M), where X and M were
defined earlier.
b) How does the expected value relate to the
histograms presented earlier?
Let’s recall some sixth-grade observations about the
average
of x1, x2, …, xn.
1) If xk = c for each k, then
• E(c) = c
2) If yk = c xk, then
• E( c X ) = c E( X )
x = c.
Let’s recall some sixth-grade observations about the
average x of x1, x2, …, xn.
3) If zk = xk + yk , then
z  x  y.
• E( X + Y ) = E( X ) + E ( Y )
Let’s recall some sixth-grade observations about the
average x of x1, x2, …, xn.
• If zk = xk yk , then usually z  x  y.
For example, take xk = k and yk = k for k = 1, 2, 3:
•Warning! In general, E( X Y ) ≠ E( X ) . E ( Y ).
Definition. VARIANCE AND SD:
Var( X ) = E[ (X - )2 ]
sSD( X ) = √Var( X )
Notice that these definitions are analogous to those
seen earlier with data sets. As before, SD( X )
measures the spread of a distribution.
SHORT-CUT formula:
Var( X ) = E[ X 2 ] - 2
PROOF.
Example.
a) Compute SD(X)
and SD(M),
where X and M
were defined
earlier.
b) How do these
values relate to
the respective
histograms?
THEOREM. (Scaling and shifting)
If a and b are real constants and X is a random
variable, then
Var( a X + b ) = a2 Var( X )
SD( a X + b ) = | a | SD( X )
Did we observe this property with data sets?
PROOF.
The Binomial Distribution
Certain probabilities bear a resemblance to each other.
Consider the following questions, which are all examples of
binomial experiments:
Example 1: A parolee has a 24% chance of becoming a
repeat offender, independent of other parolees. What is the
chance that exactly two of five parolees will become repeat
offenders?
Example 2: A roulette wheel is spun 20 times. What is the
chance that the ball will land in a black slot at least 11 times?
Example 3: A fair coin is flipped 400 times. What is the
probability that it will land heads 220 times or more?
When to use the binomial distribution:
1. There are a fixed number of trials.
We call this number n.
2. The trials are independent and are repeated under
identical conditions.
3. Each trial has only two possible outcomes –
success (S) or failure (F)
4. Each trial has the same probability of success.
We denote the probability of success by p.
5. The central problem is to find the probability of r
successes out of n trials.
Example #1: Parolees
1. n = 5
2. Independence is assumed for the
parolees.
3. S = becomes a repeat offender
F = does not become a repeat offender
4. p = 0.24
5. We seek the probability of 2 successes
out of 5 trials.
Example #2: Roulette
1. n = 20
2. We assume that the wheel is not rigged
3. S = lands black
F = does not land black
4. p  18
38
5. We seek the probability of at least 11
successes out of 20 independent trials.
Example #3: Coin Flips
1. n = 400
2. We assume the coin is fair.
3. S = heads
F = tails
4. p  1
2
5. We seek the probability of at least 220
successes out of 400 independent trials.
Example: Explain why the following are
NOT binomial experiments.
a) A company manager has ten employees –
six females, four males. Two are selected
at random to attend a conference. What is
the probability that both are females?
b) The students in this class are asked,
"What is your favorite TV show?"
The Binomial Formula – Derivation
Example: A student takes a multiplechoice exam, where each question has five
possible answers. At the end of the exam,
she answers all questions except for three,
for which she picks answers randomly.
What is the probability that she got all three
questions correct? Two of the three
correct? One of the three correct? None of
the guesses correct?
Solution: Notice that this is a binomial experiment:
1. There are three trials – questions to answer. So
n = 3.
2. The trials are independent.
3. S = correct answer
F = incorrect answer
4. For each trial, π = 1/5 = 0.2
5. The central problem is determining the
probability of 0, 1, 2, or 3 successes.
Method #1: Calculate each possible outcome
individually and compute appropriately.
First, notice there are eight possible outcomes:
SSS SSF SFS SFF
FSS FSF FFS FFF
Next, find the probabilities of each of these.
P(SSS) = P(S)P(S)P(S) = p3 = (0.2)3 = 0.008
P(SSF) = P(S)P(S)P(F) = p2 (1-p) = (0.2)2(0.8) = 0.032
P(SFS) = P(S)P(F)P(S) = p2 (1-p) = (0.2)2(0.8) = 0.032
P(SFF) = P(S)P(F)P(F) = p (1-p)2 = (0.2) (0.8)2 = 0.128
P(FSS) = P(F)P(S)P(S) = p2 (1-p) = (0.2)2(0.8) = 0.032
P(FSF) = P(F)P(S)P(F) = p (1-p)2 = (0.2) (0.8)2 = 0.128
P(FFS) = P(F)P(F)P(S) = p (1-p)2 = (0.2) (0.8)2 = 0.128
P(FFF) = P(F)P(F)P(F) = (1-p)3 = (0.8)3 = 0.512
3
2
2
1
2
1
1
0
P(0)  P(FFF) 
P(1)  P(SFF or FSF or FFS)
 P(SFF) + P(FSF) + P(FFS)

P(2)  P(SSF or SFS or FSS)
 P(SSF) + P(SFS) + P(FSS)

P(3)  P(SSS) 
The Binomial Distribution – If R denotes the
number of successes in a binomial experiment of n
trials, then we say R ~ Binomial(n, p):
 n r
fR(r)    p (1 - p)n-r
r 
p  probability of success
1 - p  probability of failure
n 
   binomial coefficient
r 

n!
r!(n- r)!
for r = 0, 1, 2, …, n.
For other values of r, fR(r) = 0.
Definition: Factorial. The factorial n!, where n
is a positive integer, is defined by:
n!  n  (n - 1)  (n - 2)  K 3  2  1
Example:
5!  5  4  3  2  1 = 120
4!  4  3  2  1 = 24
3!  3  2  1 = 6
2!  2  1 = 2
1!  1 = 1
0! 
Most calculators have a key for computing
n
 
r 
You can also use either the formula or
Pascal’s triangle. However, even if your
calculator doesn’t, you can find these with a
little multiplication and division:
 5
5!
5! 5  4  3  2 1
  


 10
 3  3!(5 - 3)! 3!2! 3  2 1  2 1
3
  
 0
 3
  
1 
13
  
 2
Note: There is no such thing as
3
 3 
  or 

 4
100 
-- you can’t have 4 successes in 3 trials.