On the left side of the applet there is a list of random integers. You select two at a time. (While selecting the second number, hold the Ctrl key down.) When selected, the two integers, say, A and B are replaced with another one computed as (A·B + A + B). The process ends when only one number remains. Controls allow you to select the starting number of integers and maximum possible integer that may be randomly selected into the game.
The final number is not quite random. Can you see whether it's possible to determine it ahead of time?
Explanation
Assume at a certain stage of the process we have a sequence S of integers, S = {A1, A2, ..., An}. Let P stand for the product of all integers present each increased by 1 less 1: P = (A1+1)(A2+1)...(An+1) - 1. When two numbers A and B are replaced with (A·B + B + C) the product P does not change. Indeed,
it loses two factors (A+1)(B+1) but gains another one (A·B + B + C + 1). The two are of course equal.
It then follows that P is an invariant quantity that does not change in the course of the game. It could be computed at the very beginning. For example, if we are given the sequence 1, 2, 3, 4, 5, 6 then P = 7! - 1 which you can easily verify.
References
- D.Fomin,S.Genkin,I.Itenberg, Mathematical Circles (Russian Experience), AMS, 1996
Copyright © 1996-2008 Alexander Bogomolny