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}
& 1 & 2 & 4 & 8 \\
\hline
1 & 0.000 & 0.000 & 0.000 & 0.125\\
5 & 0.200 & 0.200 & 0.200 & 0.175\\
25 & 0.200 & 0.200 & 0.200 & 0.167\\
125 & 0.200 & 0.200 & 0.200 & 0.100
\end{array}
$$
Do you agree that we must put good apples in the same group in order to get the minimum percentage? – Hamid Reza Ebrahimi Jun 03 '17 at 09:27