DS-GA 2: PEEQUISIES EVIEW SOLUIONS VLADIMI KOBZA he following is a selection of questions (drawn from Mr. Bernstein s notes) for reviewing the prerequisites for DS-GA 2. Questions from Ch, 8, 9 and 2 of Stewart will also be suitable for this purpose.. Sets Our model of probability will be based on set theory, and thus we will review the necessary concepts. () Let A t2, 3, 5u, B t, 3u, and suppose we are working in the universe S t, 2,..., 8u. (a) What is A Y B? What is A X B (written AB in oss)? (b) What is BzA? What is AzB? (c) What is A c (read A complement )? (d) What is A X B c? What is pa X B c q Y pa X Bq? (e) What is ta ˆ Bu? (f) Is A Ă B? Is B Ă A? Is A Ă A? (2) If A 5 and B, what can we say about A Y B? (3) If A,..., A n Ă S, for some universe S, give an expression for p Ť n A kq c in terms of an intersection. (4) What is Ť 8 np3, nq? Here p3, nq denotes the open interval tx P : 3 ă x ă nu? (5) What is Ş 8 np {n, {nq? Soln: () (a) A Y B t, 2, 3, 5u? A X B t3u. (b) BzA tu, AzB t2, 5u. (c) A c t, 4,, 7, 8u. (d) A X B c AzB t2, 5u? pa X B c q Y pa X Bq A (since B and B c partition S). (e) ta ˆ Bu tp2, q, p2, 3q, p3, q, p3, 3q, p5, q, p5, 3qu. (f) No. No. Yes. (2) ď A Y B A ` B A X B ď 5. (3) By De Morgan s laws, p Ť n A kq c Ş n Ac k. (4) Ť 8 np3, nq p3, 8q. Date: September, 2.
2 VLADIMI KOBZA (5) Ş 8 np {n, {nq (for every x, there is n sufficiently large s.t. x p {n, {nq, but P p {n, {nq for every n). 2. Series We will also need series/sums as they frequently occur when computing probabilities. ry proving each of the following commonly used results. () ř n k npn`q and ř n 2 k2 npn`qp2n`q. Soln: he first result follows by summing p `... ` nq ` pn `... ` q. For the second result, the base case (n=) is clear: 2 3. By the inductive hypothesis, we get n` ÿ k 2 nÿ k 2 ` pn ` q 2 npn ` qp2n ` q pn ` q2 ` pn ` qp2n2 ` 7n ` q pn ` qpn ` 2qp2pn ` q ` q as desired. (2) ř n k rk rn` for r and n ` if r. r Soln: For r, we have a telescoping series nÿ nÿ r k p rqr k r k If r, (3) For r ă, k p rq ` pr r2 q `... ` pr n r n` q r rn` r k nÿ r k k nÿ n ` k r k r, 8 ÿ k 2 r k r ` r2 p rq 3
DS-GA 2: PEEQUISIES EVIEW SOLUIONS 3 Soln: For the first result, lim nÿ nñ8 k r k lim nñ8 r n` r r For the second result, we use the ratio test to confirm the convergence lim a k` lim pk ` q2 r k` kñ8 kñ8 k 2 r k a k We can then expand the sum into a telescoping series though that requires slightly more algebra that the previous result. Alternatively, we can obtain the result by term-by-term differentiation. For a given r ă, let a ă be s.t. r P r a, as. Starting wth fptq t ` t ` t2 `... he term-by-term differentiated series is ř 8 krk converges uniformly on r a, as. herefore, the derivative of f is given by term-by-term differentiation, f ptq d dt p t q p tq 2 8 ÿ Multiplying by t, we get tf ptq kt k t p tq 2 kt k epeat the term-by-term differentiation to get f 2 ptq 2 pt q 3 8 ÿ kpk qt k 2 and set t 2 f 2 ptq kpk qt k
4 VLADIMI KOBZA Finally, set t r and observe that k 2 r k r 2 f 2 prq ` rf prq r 2 p 2 pr q q ` r 3 p rq 2 r ` r2 p rq 3 lim a k` lim kñ8 a k kñ8 x k` k! pk ` q! x k (4) e x ř 8 x k k for all x P. We define the function e x by the k! foregoing series and use the ratio test again to confirm the convergence. Since this limit is less than, the series converges (in fact, it converges absolutely). (5) he harmonic series ř 8 n diverges. he p-series ř 8 n n converges for p ą and diverges for p ď (can prove using integral n p test or Cauchy condensation test). Soln: By the integral test, if fpxq ě and f decreases monotonically on r, 8q then fpnq n converges if and only if 8 fpxqdx converges. hen, by explicit computation, ş 8 dx converges for x p p ą and diverges for p ď. Alternatively, by the Cauchy condensation test, the convergence of a monotonically decreasing sequence is determined by a condensed subsequence. Specifically, suppose a ě a 2 ě... ě. hen the series ř 8 n converges if and only if the series 2 n a 2 n a ` 2a 2 ` 4a 4 ` 8a 8 `... n converges. (For a proof, see e.g., udin, heorem 3.27.) If p ď, then lim 8 nñ8 Ñ 8. herefore the series diverges. n p If p ą, then the series is monotonically decreasing. By the condensation test, we consider
DS-GA 2: PEEQUISIES EVIEW SOLUIONS 5 2 n a 2 n n n 2 n 2 np 8 ÿ n 2 p n his geometric series converges if and only if 2 p ă, which is equivalent to p ă. Most of the series manipulations we have to make will involve modifying or matching the pattern with well-known series. () Give a series equal to the expression. Where does it converge? 4x 2 (2) Give a (non-series) expression for ř 8 (3) Give a (non-series) expression for ř 8 k n p qn x 3n where x ă. e tke λ λ k where λ ą and k! t P. (4) Compute a non-series expression for ř 8 k kxk when x ă. Soln: () ř 8 4x 2 k p4x2 q k converges for x ă {2. (2) ř 8 n p qn x 3n (3) ř 8 k p x 3 q. e tk e λ λ k k! e λ exppe t λq e λpet q. (4) (same as part of 2.(3) above) For a given x ă, let a ă be s.t. x P r a, as. Starting wth fptq t ` t ` t2 `... the term-by-term differentiated series is ř 8 krk. It converges uniformly on r a, as. herefore, the derivative of f is given by term-by-term differentiation, f ptq d dt p t q p tq 2 8 ÿ Multiplying by t, we get tf ptq kt k t p tq 2 kt k Letting t x kx k x p xq 2
VLADIMI KOBZA 3. Functions We will study random quantities (like the number of heads in a sequence of coin flips) using so-called random variables, which are realvalued functions. Here we will review basic facts about functions. ecall that a function f : X Ñ Y assigns to each element of X (the domain) exactly one element of Y (the codomain). he image (or range) of a function is the set fpxq defined by fpxq tfpxq : x P Xu Given any function (even non-invertible functions) we can form something called the preimage. More precisely, if A Ă Y, then f paq tx P X : fpxq P Au, called the preimage of A under f. We can perform algebra on real-valued functions in a natural way. For instance, if f, g : X Ñ, then pf ` gqpxq fpxq ` gpxq and pf 2 qpxq fpxq 2 () Let X 5 and Y 7. (a) How many functions f : X Ñ Y are there? (b) How many of them are injective? (ecall that a function is injective or one-to-one if fpx q fpx 2 q implies x x 2 for all x, x 2 P X. In the language of calculus/precalculus, injective functions pass the horizontal line test, and thus can be inverted, i.e., we get a function f : fpxq Ñ X.) (c) How many of them are surjective (we say that a function is surjective or onto if fpxq Y )? (d) How many have images of size 3? (2) Let f : Ñ be defined by fpxq x 2. What is f pr, 2sq? In other words, what is tx : fpxq P r, 2su? (3) Let X tpd, d 2 q : ď d i ď u and Y. If f, g : X Ñ Y with fpx, x 2 q x and fpx, x 2 q x 2, then what is pf `gq pt7uq tx P X : pf ` gqpxq 7u? Soln: () (a) Every domain element ican be mapped to any one of the 7 range elements. hus, there are 7 5 functions f : X Ñ Y. (b) Every domain element can be mapped to any one of the 7 range elements, provided that no other domain element is also mapped to that range element. hus, there are 7 5 4 3 injective functions f : X Ñ Y. (c) None (since an domain element can t be mapped to more than one range element).
DS-GA 2: PEEQUISIES EVIEW SOLUIONS 7 (d) here are `7 3 different images, and the function needs to be surjective on each such image. here are 3 5 total functions with an image of size 3, of which, by inclusion-exclusion principle, `3 25 `3 2 5 are non-surjective on such image. hus, ˆ7 ˆ3 ˆ3 p3 5 2 5 ` 5 q 3 2 functions have images of size 3. (2) he preimage f pr, 2sq is given by r?2, s Y r,? 2s. (3) pf ` gq pt7uq tpd, d 2 q : d ` d 2 7; ď d i ď u. If the domain is a square in, then the preimage is the line interval from (,) to (,). If the domain is Z 2, then the preimage is tp, q, p2, 5q, p3, 4q, p4, 3q, p5, 2q, p, qu. 4. Single-variable calculus ecall a few results from single-variable calculus. Let f : ra, bs Ñ be integrable. If f ě then ş b f represents the area of the region a beneath f. For g : Ñ we define b gpxqdx lim añ if the limit exists. Note that if g ě then Gpbq b b a gpxqdx gpxqdx is an increasing function. he FC connects the definite integral, which computes the area, to the anti-derivative. heorem. (Version of FC) () Assume f : Ñ is integrable, and define F by F pxq x fptqdt hen F pxq fpxq where f is continuous. (2) Suppose f : pa, bq Ñ is continuous, and there is a function F : ra, bs Ñ that is continuous with F pxq fpxq for all x P pa, bq. hen b Here are a few exercises. a fpxqdx F pbq F paq
8 VLADIMI KOBZA () Which is bigger, or are they equal: e u du or e x2 dx (2) Let F pxq ş x fptqdt sinpex2 q for all x P. What is ş 47 fptqdt? 5 (3) Let fpxq e x. (a) What is F pxq ş x fptqdt? (b) What is F pxq? (4) If F pxq ş 3x 2 2x e t2 dt then what is F pxq? (5) Define fpxq by if x ă, $ & if ď x ă, 2 ` x if ď x ă 2, % if x ě 2. (a) What is F pxq ş x fptqdt? (b) What is F pxq? Soln: () By substitution, u x 2, du 2xdx, (2) since 2x ą. 47 5 e u du e x2 2xdx ą e x2 dx. fptqdt F p47q F p 5q sinpe 452 q sinpe p 5q2 q. (3) Let fpxq e x. (a) If x ď, (b) If x ą, F pxq F pxq x e t dt ` x e t dt e x e t dt 2 e x # F e x if x ď pxq e x if x ą e x
DS-GA 2: PEEQUISIES EVIEW SOLUIONS 9 (4) Let Gpyq ş y et2 dt. By the chain rule, F pxq G p3x 2 2xqpx 2q e p3x2 2xq 2 px 2q (5) (a) $ if x ă, & x if ď x ă, F pxq ` 2x ` % x2 if x ě 2. 9 2 5 2 2 if ď x ă 2, (b) By the FC F pxq fpxq except for x, and 3 where f is discontinuous. 5. Multivariate Calculus: Integrating over egions We will use multivariate calculus to study joint distributions, which show not only how random variables behave but also how they are related. () Let f : 2 Ñ be defined as follows: fpx, yq # if ď x ď y ď, otherwise. What is ş 8 ş 8 fpx, yqdxdy? (2) Consider the function fpx, yq : 4 px 2 ` y 2 q. he graph is a surface of revolution of a parabola. (a) Let tpx, yq : ď x, y ď u. What is ť fpx, yqdxdy? (b) Let S tpx, yq : ď x 2 ` y 2 ď 4u. What is ť fpx, yqdxdy? S (c) Let be the triangular region in the xy plane enclosed by the lines y x, x and y. What is ť fpx, yqdxdy? (3) Let fpx, yq e px`yq. (a) Let g be defined by # if ď x, y ď 2, gpx, yq otherwise. What is ş 8 ş 8 fpx, yqgpx, yqdxdy?
VLADIMI KOBZA (b) Let tpx, yq : ď x, y ď u and let 2 tpx, yq : ď x, y ď 2u. Which of the following two integrals is bigger: fpx, yqdxdy or f px{2, y{2qdxdy? (4) Let tpx, yq : ď x, y ď 4u and let tpx, yq : ď x, y ď 2u. Which of the following two integrals is bigger: f px{, y{qdxdy or fpx 2 {, y 2 {qdxdy? (5) Let gpx, yq x 2 ` 2xy ` y 3 and let f be defined by Soln: () (a) What are Bg Bx (b) What are Bf Bx fpx, yq (c) What is B2 f BxBy 8 8 x y e p2t2`u 2q dtdu Bg px, yq and px, yq? By Bf px, yq and px, yq? By px, yq? fpx, yqdxdy y dxdy x y xdy y2 2 y 2 (2) (a) 4 px 2 ` y 2 qdxdy r4x x3 3 xy2 s xdy r4 3 y2 s xdy r 3 y y3 {3 3 s ydy
DS-GA 2: PEEQUISIES EVIEW SOLUIONS (b) By changing to polar coordinates, we have ij 2π 2 fpx, yqdxdy p4 r 2 qrdrdθ (c) ij t (3) (a) 8 fpx, yqdxdy 8 x 2π 8π r2r 2 r4 4 s2 xdθ 4 px 2 ` y 2 qdydx r4y x 2 y y3 fpx, yqgpx, yqdxdy dx 3 s x 4p xq x 2 p xq p xqp 4x 2 ` 2x ` q dx 3 x 2 9x ` ` 4x 3 dx 3 2 2 2 e px`yq dxdy 2 e x dx e y dy p xq3 dx 3 p e x 2 q 2 p e 2 q 2 (b) Let pu, vq Gpx, yq px{2, y{2q. hen, the Jacobian dpu,vq {4 dpx,yq fpu, vqdudv fpx{2, y{2q 4 dxdy herefore, since fpx, yq ą fpx, yqdxdy ă f px{2, y{2qdxdy
2 VLADIMI KOBZA (4) Let define the change of variables by pu, vq Gpx, yq px 2, y 2 q. hen, the Jacobian is given by dpu,vq 4xy, and we have dpx,yq f pu{, v{qdudv fpx 2 {, y 2 {q4xydxdy herefore, since fpx, yq ą ; x, y ą, (5) (a) Bg Bx f px{, y{qdxdy ą fpx 2 {, y 2 {qdxdy Bg px, yq 2x ` 2y; px, yq 2x ` 3y2 By (b) Bf Bx px, yq ş y e p2t2`x 2q dt; Bf By px, yq ş x e p2y2`u 2q du (c) B2 f BxBy px, yq e p2y2`x 2 q eferences [] Bernstein, heory of Probability lecture notes, http://www.cims.nyu.edu/ brettb/probsum25/index.html [2] oss, A First Course in Probability (9th ed., 24) [3] Stewart, Essential Calculus: Early ranscendentals (2nd ed., 23)