Download Math 107H Project: Random Variables and Probability Density

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

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

Document related concepts
Transcript
Math 107H Project: Random Variables and Probability Density Functions
The project is due in class on Friday, December 5th.
1. There’s a technical definition of random variable, but we won’t need it. For our purposes, a random
variable X is just a quantity that varies randomly. Here are a few examples.
a. Let X be the number of hearts in a bridge hand. X is a random variable that can assume values
0, 1, 2, . . . , 13. The set {0, 1, 2, . . . , 13} is the range of X.
b. Throw two dice. The sum S of the two faces is a random variable with range {2, 3, 4, . . . , 12}.
c. Let T be the length (in minutes) of a randomly selected telephone call. (Set T = 0 if no one picks up.)
T can’t be too large; after all, calls don’t last millions of minutes. But there is no mathematical benefit
gained from imposing an arbitrary upper limit on T , so we just take the range to be [0, ∞).
d. Draw a straight line and drop a needle on it. Let Θ be the angle between the line and the needle. (Set
Θ = π/2 if they’re perpendicular; otherwise choose the acute angle.) Θ is a random variable with range
[0, π/2].
There’s a fundamental difference between the random variables X and S on the one hand, and T and Θ
on the other. The ranges of X and S are discrete, but those of T and Θ are not. Probabilists would call
X and S discrete random variables, and T and Θ continuous random variables.
2. Let X be a continuous random variable. The probability P (a ≤ X ≤ b) that X lie between x1 and x2 is
given by the area under the graph of a function f between x1 and x2 . So,
Z x2
P (x1 ≤ X ≤ x2 ) =
f (u) du.
(1)
x1
The function f is called the probability density function (pdf) of X. Since probabilities are nonnegative,
it must be that
f (u) ≥ 0 for all u.
(2)
And since the value of X always lies between negative and positive infinity,
Z ∞
f (u) du = 1.
(3)
−∞
A function f is the pdf of some random variable if and only if it satisfies (2) and (3).
*a. Let a > 0. Prove that
g(t) =
0
for t < 0,
−at
ae
for t ≥ 0,
(4)
is a pdf. A random variable with pdf g(t) is called exponential or exponentially distributed.
*b. Let T be the length in minutes of a randomly chosen phone call. Suppose that T is exponentially
distributed with parameter a = .25. Compute the probability that T ≤ 2. What is the probability that
the call last at least eight minutes?
*c. Prove that
1
1
,
(5)
π 1 + u2
is a pdf. A random variable with this pdf is called Cauchy distributed, or just Cauchy. For a Cauchy
random variable X, compute P (−1 ≤ X ≤ 1).
f (u) =
* Do for credit.
3. The notion of independence simplifies the calculation of probabilities. Roughly put, random variables X
and Y are independent if neither one affects the other. Mathematically, this works out to
P (a ≤ X ≤ b , c ≤ Y ≤ d) = P (a ≤ X ≤ b) × P (c ≤ Y ≤ d).
(6)
Here, (a ≤ X ≤ b , c ≤ Y ≤ d) is the event that X ∈ [a, b] and Y ∈ [c, d]. So if f and g are the pdf’s of
X and Y respectively,
Z
P (a ≤ X ≤ b , c ≤ Y ≤ d) =
b
Z
f (x) dx ×
a
d
g(y) dy.
(7)
c
Equations (6) and (7) extend in the obvious way to three or more independent random variables. We
sometimes need to make computations with sums of independent random variables. You might have to
perform n tasks, one after the other. Let T1 , . . . , Tn be the times taken by the tasks. These times usually
aren’t constants. They vary a bit depending on working conditions, tools, materials, distractions etc.
Hence they’re random variables. If they’re independent, then your total work time,
T = T1 + T2 + · · · + Tn ,
(8)
is the sum of independent random variables. If you want to compute the probability that your project
take between a and b days, you need the pdf of T . The general question is: Given independent random
variables X1 , . . . , Xn , with pdf ’s f1 , . . . , fn , how do you compute the the pdf of the sum X = X1 +· · ·+Xn ?
4. The convolution of functions f and g is
Z
∞
(f ∗ g)(x) =
f (x − y)g(y) dy.
(9)
−∞
You’ll need a few facts about convolutions.
*a. At each point x, the convolution (f ∗ g)(x) is an improper integral. Since improper integrals can diverge,
the convolution is not necessarily defined for every pair f and g. Let f (x) = x and g(x) = 1/(1 + x2 ).
Show that (f ∗ g)(x) is undefined at every point x.
b. Using double integrals (a Math 208 topic) you can show that (f ∗g)(x) is defined at every x if the integrals
of f and g over (−∞, ∞) converge. When f and g are pdf’s, these integrals are equal to 1, and you may
therefore conclude that (f ∗ g)(x) is defined. From now on, we will assume that functions appearing in
convolutions are pdf’s.
*c. Observe that in the definition (9), the first function f (the one to the left of the star) gets the x − y in
the integral, whereas the second function g gets only a y. This suggests that order might matter in the
convolution, i.e. that (f ∗ g)(x) 6= (g ∗ f )(x). This in fact is not the case. Show that
Z ∞
(g ∗ f )(x) =
g(x − y)f (y) dy
−∞
is equal to (f ∗ g)(x). (Hint: Inside the integral, x is fixed. Make a change of variable z = x − y.) In
computing convolutions, it is occasionally easier to use one order or the other.
*d. We often deal with random variables which take only nonnegative values, e.g. the length T of a phone
call. Let f (t) and g(t) be pdf’s for two such random variables. Clearly, f (t) = g(t) = 0 for t < 0. Show
that
Z
t


