Home page for accesible maths 5 Bivariate Distributions

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

5.3 Discrete Random Variables

If X and Y are both discrete, their joint probability mass function is

pXY(x,y)=𝖯(X=x,Y=y).

Quiz: What does the ‘,’ mean here? ‘and’.

As in the earlier chapters we will concentrate on discrete random variables taking integer values.

Properties of pXY(x,y):

  1. 1.

    For all x and y: 0pXY(x,y)1.

  2. 2.

    all x,ypXY(x,y)=x=-y=-pXY(x,y)=1.

  3. 3.

    𝖯((X,Y)A)=all x,yApXY(x,y).

Example 5.3.1.

The joint pmf of X and Y is

pXY(x,y)=(x+y)/18

for x,y=0,1,2.

  1. (a)

    Write out the joint probability table.

  2. (b)

    Show this is a valid joint pmf.

  3. (c)

    Evaluate

    1. (i)

      𝖯(X=2),

    2. (ii)

      𝖯(X<Y),

    3. (iii)

      𝖯(X=Y),

    4. (iv)

      𝖯(X+Y2).

Solution. 

  1. (a)

    pXY is

    y
    x 0 1 2
    0 018 118 218
    1 118 218 318
    2 218 318 418
  2. (b)

    Validity: pXY(x,y)0(x,y) and x,ypXY(x,y)=1.

  3. (c)
    1. (i)

      𝖯(X=2)=118[2+3+4]=1/2.

    2. (ii)

      𝖯(X<Y)=118[1+2+3]=1/3.

    3. (iii)

      𝖯(X=Y)=118[0+2+4]=1/3.

    4. (iv)

      𝖯(X+Y2)=118[2+2+2+3+3+4].

If X and Y are discrete random variables their marginal pmfs are

  1. pX(x)=y=-pXY(x,y),

  2. pY(y)=x=-pXY(x,y).

Quiz: For which of the above questions did you calculate a marginal pmf? (c)(i).

Example 5.3.2.

Bivariate random variables X and Y have joint pmf

y
0 1 2 3
x 1 5/60 8/60 2/60 1/60
2 12/60 7/60 3/60 2/60
3 4/60 8/60 6/60 2/60

Find the marginal pmfs.

Solution. 

y pX(x)
0 1 2 3
x 1 5/60 8/60 2/60 1/60 16/60
2 12/60 7/60 3/60 2/60 24/60
3 4/60 8/60 6/60 2/60 20/60
gappY(y) 21/60 23/60 11/60 5/60 1

If X and Y are discrete random variables, the conditional pmfs are

  1. pXY(xy)=pXY(x,y)pY(y),

  2. pYX(yx)=pXY(x,y)pX(x).

Example 5.3.3.

For the joint pmf in Example 5.3.2 obtain the conditional pmf of X given Y=2.

Solution. 

Y
0 1 2 3
X 1 2/60 16/60
2 3/60 24/60
3 6/60 20/60
11/60

So

pXY(x|2)=pXY(x,2)/pY(2).

Thus pX|Y(1|2)=2/11, pX|Y(2|2)=3/11 and pX|Y(3|2)=6/11. This conditional pmf is not the same as the marginal pmf. Knowing y has changed the distribution for X.

Independence is the simplest form for joint behaviour of two (or more) random variables. Informally, two random variables X and Y are independent if knowing the value of one of them gives no information about the value of the other. The outcomes of, say, a roll of a dice and a toss of a coin are independent in exactly this sense: knowing that the coin came down tails does not give us any information about the score of the dice, and, conversely, knowing that the score of the dice was 3 does not give any information about the coin.

Definition.

Formally, we say that two random variables X and Y are independent if the events {XA} and {YB} are independent for all sets A and B, i.e.

𝖯(XA,YB)=𝖯(XA)𝖯(YB)

for all sets A, B.

Theorem 5.3.1.

Independence in terms of the pmfs. Two discrete random variables X and Y are independent if and only if

pXY(x,y)=pX(x)pY(y)

for all x, y.

Proof.

If X and Y are independent, discrete random variables we get by letting A={x} and B={y} that

pXY(x,y) =𝖯(XA,YB)
=𝖯(XA)𝖯(YB)

by independence, so pXY(x,y)=pX(x)pY(y).

Conversely, if the joint pmf factorises we get for arbitrary sets A and B

𝖯(XA,YB) =xAyBpXY(x,y)
=xAyBpX(x)pY(y)
=xApX(x)yBpY(y)
=𝖯(XA)𝖯(YB).

When the discrete variables (X,Y) are independent then for all x,y:

  1. pXY(xy)=pX(x)pY(y)pY(y)=pX(x),

  2. pYX(yx)=pY(y).

These results conform with intuition as when X and Y are independent knowing the value of X should tell us nothing about Y and vice versa. In Example 5.3.3 the conditional (given Y=2) and marginal pmfs for X differ, so X and Y are not independent; they are dependent.

The converse intuition is also true: if the conditional distribution of X given Y=y is independent of y or, equivalently, the conditional distribution of Y given X=x is independent of x, then X and Y are independent.

Example 5.3.4.

A fair coin is tossed. If it turns H a fair die is thrown, if T a biased die. The bias makes even numbers twice as probable as odd numbers. Find the joint pmf of X, the toss of the coin, and Y, the score on the die. Find the distribution of the coin toss given that the die shows a 6.

Solution.  Code T and H as 0 and 1 to make rvs. Marginal: pX(x)=1/2 for x=0,1.

Conditional:

x=1: pY|X(y|1)=1/6 for y=1,2,,6.

x=0: pY|X(y|0)=c for y=1,3,5 and pY|X(y|0)=2c for y=2,4,6. Hence c=1/9.

Using pXY(x,y)=pY|X(y|x)pX(x) delivers

1 2 3 4 5 6
0 1/18 2/18 1/18 2/18 1/18 2/18
1 1/12 1/12 1/12 1/12 1/12 1/12

pY(6)=2/18+1/12=7/36.

So 𝖯(heads)=pX|Y(1|6)=(1/12)/(7/36)=3/7 and hence 𝖯(tails)=4/7.