Comparison of strategies for playing the Taxman game

This page compares the results obtained using various strategies for playing Taxman. Included here are:

Upper Bound
The upper bound on the score given by the weight of the maximum-weight matching (independent edge set), as described in Franklín, A. F. and Moniot R. K., The difficulty of beating the Taxman. Discrete Applied Mathematics, 339, 166-171 (2023). This score is not achievable by playing, except for those few cases in which the Taxman graph has no flat alternating cycles.
Optimal
The maximum achievable score, found by Brian Chess and posted on GitHub.
Cycle Breaking
Score achieved by removing edges from the maximum matching to eliminate flat alternating cycles, resulting in a playable set, as described in Franklín and Moniot, op. cit..
MaxTurn
A greedy strategy first published by Carmony and Holliday, “An Example from Artificial Intelligence for CS1,” SIGCSE Bulletin vol. 25 iss. 1 (1993). On each turn, it picks the number that maximizes the difference between the player's take and the Taxman's take.
MaxTurn+
An improvement on MaxTurn published by Moniot, “The Taxman Game,” Math Horizons 14, Feb. (2007). It looks for “freebies,” which are numbers that can be inserted into the move sequence without preventing future picks chosen by MaxTurn.
OneTax
Strategy #3 in Trono, “Taxman Revisited,” SIGSCE Bulletin, vol. 26, no. 4 (Dec. 1994), with one key modification. I call it OneTax since the basic strategy is to pick the largest number that has only one divisor remaining in play, so the Taxman gets only one number as tax on each turn. Trono noted that sometimes near the end of the game, there would be three remaining integers forming a series of successive multiples of the first. For instance, for N=64, the numbers 16, 32, and 64 are left. The one-divisor rule would say to take 32, but clearly 64 is the better pick. Trono's suggestion was that if 5 or fewer numbers remain available to play, use MaxTurn instead. A better solution is to keep checking for situations where picking a number would render a multiple of it unpickable by taking its last divisors, while that multiple itself is not a divisor of any remaining number. Taking that multiple instead gives a better score and does not invalidate any future picks in the sequence.

The chart below shows the fraction of the pot won by the player for each of the various strategies, for N=1 to 1000. They are identified by the following abbreviations: UB = upper bound; Opt = optimal; 1T = OneTax; CB = cycle breaking; MT+ = MaxTurn+; MT = MaxTurn.

Taxman Strategies to
    1000

For a very simple heuristic, OneTax does very well, besting our cycle-breaking method for large N. The chart also shows that the optimal score is quite close to the upper bound.

Here is a closer look at the performance of the strategies for N=1 to 128.

Taxman Strategies to 128

Here is a table comparing the scores for the five strategies for playing the Taxman game, for game sizes N=1 to 128. Both cycle-breaking and OneTax achieve the optimal score for numerous values of N up to 90 and 79 respectively.