f (t − s)g(s) ds for t ≥ 0
(f ∗ g)(t) =
0


0
for t < 0
5. Why the digression on convolutions? It turns out that, if X and Y are independent random variables,
with pdf’s f and g, then Z = X + Y has pdf (f ∗ g)(z). Let’s not worry about the proof right now.
*a. You’re on line behind Alice and Bill at the coffee shop. Alice wants a cup of coffee, and Bill wants a
frothy mocha something-or-other. The time to serve a customer who wants plain coffee is an exponential
random variable T1 with parameter α1 = 2. The time to serve someone who wants a frothy mocha thing
is an exponential random variable T2 with parameter α2 = .5. Assume that there is one barrista and
that T1 and T2 are independent. Compute the probability that you’ll be able to order in 3 minutes or
less.
*b. The next day, you’re on line behind Bill. He’s getting his usual, and it looked so good yesterday you’ve
decided to order one also. Let T be the combined service time for Bill and you. Thus T is the sum of
two independent, identically distributed random variables. (I assume that the individual service times
are independent.) Find the pdf of T . Is T exponentially distributed? What is the probability that T ≥ 4
minutes?
6. If one pdf could claim to be more important than the rest, it would no doubt be the normal or Gaussian
pdf
−(x−µ)2
1
e 2σ2 .
(10)
f (x) = √
2πσ 2
The parameter µ is called the mean and σ 2 is the variance. The graph of f is the infamous bell curve. If
you sketch the graph of f for a few values of µ and σ, you’ll see that the curve is centered at x = µ and
that σ 2 controls the “spread.” For large variance, the bell is short and wide, and for small variance, tall
and narrow. You get the standard normal pdf,
1 − z2
ϕ(z) = √ e 2 ,
2π
(11)
by setting µ = 0 and σ = 1. A random variable variable X with a pdf of the form (10) is called Gaussian,
normal, or normally distrubuted.
*a. It isn’t so easy to prove that f is a pdf. It is obviously positive for all x, but you need advanced methods
to show that its integral over the line is equal to 1. To simplify the problem a bit, use a substitution to
show that for any µ and σ > 0,
Z
Z
∞
∞
f (x) dx =
−∞
ϕ(z) dz.
(12)
−∞
With this done you only need to show that ϕ is a pdf. It follows from (12) that f is also.
*b. We don’t have the advanced methods mentioned in part (a) with which to prove that ϕ is a pdf. Instead,
we’ll collect numerical evidence for the claim. Since ϕ(z) is an even function, we need only show that
Z
∞
ϕ(z) dz ≈ .5.
(13)
0
R2
Use Simpson’s rule with n = 10 to approximate 0 ϕ(z) dz. (Three decimal places will do.) Apply
R3
Simpson again with n = 14 to approximate 0 ϕ(z) dz. As the upper limit of integration increases does
the integral seem to approach .5?
*c. Super extra credit bonus problem: A property that makes the normal pdf so important is this: If
X and Y are independent, Gaussian random variables, then Z = X + Y is also Gaussian. (Compare that
to the result of problem 5b.) Prove that claim. If X has mean and variance µ and σ 2 , and Y has mean
and variance ν and τ 2 , what are the mean and variance of Z?