DR.WANG Mathematics中文

BMO2 · 2023/24 · 2024-01-24 · Question 4

Counting & combinatorics · Reachability

Problem outline

Let m<nm<n be positive integers. Initially there are nn piles, each containing mm objects. In one move, choose two distinct piles and remove a total of exactly nn objects from those two piles, without removing more objects than either pile contains. Determine all pairs (m,n)(m,n) for which all piles can be emptied.

Show answer and methods 1 methods

Answer

Exactly the pairs m=n−km=n-k where kk is a positive divisor of nn.

Method 1 Encode the chosen pairs as a graph

The total number of objects is mnmn, and each move removes nn, so any successful schedule uses exactly mm moves. Form a graph whose nn vertices are the piles and whose edges are the pairs selected in the moves. The same pair cannot be selected twice: two such moves would remove 2n2n objects from two piles that initially contain only 2m<2n2m<2n. Hence this is a simple graph with exactly mm edges.

Let a connected component have vv vertices. No move crosses from it to another component, so all vmvm objects initially in those piles are removed by whole moves of size nn. Thus n∣vmn\mid vm. If g=gcd⁡(m,n)g=\gcd(m,n), then n/g∣vn/g\mid v. Every component therefore has at least n/gn/g vertices, and the graph has at most gg components.

A graph on nn vertices with at most gg components has at least n−gn-g edges. Since our graph has mm edges, m≥n−gm\ge n-g. Put k=n−m>0k=n-m>0. Then k≤gk\le g. On the other hand, gg divides both mm and nn, so it divides k=n−mk=n-m and hence g≤kg\le k. Therefore g=kg=k, which shows m=n−km=n-k and k∣nk\mid n.

Conversely suppose k∣nk\mid n and m=n−km=n-k. Reserve kk of the original piles. Conceptually divide each reserved pile into m/k=n/k−1m/k=n/k-1 packets of kk objects, producing mm packets in total. Pair these packets one-to-one with the remaining mm whole piles. For each pair, choose the corresponding two original piles and remove kk objects from the reserved pile and all mm objects from the other pile. Each move removes k+m=nk+m=n objects. Every non-reserved pile is emptied once, and every reserved pile loses (m/k)k=m(m/k)k=m objects. Thus all piles are emptied, proving sufficiency.

Source and attribution

The outline and worked methods on this page were prepared for DR.WANG Mathematics.

Original question (external)