Rounding logic in sampling

68 Views Asked by At
  • A population consist of elements provided from 4 different sources.
  • I have decided to take a sample of 30 elements from the population.
  • The size of the sample taken from each source was relative to the rate of the contribution of this source to the whole population.

Is there a way to find out, what is the maximum number of extra elements (elements in addition to 30) I could get if I apply mathematical rounding (regular or roundup)? See example in the link.

Example

1

There are 1 best solutions below

0
On BEST ANSWER

For rounding-to-nearest, the sum of the rounded numbers can be anywhere from $28$ to $32$. For rounding-up, the sum of the rounded numbers can be anywhere from $30$ to $33$.

If three of the values are $1.5$, so the fourth is $25.5$, then all four round up to $2, 2, 2, 26$ with a sum of $32$. For round-to-nearest, this is the highest it can get. If any of the first three values is lowered even slightly modulo 1, then the fourth value will increase by the same amount modulo 1, and vice versa. But the lowered index will round down instead of up, while the other rounded values are unchanged, resulting in a sum of $31$.

On the lower end of round-to-nearest, the value depends on exactly which rounding rules you are using. $.5$-rounds-up will give you a minimum of $29$, while $.5$-rounds-to-even allows $28$ as a total (from $2.5, 2.5, 2.5, 22.5$, for example).

For round-up, since every value is increased, $30$ is the minimum possible sum. $0.1, 0.1, 0.1, 29.7$ will result in a total of $33$. If you write the numbers as $$n_1 + \epsilon_1, n_2 + \epsilon_2, n_3 + \epsilon_3, (30-n_1-n_2-n_3) - (\epsilon_1 + \epsilon_2 + \epsilon_3)$$ when the $n_i$ are integers and the $0\le \epsilon_i<1$, then if the three $\epsilon$ values are non-zero, each of those values increases by $1$ from $n_i$. But the fourth value will not rise from $30-n_1-n_2-n_3$. So the highest sum can be no more than 33.