Maths Olympiad Prep

Library / /5 of 27

Number theory Difficulty 7.7 National olympiad, round 2 Prove it Saudi Arabia

You plan to organize your birthday party, which will be attended either by exactly mm persons or by exactly nn persons (you are not sure at the moment). You have a big birthday cake and you want to divide it into several parts (not necessarily equal), so that you are able to distribute the whole cake among the people attending the party with everybody getting cake of equal mass (however, one may get one big slice, while others several small slices - the sizes of slices may differ). What is the minimal number of parts you need to divide the cake, so that it is possible, regardless of the number of guests.

Solution

We claim that the answer is m+ngcd(m,n)m + n - \gcd(m, n). Firstly, note that if we consider the cake as the interval [0,1][0, 1] and make cuts at points with coordinates km\frac{k}{m} (0<k<m0 < k < m) and ln\frac{l}{n} (0<l<n0 < l < n), then we will be able to satisfy the condition of the problem. Moreover, there will be m1m-1 cuts with km\frac{k}{m}, n1n-1 cuts with ln\frac{l}{n}, gcd(m,n)1\gcd(m, n) - 1 of which coincide. Therefore we will have
m+ngcd(m,n)1 m + n - \gcd(m, n) - 1
cuts, so m+ngcd(m,n)m + n - \gcd(m, n) parts. Let us show that this estimate is sharp. For that purpose, consider a bipartite graph, with the vertices of one side corresponding to the mm persons on the party, and the vertices of the other side corresponding to the nn persons on the party.
We connect the vertices vv and uu by an edge, corresponding to the piece of cake, if the piece of cake will be given to the person vv, if exactly mm persons attend, and to the person uu, if exactly nn persons attend. Consider a component of connectivity of the graph. Then, if it contains m1m_1 edges in one side and n1n_1 edges in the other side, then the edges of it correspond to a cake with weight m1m=n1n\frac{m_1}{m} = \frac{n_1}{n}. Therefore, m1mgcd(m,n)m_1 \ge \frac{m}{\gcd(m,n)}.
Thus, the number of components of connectivity is at most gcd(m,n)\gcd(m, n). The graph has m+nm+n vertices and at most gcd(m,n)\gcd(m, n) components of connectivity, so the number of edges is at least m+ngcd(m,n)m+n - \gcd(m, n) (the equality is obtained, when each of the components is a tree). \square

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.