How does one 'correct' a table that doesn't add up to $100\%$? I have a table consisting of a number of whole percentages $x_i$ between $0\%$ and $100\%$. However, they don't add up to $100\%$ (rather they add up to $101\%$). But they 'should'.
Assuming that any given percentage $x_i\%$ is rounded from some precise (unrounded) $y_i\%$ which is really uniformly distributed according to $y_i\sim \text{UNIF}(\max{(x_i-0.5\%,0\%)},\min(x_i+0.5\%,100\%))$, what is the best way to go about computing some estimates for unrounded $y_i$s, i.e. $\text{E}(y_i)$? I prefer expectation (over MLE).
NB: The table does contain some $x_i=0\%$ entries.
NB 2: The $\text{E}(y_i)$s that I am looking for are reals, not integers.
NB 3: Simply scaling doesn't work. For example take $10\%$, $80\%$ and $11\%$. Total $101\%$. Just scaling those down would obviously yield $100\%$. But $80\%\cdot \frac{100\%}{101\%}=79.2079\ldots\%$ will now round to $79\%$ instead of $80\%$. So, this cannot be right.
NB 4: Distributing the error equally over all entries has a drawback too. If the error would be $−1\%$, some such $\text{E}(y_i)$s (e.g. those belonging to $x_i=0$) could become less than zero. That indicates that that procedure cannot be right either.
 A: You can't compute unrounded $y$s because you have thrown away the information by rounding.  What you can do is to alter the $x$s so they add to $100\%$.  You will then violate the fact that the $x$s are the rounded values closest to the $y$'s.  If they currently add to $101\%$, you just need to decrease one of them by $1\%$.  If you have the $y$s available, you can choose the one that is closest above $zz.50\%$, which seems the logical one to flip-it makes the least error.  If you don't have the $y$s available, I would decrease the largest $x$, just because it introduces the least fractional error.  But you might as well pick one at random.
A: If you have the unrounded $y_i$ available, you may use algorithms used in elections (to compute party seats from vote counts), such as d'Hondt or Hare-Niemeyer. Essentialy, most methods boil down to finding real numbers $a,b$ such that an assignment of $x_i=\lfloor ay_i+b\rfloor $ yields $\sum x_i=100$. 
Standard rounding sets $b=\frac12$ and $a=\frac{100}{\sum y_i}$ and often fails to meet the goal; other methods stay with $b=\frac12$ but adjust $a$ until the goal is met; or stay with $a=\frac{100}{\sum y_i}$ and adjust $b$; or play with both. Even the best methods will fail in an actual tie. And the choice between methods will influence the outcome in some direction (in election systems: prefer either small or big parties; accordingly with your application), so should be make with care and documented.
Note that after doing any such "correction", the reader of your table may feel satisfied that all adds up to $100\,\%$, but he can never be sure that a value shown as $50\,\%$ is really between $49.5\,\%$ and $50.5\,\%$ - it may certainly lie outsude that interval and have been "forced" to the displayed numbr.
A: I think I get what you're trying to do. Given $(x_1,\ldots,x_n)$, you have bounds $l_i=\max(x_i−\frac12,0)$ and $u_i=\min(x_i+\frac12,100)$, and you're considering the probability space $[l_1,u_1]\times\cdots\times[l_n,u_n]$ under the additional condition that $y_1+\cdots+y_n=100$. Assuming said space is nonempty, you assign uniform probability density to it and you want to find the expectation of $(y_1,\ldots,y_n)$.
This probability space is the intersection of a hypercube and a hyperplane, which forms an $(n-1)$-dimensional polytope, and the expectation is its centroid. I don't know how you would actually compute this in general. But in your problem you almost always have symmetry, and the right solution is just to assign the same absolute change to each entry. Got $101$ instead of $100$? Subtract $1/n$ from all $x_i$. This only fails when one or more of the values are at $0$ or $100$ already.
