Let $ X $ and $Y$ be two random variables with means $\mu_X$ and $\mu_Y$ respectively, as well as variances $\sigma_X$ and $\sigma_Y$ (all of which exist). I am interested in computing the following variance:

$$ Var[sgn(X-Y)]$$

where, of course, sgn denotes the Signum Function.

I am stuck because the closed form of $sgn(X-Y)$ is of the form $(X-Y)/|X-Y|$, at least for $X \ne Y$, and I don't see any straightforward ways of calculating the variance of this quantity. Does anyone know how to go about this?

Thanks in advance.

Edit: We may assume $Cov(X, Y)$ exists.

  • $\begingroup$ What do you know about the covariance? And you'll need more from the distributions than just a mean and variance. $\endgroup$
    – Paul
    Feb 11, 2016 at 14:09
  • 1
    $\begingroup$ It may be easier to write $V[sgn(X-Y)]=E[(sgn(X-Y))^2] - E[sgn(X-Y)]^2$ $\endgroup$
    – Augustin
    Feb 11, 2016 at 14:15
  • $\begingroup$ @Paul I edited the question. $\endgroup$
    – atzol
    Feb 11, 2016 at 16:41
  • $\begingroup$ @Augustin You're right, please see my comment for the first answer. $\endgroup$
    – atzol
    Feb 11, 2016 at 16:42

1 Answer 1


We have that $$\begin{align} \operatorname E\mathrm{sgn}(X-Y) & =-1\cdot\Pr(X<Y)+0\cdot\Pr(X<Y)+1\cdot\Pr(X>Y) \\ & =\Pr(X>Y)-\Pr(X<Y) \end{align}$$ and $$\begin{align} \operatorname E\mathrm{sgn}^2(X-Y) & =(-1)^2\cdot\Pr(X<Y)+0^2\cdot\Pr(X<Y)+1^2\cdot\Pr(X>Y) \\ & =\Pr(X>Y)+\Pr(X<Y) \end{align}$$ using the law of the unconscious statistician. Hence, $\begin{align} \operatorname{Var}\mathrm{sgn}(X-Y) &=\Pr(X>Y)+\Pr(X<Y)-[\Pr(X>Y)-\Pr(X<Y)]^2. \end{align}$

  • $\begingroup$ This does not directly answer my question, since I didn't say I know the distributions of X and Y, or their joint distribution (which I don't). I know they are continuous, hence $P(X \lt Y) = P(X \le Y)$, so it is easy to see that $E(sgn^2(X-Y)) = 1$, but I don't see an obvious way of computing $E(sgn(X-Y))$. But thank you for your answer. $\endgroup$
    – atzol
    Feb 11, 2016 at 16:39
  • 1
    $\begingroup$ Without further information about $X$ and $Y$ (i.i.d. for example), we can't go further than $P(X>Y)-P(X<Y)$. $\endgroup$
    – Augustin
    Feb 11, 2016 at 16:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .