2. discrete random variables part iv: joint pmfs

83
2. Discrete Random Variables Part IV: Joint PMFs ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof. Ilya Pollak

Upload: hoangtuong

Post on 28-Jan-2017

237 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2. Discrete Random Variables Part IV: Joint PMFs

2.DiscreteRandomVariablesPartIV:JointPMFs

ECE302Fall2009TR3‐4:15pmPurdueUniversity,SchoolofECE

Prof.IlyaPollak

Page 2: 2. Discrete Random Variables Part IV: Joint PMFs

JointPMFpX,YofXandY•  IfXandYarediscreterandomvariables,theirjointprobabilitymassfuncQonisdefinedaspX,Y(x,y)=P(X=xandY=y).

Page 3: 2. Discrete Random Variables Part IV: Joint PMFs

JointPMFpX,YofXandY•  IfXandYarediscreterandomvariables,theirjointprobabilitymassfuncQonisdefinedaspX,Y(x,y)=P(X=xandY=y).

•  TheindividualPMFsofXandYarecalledthemarginalPMFsandcanbeobtainedfromthejointPMF:

pX (x) = pX ,Y (x,y)y∑

pY (y) = pX ,Y (x,y)x∑

Page 4: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Page 5: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

Column sums: marginal PMF pX(x)

1

1

2

2

3

3 4

4

Page 6: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

Column sums: marginal PMF pX(x)

E.g., pX(1) = P(X=1) = P(X=1, Y=1) + P(X=1, Y=2) + P(X=1, Y=3) + P(X=1, Y=4)

1

1

2

2

3

3 4

4

Page 7: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

Column sums: marginal PMF pX(x)

E.g., pX(1) = P(X=1) = P(X=1, Y=1) + P(X=1, Y=2) + P(X=1, Y=3) + P(X=1, Y=4) = pX,Y(1,1) + pX,Y(1,2) + pX,Y(1,3) + pX,Y(1,4) =

1

1

2

2

3

3 4

4

Page 8: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

Column sums: marginal PMF pX(x)

E.g., pX(1) = P(X=1) = P(X=1, Y=1) + P(X=1, Y=2) + P(X=1, Y=3) + P(X=1, Y=4) = pX,Y(1,1) + pX,Y(1,2) + pX,Y(1,3) + pX,Y(1,4) =

pX ,Y (1,y)y∑

1

1

2

2

3

3 4

4

Page 9: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

Column sums: marginal PMF pX(x)

E.g., pX(1) = P(X=1) = P(X=1, Y=1) + P(X=1, Y=2) + P(X=1, Y=3) + P(X=1, Y=4) = pX,Y(1,1) + pX,Y(1,2) + pX,Y(1,3) + pX,Y(1,4) = = 1/20 + 1/20 + 1/20 = 3/20

pX ,Y (1,y)y∑

1

1

2

2

3

3 4

4

Page 10: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

3/20 Column sums: marginal PMF pX(x)

E.g., pX(1) = P(X=1) = P(X=1, Y=1) + P(X=1, Y=2) + P(X=1, Y=3) + P(X=1, Y=4) = pX,Y(1,1) + pX,Y(1,2) + pX,Y(1,3) + pX,Y(1,4) = = 1/20 + 1/20 + 1/20 = 3/20

pX ,Y (1,y)y∑

1

1

2

2

3

3 4

4

Page 11: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

3/20 6/20 8/20 3/20

Column sums: marginal PMF pX(x)

E.g., pX(1) = P(X=1) = P(X=1, Y=1) + P(X=1, Y=2) + P(X=1, Y=3) + P(X=1, Y=4) = pX,Y(1,1) + pX,Y(1,2) + pX,Y(1,3) + pX,Y(1,4) = = 1/20 + 1/20 + 1/20 = 3/20

pX ,Y (1,y)y∑

1

1

2

2

3

3 4

4

Page 12: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(Fig2.10)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

3/20

7/20

7/20

3/20

Row sums: marginal PMF pY(y)

3/20 6/20 8/20 3/20

Column sums: marginal PMF pX(x)

E.g., pX(1) = P(X=1) = P(X=1, Y=1) + P(X=1, Y=2) + P(X=1, Y=3) + P(X=1, Y=4) = pX,Y(1,1) + pX,Y(1,2) + pX,Y(1,3) + pX,Y(1,4) = = 1/20 + 1/20 + 1/20 = 3/20

