Intuition for joint probability mass functions: an example

We toss an unbiased coin four times, and choose \(\Omega=\{H,T\}^4\) for our sample space. We write \(X\) for the number of heads in the first three tosses and \(Y\) for the number of heads in the last two tosses.

From this 'description in words', we deduce that \(X\) and \(Y\) are random variables, since \(X\) and \(Y\) specify an 'output' for every 'input' element from \(\Omega\). For instance if we take input \((T,T,H,H)\in \Omega\) then the output becomes \[ X(T,T,H,H) = 1, \quad Y(T,T,H,H)=2. \] This interpretation of \(X\) and \(Y\) as functions on \(\Omega\) can be made more explicit as follows: \[ \begin{aligned} X(\omega_1,\omega_2,\omega_3,\omega_4) & = 1\{\omega_1=H\}+1\{\omega_2=H\}+1\{\omega_3=H\}, \\ Y(\omega_1,\omega_2,\omega_3,\omega_4) & = 1\{\omega_3=H\}+1\{\omega_4=H\}, \end{aligned} \] where terms such as \(1\{\omega_1=H\}\) are indicators; it outputs 1 when \(\omega_1=H\) and 0 otherwise. Note that the output of \(X\) always lies in the set \(\{1,2,3,4\}\) and the output of \(Y\) always lies in the set \(\{1,2,3\}\).

Since our coin is unbiased and the four tosses can reasonably be interpreted as independent experiments, each outcome in \(\Omega\) is equally likely. This allows us to find probabilities such as \(P(X=1,Y=1)\), which is shorthand for \(P(\{X=1\}\cap\{Y=1\})\). We do this by looking for all outcomes that are consistent with the events \(\{X=1\}\) and \(\{Y=1\}\): \[ \{X=1\}\cap\{Y=1\} = \{(T,T,H,T),(H,T,T,H),(T,H,T,H)\}. \] We find that there are three such outcomes, each of which has probability \(1/16\), so we conclude that \(P(X=1,Y=1)=3/16\).

We can carry out the same calculation for any probability of the form \(P(X=k,Y=\ell)\) for every relevant \(k\) and \(\ell\). We summarize these probabilities in the following table:

    \(k\rightarrow\)      
 
0
1
2
3
\(\ell\)
0
1/16
2/16
1/16
0
\(\downarrow\)
1
1/16
3/16
3/16
1/16
 
2
0
1/16
2/16
1/16

The joint probability mass function (pmf) \(p\) of \(X\) and \(Y\) is a different way to summarize the exact same information as in the table, and this may help you when thinking about joint pmfs. As you can see in the table, the probabilities sum up to 1.

The joint pmf \(p\) is defined through \(p(a,b) = P(X=a,Y=b)\) for any real numbers \(a\) and \(b\). From the above table, we thus find that \[ p(a,b) = \begin{cases} 1/16 & a=0,b=2 \text{ or } a=0,b=1 \text{ or } a=1,b=2 \text{ or } a=2,b=0 \text{ or } a=3,b=1\text{ or } a=3,b=2 \\ 2/16 & a=1,b=0 \text{ or } a=2,b=2 \\ 3/16 & a=1,b=0 \text{ or } a=2,b=2 \\ 0 & \text{otherwise.} \end{cases} \]

Following is an interactive 3-D diagram of the joint pmf \(p\). Note that it encodes the same information as in the table, where the height of a bar indicates a probability. You can rotate the diagram by clicking on it and holding down your button as you move around. For a 3-D viewing experience, use (paper) 3-D glasses. You can select the type of 3-D glasses below the diagram.

Jmol0 will appear here.

The joint (cumulative) distribution function (cdf) \(F\) of \(X\) and \(Y\) is yet another way to summarize the same information.

The joint cdf \(F\) is defined through \(F(a,b) = P(X\le a, Y\le b)\) for any real numbers \(a\) and \(b\). Following is an interactive 3-D diagram of this joint cdf \(F\).

Jmol1 will appear here.

The 3-D diagrams on this page are made with JSMol and SageMath.