Presentation is loading. Please wait.

Presentation is loading. Please wait.

Random Variable隨機變數 定義

Similar presentations


Presentation on theme: "Random Variable隨機變數 定義"— Presentation transcript:

1 Random Variable隨機變數 定義 A variable X is a random variable if the value that X assumes at the conclusion of an experiment is a chance or random occurrence that cannot be predicted with certainty in advance. 社會統計(上) ©蘇國賢2007

2 Random Variable隨機變數 定義 取一個三十個人的隨機樣本並詢問其就業狀況(失業與就業),樣本中的就業人數為一隨機變數X。X的可能值為? X的值可以是0至30的任意整數,每一個數值χi都代表此實驗(問三十個人)的一特定結果。 一個隨機變數所有可能的數值稱為「變量」,隨機變數中的每一個變量皆代表一種事件。 習慣上以大寫字母X, Y, Z表隨機變數,以小寫字母x, y, z來代表其相對應的變量。 社會統計(上) ©蘇國賢2007

3 Random Variable隨機變數 丟銅板三次,樣本空間為:
例題 丟銅板三次,樣本空間為: Ω={HHH, HHT, HTH, THH, HTT, THT, TTH, TTT} 定義X為丟三次銅板出現反面的次數,隨機變數X為將上面樣本空間對應到實數的函數,此隨機變數的變量為: S={0, 1, 2, 3} 社會統計(上) ©蘇國賢2007

4 Discrete Random Variable 間斷型(不連續)隨機變數
定義 A random variable X is discrete if X can assume only a finite or countably infinite number of different values. 一隨機變數之變量若為有限個或無限但可數,稱為discrete r.v. 台北十月份下雨的天數。 高速公路一天的死亡人數。 社會統計(上) ©蘇國賢2007

5 Discrete Random Variable 連續隨機變數
定義 A random variable X is continuous if it can assume all the values in some interval. 如果隨機變數在某區間的變量為無限個,則稱為連續隨機變數。 身高。 飛機往來北高所需的飛行時間。 計程車司機每月的里程數。 Note: 連續隨機變數無法精確的測量,僅能求近似值。 社會統計(上) ©蘇國賢2007

6 Discrete Random Variable 間斷隨機變數
定義 If X is a discrete random variable, the probability function (p.f.)機率函數 of X is defined as the function f such that for each real number x, 社會統計(上) ©蘇國賢2007

7 Discrete Probability Distributions
P(X = xi)代表隨機變數等於某特定變量的機率,如P( X = 2)銅板出現兩次反面的機率,有時候會簡化為P(xi) 或f(xi)。 A discrete probability distribution is a table, graph, or rule that associates a probability P(X=xi) with each possible value xi that the discrete random variable can assume. 將一個間斷隨機函數的所有可能變量xi所相對應的機率P(X=xi)列出,稱為間斷機率分配(discrete probability distribution)。 社會統計(上) ©蘇國賢2007

8 Properties of Discrete Probability Distributions
所有非連續機率分配必須滿足下列兩個條件: 假設X為一discrete r.v.,且函數P(X)滿足上述條件,我們說P(X) 為X的p.m.f (probability mass function)機率質量函數 社會統計(上) ©蘇國賢2007

9 例題 某汽車經銷商營業員負責賣$10,000, $15,000, $20,000三種價格的車可得5%的commission。
消費者購買各種車款的機率分別為: $10,000  30% $15,000  20% $20,000  10% 不買車  40% 某顧客走入店中,以隨機變數X代表此營業員可能獲得的佣金,列出X的機率分配(probability distribution) 社會統計(上) ©蘇國賢2007

10 例題 x1=$0, x2=$500, x3=$750, x4=$1000 樣本空間S={$0, $500, $750, $1000}
與其相對應的機率為.4, .3, .2, .1 The probability distribution of a random variable is a theoretical model for the relative frequency distribution of a population. 社會統計(上) ©蘇國賢2007

11 例題 直一個公正的骰子一次,令x為所得的點數,則x的分配為何? 函數表達: 社會統計(上) ©蘇國賢2007

12 例題 隨機變數X,其機率函數為: 求c=? 社會統計(上) ©蘇國賢2007

