35
$\begingroup$

Consider the following one-person game:

A player starts with score $0$ and writes the number $20$ on an empty whiteboard. At each step, she may erase any one integer (call it $a$) and writes two positive integers (call them $b$ and $c$) such that $b + c = a$. The player then adds $b × c$ to her score. She repeats the step several times until she ends up with all $1$s on the whiteboard. Then the game is over, and the final score is calculated.

Example: At the first step, a player erases $20$ and writes $14$ and $6$, and gets a score of $14 × 6 = 84$. In the next step, she erases $14$, writes $9$ and $5$, and adds $9 × 5 = 45$ to her score. Her score is now $84 + 45 = 129$. In the next step, she may erase any of the remaining numbers on the whiteboard: $5$, $6$ or $9$. She continues until the game is over.

Alya and Bob play the game separately. Alya manages to get the highest possible final score. Bob, however, manages to get the lowest possible final score. What is the difference between Alya’s and Bob’s final scores?

I tried to "decompose" into a few numbers and I get the same scores. I am not sure how to prove the conjecture that any numbers will yield the same score no matter which path is taken.

$\endgroup$
4
  • $\begingroup$ Hint: try your conjecture with a proof by induction $\endgroup$ Commented Oct 29, 2020 at 11:21
  • $\begingroup$ Strong induction, I might add. $\endgroup$
    – player3236
    Commented Oct 29, 2020 at 11:21
  • 1
    $\begingroup$ The instructions appear to allow, from "$20$", erasing only the "$2$" and writing a pair of "$1$"s to leave "$101$". This is induced by the discrepancy in wording between "the number $20$" and "erasing any one integer" -- when "the number $20$" is on the board, there are three integers on the board, "$0$", "$2$", and "$20$". The rules give no way to proceed if the integer "$0$" is chosen, so either the rules or incomplete or this choice is implicitly prohibited. Also, does the game terminate in the state "$11 \ \ \ 1 \ 1 \ 1 \ 1 \ 1 \ 1 \ 1 \ 1 \ 1$", since only $1$s are on the board? $\endgroup$ Commented Oct 29, 2020 at 20:12
  • 11
    $\begingroup$ @EricTowers: the example suggests this is not about digits but about positive integers. So $20$ is not two digits but one integer. You replace it with two integers such as $14$ and $6$. Then you replace one of those with two integers at which point you have three. And the game ends when you have $20$ integers, each being $1$. $\endgroup$
    – Henry
    Commented Oct 29, 2020 at 23:07

5 Answers 5

42
$\begingroup$

Here’s a visual proof, to complement the algebra of other answers:

enter image description here

When you start the game (from 20), draw a “staircase” shape like in the figure, but with 19 squares in the base (so also 19 squares high). As you play, for each number on the board you’ll always have a corresponding staircase, with base and height 1 less than that number. Each turn, when you split up a number as $n = b+c$, split up its staircase as shown in the picture; that gives you a $b \times c$ rectangle, plus two smaller staircases for the resulting numbers $b$ and $c$. The area of the rectangles is your score so far. When all the numbers left are 1’s, then you’ve converted the whole original staircase into rectangles — so your final score is the total area of the original staircase.

This area, the number of squares in the staircase of base $n-1$, is given by the formula $\frac{n(n-1)}{2}$, as noted in other answers. This is a famous formula, and if you haven’t seen it before, it can be explained by the fact that two such staircases fit together into an $n \times (n-1)$ rectangle.

$\endgroup$
17
$\begingroup$

Suppose your hypothesis is that starting with $n$ you end up with a score of $\frac12 n(n-1)$. It is clearly true starting with $n=1$ as there are no moves and so a score of $0$.

Now suppose you know this is true for $1 \le n \le k$ for some $k$, then start with $k+1$ and split it into $a$ and $k+1-a$ where both are between $1$ and $k$. You get an immediate score of $a(k+1-a)$ plus (by the hypothesis) later scores of $\frac12 a(a-1)$ and $\frac12 (k+1-a)(k+1-a-1)$. Add these up and simplify to $\frac12 (k+1)k$. So it is true for $n=k+1$.

Using strong induction, you can conclude the hypothesis is true for all positive integers $n$.

$\endgroup$
12
$\begingroup$

Suppose that we represent a number $n$ on the whiteboard by $n$ distinct objects. When we split $a$ into $b+c$, we put $b$ of the objects in one group, and $c$ of the objects in the other group.

Then we can represent the $b\cdot c$ points we get for the split as follows: for every pair of objects that used to be in the same group, but are now in different groups, we get a point.

At the beginning, all $20$ objects are in the same group. At the end, all $20$ objects are in different groups, so we must have gotten $\binom{20}{2}$ points for separating them.

$\endgroup$
2
  • $\begingroup$ Note that there's a great visual version of this: draw the pairs of objects in the form of a right triangle with orthogonal sides $(n-1)$ and $(n-1)$ and then 'carve out' rectangles of points as you perform the substitution. $\endgroup$ Commented Oct 29, 2020 at 22:42
  • $\begingroup$ @StevenStadnicki: see my answer for that visual version! The conceptual explanation as given in this answer is lovely too. $\endgroup$ Commented Oct 29, 2020 at 22:49
6
$\begingroup$

I turn my comment into an answer. Your conjecture is correct, and can be deduced with a proof by induction.

Claim: For $n>1$ the game always ends with the score $n(n-1)/2$.

Proof: Clear for $n=2$. So assume for numbers less than $n$ and start the game at $n$ with $n=a+b$ and score $ab$. You then continue with separate games on $a$ and $b$, which themselves end with score $a(a-1)/2$ and $b(b-1)/2$. So your final score is $ab+a(a-1)/2+b(b-1)/2=n(n-1)/2$.

$\endgroup$
2
$\begingroup$

Compared to Misha Larov's answer, my solution has essentially the same idea but a different interpretation.

Let's say the number we start off with is $n$. At any stage of the game, we assign a complete graph $K_i$ to any number $i$ written on the board.

The action of splitting a number $a$ into $b$ and $c$ can be reinterpreted as

  1. Choosing disjoint vertex subsets $B$ and $C$ of $K_a$ with respectively $b$ and $c$ elements
  2. Deleting every edge connecting $i \in B$ and $j \in C$
  3. Obtaining new complete graphs $K_b$ and $K_c$.

The score the player gets after this splitting is the number of edges deleted in step 2. Throughout the game, we actually count the total number of edges deleted.

At the final condition, where all graphs are $K_1$, which are individual vertices, we have eliminated all edges of the initial $K_n$. Hence the final score is always the number of edges in $K_n$, $\frac{n(n-1)}{2}$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .