# 第三章 隨機變數.

## Presentation on theme: "第三章 隨機變數."— Presentation transcript:

3-1 Using Statistics Consider the different possible orderings of boy (B) and girl (G) in four sequential births(生男生女連續四次的可能性). There are 2*2*2*2=24 = 16 possibilities, so the sample space is: BBBB BGBB GBBB GGBB BBBG BGBG GBBG GGBG BBGB BGGB GBGB GGGB BBGG BGGG GBGG GGGG If girl and boy are each equally likely [P(G)=P(B) = 1/2], and the gender of each child is independent of that of the previous child, then the probability of each of these 16 possibilities is: (1/2)(1/2)(1/2)(1/2) = 1/16.

Random Variables(隨機變數)
Now count the number of girls in each set of four sequential births: BBBB (0) BGBB (1) GBBB (1) GGBB (2) BBBG (1) BGBG (2) GBBG (2) GGBG (3) BBGB (1) BGGB (2) GBGB (2) GGGB (3) BBGG (2) BGGG (3) GBGG (3) GGGG (4) Notice that: each possible outcome is assigned a single numeric value, all outcomes are assigned a numeric value, and the value assigned varies over the outcomes. The count of the number of girls is a random variable: A random variable, X, is a function that assigns a single, but variable, value to each element of a sample space.

Random Variables (Continued)
BBBB BGBB GBBB BBBG BBGB GGBB GBBG BGBG BGGB GBGB BBGG BGGG GBGG GGGB GGBG GGGG 1 X 2 3 4 Points on the Real Line Sample Space

Random Variables (Continued)
Since the random variable X = 3 when any of the four outcomes BGGG, GBGG, GGBG, or GGGB occurs, P(X = 3) = P(BGGG) + P(GBGG) + P(GGBG) + P(GGGB) = 4/16 The probability distribution of a random variable is a table that lists the possible values of the random variables and their associated probabilities. x P(x) 0 1/16 1 4/16 2 6/16 3 4/16 4 1/16 16/16=1 4 3 2 1 . N u m b e r o f g i l s , x P ( ) 6 5 7 a t y D n h G F B

Example 3-1 Consider the experiment of tossing two six-sided dice. There are 36 possible outcomes. Let the random variable X represent the sum of the numbers on the two dice: x P(x)* 2 1/36 3 2/36 4 3/36 5 4/36 6 5/36 7 6/36 8 5/36 9 4/36 10 3/36 11 2/36 12 1/36 1 1 2 9 8 7 6 5 4 3 . x p ( ) P r o b a i l t y D s u n f S m T w c e 2 3 4 5 6 7 1,1 1,2 1,3 1,4 1,5 1,6 8 2,1 2,2 2,3 2,4 2,5 2,6 9 3,1 3,2 3,3 3,4 3,5 3,6 10 4,1 4,2 4,3 4,4 4,5 4,6 11 5,1 5,2 5,3 5,4 5,5 5,6 12 6,1 6,2 6,3 6,4 6,5 6,6

Example 3-2 Probability of more than 2 switches:
Probability of at least 1 switch: P(X ³ 1) = 1 - P(0) = = .9 Probability Distribution of the Number of Switches x P(x) 0 0.1 1 0.2 2 0.3 3 0.2 4 0.1 5 0.1 1 Probability of more than 2 switches: P(X > 2) = P(3) + P(4) + P(5) = = 0.4 5 4 3 2 . x P ( ) T h e r o b a i l t y D s u n f N m S w c

Discrete(離散) and Continuous(連續) Random Variables
A discrete random variable: has a countable number of possible values has discrete jumps (or gaps) between successive values has measurable probability associated with individual values counts A continuous random variable: has an uncountably infinite number of possible values moves continuously from value to value has no measurable probability associated with each value measures (e.g.: height, weight, speed, value, duration, length)

Cumulative Distribution Function (累加分配函數)
The cumulative distribution function, F(x), of a discrete random variable X is: x P(x) F(x) 1 C u m u l a t i v e P r o b a b i l i t y D i s t r i b u t i o n o f t h e N u m b e r o f S w i t c h e s 1 . . 9 . 8 . 7 ) . 6 x ( F . 5 . 4 . 3 . 2 . 1 . 1 2 3 4 5 x

h(X) 可能是 X2、3X4、log X 或是任何函數。 隨機變數函數的期望值如下

V(X1+X2+…+Xk)=V(X1)+V(X2)+…+V(Xk) 「彼此獨立」表示：任何事件 Xi=x 與其他任何事件 Xj=y 是獨立的。

Mean, Variance, and Standard Deviation of the Binomial Distribution

Shape of the Binomial Distribution
y : n = 4 p = . 1 B i n o m i a l P r o b a b i l i t y : n = 4 p = . 3 B i n o m i a l P r o b a b i l i t y : n = 4 p = . 5 . 7 . 7 . 7 . 6 . 6 . 6 n = 4 . 5 . 5 . 5 ( ) x . 4 ( x ) . 4 ) . 4 P x ( . 3 P . 3 P . 3 . 2 . 2 . 2 . 1 . 1 . 1 . . . 1 2 3 4 1 2 3 4 1 2 3 4 x x x B i n o m i a l P r o b a b i l i t y : n = 1 p = . 1 B i n o m i a l P r o b a b i l i t y : n = 1 p = . 3 B i n o m i a l P r o b a b i l i t y : n = 1 p = . 5 . 5 . 5 . 5 . 4 . 4 . 4 n = 10 x ) . 3 ( ( ) x . 3 P P P x ( ) . 3 . 2 . 2 . 2 . 1 . 1 . 1 . . . 1 2 3 4 5 6 7 8 9 1 1 2 3 4 5 6 7 8 9 1 1 2 3 4 5 6 7 8 9 1 x x x B i n o m i a l P r o b a b i l i t y : n = 2 p = . 1 B i n o m i a l P r o b a b i l i t y : n = 2 p = . 3 B i n o m i a l P r o b a b i l i t y : n = 2 p = . 5 n = 20 2 . 2 . . 2 x ) ( x ( ) ) P P x P ( 1 . 1 . 1 . . . . 1 2 3 4 5 6 7 8 9 1 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 1 2 3 4 5 6 7 8 9 1 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 1 2 3 4 5 6 7 8 9 1 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 x x x Binomial distributions become more symmetric as n increases and as p

X 落在 a 與 b 之間的機率等於 f(x) 下方在 a 與 b 之間的面積 整個函數 f(x) 下方的面積等於 1.00