Download Random Variables - the HCC Home Page

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia, lookup

Statistics wikipedia, lookup

Probability wikipedia, lookup

Probability interpretations wikipedia, lookup

Randomness wikipedia, lookup

Transcript
Chapter 4 – Discrete Probability Distributions
4.1 Probability Distributions: Random Variables
A random variable is a variable whose value depends on the
outcome of a probability experiment. As in algebra, random variables
are represented by letters.
Examples:




T = the number of tails when a coin is flipped 3 times.
s = the sum of the values showing when two dice are rolled.
h = the height of a woman chosen at random from a group.
V = the liquid volume of soda in a can marked 12 oz.
There are two basic types of random variables:
Discrete Random Variables – (counted data) have a finite or
countable number of possible values. (Number of people in a class.)
Continuous Random Variables – (measured data) can take on
any value in some interval. (Average weekly study hours of people in a class.)
Examples:
 The variables ____and_____ from above are discrete random variables
 The variables _____and_____ from above are continuous random
variables.
In chapter 4 we will focus on DISCRETE random variables, in chapter 5 we will
look at continuous random variables.
1
Probability Distributions of Discrete Random Variables:
A probability distribution for a discrete random variable x is a
list of each possible value for x together with the probability that
when the experiment is run, x will have that value. This probability
is denoted by
P( x) .
Examples:
 As above, let T be the random variable that represents the number of tails
obtained when a coin is flipped three times. Then T has 4 possible values:
0, 1, 2, and 3. The probability distribution for T is given in the following
table:
T
P(T)
0
1
2
3
(fraction)
 A statistics class of 25 students is given a 5 point quiz. 3 students scored 0,
1 scored 1, 4 scored 2, 8 scored 3, 6 scored 4, and 3 students scored 5. If a
student is chosen at random, and the random variable s is the student’s quiz
score then the probability distribution of s is:
s
P(s)
0
1
2
3
(decimal)
Note: For any discrete random variable x:
0  P( x)  1 and
2
 P( x)  1
4
5
Finding Probabilities from a Probability Distribution:
Since a random variable can only take on one value at a time, the events of a
variable assuming two different values are always mutually exclusive. The
probability of the variable taking on any number of different
values can thus be found by simply adding the appropriate
probabilities.
Exercises:
 Find the probability that a student scored 3 or more on the quiz from the
previous example.
 Find the probability that a student did not get a perfect score.
 Find the probability of getting 2 or more tails when a coin is flipped 3
times.
 Find the probability of getting at least one tail.
 Find the missing probability in the following distribution:
X
P( X )
-3
0.21
0
0.15
5
3
13
0.33
Mean or Expected Value:
The mean or expected value of a random variable x is the
average value that we should expect for x over many trials of the
experiment.
Notation: The mean or expected value of a random variable x will be
 ( x ) or E ( x)
represented by
We can calculate the mean theoretically by using the formula:
E( x)   ( x)   xP( x)
Examples:
 The expected value of the random variable T from above is:
3 6 3 12 3
 1  3  3  1
E (T )   T  P(T )   0    1    2     3    0     
8 8 8 8 2
 8  8  8  8
Thus if 3 coins are flipped a large number of times, we should expect the
average number of tails (per 3 flips) to be about 1.5.
 The mean of the random variable s from above is:
E ( s)   s  P( s)  (0)(.12)  (1)(.04)  (2)(.16)  (3)(.32)  (4)(.24)  (5)(.12) 
0  .04  .32  .96  .96  .60  2.88
Note that this is actually the class average (mean) on the quiz as well.
Exercise:
Suppose an instant lottery ticket is purchased for $2. The possible prizes are $0,
$2, $20, $200, and $1000. Let Z be the random variable representing the amount
won on the ticket, and suppose Z has the following distribution:
Z
P( Z )
-2
0
.2
18
.05
198
.001
998
.0001
Determine P(-2). Determine E ( Z ) and interpret its meaning. How much should
you expect to gain or lose on average per ticket? If there were 2 $1000 prizes out
of 5,000 tickets sold, what would P(998) be?
4
Variance and Standard Deviation:
Often, we are also interested in how much the values of a random variable
differ from trial to trial. To measure this, we can define the variance and
standard deviation for a random variable.
For a random variable x, the variance of x, denoted by  2 ( x) can be calculated
by the formula:
 2 ( x)   ( x   )2 P( x)
