## A Game With Coins

The applet below is a simulation of a two-person game that could be played on a table top with a sufficient supply of coins. The coins of various denominations are arranged in a chain (e.g., a row, a semicircle) with two "end points" and the others each having two neighbors. A move consists in removing an end coin, whereby the coin's immediate (and the only) neighbor becomes naturally an end coin available for the removal on successive moves. When all the coins have been removed, the game ends, and the players count their bounties. The player with the larger amount wins.

The applet allows some variations. First, the coin can be arranged in a loop, in which case the first player is allowed to remove any coin. After that the game continues as before. The applet uses 4 US coins: a penny (1 cent), a nickel (5 cents), a dime (10 cents) and a quarter (25 cents), but, in addition, it can also display a sequence of small random numbers.

At the outset, you can force the computer to make the first move by pressing the "Make Move" button.

### If you are reading this, your browser is not set to run Java applets. Try IE11 or Safari and declare the site https:///www.cut-the-knot.org as trusted in the Java setup. What if applet does not run?

Can the first player always guarantee a win or at least a draw?

Discussion If the number of coins is even, the first player can guarantee at least a draw, and the proof is pretty simple. Number the coins according to their order in the arrangement: 1, 2, ..., 2n, where 2n is the number of coins. Sum up the odd numbered denominations and, separately the even numbered ones. If one of the sums is greater than the other, the first player wins by sticking with the appropriately numbered coins. This is always possible. For example, assume the even numbered coins add up to more than the odd numbered ones. The first player then picks the last coin (numbered 2n). The two remaining end coins both now have odd numbers: 1 and 2n-1. Whichever is selected by the second player, the first player on his/her second move can always choose an even numbered coin, and so on.

In a loop, the first player has more freedom to choose a coin: any coin will do whose number is of required parity.

With an odd number of coins, the situation is less straightforward. Say, with coins 1, 5, 1, the first player is bound to lose. With a three coin sequence 5, 1, 5, the first player wins effortlessly.

So the game is really pretty simple. But, if nothing else, it provides an entertaining arithmetic drill suitable for young children.

### References

1. P. Winkler, Mathematical Puzzles: A Connoisseur's Collection, A K Peters, 2004
{"ft_lang_label":"__label__en","ft_lang_prob":0.9270155,"math_prob":0.95865726,"size":2682,"snap":"2021-31-2021-39","text_gpt3_token_len":644,"char_repetition_ratio":0.1407767,"word_repetition_ratio":0.012793177,"special_character_ratio":0.24011931,"punctuation_ratio":0.13793103,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9630385,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,5,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-27T22:04:40Z\",\"WARC-Record-ID\":\"<urn:uuid:1d239619-04ad-425a-854a-256b261e4e79>\",\"Content-Length\":\"14497\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e901928b-6a39-48d1-ad61-acefd0b16572>\",\"WARC-Concurrent-To\":\"<urn:uuid:19f13cf8-4c70-40cb-b89f-3a68a384d287>\",\"WARC-IP-Address\":\"107.180.50.227\",\"WARC-Target-URI\":\"https://www.cut-the-knot.org/Curriculum/Games/Coins.shtml\",\"WARC-Payload-Digest\":\"sha1:27BSYVWUQBKWGKXNBGVWZAYZS4ZGX5YH\",\"WARC-Block-Digest\":\"sha1:24U6RNNYBGTXPUCXSRF3EFYKTVPJCUED\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780058552.54_warc_CC-MAIN-20210927211955-20210928001955-00131.warc.gz\"}"}