N Upper
Bound
Optimal Cycle
Break
One
Tax
Max
Turn+
Max
Turn
1 0 0 0 0 0 0
2 2 2 2 2 2 2
3 3 3 3 3 3 3
4 7 7 7 7 7 7
5 9 9 9 9 9 9
6 15 15 15 15 15 15
7 17 17 17 17 17 17
8 21 21 21 21 21 21
9 30 30 30 30 30 30
10 40 40 40 40 40 40
11 44 44 44 44 44 44
12 50 50 50 48 48 48
13 52 52 52 50 50 50
14 66 66 66 64 66 66
15 81 81 81 81 81 72
16 89 89 89 89 89 80
17 93 93 93 93 93 84
18 111 111 111 111 102 102
19 113 113 113 113 104 104
20 124 124 124 121 124 124
21 145 144 135 144 135 135
22 167 166 157 166 157 157
23 171 170 161 170 161 161
24 183 182 173 178 173 173
25 198 198 198 198 198 198
26 224 224 224 224 224 224
27 251 251 251 247 247 232
28 279 279 279 279 279 264
29 285 285 285 285 285 270
30 301 301 301 297 300 300
31 303 303 303 299 302 302
32 319 319 319 315 318 318
33 352 352 352 352 337 337
34 386 386 386 386 371 371
35 418 418 418 418 406 360
36 442 442 442 442 442 396
37 448 448 448 448 448 402
38 486 486 486 486 486 440
39 504 503 482 503 482 457
40 526 525 504 523 502 477
41 530 529 508 527 506 481
42 572 571 550 569 548 523
43 574 573 552 571 550 525
44 618 617 596 615 596 571
45 663 660 641 660 621 569
46 709 706 687 706 667 615
47 713 710 691 710 671 619
48 737 734 715 726 695 643
49 761 758 739 750 719 692
50 811 808 789 800 769 742
51 858 833 832 825 794 767
52 892 885 866 877 846 819
53 898 891 872 883 852 825
54 952 940 926 919 879 879
55 981 981 981 981 934 866
56 1017 1017 1017 1009 990 922
57 1041 1040 1007 1032 1013 945
58 1099 1098 1065 1090 1071 1003
59 1105 1104 1071 1096 1077 1009
60 1138 1137 1104 1120 1109 1041
61 1140 1139 1106 1122 1111 1043
62 1202 1201 1168 1184 1173 1105
63 1265 1264 1231 1255 1236 1128
64 1297 1296 1263 1287 1268 1160
65 1328 1328 1328 1319 1265 1225
66 1394 1394 1366 1385 1331 1291
67 1400 1400 1370 1391 1337 1297
68 1468 1468 1468 1459 1405 1365
69 1502 1499 1464 1490 1436 1357
70 1572 1566 1534 1566 1476 1437
71 1576 1570 1538 1570 1480 1441
72 1648 1642 1610 1642 1552 1513
73 1650 1644 1612 1644 1554 1515
74 1724 1718 1686 1718 1628 1589
75 1799 1793 1761 1793 1733 1694
76 1875 1869 1807 1869 1809 1770
77 1914 1914 1884 1905 1886 1798
78 1992 1991 1934 1991 1895 1846
79 1998 1997 1940 1997 1901 1852
80 2042 2041 2012 2029 1945 1896
81 2123 2105 2065 2083 2022 1928
82 2205 2187 2133 2165 2104 2010
83 2209 2191 2137 2169 2108 2014
84 2265 2263 2195 2261 2196 2102
85 2311 2309 2241 2299 2232 2132
86 2397 2395 2357 2385 2318 2218
87 2438 2436 2398 2426 2359 2208
88 2496 2496 2496 2470 2403 2252
89 2502 2502 2502 2476 2409 2258
90 2552 2552 2552 2512 2454 2348
91 2594 2588 2539 2548 2539 2374
92 2686 2680 2631 2640 2631 2466
93 2728 2715 2615 2675 2666 2501
94 2822 2809 2709 2769 2760 2595
95 2862 2853 2804 2813 2755 2633
96 2910 2901 2852 2861 2803 2681
97 2918 2909 2860 2869 2811 2689
98 3016 3007 2958 2991 2909 2787
99 3115 3106 3057 3048 2966 2844
100 3173 3164 3115 3148 3026 2904
101 3177 3168 3119 3152 3030 2908
102 3279 3270 3221 3254 3132 3010
103 3281 3272 3179 3256 3134 3012
104 3341 3332 3283 3308 3186 3064
105 3446 3434 3388 3363 3241 3119
106 3552 3540 3449 3469 3347 3225
107 3556 3544 3453 3473 3351 3229
108 3664 3652 3606 3581 3443 3321
109 3666 3654 3608 3583 3445 3323
110 3776 3764 3718 3693 3555 3433
111 3829 3813 3717 3742 3604 3482
112 3941 3925 3829 3854 3660 3538
113 3945 3929 3833 3858 3664 3542
114 4059 4043 3895 3972 3721 3656
115 4117 4101 4005 4030 3836 3702
116 4233 4217 4121 4146 3952 3818
117 4350 4334 4243 4197 4069 3935
118 4468 4452 4406 4315 4187 4053
119 4525 4506 4460 4369 4241 4087
120 4633 4593 4568 4417 4301 4147
121 4689 4689 4595 4687 4422 4191
122 4811 4811 4769 4809 4544 4313
123 4865 4860 4697 4858 4593 4362
124 4989 4984 4873 4982 4717 4486
125 5114 5109 5040 5107 4765 4548
126 5198 5191 5064 5179 4828 4674
127 5212 5205 5078 5193 4842 4688
128 5310 5301 5188 5193 4970 4816