The standard deviation of x, denoted by  ( x) is just the square root of  2 ( x) .
 ( x) 
 ( x   ) P( x)
2
As before, standard deviation estimates the average difference between a value
of x and the average.
5
Calculating Variance and Standard Deviation:
The calculation of standard deviation for a random variable is similar to the
calculation of weighted standard deviation we made for data in frequency tables.
(In fact, P ( x ) can just be thought of as the relative frequency of x.)
The calculation can be made using the following steps:
1. Calculate
 ( x) .
2. Subtract the mean from each of the possible values of x. Recall that these
are called the deviations of the x values.
3. Square each of the deviations calculated in Step 2.
4. Multiply each squared deviation calculated in Step 3 by the
corresponding probability P ( x ) .
5. Sum the results of Step 4. This is  2 ( x) .
6. Take the square root of the result of Step 5 to obtain  ( x) .
Exercises:
 Calculate the standard deviation of the random variable T from above.
T (number of tails 0
1
2
3
obtained when a
coin is flipped
three times)
P(T )
1/8
3/8
3/8
6
1/8
Using the TI-83 to Calculate Mean and Standard Deviation:
The mean and standard deviation for a discrete random variable can be
calculated in one step using the TI-83.
Step 1: Enter the Probability Distribution
Enter the list of possible x values in L1 and the set of corresponding
values
in L2 as was done for frequency tables in Chapter 2.
P( x)
Step 2: Calculate
Choose 1-Var Stats from the CALC menu as when finding the mean of a
data set and when it appears on the screen choose L1 comma L2:
1-Var Stats L1, L2
Press [ENTER] to calculate.
Step 3: Read the Calculated Values
x
is the mean of the random variable
x
is the standard deviation of the random variable
Exercise:
 Use your calculator to recalculate the mean and standard deviation of the
random variable Z from the lottery example above.
Z (amount
-2
0
18
198
998
.2
.05
.001
.0001
won on the
ticket)
P( Z )
7
4.2 Binomial Random Variables:
A discrete random variable x is said to have a binomial distribution if x
satisfies the following conditions:
 An experiment is repeated for a fixed number of trials n
 All trials of the experiment are independent from one another.
 All possible outcomes for each trial of the experiment can be divided into
two complementary events one S called “success” and one F called
“failure”.
 The probability of success P(S) has a constant value of p for
every trial and the probability of failure P(F) has a constant value
of q for every trial.
Note: q  1  p
 The random variable x
(success) occurred.
counts the number of trials on which S
8
Examples:
 Consider the experiment of flipping a coin 5 times. If we let the event of
getting tails on a flip be considered “success”, and if the random variable T
represents the number of tails obtained, then T will be binomially
distributed with
n=
p=
q=
 A student takes a 10 question multiple-choice quiz and guesses each
answer. For each question, there are 4 possible answers, only one of which
is correct. If we consider “success” to be getting a question right and
consider the 10 questions as 10 independent trials, then the random variable
X representing the number of correct answers will be binomially
distributed with
n=
p=
q=
 Twenty-one percent of flights from Tampa International Airport are
delayed. If 20 flights are chosen at random, then we can consider each
flight to be an independent trial. If we define a successful trial to be that a
flight takes off on time, then the random variable z representing the
number of on-time flights will be binomially distributed with
n=
p=
q=
9
Calculating Probabilities for a Binomial Random Variable:
If X is a binomial random variable with n trials, probability of success P(s)= p,
and probability of failure P(F)= q, then by the Fundamental Counting Principle,
the probability of any outcome in which there are x successes (and
therefore n  x failures) is:
( p  p  ...  p)  (q  q  ...  q)  p x q n  x
x successes
n x failures
To count the number of outcomes with x successes and n-x failures, we observe
that the x successes could occur on any x of the n trials. The number of ways of
choosing x trials out of n is n Cx , so the probability of exactly x successes in n
trials becomes:
P(x)
= C n p xq x n- x
Examples:
 As in the previous examples, let T be the random variable representing the
