My Math Forum Compute E(|X-Y|) and E(|X-Z|)

 June 29th, 2017, 03:52 PM #1 Member   Joined: Apr 2017 From: PA Posts: 43 Thanks: 0 Compute E(|X-Y|) and E(|X-Z|) Let X be a random variable distributed uniformlyE(|X-Y|) over [0, 20]. Define a new random variable Y by Y = [X] (the greatest integer in X). Find the expected value of Y. Compute E(|X-Y|) Attempt: for this I tried to use the formula for E(|X-Y|) and got (Y^2/20)+1-Y, then I plugged in 20 from the interval, but got 1. Then I attempted to take the integral $$\int_{0}^{20}([X])dx,$$ but got a number too high to be E(Y). How would u solve this?
 June 29th, 2017, 08:33 PM #2 Senior Member   Joined: Dec 2012 From: Hong Kong Posts: 853 Thanks: 311 Math Focus: Stochastic processes, statistical inference, data mining, computational linguistics Can you find any other definition of the $\displaystyle [X]$ notation in the text? Because right now I'm not sure how it's actually defined. If it means 'the greatest integer in the support of X', that's just 20 and certainly not random. If it means $\displaystyle \max_{X_i \in \mathbb{Z}} X_i$, that's a perfectly reasonable definition, but I don't see anywhere in the question where they mentioned $\displaystyle X_i$...
June 29th, 2017, 10:27 PM   #3
Senior Member

Joined: Sep 2015
From: Southern California, USA

Posts: 1,412
Thanks: 716

Quote:
 Originally Posted by poopeyey2 Let X be a random variable distributed uniformlyE(|X-Y|) over [0, 20]. Define a new random variable Y by Y = [X] (the greatest integer in X). Find the expected value of Y. Compute E(|X-Y|) Attempt: for this I tried to use the formula for E(|X-Y|) and got (Y^2/20)+1-Y, then I plugged in 20 from the interval, but got 1. Then I attempted to take the integral $$\int_{0}^{20}([X])dx,$$ but got a number too high to be E(Y). How would u solve this?

$x \geq Y(x),~\forall x \in [0,20] \Rightarrow |X-Y| = X-Y$

$0 \leq Y(x) < 1$

If you look at $X-Y$ you'll see it's a sawtooth

$Y(x) = x \mod 1,~x \in [0, 20]$

So you have 20 copies of $U[0,1)$ each weighted by the original distribution of $\dfrac 1 {20}$ and thus this corresponds to

$Y$ being distributed as $U[0,1)$

and thus $E[|X-Y|] = 0.5$

June 29th, 2017, 11:41 PM   #4
Senior Member

Joined: Dec 2012
From: Hong Kong

Posts: 853
Thanks: 311

Math Focus: Stochastic processes, statistical inference, data mining, computational linguistics
Quote:
 Originally Posted by romsek $x \geq Y(x),~\forall x \in [0,20] \Rightarrow |X-Y| = X-Y$ $0 \leq Y(x) < 1$ If you look at $X-Y$ you'll see it's a sawtooth $Y(x) = x \mod 1,~x \in [0, 20]$ So you have 20 copies of $U[0,1)$ each weighted by the original distribution of $\dfrac 1 {20}$ and thus this corresponds to $Y$ being distributed as $U[0,1)$ and thus $E[|X-Y|] = 0.5$
That was smart, I had no idea the square brackets were denoting equivalence classes! Could you clarify my confusion for me though? TBH I'm still a bit confused as to how $Y$ is defined - and in particular I don't understand the use of modular arithmetic with non-integral values...

June 29th, 2017, 11:49 PM   #5
Senior Member

Joined: Sep 2015
From: Southern California, USA

Posts: 1,412
Thanks: 716

Quote:
 Originally Posted by 123qwerty That was smart, I had no idea the square brackets were denoting equivalence classes! Could you clarify my confusion for me though? TBH I'm still a bit confused as to how $Y$ is defined - and in particular I don't understand the use of modular arithmetic with non-integral values...
$Y$ is $\left \lfloor X \right \rfloor$

$x \pmod{1} = x - \left \lfloor x \right \rfloor$

i.e. the fractional part of $x$

June 30th, 2017, 08:14 AM   #6
Senior Member

Joined: Sep 2015
From: Southern California, USA

Posts: 1,412
Thanks: 716

Quote:
 Originally Posted by romsek and thus this corresponds to $Y$ being distributed as $U[0,1)$
This is a mistake, apologies.

I meant that $X-Y = |X-Y|$ is distributed as $U[0,1)$

and thus $E[|X-Y|] = 0.5$

 July 2nd, 2017, 11:15 AM #7 Senior Member   Joined: Oct 2013 From: New York, USA Posts: 549 Thanks: 78 The mean of all the numbers from x to x + 1 is x + 0.5. This is true even if x isn't an integer. Therefore if y = the mean of all the numbers from x to x + 1, y - x = 0.5.
 July 3rd, 2017, 10:42 AM #8 Member   Joined: Apr 2017 From: PA Posts: 43 Thanks: 0 Hey Romsek, could u show the steps on how E(|X-Y|)=0.5?

 Tags compute, e|xy|, e|xz|

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post Shamieh Calculus 9 November 16th, 2013 04:53 PM ZardoZ Linear Algebra 7 December 22nd, 2012 02:14 AM sivela Calculus 6 March 5th, 2011 04:30 AM momo Number Theory 0 April 18th, 2009 10:09 AM jijicavalerul Calculus 1 October 19th, 2008 07:07 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top