Part 1. Definition
In this task, you will be given a list of numbers. The goal is to divide all the numbers in the list by a constant such that the sum of the resulting list is 1. The output should be rounded to 3 decimals.
Part 2. Example
[1, 2, 3]
Answer: [0.167, 0.333, 0.500]
Explanation: The output list sums to 1.0 and has the same weight as the input 0.333 is twice as large as 0.167, .5 is 3 times as large as 0.167, and 0.5 is 1.5 times as large as 0.333. This is a good example.
Part 3. Exercise
[17.002, 1.676, 159.829, 6.877, 87.084, 105.408, -84.989, -29.673, 9.973]
Answer:
[ 0.062  0.006  0.585  0.025  0.319  0.386 -0.311 -0.109  0.037]