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
    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
    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.