• 검색 결과가 없습니다.

Discrete Random Variables

N/A
N/A
Protected

Academic year: 2022

Share "Discrete Random Variables"

Copied!
54
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

Chapter 2

Discrete Random Variables

(2)

Chapter Outline

• Random variables

• Probability mass function (PMF)

• Expectation

• Variance

• Conditional PMF

• Geometric PMF

• Total expectation theorem

• Joint PMF of two random variables

(3)

Chapter Outline

• Multiple random variables

– Joint PMF – Conditioning – Independence

• More on expectations

• Binomial distribution revisited

• A hat problem

3

(4)

2.1. Random Variables

• An assignment of a value (number) to every possible outcome

• Mathematically: A function from the sample space Ω to the real numbers

– discrete or continuous values

• Can have several random variables defined on the same sample space

• Notation:

– random variable 𝑋 – numerical value 𝑥

(5)

Random Variables

5

(6)

Main Concepts Related to Random Variables

Starting with a probabilistic model of an experiment:

• A random variable is a real-valued function of the outcome of the experiment.

• A function of a random variable defines another random variable.

• We can associate with each random variable certain

“averages" of interest, such as the mean and the variance.

• A random variable can be conditioned on an event or on another random variable.

• There is a notion of independence of a random variable from an event or from another random variable.

(7)

Concepts Related to Discrete Random Variables

Starting with a probabilistic model of an experiment:

• A discrete random variable is a real-valued function of the outcome of the experiment that can take a finite or countably infinite number of values.

• A discrete random variable has an associated probability mass function (PMF) which gives the probability of each numerical value that the random variable can take.

• A function of a discrete random variable defines another

discrete random variable, whose PMF can be obtained from the PMF of the original random variable.

7

(8)

2.2. Probability Mass Function (PMF)

• Probability distribution of 𝑋

• Notation:

𝑝𝑋 𝑥 = 𝑃 𝑋 = 𝑥

= 𝑃 𝜔 ∈ Ω s. t. 𝑋 𝜔 = 𝑥

• 𝑝𝑋 𝑥 ≥ 0 𝑝𝑥 𝑋 𝑥 = 1

(9)

How to Compute a PMF

9

(10)

Calculation of the PMF of a Random Variable X

For each possible value 𝑥 of 𝑋:

• Collect all the possible outcomes that give rise to the event 𝑋 = 𝑥 .

• Add their probabilities to obtain 𝑝𝑋(𝑥).

(11)

How to Compute a PMF

• collect all possible outcomes for which 𝑋 is equal to 𝑥

• add their probabilities

• repeat for all 𝑥

• Example: Two independent rolls of a fair tetrahedral die

𝐹: outcome of first throw

𝑆: outcome of second throw 𝑋 = min (𝐹, 𝑆)

𝑝𝑋 2 =

11

(12)

Binomial PMF

• 𝑋: number of heads in 𝑛 independent coin tosses

• 𝑃(𝐻) = 𝑝

• Let 𝑛 = 4

𝑝𝑋 2 = 𝑃 𝐻𝐻𝑇𝑇 + 𝑃 𝐻𝑇𝐻𝑇 + 𝑃 𝐻𝑇𝑇𝐻 +𝑃 𝑇𝐻𝐻𝑇 + 𝑃 𝑇𝐻𝑇𝐻 + 𝑃 𝑇𝑇𝐻𝐻 = 6𝑝2 1 − 𝑝 2

= 4

2 𝑝2 1 − 𝑝 2 In general:

𝑝𝑋 𝑘 = 𝑛

𝑘 𝑝𝑘 1 − 𝑝 𝑛−𝑘, 𝑘 = 0,1, … , 𝑛

(13)

Binomial PMF

13

(14)

Geometric PMF

• 𝑋: number of independent coin tosses until first head

𝑝𝑋 𝑘 = 1 − 𝑝 𝑘−1𝑝, 𝑘 = 1,2, …

𝐸 𝑋 = 𝑘𝑝𝑋 𝑘

𝑘=1

= 𝑘 1 − 𝑝 𝑘−1𝑝

𝑘=1

(15)

Geometric PMF

• Memoryless property: Given that 𝑋 > 2, the r.v. 𝑋 − 2 has same geometric PMF

15

(16)

Poisson PMF

𝑝𝑋 𝑘 = 𝑒−𝜆 𝜆𝑘

𝑘! , 𝑘 = 0,1,2, …

(17)

2.3. Functions of Random Variables

17

(18)

2.4. Expectation

• We define the expected value (also called the expectation or the mean) of a random variable 𝑋, with PMF 𝑝𝑋, by

