0
$\begingroup$

We are given the numbers $a_1,a_2,\ldots,a_N$, where $a_i \in [0,1]~\forall ~i$ and $a_1\leq a_2 \leq ....\leq a_N$.

I wish to scale the numbers $a_i|_{i=1}^N$ in a way that I will get the numbers $\tilde a_1, \tilde a_2, \ldots,\tilde a_N$ with $\tilde a_1+\ldots+\tilde a_N=1$. Is there any famous approach regarding this question?

Thanks

1 Answers 1

1

I am not sure it is famous but it works. Define $s=\sum_{i=1}^{N}a_{i}$ to be the sum of the $a_{i}$ numbers. Then let $\tilde{a}_{i}=\frac{a_{i}}{s}$ for all $i$. Then $\sum_{i=1}^{N}\tilde{a}_{i}=\sum_{i=1}^{N}\frac{a_{i}}{s}=1$.

  • 0
    Thank you. Your answer definitely works. However, I forgot to mention one detail in my question. I wish to do the "scaling" in a way that more weight is given in the greater numbers and less weight is given for the lower numbers. So, if you have any ideas while taking this detail into account please let me kwow. Thanks again2017-02-03
  • 0
    @Dimitri C OK, what exactly do you mean by scaling. In my book it is multiplying. Your full problem can be achieved by first doing the transformation I proposed, and then subtracting $\tilde{a}_{1}/2$ from first $\frac{N}{2}$ $\tilde{a}_{i}$s and adding $\tilde{a}_{1}/2$ to the second half of $\tilde{a}_{i}$s.2017-02-03
  • 0
    You are right. Scaling is a wrong choice of word for what I want to do. I want to take all the numbers I have and somehow transform them so that the new numbers will sum up to 1, but during the transformation I want to give more weight in the greater numbers and less wight in the lower numbers. Your second comment is a way of doing what I want.2017-02-03