Continuous random variables

Continuous random variables
Let X be a continuous rv. Then a probability distribution or
probability density function (pdf) of X is a function f(x) such
that for any two numbers
a and b with a ≤ b,
Rb
P(a ≤ X ≤ b) = a f (x)dx.
Note for a legitimate
pdf, we have
R∞
f (x) ≥ 0 and −∞ f (x)dx = 1.
For a continuous rv, P(X = c) =
Rc
c
f (x)dx = 0, hence
P(a ≤ X ≤ b) = P(a ≤ X < b) = P(a < X ≤ b) = P(a < X < b)
.
example: The waiting time X (in minutes) for bus route 4 has the
pdf given by
1
10 , 0 ≤ x ≤ 10
f (x) =
0, otherwise
Then the probability
waiting between 2 and 5 minutes is
R 5 of
1
x x=5
P(2 ≤ X ≤ 5) = 2 10 dx = 10
|x=2 = 0.3
A continuous rv is said to have a uniform distribution on the
interval [A, B] if the pdf of X is
1
B−A , A ≤ X ≤ B
f (x; A, B) =
0, otherwise.
Normal pdf
If X ∼ N(µ, σ), its pdf is given by
2
1
], −∞ < x < ∞, −∞ < µ < ∞, σ > 0.
f (x) = √2πσ
exp[− (x−µ)
2σ 2
Exercise: 3.4.2. suppose fY (y ) = 4y 3 , 0 ≤ y ≤ 1. Find
P(0 ≤ Y ≤ 1/2).
cumulative distribution function (cdf) of a continuous r. v.
The cdf F(x) of a continuous
rv X is defined for any number x by
Rx
F (x) = P(X ≤ x) = −∞ f (y )dy .
If X is a continuous rv with pdf f(x) and cdf F(x), then at every x
at which the derivative F 0 (x) exists, F 0 (x) = f (x).
properties of cdf:
P(X > a) = 1 − F (a)
P(a ≤ X ≤ b) = F (b) − F (a)
limx→∞ FX (x) = 1
limx→−∞ FX (x) = 0
example
1
For X with
10 , 0 ≤ x ≤ 10, we have
R x a uniform density
R x 1 f (x) =
y y =x
x
F (x) = −∞ f (y )dy = 0 10 dy = 10 |y =0 = 10
, 0 ≤ x ≤ 10.
Hence

 0, x < 0
x
, 0 ≤ x ≤ 10
F (x) =
 10
1, x ≥ 10
exercise
3.4.10: A continuous r.v. has a cdf given by

 0, y < 0
y 2, 0 ≤ y < 1
FY (y ) =

1, y ≥ 1
Find P( 12 < Y < 34 ) two ways–by using cdf and by using pdf.
Expected values
The expected value
P or the mean of a discrete rv X with pmf p(x)
is µx = E (X ) = x xp(x).
The expected value or
R ∞the mean of a continuous rv X with pdf
f (x) is µx = E (X ) = −∞ xf (x)dx.
example
3.5.1: X is a binomial
r.v. with p = 5/9 and n = 3. Then
P(X = x) = x3 (5/9)x (4/9)3−x , x = 0, 1, 2, 3. What is E (X )?
P
E (X ) = 3x=0 x x3 (5/9)x (4/9)3−x = 5/3.
proposition: Suppose X is a binomial r.v. with parameters n and p.
Then E (X ) = np.
proof see p 141.
proposition: Suppose X is a hypergeometric r.v. with parameters r,
N and n. That is, suppose an urn contains N balls and r of which
are red. A sample n is drawn without replacement. Let X be the
number of red balls in the sample. Then E (X ) = nr /N = np if we
let p be the proportion of red balls in the urn.
example
The pdf of weekly gravel sales X was
3
2
2 (1 − x ), 0 ≤ x ≤ 1
f (x) =
0, otherwise.
R∞
R1
R1
E (X ) = −∞ xf (x)dx = 0 x 23 (1 − x 2 )dx = 23 0 (x − x 3 )dx =
3 x2
2( 2
−
x 4 x=1
4 )|x=0
= 38 .
Exercise
3.5.16. An urn contains 4 chips numbered 1 through 4. Two are
drawn without replacement. Let X be the larger of the two. Find
E (X ).
3.5.12. Show that fY (y ) = y12 , y ≥ 1 is a valid pdf but Y does not
have a finite mean.
The median
The median divides the area under the pdf into two equal areas.
If
R mX is a continuous r.v., its median is the solution to the equation
−∞ f (x)dx = 0.5.
example 3.5.8: if the life of a type of bulbs Y has pdf given by
fY (y ) = 0.001e −0.001y , yR > 0. Find the median of Y .
m
The median m satisfies 0 0.001e −0.001x dx = 0.5, and
m = (1/ − 0.001)ln(0.5) = 693.
Note E (Y ) = 1000 and this is a right skewed distribution.
exercise
3.5.27. Find the median for the following pdf.
fY (y ) = y + 1/2, 0 ≤ y ≤ 1.