pX ,Y (1,y)y∑

1

1

2

2

3

3 4

4

Page 13: 2. Discrete Random Variables Part IV: Joint PMFs

JointPMFformorethantwodiscreterandomvariables

pX1 ,X 2 ,…,Xn(x1,x2,…,xn ) = P(X1 = x1,X2 = x2,…,Xn = xn )

Page 14: 2. Discrete Random Variables Part IV: Joint PMFs

JointPMFformorethantwodiscreterandomvariables

pX1 ,X 2 ,…,Xn(x1,x2,…,xn ) = P(X1 = x1,X2 = x2,…,Xn = xn )

The marginal PMF for each Xi can be obtained fromthe joint PMF by summing over all the x j 's other than xi,for example,

pX1(x1) = … pX1 ,X 2 ,…,Xn

(x1,x2,…,xn )xn

∑x3

∑x2

Page 15: 2. Discrete Random Variables Part IV: Joint PMFs

FuncQonsofmanydiscreterandomvariables

Let Y = g(X1,X2,…,Xn ). Then

pY (y) = pX1 ,X 2 ,…,Xn(x1,x2,…,xn )

{(x1 ,…,xn )|g(x1 ,…,xn )= y}∑

Page 16: 2. Discrete Random Variables Part IV: Joint PMFs

FuncQonsofmanydiscreterandomvariables

Let Y = g(X1,X2,…,Xn ). Then

pY (y) = pX1 ,X 2 ,…,Xn(x1,x2,…,xn )

{(x1 ,…,xn )|g(x1 ,…,xn )= y}∑

E[g(X1,X2,…,Xn )] = g(x1,…,xn )pX1 ,…,Xn(x1,…,xn )

x1 ,…,xn

Page 17: 2. Discrete Random Variables Part IV: Joint PMFs

FuncQonsofmanydiscreterandomvariables

Let Y = g(X1,X2,…,Xn ). Then

pY (y) = pX1 ,X 2 ,…,Xn(x1,x2,…,xn )

{(x1 ,…,xn )|g(x1 ,…,xn )= y}∑

E[g(X1,X2,…,Xn )] = g(x1,…,xn )pX1 ,…,Xn(x1,…,xn )

x1 ,…,xn

If g(X1,X2,…,Xn ) = a0 + a1X1 + a2X2 +…+ anXn, thenE[g(X1,X2,…,Xn )] = a0 + a1E[X1] + a2E[X2] +…+ anE[Xn ]

Page 18: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

3/20

7/20

7/20

3/20

3/20 6/20 8/20 3/20

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

Page 19: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

Z = X+2Y is between 3 and 12, with probability 1

Page 20: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3

4

5

6

7

8

9

10

11

12

Z = X+2Y is between 3 and 12, with probability 1

Page 21: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3

4

5

6

7

8

9

10

11

12

Z = X+2Y is between 3 and 12, with probability 1 pZ(3)=P(X+2Y = 3) = P(X=1 and Y=1) = 1/20

Page 22: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4

5

6

7

8

9

10

11

12

Z = X+2Y is between 3 and 12, with probability 1 pZ(3)=P(X+2Y = 3) = P(X=1 and Y=1) = 1/20

Page 23: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4

5

6

7

8

9

10

11

12

Z = X+2Y is between 3 and 12, with probability 1 pZ(3)=P(X+2Y = 3) = P(X=1 and Y=1) = 1/20 pZ(4)=P(X+2Y = 4) = P(X=2 and Y=1) = 1/20

Page 24: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5

6

7

8

9

10

11

12

Z = X+2Y is between 3 and 12, with probability 1 pZ(3)=P(X+2Y = 3) = P(X=1 and Y=1) = 1/20 pZ(4)=P(X+2Y = 4) = P(X=2 and Y=1) = 1/20

Page 25: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5

6

7

8

9

10

11

12

Z = X+2Y is between 3 and 12, with probability 1 pZ(3)=P(X+2Y = 3) = P(X=1 and Y=1) = 1/20 pZ(4)=P(X+2Y = 4) = P(X=2 and Y=1) = 1/20 pZ(5)=P(X+2Y = 5) = P(X=1 and Y=2) + P(X=3 and Y=1) = 2/20

Page 26: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5 2/20

6

7

8

9

10

11

12

