I have a list of positive numbers given.
By dividing each element by the sum of all elements, I receive a normalized result between 0 and 1 while keep the weights:
before [12, 12, 0, 0, 0] -> after [12/24, 12/24, 0, 0, 0] = [0.5, 0.5, 0, 0, 0]
However, I want to normalize the result between 0.5 and 1 rather than 0 and 1.
Desired result:
[12, 12, 0, 0, 0] -> [0.75, 0.75, 0.5, 0.5, 0.5]
[12, 0, 0, 0, 0] -> [1, 0.5, 0.5, 0.5, 0.5]
How can this be achieved?