2
$\begingroup$

I have a sample $S(x)$ containing $n$ elements:

$$S(x)=\{ s_1 x, s_2 x, \ldots, s_n x \},\qquad s_i \in \mathbb{R}, x\in \mathbb{R^{+}}$$

Every element in the sample is multiplied by $x$. Now median of this sample is

$$\tilde{S}(x)=y,\qquad y\in \mathbb{R^{+}}$$

When $y$ is given, how to find $x$?

In other words: If I know median of a sample whose every element is multiplied by a certain factor, how to find this factor? The original sample elements $s_{i}$ are also known.

I think it would be possible to find the value with a search algorithm (to some degree of precision), but maybe there is a simple closed solution.

Note that there may be more that one $x$ satisfying the above equation, since $s_i$ come from $\mathbb{N}$. The solution will more likely be an interval of values.

  • 0
    @MichaelHardy I don't think this edit is correct. If I read it correctly, s$_i$x were the observed samples and you know that the median of the sample of s$_i$x =y. Then find x.2012-09-23
  • 0
    Who is right? me or Michael Hardy?2012-09-23
  • 0
    @MichaelChernick You first comment is alright.2012-09-23
  • 0
    My only edit to this posting was to change "..." to "\ldots". Is that was is being called incorrect?2012-09-23
  • 0
    I haven't found any problems with the edit. Using '\ldots' instead of '...' is OK.2012-09-23
  • 0
    @MichaelHardy I don't see the original any more so I was going by memory. Also I had no wya of knowing exactly how you edited it. I thought the original said that the sample is what you get after you multiple while now I thought it looked like the sample that you see is the numbers prior to multiplication but I had trouble reading on my screen.2012-09-23
  • 0
    I see now that you did not change it that way. Sorry.2012-09-23

2 Answers 2

1

Sort your sequence $s_1,\ldots,s_n$ to obtain a new sequence $t_1,\ldots,t_n$.

If $n$ is odd, take $t=t_{(n+1)/2}$.
If $n$ is even, take $t=(t_{n/2}+t_{(n/2)+1})/2$

Solve for $x$ the following equation

$$tx=y$$

  • 0
    What does "Solve for $tx=y$" mean? One could say "Solve $tx=y$ for $x$" or "Solve $tx-y$ for $t$", and I would understand it.2012-09-23
  • 0
    But his sequence is not the t$_i$s it is the t$_i$s multiplied by x, You need to take account of the fact that the t$_i$s are integers.2012-09-23
  • 0
    @MichaelHardy: i'm not English, excuse me.2012-09-23
  • 0
    @MichaelChernick: the median shouldn't be integer: [Medians for samples](http://en.wikipedia.org/wiki/Median#Medians_for_samples).2012-09-23
  • 0
    I totally forgot that *position* of median value does not change by multiplying the elements, hence can be computed in this simple manner...2012-09-23
  • 0
    @enzotib : Terminology of this kind often gets misused by native English-speaking students. In at least that respect, you're in good company.2012-09-23
  • 0
    @Libor I said that the s$_i$s were integers based on the original post that said that for each i s$_i$ belongs to N the integers and not R as the current edit shows. Also it seemed that the s$_i$s were not known and only the t$_i$=s$_i$ x. Otherwise the unique median could be obtained by ordering the s$_i$s and you do not need to know y. My answer solves the original problem using y and assuming the s$_i$s are integers as was originally said. Also your original comment that the solution may not be unique makes sense if we assume that the s$_i$s are integers.2012-09-24
  • 0
    In the original formulation the checked answer makes no sense. But it does for the revised question if y=sx not tx by the way the t$_i$s were defined.2012-09-24
0

The fact that y is the median only tells that approximately n/2 elements are below y and n/2 are above. So it seems that the most information comes from knowing y/x is an integer. So the only thing I think you can do is search through values less than y give y/x as an integer. There will be at least one but there could be more than 1 in which case you will get a discrete list of possible values.