Z = X+2Y is between 3 and 12, with probability 1 pZ(3)=P(X+2Y = 3) = P(X=1 and Y=1) = 1/20 pZ(4)=P(X+2Y = 4) = P(X=2 and Y=1) = 1/20 pZ(5)=P(X+2Y = 5) = P(X=1 and Y=2) + P(X=3 and Y=1) = 2/20

Page 27: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5 2/20

6 2/20

7 4/20

8 3/20

9 3/20

10 2/20

11 1/20

12 1/20

Z = X+2Y is between 3 and 12, with probability 1 pZ(3)=P(X+2Y = 3) = P(X=1 and Y=1) = 1/20 pZ(4)=P(X+2Y = 4) = P(X=2 and Y=1) = 1/20 pZ(5)=P(X+2Y = 5) = P(X=1 and Y=2) + P(X=3 and Y=1) = 2/20, etc

Page 28: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5 2/20

6 2/20

7 4/20

8 3/20

9 3/20

10 2/20

11 1/20

12 1/20

E[Z] = 3 · (1/20) + 4 · (1/20) + 5 · (2/20) + 6 · (2/20) + 7 · (4/20) + 8 · (3/20) + 9 · (3/20) + 10 · (2/20) + 11 · (1/20) + 12 · (1/20) = 7.55

Page 29: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

3/20

7/20

7/20

3/20

3/20 6/20 8/20 3/20

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5 2/20

6 2/20

7 4/20

8 3/20

9 3/20

10 2/20

11 1/20

12 1/20

Alternatively, E[Z] = E[X] + 2E[Y]

Page 30: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

3/20

7/20

7/20

3/20

3/20 6/20 8/20 3/20

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5 2/20

6 2/20

7 4/20

8 3/20

9 3/20

10 2/20

11 1/20

12 1/20

Alternatively, E[Z] = E[X] + 2E[Y] E[X] = 1 · (3/20) + 2 · (6/20) + 3 · (8/20) + 4 · (3/20) = 51/20

Page 31: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

3/20

7/20

7/20

3/20

3/20 6/20 8/20 3/20

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5 2/20

6 2/20

7 4/20

8 3/20

9 3/20

10 2/20

11 1/20

12 1/20

Alternatively, E[Z] = E[X] + 2E[Y] E[X] = 1 · (3/20) + 2 · (6/20) + 3 · (8/20) + 4 · (3/20) = 51/20 E[Y] = 1 · (3/20) + 2 · (7/20) + 3 · (7/20) + 4 · (3/20) = 50/20

Page 32: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.9(conQnued)

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

3/20

7/20

7/20

3/20

3/20 6/20 8/20 3/20

1

1

2

2

3

3 4

4

Z=X+2Y (a) Find pZ(k). (b) Find E[Z].

k pZ(k)

3 1/20

4 1/20

5 2/20

6 2/20

7 4/20

8 3/20

9 3/20

10 2/20

11 1/20

12 1/20

Alternatively, E[Z] = E[X] + 2E[Y] = 51/20 + 2 · (50/20) = 7.55 E[X] = 1 · (3/20) + 2 · (6/20) + 3 · (8/20) + 4 · (3/20) = 51/20 E[Y] = 1 · (3/20) + 2 · (7/20) + 3 · (7/20) + 4 · (3/20) = 50/20

Page 33: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.10:meanofabinomialrandomvariable

•  Nstudentsinclass•  Eachhasprobabilitypofge]nganA

•  Allgradesareindependent•  X=numberofstudentsthatgetanA

•  WhatisE[X]?

Page 34: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.10:meanofabinomialrandomvariable

Let Xi =1, if the i - th student gets an A0, otherwise

Page 35: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.10:meanofabinomialrandomvariable

Let Xi =1, if the i - th student gets an A0, otherwise

X1,X2,…,XN are Bernoulli random variables with E[Xi] = p.

Page 36: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.10:meanofabinomialrandomvariable

Let Xi =1, if the i - th student gets an A0, otherwise

X1,X2,…,XN are Bernoulli random variables with E[Xi] = p.X1 + X2 +…+ XN = X is the number of successes in N independent Bernoulli trials.

Page 37: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.10:meanofabinomialrandomvariable

Let Xi =1, if the i - th student gets an A0, otherwise

X1,X2,…,XN are Bernoulli random variables with E[Xi] = p.X1 + X2 +…+ XN = X is the number of successes in N independent Bernoulli trials.Therefore, X is a binomial random variable, with the following PMF :