𝐸 𝑋 = 𝑥𝑝𝑋 𝑥

𝑥

• Interpretations:

– Center of gravity of PMF

– Average in large number of repetitions of the experiment (to be substantiated later in this course)

(19)

Expectation

• Example: Uniform on 0, 1, . . . , 𝑛

𝐸 𝑋 = 0 × 𝑛+11 + 1 × 𝑛+11 ⋯ 𝑛 × 𝑛+11 =

19

(20)

Expected Value Rule for Functions of Random Variables

• Let 𝑋 be a random variable with PMF 𝑝𝑋, and let 𝑔(𝑋) be a

function of 𝑋. Then, the expected value of the random variable 𝑔(𝑋) is given by

𝐸 𝑔 𝑋 = 𝑔 𝑥 𝑝𝑋(𝑥)

𝑥

.

(21)

Average Speed vs. Average Time

• Traverse a 200 mile distance at constant but random speed 𝑉

• time in hours = 𝑇 = 𝑡 𝑉 = 200/𝑉

• 𝐸 𝑇 = 𝐸 𝑡 𝑉 = 𝑡 𝑣 𝑝𝑣 𝑉 𝑣 =

• 𝐸 𝑇𝑉 = 200 ≠ 𝐸 𝑇 ⋅ 𝐸 𝑉

• 𝐸 200/𝑉 = 𝐸 𝑇 ≠ 200/𝐸 𝑉 .

21

(22)

Properties of Expectations

• Let

X

be a r.v. and let 𝑌 = 𝑔 𝑋

– Hard: 𝐸 𝑌 = 𝑦𝑝𝑦 𝑌 𝑦

– Easy: 𝐸 𝑌 = 𝑔 𝑥 𝑝𝑥 𝑋 𝑥

• Caution: In general, E 𝑔 𝑋 ≠ 𝑔 E 𝑋 Properties: If 𝛼, 𝛽 are constants, then:

• 𝐸 𝛼 =

• 𝐸 𝛼𝑋 =

• 𝐸 𝛼𝑋 + 𝛽 =

(23)

Variance

• The variance var(𝑋) of a random variable 𝑋 is defined by var 𝑋 = 𝐸 𝑋 − 𝐸 𝑋 𝟐 ,

and can be calculated as

var 𝑋 = 𝑥 − 𝐸 𝑋 𝟐

𝑥

𝑝𝑋 𝑥 .

It is always nonnegative. Its square root is denoted by 𝜎𝑋 and is called the standard deviation.

23

(24)

Variance

Recall 𝐸 𝑔 𝑋 = 𝑔 𝑥 𝑝𝑥 𝑋 𝑥

• Second moment: 𝐸 𝑋2 = 𝑥𝑥 2𝑝𝑋 𝑥

• Variance: var(𝑋) = 𝐸 𝑋 − 𝐸 𝑋 2 = 𝑥 − 𝐸 𝑋𝑥 2𝑝𝑋 𝑥 = 𝐸 𝑋2 − 𝐸 𝑋 2 Properties:

• var 𝑋 ≥ 0

• var 𝛼𝑋 + 𝛽 = 𝛼2var 𝑋

(25)

Example 2.6. (Discrete Uniform Random Variable)

25

(26)

Example 2.8. (The Quiz Problem)

(27)

27

(28)

Review

• Random variable 𝑋: function from sample space to the real numbers

• PMF (for discrete random variables):

𝑝𝑋 𝑥 = 𝑃 𝑋 = 𝑥

• Expectation:

𝐸 𝑋 = 𝑥𝑝𝑋 𝑥

𝑥

𝐸 𝑔 𝑋 = 𝑔 𝑥 𝑝𝑋 𝑥 𝐸 𝛼𝑋 + 𝛽 = 𝛼𝐸 𝑋 + 𝛽 𝑥

(29)

Review

• 𝐸 𝑋 − 𝐸 𝑋 =

var 𝑋 = 𝐸 𝑋 − 𝐸 𝑋 2

= 𝑥 − 𝐸 𝑋𝑥 2𝑝𝑋 𝑥 = 𝐸 𝑋2 − 𝐸 𝑋 2

Standard deviation: 𝜎𝑋 = var 𝑋

29

(30)

Conditional PMF and Expectation

• 𝑝𝑋|𝐴 𝑥 = 𝑃 𝑋 = 𝑥|𝐴

• 𝐸 𝑋|𝐴 = 𝑥𝑝𝑥 𝑋|𝐴 𝑥

• Let 𝐴 = 𝑋 ≥ 2 𝑝𝑋|𝐴 𝑥 =

