Some days ago another user posted a question which was something like this:

$$ A \sim U(0,4)$$ $$B \sim U(0,6)$$ $$A - B \sim U(-4,4)$$

The question was originally to find the distribution of A conditional on B. Immediately two famous users of the community spotted a problem and commented that it was impossible, then providing a hint (if I remember correctly) something like "Write $A = (A-B)+B$". Which today I still do not understand. I found proofs (actually one of these famous users posted some years ago the proof) which claimed that the difference of two iid variables will never yield a uniform distribution, but what about the conditional case? How do we know which distribution is possible and which one is not? If we have $B \sim U(0,4)$, is it now possible?

As part of my journey trying to understand why it was not possible, I tried to replicate the problem, but with discrete scenarios (My technical background is unfortunately not adept to the continuous case...).

In my mind, I am trying to find a joint probability mass where each difference have the same probability of occurrence, and the marginal distributions as well. In plain words, each diagonal sum the same, each row sum the same, each column sum the same.

First with a 3x3 matrix. We can get something like (it should be normalized to 15, otherwise it is not a distribution, but for ease of readibility let's keep it like that):

\begin{bmatrix} 0 & 2 & 3 \\ 2 & 2 & 1 \\ 3 & 1 & 1 \\ \end{bmatrix}

For a 4x4 matrix:

\begin{bmatrix} 1 & 0 & 2 & 4 \\ 0 & 2 & 3 & 2 \\ 2 & 3 & 1 & 1 \\ 4 & 2 & 1 & 0 \\ \end{bmatrix}

For a 5x5 matrix: \begin{bmatrix} 0 & 0 & 1 & 3 & 5 \\ 0 & 0 & 4 & 3 & 2 \\ 1 & 4 & 2 & 1 & 1 \\ 3 & 3 & 1 & 2 & 0 \\ 5 & 2 & 1 & 0 & 1 \\ \end{bmatrix}

The 4x6 matrix had indeed no solution (Is this related to the comment on $A = (A-B)+B$?)

So I got some questions from here. It seems like there is more than one solution for the 5x5 matrix, and for the other matrices. It makes me think that in the continuous case there may be as well more than one solution ie. for the case where both, A and B are uniform (0,4) and their difference is uniform (-4,4). But how can I find one of those solutions that fit these conditions? How do I identify which conditions are just impossible and which ones can be solved?

Any thoughts on this topic are highly appreciated.

  • 2
    $\begingroup$ References to the original questions will be helpful $\endgroup$
    – Max
    Mar 3 at 13:23
  • 2
    $\begingroup$ The solution is immediate from general solution sum of two uniform random variables aY+bX=Z $\endgroup$ Mar 3 at 13:41
  • 1
    $\begingroup$ @Kjetil How? The issue here is that $A$ and $B$ are not assumed independent. // The more challenging situation is where $A$ and $B$ have equal expectations. In that case, consider the situation where $X$ has a uniform distribution on $[-1,1]$ and set $A=2X+2,$ $B = 2-2X.$ Clearly all three of $A,$ $B,$ and $A-B$ have uniform distributions. I believe this is essentially the only such example: that is, when all three are uniform, $A$ and $B$ must be affinely related. $\endgroup$
    – whuber
    Mar 3 at 18:11
  • $\begingroup$ @Max - perhaps stats.stackexchange.com/questions/640018/… $\endgroup$
    – Henry
    Mar 3 at 22:42
  • 2
    $\begingroup$ @whuber If I understand what you're saying: there actually are possibilities other than the case when they're affinely related. Let's stick to the case where we want both $A$ and $B$ to have $U[0,4]$ distribution. If you take $A\sim U[0,4]$, and set $B=2-A$ for $A<2$ and $B=6-A$ for $A>2$, then also $B\sim U[0,4]$, and $A-B\sim U[-2,2]$. Via a similar splitting into $k$ cases, I think you can get $A-B\sim U[-4/k, 4/k]$ for any positive integer $k$. Can you get $A-B\sim[-c,c]$ for other $c$? $\endgroup$ Mar 4 at 1:55

1 Answer 1


If the postulated distributions held, then $E(A) = 2, E(B) = 3$ while $E(A - B) = 0$, can you see the problem here? (hint: linearity of expectation.)

  • 1
    $\begingroup$ At a quick glance, this seems a quick and sound rebuttal to the confusion. BTW, welcome after a long time. $\endgroup$ Mar 3 at 13:52
  • $\begingroup$ Amazing, thanks for the note. I was confused and thought dependent variables could have different expectation. I found also a link with more details on it. stats.stackexchange.com/questions/130067/… $\endgroup$ Mar 3 at 15:20
  • $\begingroup$ Do you have any other thoughts/ hints for how to find a possible distribution when the Expectations match? (For example the case where $A,B \sim U(0,4)$ and $A - B \sim U(-4,4)$). Or in the other case, how to find that there is no such distribution? $\endgroup$ Mar 3 at 15:22
  • 3
    $\begingroup$ @OscarFlores "I was confused and thought dependent variables could have different expectation." -- NO. The beautiful thing of the expectation is that the linearity alway holds regardless r.v.s are dependent or independent. $\endgroup$
    – Zhanxiong
    Mar 3 at 15:32
  • 3
    $\begingroup$ OscarFlores @whuber's comment to the question gives the solution (up to a zero probability event) to your $A,B\sim U(0,4)$ and $A−B\sim U(−4,4)$ follow-up: for $A \sim U(0,4)$ take $B =4-A \sim U(0,4)$ and so $A-B=2A-4\sim U(-4,4)$. $\endgroup$
    – Henry
    Mar 3 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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