Probabilities in a sub-population

Complete population
The joint probabilities pxy and the marginal probabilities px and py all describe proportions in the complete population of (xy) pairs.
Sub-population
In contrast, it is sometimes meaningful to restrict attention to a subset of the (xy) pairs. For example, we may be interested only in pairs for which the first variable, X , has some particular value. Probabilities that relate to a sub-population are called conditional probabilities.

Conditional probabilities for Y, given X = x

The general definition of the conditional probabilities for Y given that the value of X is x is

They can be found by rescaling of that row of the table of joint probabilities (dividing by px) so that the row sums to 1.0.

Two sets of conditional probabilities

Conditional probabilities for X given that Y  has the value y are defined in a similar way:

You should be careful to distinguish between px | y and py | x.

The probability of being pregnant, given that a randomly selected person is female would be fairly small. The probability of being female, given that a person is pregnant is 1.0 !!