# “Normalize” values to sum 1 but keeping their weights

I am not really sure what this operation might be called, but I have some numbers, for example:

40

10

I need to format these numbers so that they form the sum 1, but they should keep their "weight".

In this specific case

40 would become 0.80, and 10 would become 0.2

But if I have more values (like 40, 10, 25, 5 for example), I am really lost because I don't know the formula.

If anybody can help, could he please reply in words (for example: "Sum up all values then divide through...", and not in a formula? I am really not good at reading formulas at all.

Thank you so much!

-
how should $[40,10]$ become $[0.75,0.25]$? $\frac{40}{10} \neq \frac{0.75}{0.25}$ –  Jan Dvorak Jan 14 '13 at 6:38
Shouldn't $[40,10]$ become $[0.8,0.2]$? Then it's easy - just divide each element by the sum. –  Jan Dvorak Jan 14 '13 at 6:43
Answer posted . –  Jan Dvorak Jan 14 '13 at 6:52

Why not just divide each number in your sample by the sum of all the numbers in your sample?

-

From the text description, it seems this is what you want:

• calculate the sum of all elements
• divide each element by the sum

Note that, however, then your example $[40, 10]$ normalises as $[0.8, 0.2]$, not $[0.75,0.25]$. The latter doesn't preserve the ratio of both elements.

-

Divide $100$ by the sum which is $80$ to get $1.25$. Then you multiply the the terms and use simple proportion where $80*1.25=100$ is proportional to one. You will get answers like $05,0.125,0.3125$ and $0.0625$.

-

Just divide all the numbers through by 50. Should normalise it to the scale you want 0 - 1. For example: 40/50 = 0.8 25/50 = 0.5 5/50 = 0.1

etc.

I think you get the idea!

-