How do you scale a set of number such that they sum to 0.5 after scaling

3.2k Views Asked by At

Suppose I have a set of numbers of various different values (>0.0). I want to scale these numbers so that they all sum to 0.5. The scaling is required so that the relative strength of the numbers with respect to the other numbers is retained as is, and the constraint that the sum of the numbers should be 0.5 after scaling is my requirement.

What is the actual mathematical way to accomplish this?

1

There are 1 best solutions below

4
On BEST ANSWER

To do this you can divide each number by twice their total sum. To see why this works, say you have a collection of $n$ numbers and denote them $p_i$ for $i \in \{1, \ldots, n\}$. Their sum is \begin{equation} S = \sum_{i=1}^{n} p_i. \end{equation} Dividing each $p_i$ by $2S$ gives \begin{equation} \sum_{i=1}^{n} \frac{p_i}{2S} = \frac{1}{2S} \sum_{i=1}^{n} p_i = \frac{1}{2S}S = \frac{1}{2}. \end{equation} This preserves the relative magnitude of each number while scaling their sum, just as we wanted.