5

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?

London guy
  • 153
  • 1
  • 5

1 Answers1

9

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.

  • 1
    If I want the set to sum to 1000, do I just divide each value by 1/1000 of their total sum? Also, how does this question differ from http://math.stackexchange.com/q/278418/190742 which has a different answer? – Walter Stabosz Nov 07 '14 at 22:18
  • 1
    The difference is that in their other question they want the total sum to be $1$, whereas here we want $1/2$. To make the sum $1,000$, you would multiply each number by $1000/S$, where $S$ is their current total sum. – yoknapatawpha Nov 07 '14 at 22:23
  • Do you have any references for this solution? – Amir Oct 08 '19 at 11:18
  • This is just beautiful! – Student Jan 26 '23 at 09:37