pX (k) =Nk

pk (1− p)N−k

Page 38: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.10:meanofabinomialrandomvariable

Let Xi =1, if the i - th student gets an A0, otherwise

X1,X2,…,XN are Bernoulli random variables with E[Xi] = p.X1 + X2 +…+ XN = X is the number of successes in N independent Bernoulli trials.Therefore, X is a binomial random variable, with the following PMF :

pX (k) =Nk

pk (1− p)N−k

Hard way of evaluating E[X] :

E[X] = kNk

pk (1− p)N−k

k= 0

N

Page 39: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.10:meanofabinomialrandomvariable

Let Xi =1, if the i - th student gets an A0, otherwise

X1,X2,…,XN are Bernoulli random variables with E[Xi] = p.X1 + X2 +…+ XN = X is the number of successes in N independent Bernoulli trials.Therefore, X is a binomial random variable, with the following PMF :

pX (k) =Nk

pk (1− p)N−k

Hard way of evaluating E[X] :

E[X] = kNk

pk (1− p)N−k

k= 0

N

Easy way :E[X] = E[X1] + E[X2] +… + E[XN ] = Np

Page 40: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.10:meanofabinomialrandomvariable

Let Xi =1, if the i - th student gets an A0, otherwise

X1,X2,…,XN are Bernoulli random variables with E[Xi] = p.X1 + X2 +…+ XN = X is the number of successes in N independent Bernoulli trials.Therefore, X is a binomial random variable, with the following PMF :

pX (k) =Nk

pk (1− p)N−k

Hard way of evaluating E[X] :

E[X] = kNk

pk (1− p)N−k

k= 0

N

Easy way :E[X] = E[X1] + E[X2] +… + E[XN ] = NpE.g., if N = 60 and p =1/5, then E[X] =12.

Page 41: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.11

•  npeoplethrowtheirhatsinabox•  eachpicksuponehatatrandom

•  X=numberofpeoplewhogettheirownhatback

•  WhatisE[X]?

Page 42: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.11

Let Xi =1, if the i - th person gets his own hat0, otherwise

Page 43: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.11

Let Xi =1, if the i - th person gets his own hat0, otherwise

pXi(k) =

1/n, if k =1 1−1/n, if k = 00, otherwise

Page 44: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.11

Let Xi =1, if the i - th person gets his own hat0, otherwise

pXi(k) =

1/n, if k =1 1−1/n, if k = 00, otherwise

E[Xi] =1⋅ 1n

+ 0 ⋅ 1− 1n

=

1n

Page 45: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.11

Let Xi =1, if the i - th person gets his own hat0, otherwise

pXi(k) =

1/n, if k =1 1−1/n, if k = 00, otherwise

E[Xi] =1⋅ 1n

+ 0 ⋅ 1− 1n

=

1n

X = X1 + X2 +…+ Xn

Page 46: 2. Discrete Random Variables Part IV: Joint PMFs

Example2.11

Let Xi =1, if the i - th person gets his own hat0, otherwise

pXi(k) =

1/n, if k =1 1−1/n, if k = 00, otherwise

E[Xi] =1⋅ 1n

+ 0 ⋅ 1− 1n

=

1n

X = X1 + X2 +…+ Xn

E[X] = E[X1] + E[X2] +…+ E[Xn ] = n ⋅ 1n

=1

Page 47: 2. Discrete Random Variables Part IV: Joint PMFs

CondiQoningarandomvariableonanevent

•  CondiQonalPMFofarandomvariableX,condiQonedonaneventAwithP(A)>0:

pX |A (x) = P(X = x | A) =P( X = x{ }∩ A)

P(A)

Page 48: 2. Discrete Random Variables Part IV: Joint PMFs

CondiQoningarandomvariableonanevent

•  CondiQonalPMFofarandomvariableX,condiQonedonaneventAwithP(A)>0:

pX |A (x) = P(X = x | A) =P( X = x{ }∩ A)

P(A)Note :

P(A) = P( X = x{ }∩ A)x∑ , and therefore

pX |A (x) =1x∑

Page 49: 2. Discrete Random Variables Part IV: Joint PMFs

CondiQoningarandomvariableonanotherrandomvariable

•  IfXandYarerandomvariables,condiQonalPMFpX|YofXgivenYisdefined,forally>0,as:

