Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $X$ and $Y$ be random variable and $k$ be some fixed constant.

For a long time I thought that $P(X+Y=k)=P(X=k-Y)$, but recently I read something like $$P(X - Y = k) = E_{Y} \Big( P(X-Y = k) \Big) = E_{Y} \Big( P(X = k+Y) \Big) = \sum_{y=0}^{\infty} P(Y=y)P(X = k+y)$$ that makes me wonder whether it is common to consider as random variables probabilities involving random variables being equal to a quantity that involves a random variable itself, like $P(X=k-Y)$.

I have no background in Probability Theory from a measure-theoretic point of view, but from my naïve understanding an explanation could be that $$P(X=k-Y)=P(\{\omega:\omega\in X^{-1}(k-Y)\})\neq P(\{\omega:\omega\in {(X+Y)}^{-1}(k)\})=P(X+Y=k)$$ where $-1$ obviously indicates the preimage of the argument respect to the function.

In other words, in one case "$P(\cdot)$" is used as a measure of the preimage of $k$ via $X+Y$, in the other case it's used as a function of $Y$ therefore becoming itself a r.v.

Then the confusion rise because of the equal sign being improperly used in place of the set-theoretic way to write down the probability that a r.v. takes some value.


share|cite|improve this question
The notation $\{\omega : \omega\in X^{-1}(k-Y)\}$ is overly complicated, since the same set can be written simply as $X^{-1}(k-Y)$. One could reasonably write $\{\omega : X(\omega)=k-Y\}$ in order to define the set $X^{-1}(k-Y)$. – Michael Hardy Dec 2 '12 at 2:30
@MichaelHardy sorry, I rewrote $\{\omega : X(\omega)=k-Y\}$ without noticing to become redundant. – Immanuel Weihnacht Dec 2 '12 at 2:42
up vote 1 down vote accepted

Your understanding that $\Pr(X+Y=k)=\Pr(X=k-Y)$ is correct. Formally, $$\Pr(X+Y=k)=\Pr \{\omega: X(\omega) + Y(\omega) = k)\} = \Pr(X=k-Y).$$

Possibly, what you read was the following (for independent $X$ and $Y$): $$\Pr(X+Y=k)=\mathbb{E}_Y[\Pr_X(X + Y = k)].$$ Here, $\Pr_X(X + Y = k)$ is a random variable (which is a function of $Y$), and $\mathbb{E}_Y[\Pr_X(X + Y = k)]$ is its expectation.

share|cite|improve this answer

I have a suspicion that what you read said, or ought to have said, something like this: \begin{align} \Pr(X-Y=k) = \mathbb E(\Pr(X-Y=k\mid Y)) & = \sum_y \Pr(X-Y=k\mid Y=y)\Pr(Y=y) \\[15pt] & = \sum_y \Pr(X-y=k\mid Y=y)\Pr(Y=y) \\[15pt] & = \sum_y \Pr(X=k+y\mid Y=y)\Pr(Y=y) = \cdots\cdots \end{align} Google the term "law of total expectation".

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.