We have 1000 apples and 900 of them are "Good".If we distribute these apples into some equal groups ,what's the minimum percentage of groups ... We have 1000 apples and 900 of them are "Good".If we distribute these apples into some equal groups ,what's the minimum percentage of groups in which the majority of apples are "Good"?


I think the answer must be 90%,but the formal answer says it is: 80% !! I don't get it! because overall 90% of apples are "Good"! I tried many different equal groupings...
(Origin: Iranian National Mathematical Olympiad,1st round,2016)
We divide the 1000 apples in $n$ groups. In order for a group to not have a majority of good apples, there must be $\lceil \frac{1000}{n} \times \frac{1}{2} \rceil = \lceil \frac{1000}{2n} \rceil$ bad apples in the group. Since we have 100 apples, the maximum number of groups for which there are at least $\lceil \frac{1000}{2n} \rceil$ bad apples equals $\bigg\lfloor \frac{100}{\lceil \frac{1000}{2n} \rceil} \bigg\rfloor = \frac{n}{5}$ for $n | 500$ and $5 | n$. Since there are $n$ groups, the maximum percentage of groups for which there is no majority of good apples thus equals $\frac{\frac{n}{5}}{n} = \frac{1}{5} = 20\%$. As such, at least $80\%$ of groups contain a majority of good apples.

The following table shows the ratio of groups not containing a majority of bad apples, for all divisors of 1000 (multiply row and column value):

$$
\begin{array}{r | c c c c}
 &amp; 1 &amp; 2 &amp; 4 &amp; 8 \\
\hline
  1 &amp; 0.000 &amp; 0.000 &amp; 0.000 &amp; 0.125\\
  5 &amp; 0.200 &amp; 0.200 &amp; 0.200 &amp; 0.175\\
 25 &amp; 0.200 &amp; 0.200 &amp; 0.200 &amp; 0.167\\
125 &amp; 0.200 &amp; 0.200 &amp; 0.200 &amp; 0.100
\end{array}
$$
Let $g$ and $b$ represent the numbers of good and bad apples in one box (group). There could be 3 cases: $g&gt;b$, $g=b$ or $g&lt;b$. The minimum percent of good boxes means maximum bad boxes. Note that a bad box is when $b\ge g$. Having $b&gt;g$ in a box is not efficient because extra bad apples can be switched to a good box to make it a bad box. Thus, $b=g=100$, that is 200 in $B$ bad boxes leaving 800 in $G$ good boxes. There are several solutions: $B$=divisors of 100.