pX |Y (x | y) = P(X = x |Y = y) =P X = x{ }∩ Y = y{ }( )

P Y = y{ }( )=pX ,Y (x,y)pY (y)

Page 50: 2. Discrete Random Variables Part IV: Joint PMFs

CondiQonalPMF:examples

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

x 2 3 4

pX|Y(x|4) 1/3 1/3 1/3

Page 51: 2. Discrete Random Variables Part IV: Joint PMFs

CondiQonalPMF:examples

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

x 2 3 4

pX|Y(x|4) 1/3 1/3 1/3

x 1 2 3 4

pX|Y(x|3) 1/7 2/7 3/7 1/7

Page 52: 2. Discrete Random Variables Part IV: Joint PMFs

CondiQonalPMF:examples

0 1/20 1/20 1/20

1/20 2/20 3/20 1/20

1/20 2/20 3/20 1/20

1/20 1/20 1/20 0

y

x

Joint PMF pX,Y(x,y)

1

1

2

2

3

3 4

4

x 2 3 4

pX|Y(x|4) 1/3 1/3 1/3

x 1 2 3 4

pX|Y(x|3) 1/7 2/7 3/7 1/7

y pY|X(y|3)

1 1/8

2 3/8

3 3/8

4 1/8

Page 53: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Page 54: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Page 55: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Y = X −1A = X ≥ 2{ }pY |A (m) = ?

Page 56: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

•  IntuiQon:sinceflipsareindependent,theoutcomeofthefirstflipdoesnotinfluencethefuture.

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Y = X −1A = X ≥ 2{ }pY |A (m) = ?

Page 57: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

•  IntuiQon:sinceflipsareindependent,theoutcomeofthefirstflipdoesnotinfluencethefuture.Therefore,theremainingflipsaierthefirstoneshouldhavethesamecondiQonaldistribuQonaspX.Inotherwords,theanswermustbepY|A=pX.

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Y = X −1A = X ≥ 2{ }pY |A (m) = ?

Page 58: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Y = X −1; A = X ≥ 2{ }

pY |A (m) =P(Y = m,X ≥ 2)P(X ≥ 2)

Page 59: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Y = X −1; A = X ≥ 2{ }

pY |A (m) =P(Y = m,X ≥ 2)P(X ≥ 2)

=P(X = m +1,X ≥ 2)

P(X ≥ 2)

Page 60: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Y = X −1; A = X ≥ 2{ }

pY |A (m) =P(Y = m,X ≥ 2)P(X ≥ 2)

=P(X = m +1,X ≥ 2)

P(X ≥ 2)=P(X = m +1)P(X ≥ 2)

, if m =1,2,…

0, otherwise

Page 61: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Y = X −1; A = X ≥ 2{ }

pY |A (m) =P(Y = m,X ≥ 2)P(X ≥ 2)

=P(X = m +1,X ≥ 2)

P(X ≥ 2)=P(X = m +1)P(X ≥ 2)

, if m =1,2,…

0, otherwise

=(1− p)m p

1− p, if m =1,2,…

0, otherwise

Page 62: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirsttrialisaT,whatisthecondiQonalPMFofX–1?

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

Y = X −1; A = X ≥ 2{ }

pY |A (m) =P(Y = m,X ≥ 2)P(X ≥ 2)

=P(X = m +1,X ≥ 2)

P(X ≥ 2)=P(X = m +1)P(X ≥ 2)

, if m =1,2,…

0, otherwise

=(1− p)m p

1− p, if m =1,2,…

0, otherwise =

(1− p)m−1 p, if m =1,2,…0, otherwise

= pX (m)

Page 63: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirstNtrialsareallT’s,findcondiQonalPMFofX–N.

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

YN = X − N; AN = X ≥ N +1{ }

Page 64: 2. Discrete Random Variables Part IV: Joint PMFs

Example:memorylesspropertyofageometricrandomvariable

•  X=thenumberofindependentcoinflipsunQlfirstH,withP(H)=p.

•  GiventhatthefirstNtrialsareallT’s,findcondiQonalPMFofX–N.

pX (k) =(1− p)k−1 p, if k =1,2,…0, otherwise

YN = X − N; AN = X ≥ N +1{ }

pYN |AN(m) =

(1− p)m−1 p, if m =1,2,…0, otherwise

= pX (m)

Page 65: 2. Discrete Random Variables Part IV: Joint PMFs