𝐸 𝑋|𝐴 =

(31)

Total Expectation Theorem

• Partition of sample space into disjoint events 𝐴1, 𝐴2, . . . , 𝐴𝑛

𝑃 𝐵 = 𝑃 𝐴1 𝑃 𝐵|𝐴1 + ⋯ + 𝑃 𝐴𝑛 𝑃 𝐵|𝐴𝑛 𝑝𝑋 𝑥 = 𝑃 𝐴1 𝑝𝑋|𝐴1 𝑥 + ⋯ + 𝑃 𝐴𝑛 𝑝𝑋|𝐴𝑛 𝑥

𝐸 𝑋 = 𝑃 𝐴1 𝐸 𝑋|𝐴1 + ⋯ + 𝑃 𝐴𝑛 𝐸 𝑋|𝐴𝑛

31

(32)

Total Expectation Theorem

• Geometric example:

𝐴1 ∶ {𝑋 = 1}, 𝐴2 ∶ {𝑋 > 1}

𝐸 𝑋 = 𝑃 𝑋 = 1 𝐸 𝑋|𝑋 = 1 +𝑃 𝑋 > 1 𝐸 𝑋|𝑋 > 1

• Solve to get 𝐸 𝑋 = 1/𝑝

(33)

2.5. Joint PMFs

• 𝑝𝑋,𝑌 𝑥, 𝑦 = 𝑃 𝑋 = 𝑥 and 𝑌 = 𝑦

• 𝑝𝑥 𝑦 𝑋,𝑌 𝑥,𝑦 =

• 𝑝𝑋 𝑥 = 𝑝𝑦 𝑋,𝑌 𝑥, 𝑦

• 𝑝𝑋|𝑌 𝑥|𝑦 = 𝑃 𝑋 = 𝑥|𝑌 = 𝑦 = 𝑝𝑋,𝑌𝑝 𝑥,𝑦

𝑌 𝑦

• 𝑝𝑥 𝑋|𝑌 𝑥|𝑦 =

33

(34)

Joint and Marginal PMFs

(35)

Summary of Facts About Joint PMFs

Let 𝑋 and 𝑌 be random variables associated with the same experiment.

• The joint PMF 𝑝𝑋,𝑌 of 𝑋 and 𝑌 is defined by 𝑝𝑋,𝑌 𝑥, 𝑦 = 𝑃 𝑋 = 𝑥, 𝑌 = 𝑦 .

• The marginal PMFs of 𝑋 and 𝑌 can be obtained from the joint PMF, using the formulas

𝑝𝑋 𝑥 = 𝑝𝑋,𝑌 𝑥, 𝑦

𝑦

, 𝑝𝑌 𝑦 = 𝑝𝑋,𝑌 𝑥, 𝑦

𝑥

.

35

(36)

Summary of Facts About Joint PMFs

• A function 𝑔(𝑋, 𝑌) of 𝑋 and 𝑌 defines another random variable, and

𝐸 𝑔 𝑋, 𝑌 = 𝑔(𝑋, 𝑌)

𝑦 𝑥

𝑝𝑋,𝑌 𝑥, 𝑦 .

If 𝑔 is linear, of the form 𝑎𝑋 + 𝑏𝑌 + 𝑐, we have 𝐸 𝑎𝑋 + 𝑏𝑌 + 𝑐 = 𝑎𝐸 𝑋 + 𝑏𝐸 𝑌 + 𝑐.

• The above have natural extensions to the case where more than two random variables are involved.

(37)

Summary of Conditional PMF

37

(38)

Summary of Conditional PMF

(39)

Summary of Facts About Conditional PMFs

Let 𝑋 and 𝑌 be random variables associated with the same experiment.

• Conditional PMFs are similar to ordinary PMFs, but pertain to a universe where the conditioning event is known to have

occurred.

• The conditional PMF of 𝑋 given an event 𝐴 with 𝑋(𝐴) > 0, is defined by

𝑝𝑋|𝐴 𝑥 = 𝑃(𝑋 = 𝑥|𝐴) and satisfies

𝑝𝑋|𝐴 𝑥 = 1.

𝑥

39

(40)

Summary of Facts About Conditional PMFs

• If 𝐴1, … , 𝐴𝑛 are disjoint events that form a partition of the sample space, with 𝑃(𝐴𝑖) > 0 for all 𝑖, then

𝑝𝑋 𝑥 = 𝑃(

𝑛

𝑖=1

𝐴𝑖)𝑝𝑋|𝐴𝑖 𝑥 .

(This is a special case of the total probability theorem.)

(41)

Summary of Facts About Conditional PMFs

