Chapter 4 Conditional distributions
Nike and Adidas have opened up new neighboring sports stores which have found themselves in direct competition with each other. Let SNike be the total sales in the Nike store, and let SAdidas be the total sales in the Adidas store. Phil Knight, the co-founder of Nike, would like to know the sales of the Adidas store in order to make business decisions regarding his own store. However Phil is not privy to this information. Phil only knows the exact sales of the Nike store. Given the information about SNike, what can be said about SAdidas?
4.1 Conditional Probabilities and Discrete Conditional Distributions
The problem described above concerning sales in a Nike and Adidas store is in a continuous setting, that is, S1 and S2 are both continuous random variables. We have encountered this type of conditional problem in the context of probabilities. In this section, we recall this theory and extend it to discrete random variables.
Consider two events A and B such that P(B)>0. The probability of event A happening given that B has already happened is called the conditional probability of A given B, and is denoted P(A∣B). The conditional probability can be calculated by the formula P(A∣B)=P(A∩B)P(B).
Why does Definition 4.1.1 specify that P(B)>0? The reason for this has both a real-world interpretation and a mathematical one. The statement that P(B)=0 is equivalent to B being an impossible event. If B was an impossible event, then the assumption that B has already happened in Definition 4.1.1 would be a contradiction. Mathematically if P(B)=0, then we are unable to divide by P(B) in the formula P(A∣B)=P(A∩B)P(B). Therefore we must specify that P(B)>0.
Consider the cafe from Example 3.1.2, where the owner has collected data to determine the joint probabilities of the temperature X in degrees Celsius during winter and the number of customers Y in the cafe each day. The joint probability table is
The owner would like to make a decision about how many staff are on shift today. Given that it is going to be 20∘C, what is the probability that there are 75 customers?

In mathematical language, the question is asking us to calculate P(Y=75∣X=20). Using the formula of Definition 4.1.1, we know that P(Y=75∣X=20)=P(X=20∩Y=75)P(X=20). Calculate that
Therefore
Can we extend this idea of conditional probability to the language of discrete random variables?
Recall that for a random variable X, the probability P(X=x) is given by the evaluation of the probability mass function pX(x) of X. Similarly for two random variables X and Y, the probability P(X=x,Y=y) is given by the evaluation of the joint probability mass function pX,Y(x,y). Converting Definition 4.1.1 into these terms leads us to the following.
Consider two discrete random variables X and Y. Let pX,Y(x,y) be the joint PMF of X and Y, and pY(y) be the marginal PMF of Y. The conditional probability mass function of X given Y, denoted pX|Y(x∣y), is the function
The conditional PMF pY|X(y∣x) is defined similarly.
The value pX|Y(x|y) is equal to the probability P(X=x∣Y=y).
Calculate the conditional PMF of X given Y for the random variables given in Example 4.1.2.
By applying Definition 4.1.3, calculate that
Let y be some fixed outcome for the random variable Y. The sum of conditional probabilities pX|Y(x|y) over all values of x will sum to 1 since this is a complete set of possible outcomes. This can be verified for the solution to Example 4.1.4, for example:
Check that the sum of values p(x∣10) and the sum of values p(x∣20) respectively over all possible outcomes x equals 1.
Consider two discrete random variables X and Y. The conditional CDF of X given Y=y is FX|Y(x|y)=∑x′≤xpX|Y(x′|y).
It follows from Definition 4.1.5 that FX|Y(x|y)=P(X≤x|Y=y).
4.2 Continuous Conditional Distributions
This theory cannot be extended to the continuous case directly since for a continuous random variable Y, and for any fixed value y, one has PY(Y=y)=0.
Consider two continuous random variables X and Y. Let fX,Y be the joint p.d.f. of X and Y, and fY(y) be the marginal p.d.f. of Y.
The conditional probability density function of X given that Y=y is defined by
Consider two continuous random variables X and Y. The cumulative conditional probability distribution function of X given Y=y is defined by
Note that conditional p.d.f.’s are themselves probability density functions and thus have all the associated properties.
Consider two random variables X,Y whose joint p.d.f. is
fX,Y(x,y)={24x(1−x−y),if x,y≥0 and x+y≤1,0,otherwise.Find the conditional p.d.f. of X given Y=12.
In Example 2.2.3, we found
ADD CONDITIONAL DISTRIBUTION APP
4.3 Independence
Recall the statement of Definition 2.5.1 that states two random variables X,Y are independent if fX,Y(x,y)=fX(x)fY(y) for all x,y∈R. It follows that for independent continuous random variables X and Y, then for any y such that fY(y)>0:
This is to say that the conditional probability density function fX|Y is equal to the probability density function fX, and does not depend on y at all. This makes sense: the information on the outcome of Y is independent of X.
4.4 Conditional Expectation
Let X and Y be random variables. One can ask about the expectation of X, that is the average value of X over infinitely many trials, given the outcome of Y.
The conditional expectation of X given Y=y, is defined by
Many of the properties of expectation such as linearity are inherited by conditional expectation.
Consider two continuous random variables X,Y whose joint p.d.f. is
For some fixed value y>0, find E[X|Y=y].
Calculating the marginal p.d.f. of Y:
Hence, for y>0, the conditional probability density function is
Therefore by Definition 4.3.1 the conditional expectation of X is