ECE32 Spring 25 HW Solutions April 6, 25 Solutions to HW Note: Most of these solutions were generated by R. D. Yates and D. J. Goodman, the authors of our textbook. I have added comments in italics where I thought more detail was appropriate. Those solutions I have written myself are designated by my initials. Solution to problem 7.2.2 (SK) We are given that random variable X has CDF x <,.2 x <, F X (x).7 x <, x, and that B X > }. We are asked to find P X B (x), E[X B], Var[X B]. First we need the PMF of X. We find x <, /5 x (/5.2 ) f X (x) /2 x (/2.7.2) 3/ x (3/.7) otherwise. (2) So and thus P [B] P [X ] /2 /2 P X B (x) P X(x) P B (x) 2/5 x, 3/5 x, otherwise. Note that because B is the event that X is nonzero, P X B takes nonzero values only for nonzero x. and E[X B] 2/5( ) + 3/5 /5 V ar[x B] E[X 2 ] (E[X]) 2 2/5( ) 2 + 3/5 2 (/5) 2 /25 24/25. Problem 7.2.4 Y is an exponential random variable with parameter λ.2. Given the event A Y < 2}, (a) What is the conditional PDF, f Y A (y)?
ECE32 Spring 25 HW Solutions April 6, 25 2 (b) Find the conditional expected value, E[Y A]. Problem 7.2.4 Solution From Definition 3.6, the PDF of Y is f Y (y) (/5)e y/5 y otherwise (a) The event A has probability P [A] P [Y < 2] 2 (/5)e y/5 dy e y/5 2 From Definition 3.5, the conditional PDF of Y given A is e 2/5 (2) fy (y) /P [A] x A f Y A (y) otherwise (/5)e y/5 /( e 2/5 ) y < 2 otherwise (4) (b) The conditional expected value of Y given A is E [Y A] yf Y A (y) dy /5 e 2/5 2 ye y/5 dy (5) Using the integration by parts formula u dv uv v du with u y and dv e y/5 dy yields E [Y A] ( /5 e 2/5 /5 e 2/5 2 + 5ye y/5 2 ( e 2/5 25e y/5 2 ) 5e y/5 dy ) 5 7e 2/5 e 2/5 (8) (6) (7) Problem 7.2.6 The number of pages X in a document has PMF.5 x, 2, 3, 4 P X (x). x 5, 6, 7, 8 otherwise A firm sends all documents with an even number of pages to printer A and all documents with an odd number of pages to printer B.
ECE32 Spring 25 HW Solutions April 6, 25 3 (a) Find the conditional PMF of the length X of a document, given the document was sent to printer A. What are the conditional expected length and standard deviation? (b) Find the conditional PMF of the length X of a document, given the document was sent to printer B and had no more than six pages. What are the conditional expected length and standard deviation? Problem 7.2.6 Solution Recall that the PMF of the number of pages in a fax is.5 x, 2, 3, 4 P X (x). x 5, 6, 7, 8 otherwise (a) The event that a document was sent to printer A can be expressed mathematically as the event that the number of pages X is an even number. Similarly, the event that a document was sent to [printer] B is the event that X is an odd number. Since S X, 2,..., 8}, we define the set A 2, 4, 6, 8}. Using this definition for A, we have that the event that a document is sent to A is equivalent to the event X A. The event A has probability P [A] P X (2) + P X (4) + P X (6) + P X (8).5 (2) Given the event A, the conditional PMF of X is P X A (x) x A otherwise PX (x) P [A] The conditional first and second moments of X given A is.3 x 2, 4.2 x 6, 8 otherwise E [X A] x E [ X 2 A ] x xp X A (x) 2(.3) + 4(.3) + 6(.2) + 8(.2) 4.6 (4) x 2 P X A (x) 4(.3) + 6(.3) + 36(.2) + 64(.2) 26 (5) The conditional variance and standard deviation are Var[X A] E [ X 2 A ] (E [X A]) 2 26 (4.6) 2 4.84 (6) σ X A Var[X A] 2.2 (7) (b) Let the event B denote the event that the document was sent to B and that the document had no more than 6 pages. Hence, the event B, 3, 5} has probability P [ B ] P X + P X + P X (5).4 (8) The conditional PMF of X given B is P X B (x) PX (x) P [B ] x B otherwise 3/8 x, 3 /4 x 5 otherwise (9)
ECE32 Spring 25 HW Solutions April 6, 25 4 Given the event B, the conditional first and second moments are E [ X B ] x E [ X 2 B ] x xp X B (x) (3/8) + 3(3/8) + 5(/4)+ /4 x 2 P X B (x) (3/8) + 9(3/8) + 25(/4) () The conditional variance and standard deviation are Var[X B ] E [ X 2 B ] (E [ X B ] ) 2 (/4) 2 39/6 (2) σ X B Var[X B ] 39/4.56 Solution to Problem 7.4.4 (SK) We are given that Z N (, ), independent of X, and Y X + Z. We are asked to find the conditional PDF f Y X (y x). There are many theorems that at first glance appear to be potentially useful here. However, we do not need any of them to solve the problem. Going back to the definition of the conditional CDF and the CDF, we have that F Y X (y x) P [Y y X x] (4) P [X + Z y X x] (5) P [x + Z y] (6) P [Z y x] (7) F Z (y x). (8) Then so f Y X (y x) d dy F Y X(y x) (9) f Y X (y x) d dy F Z(y x) (2) z F Z(z) z (2) y f Z (y x) (22) ( ) e (y x)2 /2. 2π (23)
ECE32 Spring 25 HW Solutions April 6, 25 5 Problem 4.9.3 X and Y have joint PDF f X,Y (x, y) (4x + 2y)/3 x ; y, otherwise. (a) For which values of y is f X Y (x y) defined? What is f X Y (x y)? (b) For which values of x is f Y X (y x) defined? What is f Y X (y x)? Problem 7.4.6 Random variables X and Y have joint PDF (4x + 2y)/3 x ; f X,Y (x, y) y, otherwise. Let A Y /2}. (a) What is P [A]? (b) Find f X,Y A (x, y), f X A (x), and f Y A (y). Solution to Problem 7.4.6 (SK) First let s check to be sure that the given joint PDF is valid. (4x + 2y)/3dxdy (2x 2 + 2xy) dy 2x2 y + xy 2 3 (a) For what values of y is f X Y (x y) defined? The conditional PDF is defined for y such that f Y (y) >. Thus f Y (y) (4x + 2y)/3dx 2x2 + 2xy 3 2( + y) 3 3/3. which is defined on [, ] subject to the added (and superfluous here) requirement that y. Now f X Y (x y) f X,Y (x, y) 2x+2y +y x, y [, ] f Y (y) otherwise. (b) For what values of x is f Y X (y x) defined? f Y X(y x) is defined for x such that f X (x). so f X (x) (4x + 2y)/3dy 4xy + y2 3 4x + 3
ECE32 Spring 25 HW Solutions April 6, 25 6 requires x /4. f Y X (y x) f X,Y (x, y) f X (x) 4x+2y 4x+ x, y [, ] otherwise. Solution to 7.4.8 (SK) We are given that Y ZX where X N (, ), X and Z are independent, and p z, P Z (z) p z, otherwise. (a) Putting these together we have that the PDF of Y is either Thus (/2π)e x2 /2 with probability p (/2π)e ( x)2 /2 with probability p. f Y Z (y ) f Y Z (y ) (/2π)e x2 /2 and Y and Z are independent. (b) Note that while conditioning on Z yields a PDF, conditioning on X yields a PMF. p y x P Y X (y x) : P [Y y X x] p y x. Thus by Theorem 7. Y and X are not independent. Problem 7.5.2 Let random variables X and Y have joint PDF f X,Y (x, y) given in Problem 4.9.4. Find the PDF f X (x), the conditional PDF f Y X (y x), and the conditional expected value E[Y X x]. Problem 7.5.2 Solution Random variables X and Y have joint PDF Y f X,Y (x, y) 2 y x otherwise X For x, the marginal PDF for X satisfies f X (x) f X,Y (x, y) dy x 2 dy 2x (2)
ECE32 Spring 25 HW Solutions April 6, 25 7 Note that f X (x) for x < or x >. Hence the complete expression for the marginal PDF of X is 2x x f X (x) otherwise The conditional PDF of Y given X x is f Y X (y x) f X,Y (x, y) f X (x) /x y x otherwise Given X x, Y has a uniform PDF over [, x] and thus has conditional expected value E[Y X x] x/2. Another way to obtain this result is to calculate yf Y X(y x) dy. (4) Problem 7.5.4 The probability model for random variable A is /3 a, P A (a) 2/3 a, otherwise. The conditional probability model for random variable B given A is: /3 b, P B A (b ) 2/3 b, otherwise, P B A (b ) /2 b, /2 b, otherwise. (a) What is the probability model for random variables A and B? Write the joint PMF P A,B (a, b) as a table. (b) If A, what is the conditional expected value E[B A ]? (c) If B, what is the conditional PMF P A B (a )? (d) If B, what is the conditional variance Var[A B ] of A? (e) What is the covariance Cov[A, B] of A and B? Problem 7.5.4 Solution (a) First we observe that A takes on the values S A, } while B takes on values from S B, }. To construct a table describing P A,B (a, b) we build a table for all possible values of pairs (A, B). The general form of the entries is P A,B (a, b) b b a P B A ( ) P A ( ) P B A ( ) P A ( ) a P B A ( ) P A P B A ( ) P A
ECE32 Spring 25 HW Solutions April 6, 25 8 Now we fill in the entries using the conditional PMFs P B A (b a) and the marginal PMF P A (a). This yields P A,B (a, b) b b a (/3)(/3) (2/3)(/3) a (/2)(2/3) (/2)(2/3) (b) Since P A P A,B (, ) + P A,B (, ) 2/3, P B A (b ) P A,B (, b) P A which simplifies to /2 b,, otherwise. P A,B (a, b) b b a /9 2/9 a /3 /3 (2) If A, the conditional expectation of B is E [B A ] bp B A (b ) P B A ( ) /2. (4) b (c) Before finding the conditional PMF P A B (a ), we first sum the columns of the joint PMF table to find 4/9 b P B (b) (5) 5/9 b The conditional PMF of A given B is P A B (a ) P A,B (a, ) P B 2/5 a 3/5 a (d) Now that we have the conditional PMF P A B (a ), calculating conditional expectations is easy. E [A B ] ap A B (a ) (2/5) + (3/5) /5 (7) E [ A 2 B ] a, a, The conditional variance is then (6) a 2 P A B (a ) 2/5 + 3/5 (8) Var[A B ] E [ A 2 B ] (E [A B ]) 2 (/5) 2 24/25 (9) (e) To calculate the covariance, we need E [A] ap A (a) (/3) + (2/3) /3 E [B] E [AB] a, bp B (b) (4/9) + (5/9) 5/9 () b a, b abp A,B (a, b) (2) ()(/9) + (2/9) + ()(/3) + (/3) /9
ECE32 Spring 25 HW Solutions April 6, 25 9 The covariance is just Cov [A, B] E [AB] E [A] E [B] /9 (/3)(5/9) 2/27 (4)