• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Dwarf problem

From the 1977 all-Soviet-Union Mathematical Olympiad:
Seven dwarfs are sitting at a round table. Each has a cup, and some cups contain milk. Each dwarf in turn pours all his milk into the other six cups, dividing it equally among them. After the seventh dwarf has done this, they find that each cup again contains its initial quantity of milk. How much milk does each cup contain, if there were 42 ounces of milk altogether?

Not difficult (took me < 2 minutes) but I want to know how people arrive at the solution


neat little problem.

i started thinking binomial expansion and then system of equations. i brute forced it for n=3. once i solved that, i saw how to extend it to an arbitrary number of vertically-challenged people (sorry, the ten minutes the debate was on polluted my mind) and an arbitrary number of ounces. there's probably a more clever way to solve it.
Solution as posted on http://pratikpoddarcse.blogspot.in/2012/11/math-olympiad-problem-simple-and.html

Since the final state matches the initial state, we can imagine this process going on continuously. Consider the dwarf whose cup contains the smallest amount of milk just before he begins pouring. Call him D, and call this quantity of milk a ounces. Since D's cup contains the least milk before pouring, then each other dwarf has an equal or greater amount in his own cup before pouring, and thus gives D at least a/6 ounces. This would leave D with at least a ounces in his own cup just before pouring; the only way he can receive precisely a ounces, as we know he does, is if each other dwarf gives him precisely a/6 ounces and no more, i.e., that each cup, just before pouring, contains the same quantity of milk. So after any given pouring the cups contain a, 5/6a, 4/6a, 3/6a, 2/6a, 1/6a, and 0 ounces; if there are 42 ounces in total then this works out to 12, 10, 8, 6, 4, 2, and 0 ounces.