There is also a concept of the conditional probability of an event given a discrete random variable. Such a conditional probability is a random variable in its own right.
Suppose X is a random variable that can be equal either to 0 or to 1. As above, one may speak of the conditional probability of any event A given the event X = 0, and also of the conditional probability of A given the event X = 1. The former is denoted P(A|X = 0) and the latter P(A|X = 1). Now define a new random variable Y, whose value is P(A|X = 0) if X = 0 and P(A|X = 1) if X = 1. That is
This new random variable Y is said to be the conditional probability of the event A given the discrete random variable X:
According to the "law of total probability", the expected value of Y is just the marginal (or "unconditional") probability of A.