• The conditional PMF of 𝑋 given 𝑌 = 𝑦 is related to the joint PMF by

𝑝𝑋,𝑌 𝑥, 𝑦 = 𝑝𝑌 𝑦 𝑝𝑋|𝑌 𝑥 𝑦 .

• The conditional PMF of 𝑋 given 𝑌 can be used to calculate the marginal PMF of 𝑋 through the formula

𝑝𝑋 𝑥 = 𝑝𝑌 𝑦 𝑝𝑋|𝑌 𝑥 𝑦 .

𝑦

• There are natural extensions of the above involving more than two random variables.

41

(42)

Summary of Facts About Conditional Expectations

Let 𝑋 and 𝑌 be random variables associated with the same experiment.

• The conditional expectation of 𝑋 given an event 𝐴 with 𝑃(𝐴) > 0, is defined by

𝐸 𝑋 𝐴 = 𝑥𝑝𝑋|𝐴 𝑥 . For a function 𝑔(𝑋), we have 𝑥

𝐸 𝑔(𝑋) 𝐴 = 𝑔(𝑥)𝑝𝑋|𝐴 𝑥 .

𝑥

• The conditional expectation of 𝑋 given a value 𝑦 of 𝑌 is defined by

(43)

Summary of Facts About Conditional Expectations

• If 𝐴1, … , 𝐴𝑛 be disjoint events that form a partition of the sample space, with 𝑃(𝐴𝑖) > 0 for all 𝑖, then

𝐸 𝑋 = 𝑃(

𝑛

𝑖=1

𝐴𝑖)𝐸[𝑋|𝐴𝑖].

Furthermore, for any event 𝐵, with 𝑃(𝐴𝑖 ∩ 𝐵) > 0 for all 𝑖, we have

𝐸 𝑋|𝐵 = 𝑃(

𝑛

𝑖=1

𝐴𝑖|𝐵)𝐸[𝑋|𝐴𝑖 ∩ 𝐵].

• We have

𝐸 𝑋 = 𝑝𝑌 𝑦 𝐸 𝑋 𝑌 = 𝑦 .

𝑦

43

(44)

(45)

Review

𝑝

𝑋

𝑥 = 𝑃 𝑋 = 𝑥

𝑝

𝑋,𝑌

𝑥, 𝑦 = 𝑃(𝑋 = 𝑥, 𝑌 = 𝑦) 𝑝

𝑋|𝑌

𝑥 𝑦 = 𝑃(𝑋 = 𝑥|𝑌 = 𝑦)

𝑝

𝑋

𝑥 = 𝑝

𝑋,𝑌

(𝑥, 𝑦)

𝑦

𝑝

𝑋,𝑌

𝑥, 𝑦 = 𝑝

𝑋

(𝑥)𝑝

𝑌|𝑋

(𝑦|𝑥)

45

(46)

2.7. Independent Random Variables

𝑝

𝑋,𝑌,𝑍

𝑥, 𝑦, 𝑧 = 𝑝

𝑋

𝑥 𝑝

𝑌|𝑋

𝑦 𝑥 𝑝

𝑍|𝑋,𝑌

𝑧 𝑥, 𝑦

• Random variables 𝑋, 𝑌, 𝑍 are independent if:

𝑝

𝑋,𝑌,𝑍

𝑥, 𝑦, 𝑧 = 𝑝

𝑋

(𝑥) ∙ 𝑝

𝑌

(𝑦) ∙ 𝑝

𝑍

(𝑧)

for all 𝑥, 𝑦, 𝑧

(47)

Independent Random Variables: Example

• Independent?

47

(48)

Expectations

• In general: 𝐸 𝑔 𝑋, 𝑌 ≠ 𝑔 𝐸 𝑋 , 𝐸 𝑌

• 𝐸 𝛼𝑋 + 𝛽 = α𝐸 𝑋 + 𝛽

• 𝐸 𝑋 + 𝑌 + 𝑍 = 𝐸 𝑋 + 𝐸 𝑌 + 𝐸 𝑍

• If 𝑋, 𝑌 are independent:

– 𝐸 𝑋𝑌 = 𝐸 𝑋 𝐸 𝑌

– 𝐸 𝑔 𝑋 ℎ 𝑌 = 𝐸[𝑔 𝑋 ] ∙ 𝐸[ℎ 𝑌 ] 𝐸 𝑋 = 𝑥𝑝𝑋 𝑥

𝑥

𝐸 𝑔 𝑋, 𝑌 = 𝑔(𝑥, 𝑦)𝑝𝑋,𝑌(𝑥, 𝑦)

𝑦 𝑥