13 Cumulative Distribution Function
Let X be a discrete or continuous random variable and let x be any real number. The cumulative distribution function (CDF) of X is the function 則稱F(X)為隨機變數X的累加機率函數 社會統計(上) ©蘇國賢2007

14 Properties of Cumulative Distribution Function
Let X be a discrete r.v. that can assume the values x1, x2, …xn, where x1<x2<…<xn. Then F(x) denote the probability that X assumes a value that is less than or equal to xr, and is given by: 社會統計(上) ©蘇國賢2007

15 累加百分比(Cumulative Percentage)
實例說明 累加百分比(Cumulative Percentage) 社會統計(上) ©蘇國賢2007

16 Properties of Cumulative Distribution Function
社會統計(上) ©蘇國賢2007

17 例題 續前例: F(500) = =.7 F(750) = =.9 社會統計(上) ©蘇國賢2007

18 Expected value of a discrete random variable
The expected value, or mean, of a discrete random variable is the weighted average of the possible values of the random variable where the weight assigned to xi is the probability P(X=xi) 社會統計(上) ©蘇國賢2007

19 例題 計算營業人員commission的期望值。
E(X) = (0)(.4)+(500)(.3)+(750)(.2)+(1000)(.1) = $400 社會統計(上) ©蘇國賢2007

20 例題 一賭徒玩輪盤,輪盤共有38個號碼,其中18為「紅」,18個為「黑」,另有兩個號碼為「綠」,壓$1於「紅」,可贏$1,如果出現「黑」,則$1全輸,如果出現「綠」,則輸$.5,求賭徒壓紅的期望值。 社會統計(上) ©蘇國賢2007

21 Expected value of a function of X
Let X be a discrete random variable, and let Y be any function of X such that Y = g(X). Then the expected value of Y, or the expected value of g(X), is 社會統計(上) ©蘇國賢2007

22 例題 若上例賭徒壓$100於「紅」,求期望值。 社會統計(上) ©蘇國賢2007

23 例題 隨機函數X的變量 機率函數 隨機函數X = 生三個小孩中,女孩的人數
間斷機率分配Discrete prob. distribution 假設生三個小孩各種情況所相對應的機率為: 社會統計(上) ©蘇國賢2007

24 例題 P(X<2) = F(1) = P(X ≦ 1) = =.53 社會統計(上) ©蘇國賢2007

25 例題 E(X) =  x.f(x) = (0)(.14) + (1)(.39) + (2)(.36) + (3)(.11) =1.44
= (0)(.14) + (1)(.39) + (2)(.36) + (3)(.11) =1.44 請問1.44代表的意義為? 社會統計(上) ©蘇國賢2007

26 Properties of Expectations
Property 1: E(c) = c 若c為任意常數,求E(c) =? 社會統計(上) ©蘇國賢2007

27 Properties of Expectations
Property 2: if Y=a.X+b, where a and b are constant, then E(Y) = a.E(X) + b =1 E(X) 社會統計(上) ©蘇國賢2007

28 Properties of Expectations
例題:若E(X)=5, 求 E(3X-5)=? E(3X-5) = 3E(X) – 5 = 15-5 =10 社會統計(上) ©蘇國賢2007

29 Joint Probability Tables 聯合機率表
複習 如果兩個變數都屬於間斷型的類別變數,則可以用聯合機率表來表示其發生的機率 社會統計(上) ©蘇國賢2007

30 聯合機率函數 複習 設X,Y為二元間斷隨機變數,X之值為x1,x2,x3,…xn,Y之值為y1,y2,y3…ym,若f(xi, yj)滿足下列兩條件: 則f(xi, yj)成為聯合機率函數 社會統計(上) ©蘇國賢2007

31 邊際機率函數 設X,Y為二元間斷隨機變數,其機率函數為f(xi,yi),則X, Y的邊際機率函數分別為fx(xi)與fy(yj) 複習
社會統計(上) ©蘇國賢2007

32 X,Y的聯合機率分配表 複習 社會統計(上) ©蘇國賢2007

33 Properties of Expectations
property 3: if X1, X2, X3…Xn are n random variable such that each expectation E(Xi) exists (i = 1,2, …n), then E(X1+X2…+Xn) = E(X1) +E(X2) +… E(Xn) 社會統計(上) ©蘇國賢2007

