10

Click here to load reader

MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

Embed Size (px)

Citation preview

Page 1: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

MATH 105 921 Solutions to Probability Exercises

Problem 1. Suppose we flip a fair coin once and observe either T for ”tails” or H for”heads”. Let X1 denote the random variable that equals 0 when we observe tails and equals1 when we observe heads. (This is called a Bernoulli random variable.)

(a) Make a table of the PDF of X1 and calculate E(X1) and Var(X1).

Solution: We have the following PDF table of X1:

x Pr(X1 = x)0 1

2

1 12

The expected value is:

E(X1) =

(1

2

)0 +

(1

2

)1 =

1

2.

The variance is:

Var(X1) =

(1

2

)(0− 1

2

)2

+

(1

2

)(1− 1

2

)2

=1

4.

(b) Now suppose that we flip a fair coin twice. We will observe one of four events: TT, TH,HT, or HH. Let X2 be the random variable that counts the number of heads we observe.(So, X2 can take the values 0, 1 or 2.) Redo part (a) for this new random variable.

Solution: We have the following PDF table of X2:

x Pr(X2 = x)0 1

4

1 12

2 14

The expected value is:

E(X2) =

(1

4

)0 +

(1

2

)1 +

(1

4

)2 = 1.

The variance is:

Var(X2) =

(1

4

)(0− 1)2 +

(1

2

)(1− 1)2 +

(1

4

)(2− 1)2 =

1

2.

Page 1 of 10

Page 2: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

(c) Let X3 be the random variable that counts the number of heads we observe after threesuccessive flips of a fair coin. Redo part (a) for this new random variable.

Solution: We have the following PDF table of X3:

x Pr(X3 = x)0 1

8

1 38

2 38

3 18

The expected value is:

E(X3) =

(1

8

)0 +

(3

8

)1 +

(3

8

)2 +

(1

8

)3 =

3

2.

The variance is:

Var(X3) =

(1

8

)(0− 3

2

)2

+

(3

8

)(1− 3

2

)2

+

+

(3

8

)(2− 3

2

)2

+

(1

8

)(3− 3

2

)2

=3

4.

(d) Do you notice any patterns in your calculations? Make a guess for the pdf table, theexpectation and the variance of X4, the random variable that counts the number ofheads we observe after four successive flips of a fair coin, and then verify your guess bydirect computation.

Solution: We have the following PDF table of X4:

x Pr(X4 = x)0 1

16

1 14

2 38

3 14

4 116

The expected value is:

E(X4) =

(1

16

)0 +

(1

4

)1 +

(3

8

)2 +

(1

4

)3 +

(1

16

)4 = 2.

Page 2 of 10

Page 3: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

The variance is:

Var(X4) =

(1

16

)(0− 2)2 +

(1

4

)(1− 2)2 +

+

(3

8

)(2− 2)2 +

(1

4

)(3− 2)2 +

(1

16

)(4− 2)2

= 1.

Problem 5. Recall the example of rolling a six-sided die. This is an example of a discreteuniform random variable, so named because the probability of observing each distinct out-come is the same, or uniform, for all outcomes. Let Y be the discrete uniform randomvariable that equals the face-value after a roll of an eight-sided die. (The die has eight faces,each with number 1 through 8.) Calculate E(Y ), Var(Y ), and StdDev(Y ).

Solution: We have the following PDF table of Y :

x Pr(Y = x)1 1

8

2 18

3 18

4 18

5 18

6 18

7 18

8 18

The expected value is:

E(Y ) =8∑

x=1

xPr(Y = x) =1

8

(8∑

x=1

x

)=

1

8

(8(9)

2

)=

9

2.

The variance is:

Var(Y ) =8∑

x=1

(x− E(Y ))2 Pr(Y = x) =1

8

(8∑

x=1

(x− 9

2

)2)

=1

8(42) =

21

4.

The standard deviation is:

StdDev(Y ) =√

Var(Y ) =

√21

4=

√21

2.

Page 3 of 10

Page 4: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

Problem 9. Are the following functions PDF’s?

(a) f(x) =