number of tails when a coin is flipped 3 times. Using the formula above,
we can calculate the probability of exactly 2 tails as:
2
1
1
3
1 1
P(2)  3 C2      3 
  0.375
2
8
2 2
3
 Let the random variable X represent the number of correct answers on the
multiple-choice quiz described above. Then the probability of a student
guessing 3 answers correctly is:
3
7
1
2187
1 3
P(3)  10 C3      120  
 0.25
64 16384
4 4
while the probability of guessing seven answers correctly is:
7
3
1
27
1 3
P(7)  10 C7      120 

 0.003
16384 64
4 4
10
Exercises: Let z be the random variable defined above as the number of ontime flights out of 20 at Tampa International Airport (21% delayed, z=on time.)
 Find the probability that exactly15 out of the 20 flights depart on time.
 Find the probability that only 6 out of the 20 flights depart on time.
 Find the probability that all 20 flights are on time.
 Find the probability that none of the flights depart on time.
 Find the probability that at least one of the flights departs on time.
11
Properties of Binomial Distributions:
In many cases, we are interested in the mean and standard deviation of
a binomial random variable. If x is a binomial random variable with n trials,
probability of success p and probability of failure q, then the mean and standard
deviation of x can be calculated by the following:
E ( x)   ( x)  np
and
 ( x)  npq
Example:
 For T the number of tails when a coin is flipped 3 times:
1 3
E (T )    3   
2 2
and
 1  1 
3
 (T )  3    
 .866
2
2
4
  
Exercises:
 Compute  ( X ) and  ( X ) for the random variable X from the multiplechoice test example. (10 questions, 4 possible choices each, X = correct.)
.
 Compute  ( z ) and  ( z ) for the random variable z from the example using
flights from Tampa International. (20 flights, 14% delayed, z=on time.)
 Do page 195 # 20
Note: A binomial distribution is symmetric if
skewed if p  q .
12
p q,
left skewed if p  q and right
Using the TI-83 to Calculate Binomial Probabilities:
If x is a binomial random variable with number of trials n, probability of success
p, then P ( x ) can be calculated on the TI-83 as follows:
 Press [2nd][VARS] to choose DISTR.
 From the menu use the down arrow to select 0: binompdf( and press
[ENTER]. binompdf( should appear on the screen.
 Enter the number of trials n, probability of success p, and desired number
of successes x separated by commas so that the screen reads:
binompdf(n,p,x)
 To calculate press [ENTER] again.
Examples:
Given the 10 item 4-choice multiple choice test, what do each of the following
mean?
 binompdf(10, .25, 3) yields .2502822876
 binompdf(10, .25, 7) yields .0030899048
Exercise:
Use your calculator to find P(x) for rolling three die and getting exactly 2 heads.
How could we find P(x) for rolling at least one heads?
. . . at least 2 heads? (see next page)
13
Creating Binomial Probability Distributions with the TI-83:
Omitting the last entry x in the parenthesis when using the binompdf function
will yield a list of all binomial probabilities starting with x = 0
and ending with x = n..
Example:
 Entering binompdf(3, .5) yields: {.125, .375, .375, .125} the probability
distribution of the binomial experiment of flipping three coins.
Exercise:
 Use the TI-83 to construct a probability distribution for the random variable
X defined above as the number of correct answers on a 10 item 4 –choice
multiple choice quiz.
Cumulative Binomial Probabilities with the TI-83:
The binomcdf function can also be accessed from the DISTR menu, and
binomcdf(n, p, x) gives the probability of at most x successes.
Example:
 The probability of at most 12 on-time flights (out of 20) from Tampa can
be found on the TI-83 as follows:
binomcdf (20, 0.79,12)  .0419231498
Exercise:
 Use your calculator to calculate the probability that at least 15 flights (out
of 20) from Tampa are on time.
Note: As with binompdf, omitting the last entry x in using the binomcdf
function will produce the list of cumulative probabilities starting with x=0 and
ending with x=n.
14