How to prove that median(x-y) <= median(x) for x&y>=0?

ToxicStats

New member
Joined
Jan 19, 2021
Messages
4
Hello everyone!

Let x and y be vectors containing non-negative random numbers (say, both x and y contain n cases, n>1).

How can we show that for any x and any y we have
median(x - y) <= median(x) ?

Thanks so much!
 
This is a free math help forum not a free homework service. You really should have read the posting guidelines.
In any case to receive help the tutors on this forum need to see your work so they know which method you want to use to solve your problem and to see where you are making any mistakes.

Can you compute median x-y? How about median (x)? Pleas show us something so we can offer some help.
 
Hi! Thanks a lot for your reply!
I'm not doing a homework - I am doing a research and I want to develop an indicator. It's important to know if median(x - y) theoretically can exceed median(x) or not. In fact, I do not expect someone can get this task as a homework.

I made the following simulation in R:


r<-array()
for(i in 1:10000)
{
a<-runif(5)*100
f<-runif(5)*100
r<-median(a-f)-median(a)
}

min(r)
max(r)
boxplot(r)

The result is
> min(r)
[1] -99.99844
> max(r)
[1] -0.002380996


Experiments show that the above expression is true.
Would appreciate it a lot if someone knows a quick way to prove it.

I can prove it easily that mean(x-y)<mean(x) when both x and y are >0. A bit of a problem for the median though.

Thanks a gain!
 
For mean(x-y)<mean(x) we have:
mean(x-y)-mean(x)<0
mean(x)-mean(y)-mean(x)<0
mean(x)-mean(y)-mean(x)<0
Finally
-mean(y)<0, which is true if all cases in y>0.

But can we prove the same for the medians?..
 
Hi! Thanks a lot for your reply!
I'm not doing a homework - I am doing a research and I want to develop an indicator. It's important to know if median(x - y) theoretically can exceed median(x) or not. In fact, I do not expect someone can get this task as a homework.

I made the following simulation in R:


r<-array()
for(i in 1:10000)
{
a<-runif(5)*100
f<-runif(5)*100
r<-median(a-f)-median(a)
}

min(r)
max(r)
boxplot(r)

The result is
> min(r)
[1] -99.99844
> max(r)
[1] -0.002380996


Experiments show that the above expression is true.
Would appreciate it a lot if someone knows a quick way to prove it.

I can prove it easily that mean(x-y)<mean(x) when both x and y are >0. A bit of a problem for the median though.

Thanks a gain!
Since x-y <= x don't you get your desired result immediately?
 
For the record, I made that post hours ago but somehow I did not hit 'post reply'. Sorry about the delay.
 
Thanks a lot for your reply.
Intuitively, yes, you're right. But when it comes the the formal prof, not that clear though.

Suppose we have vectors z and x. Both vectors containing n observations, for any i=1,...,n we have z_i < x_i.
I can easily show that mean(z) < mean(x):
z_1 < x_1
z_2 < x_2

...
z_n < x_n
sum(z)<sum(x)
sum(z)/n<sum(x)/n
mean(z)<mean(x)

But can we show that median(z) < median(x) when z_i < x_i for any i = 1,...,n ?
 
Top