Example

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s).

Page 66: 2. Discrete Random Variables Part IV: Joint PMFs

Example

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s).

pS (s) =

12 /45, if s =1 ?, if s = 2?, if s = 3

0, otherwise

Page 67: 2. Discrete Random Variables Part IV: Joint PMFs

Example

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s).

pS (s) =

12 /45, if s =1 18 /45, if s = 2

?, if s = 30, otherwise

Page 68: 2. Discrete Random Variables Part IV: Joint PMFs

Example

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s).

pS (s) =

12 /45, if s =1 18 /45, if s = 215 /45, if s = 30, otherwise

Page 69: 2. Discrete Random Variables Part IV: Joint PMFs

Example

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s).

pS (s) =

12 /45, if s =1 18 /45, if s = 215 /45, if s = 30, otherwise

P(A) =12 /45 +18 /45 = 30 /45

Page 70: 2. Discrete Random Variables Part IV: Joint PMFs

Example

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s).

pS (s) =

12 /45, if s =1 18 /45, if s = 215 /45, if s = 30, otherwise

P(A) =12 /45 +18 /45 = 30 /45

pS |A (s) =

12 /4530 /45

=1230

, if s =1

?, if s = 20, otherwise

Page 71: 2. Discrete Random Variables Part IV: Joint PMFs

Example

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s).

pS (s) =

12 /45, if s =1 18 /45, if s = 215 /45, if s = 30, otherwise

P(A) =12 /45 +18 /45 = 30 /45

pS |A (s) =

12 /4530 /45

=1230

, if s =1

18 /4530 /45

=1830

, if s = 2

0, otherwise

Page 72: 2. Discrete Random Variables Part IV: Joint PMFs

Example

y

r

Joint PMF pR,Y(r,y)

1

0

2

1

2

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y).

4/45

6/45

6/45

-1

-2

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Page 73: 2. Discrete Random Variables Part IV: Joint PMFs

Example

y

r

Joint PMF pR,Y(r,y)

1

0

2

1

2

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y).

6/45

4/45 9/45

6/45 9/45

6/45

-1

-2

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Page 74: 2. Discrete Random Variables Part IV: Joint PMFs

Example

y

r

Joint PMF pR,Y(r,y)

1

0

2

1

2

3

Let A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y).

0 0 2/45

0 6/45 3/45

4/45 9/45 0

6/45 9/45 0

6/45 0 0

-1

-2

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Page 75: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

Event A P(A)=30/45

Page 76: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

X=2

Event A P(A)=30/45

Page 77: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

X=2 X=3

Event A P(A)=30/45

Page 78: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

X=2 X=3 X=4

Event A P(A)=30/45

Page 79: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

X=2 X=3 X=4 X=5

Event A P(A)=30/45

Page 80: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

X=2 X=3 X=4 X=5

pX |A (x) =

4 /4530 /45

=430

, if x = 2

?, if x = 3 ?, if x = 4?, if x = 50, otherwise

Event A P(A)=30/45

Page 81: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

X=2 X=3 X=4 X=5

pX |A (x) =

4 /4530 /45

=430

, if x = 2

6 /45 + 6 /4530 /45

=1230

, if x = 3

?, if x = 4?, if x = 50, otherwise

Event A P(A)=30/45

Page 82: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

X=2 X=3 X=4 X=5

pX |A (x) =

4 /4530 /45

=430

, if x = 2

6 /45 + 6 /4530 /45

=1230

, if x = 3

2 /45 + 9 /4530 /45

=1130

, if x = 4

?, if x = 50, otherwise

Event A P(A)=30/45

Page 83: 2. Discrete Random Variables Part IV: Joint PMFs

ExampleLet A = {S ≠ 3}, Y = R − S, X = R + S (a) Find pS(s) and pS|A(s). (b) Find pR,Y(r,y). (c)  Find pX|A(x).

6/45 9/45 0

6/45 9/45 3/45

4/45 6/45 2/45

s

r

Joint PMF pR,S(r,s)

1 1

2

2

3

3

X=2 X=3 X=4 X=5

pX |A (x) =

4 /4530 /45

=430

, if x = 2

6 /45 + 6 /4530 /45

=1230

, if x = 3

2 /45 + 9 /4530 /45

=1130

, if x = 4

3/4530 /45

=3

30, if x = 5

0, otherwise

Event A P(A)=30/45