Handout Ch3 實習 微積分複習 2 dxn/dx=nxn-1 dC/dx=0 dlnx/dx=1/x dex/dx=ex dx/dy=0 ∫xndx=(1/n+1)xn+1+C ∫exdx=ex+C ∫(1/x)dx=ln∣x ∣+C Jia-Ying Chen 微積分笑話一 3 某天,一位同學和微積分教授說: 「教授啊,我今天心情很不好耶…」 教授就說:「那我用微積分來幫你卜卦看看好不好?」 於是,教授就要求同學隨意寫下兩個字, 同學雖然半信半疑,但是還是寫了「麻煩」二字。 教授看了之後,笑笑的說:「你一定是被爸媽罵了。」 同學大驚:「哇塞!教授,你怎麼那麼厲害,一下就猜到了!」 「你別急,我來慢慢解釋給你聽。」教授不急不徐地解釋: 「首先我們先用一次微分把麻煩的「麻」字的蓋子微掉, 不就剩下「林」了嗎?然後也把「煩」這個字用二次微分, 分別把「火」和「┬」去掉,剩下的字就是「貝」。」 「此時我們可以得到「林貝」二字,這就說明你被你爸罵了!」 正當同學張大嘴巴說不出話來時,教授又繼續說了下去。 「還沒完喔,現在再把剩下的「貝」字再做一次微分, 把下面的「八」去掉,就得到「目」這個字。」 「因此我們又得到「林目」二字,這說明你也有被你媽媽罵!」 Jia-Ying Chen 微積分笑二 4 某天上微積分課時,教授提到了在座標軸上的積分, 學生們看著滿滿的黑板公式,趕緊在下面抄筆記, 但是心似乎都不放在課堂之上。 講到一半,教授問一位女同學:「先積甚麼?」 女同學被突如其來的問話嚇了一跳,緊接著說她不會, 教授再問全班同學,也沒有人回答。 這時教授突然大吼一聲:「雞歪啦!連這個都不會。」 全班同學當場嚇了一大跳,教授竟然開口飆髒話! 結果仔細一看,才發現教授正在積y軸… Jia-Ying Chen 微積分笑話三 5 有一位數學家得了精神病,他覺得自己是微分的主宰者, 朋友們將他送到精神病院希望他能好起來。 每天,這位數學家都會在院內四處閒逛,只要遇到其他病人, 他就會恐嚇地說:「我要把你微分掉!」 有一天,院裡來了一個新病人,像往常一樣地, 他瞪著那位病人大聲吼:「我要把你微分掉!」 但這次,那位病人的表情一點也不變。 數學家十分訝異,提起精神來狠狠地盯著那位新病人, 更大聲地說:「我要把你微分掉!」 但那位病人依然一點反應也沒有。 數學家氣極了,最後他放聲大叫:「我要把你微分掉!」 病人平靜地看了數學家一眼,他說: 「你想怎麼微分我都無所謂,因為我是e的x次方。」 Jia-Ying Chen 微積分笑話四 6 某天,常數函數C和指數函數e的x次方走在街上, 遠遠地,他們看到微分運算元朝他們這邊走了過來。 常數函數嚇得慌忙躲藏起來,緊張地說: 「被它微分一下,我就什麼都沒有啦!」 指數函數則是不慌不忙地說: 「它可不能把我怎麼樣,我可是e的x次方耶!」 終於,指數函數和微分運算元在路中相遇了。 指數函數首先自我介紹道:「你好,我是e的x次方!」 而微分運算元也微笑地自我介紹: 「你好,我是d/dy!」 Jia-Ying Chen Example 1 Suppose that the p.d.f of a random variable X is as follows: cx3 for1 x 2 f ( x) otherwise 0 7 a. Find the value of constant c and sketch the p.d.f b. Find the value of Pr(X>3/2) Jia-Ying Chen Solution a. 2 4 3 x 15 4 f ' ( x) x 2 when1 x 2, f' (x) 0 5 8 f ' ' ( x) x when1 x 2, f' ' (x) 0 5 4 32 f( 1 ) f( 2 ) 15 15 f ( x) cx dx 1 3 1 1 4 2 cx 1 1 4 1 c(24 14 ) 1 4 4 c 15 32 15 4 15 3 Pr( X ) 2 2 b. 4 3 x dx 15 3 2 8 1 4 x 15 2 3 2 35 48 Jia-Ying Chen Cumulative Distribution Function The cumulative distribution function (c.d.f.) or distribution function (d.f.) of a random variable X (discrete or continuous) is a function defined for each real number x as follow: F ( x) Pr(X x) for x Discrete distribution F ( x) Pr(X x) f (t ) tx Continuous distribution x F ( x) Pr( X x) f (t )dt 9 f ( x) F ( x) dF ( x) dx Jia-Ying Chen Determining Probabilities from the c.d.f. For every x, Pr(X > x) = 1-F(x) lim F ( x) 0 x lim F ( x) 1 x For all x1 and x2 such that x1 < x2, then Pr(x1 X x2 ) F ( x2 ) F ( x1 ) For each x, Pr(X x) F ( x ) For every x, Pr(X x) F ( x) F ( x ) For example, Pr(X x1 ) z1 z0 , Pr(X x3 ) z3 z 2 and the probability of every other individual value of X is 0. 10 Jia-Ying Chen Example 2 11 Suppose that the d.f. F of a random variable X is as sketched as follows. Find each of the following probabilities a. Pr(X=2) b. Pr(2<=x<=5) c. Pr(X>=5) d. Pr(X=4) e. Pr(1<x<=2) f. Pr(2<=X<=4) Jia-Ying Chen 0.8 0.7 0.3 0.2 1 12 2 4 5 Jia-Ying Chen Solution a.Pr( X 2) F (2) F (2 ) 0.3 0.3 0 b.Pr(2 X 5) F (5) F (2 ) 1 0.3 0.7 c.Pr( X 5) 1 F (5 ) 1 1 0 d .Pr( X 4) F (4) F (4 ) 0.8 0.7 0.1 e.Pr(1 X 2) F (2) F (1) 0.3 0.3 0 f .Pr(2 X 4) F (4) F (2 ) 0.8 0.3 0.5 13 Jia-Ying Chen Bivariate Distributions - Discrete Joint Distributions The joint probability mass function, or the joint p.m.f., of X and Y is defined as f ( x, y) Pr(X x and Y y). Example: Suppose the joint p.m.f. of X and Y is specified as: Y X 1 2 3 4 1 0.1 0 0.1 0 2 0.3 0 0.1 0.2 3 0 0.2 0 0 Pr(X 2 and Y 2) f (2,2) f (2,3) f (2,4) f (3,2) f (3,3) f (3,4) 0.5 4 Pr(X 1) f (1, y) 0.2 14 y 1 Jia-Ying Chen Bivariate Distributions - Continuous Joint Distributions The joint probability density function, or the joint p.d.f. of X and Y is defined as f (x, y). For every subset A of the xy-plane, Pr( x, y ) A f ( x, y )dxdy A The joint p.d.f. must satisfy two conditions: f ( x, y) 0 for x and y 15 f ( x, y)dxdy 1 Jia-Ying Chen 雙重積分複習 0≦y ≦1-x,0≦x≦1 1 1 y f ( x, y )dxdy y=1-x 0 0 1 1 x 0 0 積分秘訣 16 f ( x, y )dydx 依照題目給定範圍畫出圖 判斷先積x還是先積y比較容易 Jia-Ying Chen Example 3 Suppose that the joint p.d.f of two random variables X and Y as follows: 5 2 2 ( x y ) for 0 y 1 x , f ( x, y ) 4 0 otherwise Determine Pr(0<=X<=1/2) 17 Jia-Ying Chen Solution 1 Pr(0 X ) 2 1 1 x 2 5 2 ( x 2 y )dydx 0 0 4 1 5 2 5 2 1 x2 2 ( x y y ) 0 dx 0 4 8 1 5 2 5 2 2 [ x (1 x ) (1 x 2 ) 2 ]dx 0 4 8 1 5 5 4 79 2 ( x )dx 0 8 8 256 18 Jia-Ying Chen Bivariate Cumulative Distribution Functions The joint cumulative distribution function, or joint c.d.f., of two random variables X and Y is defined as F ( x, y) Pr(X x and Y y). Note that Pr(a X b and c Y d ) F (b, d ) F (a, d ) F (b, c) F (a, c). F1 ( x) Pr( X x) lim F ( x, y ) y F2 ( y ) Pr(Y y ) lim F ( x, y ) x y 19 x If X and Y have a continuous joint p.d.f., then F ( x, y) f (r , s)drds The joint p.d.f. can be derived from the joint c.d.f. by using 2 F ( x, y ) f ( x, y ) xy Jia-Ying Chen Marginal Distributions If X and Y have a discrete joint distribution for which the joint p.m.f. is f, then the marginal p.m.f. f1 of X can be found as follows: f1 ( x) Pr(X x) Pr(X x and Y y ) f ( x, y ). y Also, y f 1 ( y ) f ( x, y ) x If X and Y have a joint p.d.f. f, then the marginal p.d.f. of X and Y are: f1 ( x) f ( x, y )dy for x 20 f 2 ( y ) f ( x, y )dx for y Jia-Ying Chen Independent Random Variables Two random variables (discrete or continuous) X and Y are independent if, for every two sets A and B of real numbers, Pr(X A and Y B) Pr(X A) Pr(Y B) Two random variables X and Y are independent if and only if, for all real numbers x and y, Pr(X x and Y y) Pr(X x) Pr(Y y) F ( x, y) F1 ( x) F2 ( y) 21 X and Y are independent if and only if, for all real numbers x and y, f ( x, y) f1 ( x) f 2 ( y) Jia-Ying Chen Independent Random Variables Suppose X and Y are random variables that have a continuous joint p.d.f. Then X and Y will be independent if and only if, for x and y , f ( x, y) g1 ( x) g 2 ( y) Proof: f ( x, y ) g1 ( x ) g 2 ( y ) Then 1 f ( x, y )dxdy g1 ( x)dx g 2 ( y )dy C1C2 where C1 g1 ( x)dx and C2 g 2 ( y )dy. Also, f1 ( x) f ( x, y )dy C2 g1 ( x), f 2 ( y ) f ( x, y )dx C1 g 2 ( y ) Since C1C2 1, we thus see that f ( x, y ) f1 ( x) f 2 ( y ) 22 Jia-Ying Chen Example 4 Suppose that X and Y have a discrete joint distribution for which the joint p.f. is defined as follow: 1 ( x y ), x 0,1y 0,1 f ( x, y ) 4 0, otherwise 23 a. Determine the marginal p.f.’s of X and Y b. Are X and Y independent? Jia-Ying Chen Solution 1 1 b. f ( x, y ) ( x y ) f ( x) f ( y ) (2 x 1)( 2 y 1) 4 16 24 Jia-Ying Chen Discrete and Continuous Conditional Distributions Suppose that X and Y have a joint p.m.f. f (x, y), then we can define the conditional p.m.f. g1 of x given that Y = y as g1 ( x | y) Pr(X x | Y y) Suppose that X and Y have a joint p.d.f. f(x,y), then we can define the conditional p.d.f. g1 of X given that Y=y as f ( x, y) g1 ( x | y) f 2 ( y) 25 Pr(X x and Y y) f ( x, y) Pr(Y y) f 2 ( y) for x Jia-Ying Chen Example 5 (3.6.7) Suppose that the joint p.d.f of two random variables X and Y is as follows: 3 (4 2 x y) f ( x, y ) 16 0, 26 for x 0, y 0 and 2 x y 4 otherwise Determine (a) the conditional p.d.f of Y for every given value of X, and (b) Pr (Y 2 X 0.5) Jia-Ying Chen Solution 42 x 3 3 (4 2 x y )dy (8 8 x 2 x 2 ) 0 16 16 4 2x y for 0 y 4 2 x f ( x, y ) So, g 2 ( y | x) 8 8x 2 x 2 f1 ( x) ot herwise 0 f1 ( x) Pr Y 2 | X 0.5 g 2 y | 0.5dy 27 3 3 2 2 4 2x y 1 dy 8 8x 2 x 2 9 Jia-Ying Chen