# Minimum value for A+B, given rounded percentages

The percentage of boys in a Math circle, rounded to an integer is equal to 51%. The percentage of girls in this Math circle, rounded to an integer is equal to 49%. What is the minimal possible number of participants in the circle? (Source: "Formula of unity" contest, 2020 qualification rounds, R7, problem 2 - https://www.formulo.org/en/olymp/2020-math-en/)

What is a principled way to tackle such a problem?

Here was my sketch of solution: It is easy to see 51 - 49 is a solution, although not minimal.

Assuming the girls percentage can be at least 48.501 and boys percentage 51.499, and that the difference between the two is at least 1 -- I could guess the solution is somewhere around 33 children in the class. Then, 35 (17 + 18) is the smallest solution.

Alternative proof (advantage is no need for trial-and-error):

Using Calvin Lin's notation, we have $$\frac{1}{100} < \frac{2B}{A} - 1 < \frac{3}{100}$$

• If $$A=2m$$ then $$B=m+d, d\ge1$$, $$\frac{1}{100} < \frac{2(m+d)}{2m} - 1 = \frac dm < \frac{3}{100} \\\implies m > \frac{100d}{3} > 33, m\ge 34, A=2m \ge 68.$$

• If $$A=2m+1$$ then $$B=m+d, d\ge1$$, $$\frac{1}{100} < \frac{2(m+d)}{2m+1}-1 = \frac{2d-1}{2m+1} < \frac{3}{100}\\ \implies 2m+1 > 100(2d-1)/3>33 \text{ and } 2m+1 < 100(2d-1) \\ \implies 2m+1 \ge 35.$$

BTW: a quick and dirty trick is to look at the continued fraction of $$0.515$$ which turns out to be $$\{0; 1, 1, 16, \ldots,\}$$ and the first fraction between $$0.505$$ and $$0.515$$ is $$\frac{1}{1+\frac{1}{1+\frac{1}{16+1}}}=\frac{18}{35}.$$

• Nice trick with the continued fraction! What is the intuition behind it, i.e. why is the first fraction in the interval 0.505 and 0.515 is the answer we were looking for? Dec 30, 2020 at 11:09
• It's a well known result. Great question about intuition. I will come back to you later after I think it through. Dec 30, 2020 at 16:45

Start with $$\frac{101}{200} < \frac{ B}{A } < \frac{103}{200}$$.
This gives us $$101 A < 200 B < 103 A$$.

What's the smallest $$A$$ that this could happen?
Trial and error is a reasonable approach if you can't think of something creative.

As OP points out in the comments, if we wrote it as $$\frac{101}{200} < \frac{ B}{B+G } < \frac{103}{200}$$, then we have

1. $$101G < 99B$$
2. $$97B < 103 G \Rightarrow 97 (B-G ) < 6G$$. Since $$B-G \geq 1$$, this gives us $$G > 16.$$ We test $$G = 17$$, and it works.
• Thanks for your reply!Could you please explain how you got the intuition behind the start inequality: $\frac{101}{200} \lt \frac{B}{A} \lt \frac{103}{200}$? Dec 29, 2020 at 11:05
• What does it mean to round to 51%? The value must be between 50.5% and 51.5%. What is that as a fraction? Dec 29, 2020 at 11:06
• Nice! Thanks for the clarification. Then, shouldn't it be $\frac{101}{200} \lt \frac{B}{A + B} \lt \frac{103}{200}$? it was $\frac{B}{A}$ which was not clear. So, I would get 101A < 99B and 103A < 97B; so, from the second one, I get 6A < 97(B-A); If the difference is 1; 6A < 97 -> A <= 16; which doesn't fit, but then (17;18) is a solution. Dec 29, 2020 at 11:17
• 1) I let $A$ be the total number of participants, which was slightly easier than trying to minimize $B+G$. Sorry for not stating that up front. 2) Your second inequality should be $97 B < 103 A$, can you recheck your work? Dec 29, 2020 at 11:19
• @Mircea That's a great way to cut down the guess and check! It helps that the first thing we try works. Dec 29, 2020 at 16:09