{12x2(x− 1) if 0 < x < 1

0 if otherwise.

Solution: f(x) is not a PDF because it fails the property that f(x) ≥ 0 for allx ∈ R. In fact, for any 0 < x < 1, we have that 12x2 > 0 (being an even power), butx− 1 < 0. So, for any 0 < x < 1,

f(x) = 12x2(x− 1) < 0.

For example, f

(1

2

)= −3

2< 0.

(b) f(x) =

{1− |x| if |x| ≤ 1

0 if otherwise..

Solution: f(x) is a PDF because it satisfies the following two properties:

• If |x| ≤ 1, then f(x) = 1 − |x| ≥ 0, and if |x| > 1, then f(x) = 0 ≥ 0, trivially.Thus, f(x) ≥ 0 for all x ∈ R.

• Observe that we may rewrite f(x) in more explicit form as:

f(x) =

1 + x if −1 < x < 0

1− x if 0 < x < 1

0 if otherwise.

So, ∫ ∞−∞

f(x) dx =

∫ 0

−1(1 + x) dx+

∫ 1

0

(1− x) dx

=

(x+

x2

2

)|0−1 +

(x− x2

2

)|10

= 0 + 1− 1

2+ 1− 1

2− 0 = 1.

Thus,

∫ ∞−∞

f(x) dx = 1.

(c) f(x) =

{π2

cos(πx) if |x| < 12

0 if otherwise.

Page 4 of 10

Page 5: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

Solution: f(x) is a PDF because it satisfies the following two properties:

• If |x| ≤ 1

2, then −π

2≤ πx ≤ π

2, which means that cos(πx) ≥ 0. Therefore,

f(x) =π

2cos(πx) ≥ 0 for |x| ≤ 1

2. If |x| > 1

2, then f(x) = 0 ≥ 0 trivially. Thus,

f(x) ≥ 0 for all x ∈ R.

• We have that:∫ ∞−∞

f(x) dx =

∫ 12

− 12

π

2cos(πx) dx

=1

2sin(πx) |

12

− 12

=1

2sin(π

2

)− 1

2sin(−π

2

)=

1

2+

1

2= 1.

Thus,

∫ ∞−∞

f(x) dx = 1.

(d) f(x) =

{12

if |x| ≤ 2

0 if otherwise.

Solution: f(x) is not a PDF because it fails to satisfy the property that

∫ ∞−∞

f(x) dx =

1. In fact, we have that: ∫ ∞−∞

f(x) dx =

∫ 2

−2

1

2dx

=1

2x |2−2

=1

2(2− (−2)) = 2.

Thus,

∫ ∞−∞

f(x) dx = 2 6= 1.

Problem 14. What is the CDF of the density function1

π(1 + x2)?

Page 5 of 10

Page 6: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

Solution: Recall that given a PDF f(x), we can find the CDF as follows:

F (x) =

∫ x

−∞f(t) dt

= lima→−∞

∫ x

a

1

π(1 + t2)dt

= lima→−∞

1

πarctan t |xa

= lima→−∞

1

πarctanx− 1

πarctan a

=1

πarctanx+

1

2.

Thus, the CDF of the given density function is F (x) =1

πarctanx+

1

2for any x ∈ R.

Problem 15. Show that p(x) =e−x

(1 + e−x)2on x ∈ R is a PDF.

Solution: To show that p(x) is a PDF, we need to verify the following two properties:

• We observe that e−x > 0 (being an exponential function), and (1+e−x)2 > 0 (beingan even power) for all x ∈ R. Thus,

p(x) =e−x

(1 + e−x)2> 0 for all x ∈ R.

• We have that: ∫ ∞−∞

p(x) dx =

∫ 0

−∞p(x) dx+

∫ ∞0

p(x) dx,

if both improper integrals on the right hand side converge. Using direct substitutionwith u = 1 + e−x, and du = −e−x dx, we get:∫

e−x

(1 + e−x)2dx =

∫−u−2 du = u−1 + C = (1 + e−x)−1 + C

Thus,∫ 0

−∞p(x) dx = lim

a→−∞

∫ 0

a

p(x) dx = lima→−∞

(1 + e−x)−1 |0a= lima→−∞

1

2− 1

1 + e−a=

1

2,∫ ∞

0

p(x) dx = limb→∞

∫ b

0

p(x) dx = limb→∞

(1 + e−x)−1 |b0= limb→∞

1

1 + e−b− 1

2=

1

2,∫ ∞

−∞p(x) dx =

1

2+

1

2= 1.

Page 6 of 10

Page 7: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

So,

∫ ∞−∞

p(x) dx = 1.

Therefore, p(x) is a PDF.

Problem 19. Let Z be a standard normal random variable (the classic ”bell curve”,given by the density:

φ(x) =1√2πe−

x2

2 .

Verify that E(Z) = 0.

Solution: We have that:

E(Z) =

∫ ∞−∞

xφ(x) dx =

∫ 0

−∞xφ(x) dx+

∫ ∞0

xφ(x) dx,

if both improper integrals on the right hand side converge. Using direct substitution

with u = −x2

2and du = −x dx to find an antiderivative of xφ(x), we get:∫

xφ(x) dx =

∫1√2πxe−

x2

2 dx =

∫− 1√

2πeu du = − 1√

2πeu + C = − 1√

2πe−

x2

2 + C

Thus, ∫ 0

−∞xφ(x) dx = lim

a→−∞

∫ 0

a

xφ(x) dx = lima→−∞

− 1√2πe−

x2

2 |0a= −1√2π,∫ ∞

0

xφ(x) dx = limb→∞

∫ b

0

xφ(x) dx = limb→∞− 1√

2πe−

x2

2 |b0=1√2π,

E(Z) = − 1√2π

+1√2π

= 0.

Therefore, E(Z) = 0, as desired.

Problem 20. Expectations (and variances) need not be finite. Let X be a Cauchy

random variable given by the PDF: p(x) =1

π(1 + x2), for x ∈ R.

(a) Prove that E(X) does not exist (i.e. the expectation is infinite).

Page 7 of 10

Page 8: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

Solution: We have that:

E(X) =

∫ ∞−∞

xf(x) dx =

∫ 0

−∞xf(x) dx+

∫ ∞0

xf(x) dx,

if both improper integrals on the right hand side converge. Using direct substitutionwith u = 1 + x2 and du = 2x dx to find an antiderivative of xf(x), we get:∫

xf(x) dx =

∫x

π(1 + x2)dx =

∫1

2πu−1 du =

1

2πln |u|+ C =

1

2πln(1 + x2) + C

Thus,∫ 0

−∞xf(x) dx = lim

a→−∞

∫ 0

a

xf(x) dx = lima→−∞

1

2πln(1 + x2) |0a= lim

a→−∞− 1

2πln(1 + a2) = −∞

Since

∫ 0

−∞xf(x) dx diverges, the improper integral

∫ ∞−∞

xf(x) dx also diverges. There-

fore, the expectations E(X) does not exist.

Problem 21. Let p(x) =1

βe−

xβ for 0 ≤ x < ∞, β > 0, an exponential random variable

with parameter β.

(a) Show that this density integrates to 1.

Solution: We have that:∫ ∞−∞

p(x) dx =

∫ ∞0

1

βe−

xβ dx

= limb→∞

∫ b

0

1

βe−

xβ dx

= limb→∞−e−

xβ |b0

= limb→∞−e−

bβ + 1 = 1.

Thus,

∫ ∞−∞

p(x) dx = 1, as desired.

(b) Calculate Pr(X ≥ 1), E(X) and StdDev(X), for the exponential random variable X.

Page 8 of 10

Page 9: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

Solution: We have that:

Pr(X ≥ 1) =

∫ ∞1

p(x) dx

=

∫ ∞1

1

βe−

xβ dx

= limb→∞

∫ b

1

1

βe−

xβ dx

= limb→∞−e−

xβ |b1

= limb→∞−e−

bβ + e−

⇒ Pr(X ≥ 1) = e−1β .

Using integration by parts with u = x, du = dx, and dv = e−xβ dx, v = −βe−

xβ , we

find that the expected value is:

E(X) =

∫ ∞−∞

xp(x) dx

=

∫ ∞0

1

βxe−

xβ dx

= limb→∞

∫ b

0

1

βxe−

xβ dx

= limb→∞

(−xe−

xβ − βe−

)|b0

= limb→∞−be−

bβ − βe−

bβ + 0 + β (using L’Hopital’s Rule)

⇒ E(X) = β.

To find StdDev(X), we first compute Var(X) as follows:

Var(X) =

∫ ∞−∞

(x− E(X))2p(x) dx =

∫ ∞0

1

β(x− β)2e−

xβ dx

=

∫ ∞0

(1

βx2e−

xβ − 2xe−

xβ + βe−

)dx

= limb→∞

∫ b

0

(1

βx2e−

xβ − 2xe−

xβ + βe−

)dx

Using integration by parts twice on the first summand and integration by parts once

Page 9 of 10

Page 10: MATH 105 921 Solutions to Probability Exercisesathena/P1S1.pdf · 2012-07-16 · MATH 105 921 Solutions to Probability Exercises (c) Let X 3 be the random variable that counts the

MATH 105 921 Solutions to Probability Exercises

on the second summand, we get the following antiderivative of the integrand:

Var(X) = limb→∞

∫ b

0

(1

βx2e−

xβ − 2xe−

xβ + βe−

)dx

= limb→∞

(−β2e−

xβ − x2e−

)|b0

= lim→∞

(−β2e−

bβ − b2e−

bβ + β2 + 0

)(using L’Hopital’s Rule)

⇒ Var(X) = β2.

Therefore, StdDev(X) =√

Var(X) =√β2 = β, since β > 0.

Problem 24. Let X be a Laplace random variable given by the PDF: p(x) =1

2e−|x| for

x ∈ R.

(a) Verify that p(x) is in fact a valid PDF.

Solution: p(x) is a valid PDF because it satisfies the following two properties:

• For any real number x, we have that e−|x| ≥ 0 (being an exponential function).

Thus, p(x) =1

2e−|x| ≥ 0 for all x ∈ R.

• Observe that we may rewrite p(x) in more explicit form as:

p(x) =

{12ex if x < 0

12e−x if 0 ≤ x

So, ∫ ∞−∞

p(x) dx =

∫ 0

−∞

1

2ex dx+

∫ ∞0

1

2e−x dx (if both integrals converge)

= lima→−∞

∫ 0

a

1

2ex dx+ lim

b→∞

∫ b

0

1

2e−x dx

= lima→−∞

1

2ex |0a + lim

b→∞−1

2e−x |b0

= lima→−∞

1

2(1− ea) + lim

b→∞−1

2

(e−b − 1

)=

1

2+

1

2= 1.

Thus,

∫ ∞−∞

p(x) dx = 1.

Page 10 of 10