Continuous Random Variables

Download Report

Transcript Continuous Random Variables

Continuous Random
Variables
Lecture 24
Section 7.5.4
Tue, Oct 18, 2005
Continuous Probability
Distribution Functions


Continuous Probability Distribution Function
(pdf) – For a random variable X, it is a function
with the property that the area between the
graph of the function and an interval a ≤ x ≤ b
equals the probability that a ≤ X ≤ b.
In other words,
AREA = PROBABILITY
Example



The TI-83 will return a random number
between 0 and 1 if we enter rand and press
ENTER.
These numbers have a uniform distribution
from 0 to 1.
Let X be the random number returned by the
TI-83.
Example

The graph of the pdf of X.
f(x)
1
x
0
1
Example

What is the probability that the random number
is at least 0.3?
Example

What is the probability that the random number
is at least 0.3?
f(x)
1
x
0
0.3
1
Example

What is the probability that the random number
is at least 0.3?
f(x)
1
x
0
0.3
1
Example

What is the probability that the random number
is at least 0.3?
f(x)
1
x
0
0.3
1
Example


What is the probability that the random number
is at least 0.3?
Probability = 70%.
f(x)
1
Area = 0.7
x
0
0.3
1
Example

What is the probability that the random number
is between 0.3 and 0.9?
f(x)
1
x
0
0.3
0.9 1
Example

What is the probability that the random number
is between 0.3 and 0.9?
f(x)
1
x
0
0.3
0.9 1
Example

What is the probability that the random number
is between 0.3 and 0.9?
f(x)
1
x
0
0.3
0.9 1
Example


What is the probability that the random number
is between 0.3 and 0.9?
Probability = 60%.
f(x)
1
Area = 0.6
x
0
0.3
0.9 1
Experiment

Use the TI-83 to generate 500 values of X.


Use rand(500) to do this.
Check to see what proportion of them are
between 0.3 and 0.9.

Use a TI-83 histogram and Trace to do this.
Example



Now suppose we use the TI-83 to get two
random numbers from 0 to 1, and then add
them together.
Let Y = the sum of the two random numbers.
What is the pdf of Y?
Example

The graph of the pdf of Y.
f(y)
1
y
0
1
2
Example

The graph of the pdf of Y.
f(y)
1
Area = 1
y
0
1
2
Example

What is the probability that Y is between 0.5 and
1.5?
f(y)
1
y
0
0.5
1
1.5
2
Example

What is the probability that Y is between 0.5 and
1.5?
f(y)
1
y
0
0.5
1
1.5
2
Example

The probability equals the area under the graph
from 0.5 to 1.5.
f(y)
1
y
0
0.5
1
1.5
2
Example

Cut it into two simple shapes, with areas 0.25
and 0.5.
f(y)
1
Area = 0.25
0.5
Area = 0.5
y
0
0.5
1
1.5
2
Example


The total area is 0.75.
The probability is 75%.
f(y)
1
Area = 0.75
y
0
0.5
1
1.5
2
Verification

Use the TI-83 to generate 500 values of Y.


Use rand(500) + rand(500).
Use a histogram to find out how many are
between 0.5 and 1.5.
Example



Now suppose we use the TI-83 to get three
random numbers from 0 to 1, and then add
them together.
Let Y = the sum of the three random numbers.
What is the pdf of Y?
Example

The graph of the pdf of Y.
f(y)
1
y
0
1
2
3
Example

The graph of the pdf of Y.
f(y)
1
Area = 1
y
0
1
2
3
Example

What is the probability that Y is between 1 and
2? f(y)
1
y
0
1
2
3
Example

What is the probability that Y is between 1 and
2? f(y)
1
y
0
1
2
3
Example

The probability equals the area under the graph
from 1 to 2; it turns out to be 2/3.
1
Area = 2/3
y
0
1
2
3
Verification

Use Excel to generate 500 values of Y.


Uniform3.xls.
It so happens that the standard deviation of Y is
½, so by the Empirical Rule we would expect
around 68% to lie within ½ of 1 ½.
Example



Suppose we get 12 random numbers, uniformly
distributed between 0 and 1, from the TI-83 and
add them all up.
Let X = sum of 12 random numbers from 0 to
1.
What is the pdf of X?
Example

It turns out that the pdf of X is nearly exactly
normal with a mean of 6 and a standard of 1.
N(6, 1)
x
3
4
5
6
7
8
9
Example


What is the probability that the sum will be
between 5 and 7?
P(5 < X < 7) = P(–1 < Z < 1)
= 0.8413 – 0.1587
= 0.6826.
Example


What is the probability that the sum will be
between 4 and 8?
P(4 < X < 8) = P(–2 < Z < 2)
= 0.9772 – 0.0228
= 0.9544.
Experiment

Use the Excel spreadsheet Uniform12.xls to
generate 1000 values of X, where X is the sum
of 12 random numbers from U(0, 1).
We should see a value between 5 and 7 about 68%
of the time.
 We should see a value between 4 and 8 about 95%
of the time.
 We should see a value between 3 and 9 nearly always
(99.7%).