34 Properties of Expectations
It follows from property 2 and property3 that for any constant a1, a2, …an and b, E(a1X1+a2X2…+anXn) = a1E(X1) +a2E(X2) +… +anE(Xn) 社會統計(上) ©蘇國賢2007

35 Properties of Expectations
Property 4: If X1, …Xn are n independent variables such that each expectation E(Xi) exists, then E(X1.X2.X3…Xn)=E(X1)E(X2)…E(Xn) 社會統計(上) ©蘇國賢2007

36 Properties of Expectations
Proof X and Y are independent variables, P(XY)= P(X)P(Y) 社會統計(上) ©蘇國賢2007

37 Rules for Means Property 1: c is a constant, then E(c) = c
Property 2: if Y=a.X+b, where a and b are constant, then E(Y) = a.E(X) + b Property 3: if X1, X2, X3…Xn are n random variable such that each expectation E(Xi) exists (i = 1,2, …n), then E(X1+X2…+Xn) = E(X1) +E(X2) +… E(Xn) Property 4: If X1, …Xn are n independent variables such that each expectation E(Xi) exists, then E(X1.X2.X3…Xn)=E(X1)E(X2)…E(Xn) 社會統計(上) ©蘇國賢2007

38 Variance of Discrete Random Variable
非連續隨機變數的變異數 社會統計(上) ©蘇國賢2007

39 Variance of Discrete Random Variable
社會統計(上) ©蘇國賢2007

40 Variance of Discrete Random Variable
= 2.82 – (1.44)2 = ΣX2f(x) – u2 社會統計(上) ©蘇國賢2007

41 Properties of the variance
Var(c)=0, c 為常數項 更正式的陳述:Var(X)=0 if and only if there exists a constant c such that P(X=c)=1. 社會統計(上) ©蘇國賢2007

42 Properties of the variance
Property 5: Var(aX+b)=a2Var(X) Proof. 因為E(aX+b)=aE(X)+b=au+b Var(aX+b)=E[((aX+b) – E(aX+b))2] =E[(aX+b – au –b)2]=E[(aX-au)2] =a2E[(X-u)2] 社會統計(上) ©蘇國賢2007

43 Properties of the variance
Property 6: If X1, …Xn are independent random variables, then Var(X1+…+Xn) = Var(X1)+ …+Var(Xn) 社會統計(上) ©蘇國賢2007

44 Properties of the variance
Proof. 以n=2為例,If E(X1) = u1 and E(X2) = u2 E(X1+X2)=u1+u2 Var(X1+X2)=E[(X1+X2-u1-u2)2] =E[(X1-u1)2+(X2-u2)2+2(X1-u1)(X2-u2)] =Var(X1) + Var(X2) +2E[(X1-u1)(X2-u2)] X1, X2 are independent, 根據property 4 E[(X1-u1)(X2-u2)]=E(X1-u1)E(X2-u2)=0 社會統計(上) ©蘇國賢2007

45 例題 X,Y,Z are independent and E(X)=1, E(Y)=4, E(Z)=3
Var(X)=3, Var(Y)=7, Var(Z)=2 What is the mean and variance of U=3X+4Y E(U)=E(3X+4Y)=3E(X) + 4E(Y) =3·1+4·4 = 19 Var(U) = Var(3X+4Y) = 9Var(X) + 16Var(Y) =9*3+16*7 = 139 社會統計(上) ©蘇國賢2007

46 例題 成功機械公司之生產經理欲推計該公司某一長期客戶,訂購其產品之生產成本。若經由多年之銷售記錄,訂立了該客戶每月訂購量X之機率分配如下:
X =1 f(X) = .5 X =2 f(X) = .3 X=3 f(X) = .2 (1) 求隨機變數(訂購量)X的期望值及變異數。 (2)若生產經理認為該產品的生產成本為:固定成本每月20,000元,每單位之變動成本為40,000。試求該項交易每月期望總生產成本為?(成大企研) 社會統計(上) ©蘇國賢2007

47 例題 E(X)=(x)f(x)=1(.5)+2(.3)+3(.2)=1.7
Var(X)=E(X2)-[E(X)]2 =3.5-(1.7)2=0.61 令Y= X E(Y)= E(X)=88000 社會統計(上) ©蘇國賢2007


Download ppt "Random Variable隨機變數 定義"

Similar presentations


Ads by Google