(49)

Variances

• var 𝛼𝑋 = 𝛼2var 𝑋

• var 𝑋 + 𝛼 = var 𝑋

• Let 𝑍 = 𝑋 + 𝑌 . If 𝑋, 𝑌 are independent:

var 𝑋 + 𝑌 = var 𝑋 + var 𝑌

• Examples:

− If 𝑋 = 𝑌, var 𝑋 + 𝑌 = − If 𝑋 = −𝑌, var 𝑋 + 𝑌 =

− If 𝑋, 𝑌 are indepent and 𝑍 = 𝑋 − 3𝑌, var 𝑍 =

49

(50)

Binomial Mean and Variance

• 𝑋 = number of successes in

n

independent trials – probability of success 𝑝

• 𝑋𝑖 = 1, if success in trial 𝑖, 0, otherwise

• 𝐸 𝑋𝑖 = 𝐸 𝑋 =

• var 𝑋𝑖 = var 𝑋 =

𝐸 𝑋 = 𝑛𝑘=0 𝑘 𝑛𝑘 𝑝𝑘(1 − 𝑝)𝑛−𝑘

(51)

The Hat Problem

• 𝑛 people throw their hats in a box and then pick one at random.

𝑋: number of people who get their own hat – Find 𝐸 𝑋

𝑋𝑖= 1, if 𝑖 selects own hat 0, otherwise

• 𝑋 = 𝑋1 + 𝑋2 + ⋯ + 𝑋𝑛

• 𝑃 𝑋𝑖 = 1 =

• 𝐸 𝑋𝑖 =

• Are the 𝑋𝑖 independent?

• 𝐸 𝑋 =

51

(52)

Variance in the Hat Problem

• var 𝑋 = 𝐸 𝑋2 − 𝐸 𝑋 2 = 𝐸 𝑋2 − 1 𝑋2 = 𝑋𝑖2

𝑖

+ 𝑋𝑖𝑋𝑗

𝑖,𝑗:𝑖≠𝑗

• 𝐸 𝑋𝑖2 =

𝑃 𝑋1𝑋2 = 1 = 𝑃 𝑋1 = 1 ∙ 𝑃 𝑋2 = 1 𝑋1 = 1 =

• 𝐸 𝑋2 =

• var 𝑋 =

52

(53)

Summary of Facts About Independent Random Variables

• Let 𝐴 be an event, with 𝑃(𝐴) > 0, and let 𝑋 and 𝑌 be random variables associated with the same experiment.

• 𝑋 is independent of the event 𝐴 if

𝑝𝑋|𝐴 𝑥 = 𝑝𝑋 𝑥 , for all 𝑥,

that is, if for all 𝑥, the events {𝑋 = 𝑥} and 𝐴 are independent.

• 𝑋 and 𝑌 independent if for all pairs (𝑥, 𝑦), the events {𝑋 = 𝑥}

and {𝑌 = 𝑦} are independent, or equivalently

𝑝𝑋,𝑌 𝑥, 𝑦 = 𝑝𝑋 𝑥 𝑝𝑌 𝑦 , for all 𝑥, 𝑦.

53

(54)

Summary of Facts About Independent Random Variables

• If 𝑋 and 𝑌 are independent random variables, then 𝐸 𝑋𝑌 = 𝐸 𝑋 𝐸 𝑌 .

Furthermore, for any functions 𝑔 and ℎ, the random variables 𝑔(𝑋) and ℎ(𝑌) are independent, and we have

𝐸 𝑔(𝑋)ℎ(𝑌) = 𝐸 𝑔(𝑋) 𝐸 ℎ(𝑌) .

• If 𝑋 and 𝑌 are independent, then

참조

관련 문서

If a path is possible (i.e. , has positive probability), we want the hedge to work along that path. The actual value of the probability is irrelevant. There are no

Family support was selected as an independent variable, probability game item addiction was placed as a dependent variable, and friendship support,

- The best value of a parameter of a probability distribution should be that value which maximizes the likelihood or joint probability of occurrence of

Step 2 can be repeated as many times as necessary to produce the desired level of accuracy, that 

: At a critical point an infinitesimal variation of the independent variable results in no change in the value of the function..

 An ODE contains one dependent variable, one independent variable, and ordinary derivatives of the dependent variable.  Any linear ODE can be written in the

Conversely, if the optimal objective value of the phase I problem is 0, each artificial variable should be 0 and the values of the remaining variables form a feasible solution

6.4 Function Definitions with Multiple Parameters 6.5 Function Prototypes and Argument Coercion 6.6 C++ Standard Library Header Files.. 6.7 Case Study: