Skip to main content

CS 70 Fall 2017 Discrete Mathematics and Probability Theory Kannan Ramchandran and Satish Rao

Page 1

CS 70

Discrete Mathematics and Probability Theory

Fall 2017

Kannan Ramchandran and Satish Rao

HW 12 Sundry Before you start your homework, write down your team. Who else did you work with on this homework? List names and email addresses. (In case of homework party, you can also just describe the group.) How did you work on this homework? Working in groups of 3-5 will earn credit for your "Sundry" grade. Please copy the following statement and sign next to it: I certify that all solutions are entirely in my words and that I have not looked at another student’s solutions. I have credited all external sources in this write up. I certify that all solutions are entirely in my words and that I have not looked at another student’s solutions. I have credited all external sources in this write up. (signature here)

1

Darts with Friends

Michelle and Alex are playing darts. Being the better player, Michelle’s aim follows a uniform distribution over a circle of radius r around the center. Alex’s aim follows a uniform distribution over a circle of radius 2r around the center. (a) Let the distance of Michelle’s throw be denoted by the random variable X and let the distance of Alex’s throw be denoted by the random variable Y . • What’s the cumulative distribution function of X? • What’s the cumulative distribution function of Y ? • What’s the probability density function of X? • What’s the probability density function of Y ? (b) What’s the probability that Michelle’s throw is closer to the center than Alex’s throw? What’s the probability that Alex’s throw is closer to the center? (c) What’s the cumulative distribution function of U = min{X,Y }? (d) What’s the cumulative distribution function of V = max{X,Y }?

CS 70, Fall 2017, HW 12

1


(e) What is the expectation of the absolute difference between Michelle’s and Alex’s distances from the center, that is, what is E[|X −Y |]? [Hint: There are two ways of solving this part.] Solution: (a)

• To get the cumulative distribution function of X, we’ll consider the ratio of the area where the distance to the center is less than x, compared to the entire available area. This gives us the following expression: P(X ≤ x) =

πx2 x2 = , πr2 r2

x ∈ [0, r]

• Using the same approach as the previous part: P(Y ≤ y) =

πy2 y2 = , π · 4r2 4r2

y ∈ [0, 2r]

• We’ll take the derivative of the CDF to get the following: fX (x) =

dP(X ≤ x) 2x = 2, dx r

x ∈ [0, r]

• Using the same approach as the previous part: fY (y) =

y dP(Y ≤ y) = 2, dy 2r

y ∈ [0, 2r]

(b) We’ll condition on Alex’s outcome and then integrate over all the possibilities to get the marginal P(X ≤ Y ) as following: Z r 2 y

Z 2r

2r y y P(X ≤ Y ) = × dy + P(X ≤ Y | Y = y) fY (y) dy = 1 × 2 dy 2 2 2r 2r 0 r 0 r 4 2 2 r − 0 4r − r 1 3 7 = + = + = 4 2 8r 4r 8 4 8

Z

Note the range within which P(X ≤ Y ) = 1. This allowed us to separate the integral to simplify our solution. Using this, we can get P(Y ≤ X) by the following: P(Y ≤ X) = 1 − P(X ≤ Y ) =

1 8

A similar approach to the integral above could be used to verify this result. x2 2x 1 P(Y ≤ X) = dx = 4 P(Y ≤ X | X = x) fX (x) dx = 2 2 2r 0 0 4r r Z r

CS 70, Fall 2017, HW 12

Z r

Z r 0

x3 dx =

r4 1 = 4 8r 8

2


(c) Getting the CDF of U relies on the insight that for the minimum of two random variables to be greater than a value, they both need to be greater than that value. Taking the complement of this will give us the CDF of U. This allows us to get the following result. For u ∈ [0, r]: P(U ≤ u) = 1 − P(U ≥ u) = 1 − P(X ≥ u)P(Y ≥ u) = 1 − 1 − P(X ≤ u) 1 − P(Y ≤ u) u2 u2 5u2 u4 = 1− 1− 2 1− 2 = 2 − 4 r 4r 4r 4r For u > r, we get P(X > u) = 0, this makes P(U ≤ u) = 1. (d) Getting the CDF of V also relies on a similar insight that for the maximum of two random variables to be smaller than a value, they both need to be smaller than that value. Using this we can get the following result for v ∈ [0, r]: P(V ≤ v) = P(X ≤ v)P(Y ≤ v) =

v2 v2 r2

4r2

=

v4 4r4

For v ∈ [r, 2r] we have P(X ≤ v) = 1, this makes P(V ≤ v) = P(Y ≤ v) =

v2 . 4r2

For v > 2r we have P(V ≤ v) = 1 since CDFs of both X and Y are 1 in this range. (e) We can subtract U from V to get this difference. Using the tail-sum formula to calculate the expectation, we can get the following result: E[|X −Y |] = E[V −U] = E[V ] − E[U] =

Z 2r 0

P(V > v) dv −

Z r 0

P(U > u) du

2r r v4 u4 v2 5u2 = 1 − 4 dv + 1 − 2 dv − 1 − 2 + 4 du 4r 4r 4r 4r 0 r 0 19r 5r 19r 11r + − = = 20 12 30 15

Z r

Z

Z

Alternatively, you could derive the density of U and V and use those to calculate the expectation. For v ∈ [0, r]: dP(V ≤ v) v3 fV (v) = = 4 dv r For v ∈ [r, 2r]: dP(V ≤ v) v fV (v) = = 2 dv 2r Using this we can calculate E[V ] as: Z 2r

E[V ] =

0

v fV (v) dv =

1 r4

Z r

v4 dv +

0

1 2r2

Z 2r r

v2 dv =

r5 8r3 − r3 r 7r 41r + = + = 5r4 6r2 5 6r 30

To calculate E[U] we will use the following PDF for u ∈ [0, r]: fU (u) = CS 70, Fall 2017, HW 12

dP(U ≤ u) 5u u3 = 2− 4 du 2r r 3


We can get the E[U] by the following: Z r

E[U] =

0

u fU (u) du =

Z r 0

5u2 u4 5r3 r5 5r r 19r du = − − = − = 2 4 2 4 2r r 6r 5r 6 5 30

Combining the two results gives us the same result as above: E[|X −Y |] = E[V −U] = E[V ] − E[U] =

2

41r 19r 11r − = 30 30 15

Variance of the Minimum of Uniform Random Variables i.i.d.

Let n be a positive integer and let X1 , . . . , Xn ∼ Uniform[0, 1]. Find varY , where Y := min{X1 , . . . , Xn }.

Solution: We know that the density of Y is f (y) = n(1 − y)n−1 , for y ∈ [0, 1], and E[Y ] = (n + 1)−1 . It remains to compute (via integration by parts) Z 1

2

E[Y ] =

2

n−1

y · n(1 − y)

Z 1

dy = n

0

2 = n+1

2

n−1

y (1 − y)

2

dy = −y (1 − y)

0

Z 1

n

Z 1

1 0

+2

y(1 − y)n dy

0

y(n + 1)(1 − y)n dy.

0

Since g(y) := (n + 1)(1 − y)n is the density of the minimum of n + 1 i.i.d. Uniform[0, 1] random variables, we recognize the last integral as the expectation of this minimum, which is 1/(n + 2). Thus, E[Y 2 ] =

2 (n + 1)(n + 2)

and so varY = E[Y 2 ] − E[Y ]2 =

1 2(n + 1) − (n + 2) n 2 − = = . (n + 1)(n + 2) (n + 1)2 (n + 1)2 (n + 2) (n + 1)2 (n + 2)

Fun Fact: For a non-negative random variable X with density fX , one can extend the tail sum formula to give Z ∞ Z ∞ Z x Z ∞ Z ∞ Z ∞ E[X 2 ] = x2 fX (x) dx = 2s ds fX (x) dx = 2s fX (x) dx ds = 2sP(X ≥ s) ds 0

0

0

0

s

0

and this gives another way to compute E[Y 2 ] in this problem. You can derive a similar formula to compute any moment E[X k ] for k ∈ N. CS 70, Fall 2017, HW 12

4


3

Exponential Practice

Let X ∼ Exponential(λX ) and Y ∼ Exponential(λY ) be independent, where λX , λY > 0. Let U = min{X,Y }, V = max{X,Y }, and W = V −U. (a) Compute P(U > t, X ≤ Y ), for t ≥ 0. (b) Use the previous part to compute P(X ≤ Y ). Conclude that the events {U > t} and {X ≤ Y } are independent. (c) Compute P(W > t | X ≤ Y ). (d) Use the previous part to compute P(W > t). (e) Calculate P(U > u,W > w), for w > u > 0. Conclude that U and W are independent. [Hint: Think about the approach you used for the previous parts.] Solution: (a) One has P(U > t, X ≤ Y ) = P(t < X ≤ Y ) =

Z ∞Z ∞ t

fX,Y (x, y) dy dx

x

Z ∞Z ∞

= t

x

λX exp(−λX x)λY exp(−λY y) dy dx

exp(−λY x) dx = λX = λX λY exp(−λX x) · λY t λX = exp −(λX + λY )t . λX + λY Z ∞

Z ∞ t

exp −(λX + λY )x dx

(b) Take t = 0. P(X ≤ Y ) =

λX . λX + λY

Since X and Y are independent exponentials, U = min{X,Y } ∼ Exponential(λX + λY ). So, P(U > t) = exp(−(λX + λY )t), and therefore we have P(U > t, X ≤ Y ) = P(X ≤ Y )P(U > t). (c) One has P(W > t, X ≤ Y ) = P(Y − X > t) =

Z ∞Z ∞ 0

x+t

λX exp(−λX x)λY exp(−λY y) dy dx

exp(−λY (x + t)) dx λY 0 Z ∞ = λX exp(−λY t) exp −(λX + λY )x dx = Z ∞

= λX λY

exp(−λX x) ·

0

CS 70, Fall 2017, HW 12

λX exp(−λY t). λX + λY

5


Turn static files into dynamic content formats.

Create a flipbook
CS 70 Fall 2017 Discrete Mathematics and Probability Theory Kannan Ramchandran and Satish Rao by AnswerDone - Issuu