Let's say we have a fixed yearly amount that we have to divide equally among an amount of days. For instance for $1,600 we may have:
case a) 11 days -> $1,600 / 365 * 11 = $48.21917808219182 ≈ $48.22
case b) 27 days -> $1,600 / 365 * 27 = $118.35616438356174 ≈ $118.36
Now we have to add some percentage to this amount, for instance a tax of 21%. For each case, let's see what happens using the whole number resulting from the previous step and the rounded one.
case a) USING THE WHOLE NUMBER
$48.21917808219182 * 1.21 = $58.3452054794521 ≈ $58.35 = X
case a) USING THE ROUNDED NUMBER
$48.22 * 1.21 = $ 58.3462 ≈ $58.35 = X
For both approaches the final result is the same, this is X = $58.35. Now for case (b):
case b) USING THE WHOLE NUMBER
$118.35616438356174 * 1.21 = $143.21095890410971 ≈ $143.21 = Y
case b) USING THE ROUNDED NUMBER
$118.36 * 1.21 = $143.2156 ≈ $143.22 ≠ Y
In this case both approaches doesn't lead to the same result: 143.21 ≠ 143.22.
So, for this fixed yearly amount there are some cases where rounding in the middle step will lead to a different result than carrying the whole decimals and rounding only in the end step.
My question is: How can I analytically find more cases similar to case (b)? Is there some kind of equation or something that I can use? At the moment I am using a trial and error method and I've found some other results, like 46 days.
Side note
As the minimal monetary unit is $0.01, I think that the correct approach is rounding in the middle step and then rounding again in the end step, because we cannot manage amounts under 0.01. But apart from which is the right approach I want to prove to my colleague that you won't get the exact same result using one approach or the other, it's just that using a trial and error method seems too rough to me.
Thanks.