I want to fairly divide a random number of sweets I buy every day between kids in my class for the day based on the days test results. I calculate the test results.
There are 10 Kids: At the end of the day I add their marks together and find the fraction over the total achieved mark for each kid. I get the following.
- 1:0.1
- 2:0.1
- 3:0.15
- 4:0.15
- 5:0.2
- 6:0.1
- 7:0.1
- 8:0.0.05
- 9:0.025
- 10:0.025
The fractions sum equal 100%
For example if I bring 48 sweets
- 1:0.1 * 48 rounded = 5
- 2:0.1 * 48 rounded = 5
- 3:0.1 * 48 rounded = 5
- 4:0.2 * 48 rounded = 10
- 5:0.2 * 48 rounded = 10
- 6:0.1 * 48 rounded = 5
- 7:0.1 * 48 rounded = 5
- 8:0.0.05 * 48 rounded = 2
- 9:0.025 * 48 rounded = 1
- 10:0.025 * 48 rounded = 1
After handing out the sweet I realized I am short one sweet as the total is 49
Some days I am short multiple sweet. Other days I have sweets left.
Is it possible to evenly divide the sweets every day so I have none short or left.
is there something in Mathematics that can assist me?
In some cases, no fair division where you give out all the sweets is possible. Consider, for example, the outcome in which all $10$ children get the same score (and you brought $48$ sweets). You can't give each child $4.8$ sweets, but if you round some of the numbers up and the rest down, you end up with two children that have the exact same score but receive different amounts of candy.
Aside from that, a reasonable thing to do is the following:
In the last step, break ties arbitrarily. (Maybe bias it towards children who got less candy, to be nice? Or maybe towards children who lost ties the previous time? Or both?)
So in your example, we have:
\begin{array}{c|l|c|c|c} \text{Child} & \text{Score} & \text{Candy earned} & \text{Step 1 candy} & \text{Fraction} & \text{Step 3 candy} \\ \hline 1 & 0.1 & 4.8 & 4 & \frac{0.8}{4} = 0.2 & 0 \\ 2 & 0.1 & 4.8 & 4 & \frac{0.8}{4} = 0.2 & 0 \\ 3 & 0.15 & 7.2 & 7 & \frac{0.2}{7} \approx 0.03 & 0\\ 4 & 0.15 & 7.2 & 7 & \frac{0.2}{7} \approx 0.03 & 0\\ 5 & 0.2 & 9.6 & 9 & \frac{0.6}{9} \approx 0.07 & 0\\ 6 & 0.1 & 4.8 & 4 & \frac{0.8}{4} = 0.2 & 1\\ 7 & 0.1 & 4.8 & 4 & \frac{0.8}{4} = 0.2 & 1\\ 8 & 0.05 & 2.4 & 2 & \frac{0.4}{2} = 0.2 & 1\\ 9 & 0.025 & 1.2 & 1 & \frac{0.2}{1} = 0.2 & 1\\ 10 & 0.025 & 1.2 & 1 & \frac{0.2}{1} = 0.2 & 1\\ \end{array}
(You see that again we run into problems where children with the same scores get different amounts of candy. Maybe this doesn't happen too often in practice if the scores are very unlikely to be equal?)
The motivation for this argument is that: