# Thread: Equality of random variables

1. ## Equality of random variables

Suppose the random varaible Y has non-zero probability at 0,1,2,3,... (i.e. the support of Y is the set of non-negative integers).

Define a random variable W:
W=0 ,if Y=0,1,2,or 3
--=Y-3 ,if Y=4,5,...

Define a random variable Z:
Z=max{0,Y-3}=0 ,if Y≦3
--------------=Y-3 ,if Y>3

And I have 2 questions...

1) Can I say that W and Z are equal as random variables (i.e. W=Z) ?
(what is bothering me is that W is undefined at e.g. Y=0.5, Y=2.2, etc. while Z is defined everywhere, my notes say that W and Z are equal random varaibles, but I just struggle to understand why)

2) Is it true that E(W)=E(Z) ?

Hopefully someone can clarify this! Thank you!

Note: also under discussion in SOS math cyberboard

2. ## Re: Equality of random variables

Hello,

Yes they're equal. Because Y is almost surely equal to 0,1,2,3,4,... So you can consider that Y being 2.2 never happens, so if W=2.2 it's a negligible event that shouldn't be taken into account.

If you want a more formal explanation :
2 rv W and Z are equal if there exists $\displaystyle A\subset\Omega$ such that $\displaystyle P(A)=0$ and $\displaystyle \forall \omega\in\{\Omega\setminus A\},~ W(\omega)=Z(\omega) \quad (1)$, where $\displaystyle P(A)=0$.

But if $\displaystyle \omega$ is such that $\displaystyle Y$ doesn't take integer values, then $\displaystyle \omega \in B$, where $\displaystyle P(B)=0$, since the support for Y is the set of natural integers.

So by taking A=B in the proposition (1), we get that the 2 rv's are (almost surely) equal.

And yes, their expectation is equal. By definition of each of them.

3. ## Re: Equality of random variables

Both W and Z are functions of the same Y.
W=g(Y)
Z=h(Y)

When you look mathmatically at these two functions, they just aren't the same. W is undefined at e.g. Y=0.5, Y=2.2, etc. while Z is defined everywhere. My notes still say that W and Z are equal random varaibles, but I just struggle to understand why. And also, I think you're talking about "almost sure equality", rather than equality.

Thanks!

4. ## Re: Equality of random variables

Yes, everything is almost surely. And yes, I understand that they're functions of the same random variable.
What you must know is, yep, one is defined if Y is 0.5 or 2.2. But Y is "almost never" equal to 0.5 or 2.2 (by definition of Y because 'the support of Y is the set of non-negative integers').

They're almost surely equal. Indeed, the only times where W and Z are not equal is when W is defined and Z is not. But it's a set of events of probability 0, so we don't care.

By extension, we say that they're equal rvs.