This week the #puzzle is: Can You Win the World Cup? #montecarlo #coding #probabilities
| Congratulations to Fiddler Nation for making it to the semifinals of the World Cup! All four teams that made it this far are equally matched in that they each possess the same total amount of “energy.” In advance of each semifinal game, teams must independently decide how much of their energy to allocate to the match; all remaining energy goes toward the finals. The team that spends more energy in any given game will win. The semifinals and finals occur so close in time that teams can’t recuperate any of their energy in between. |
| You’ve heard that the managers for the other three teams are abysmal and have no idea how to allocate their teams’ energy. Each of the other managers will independently pick a random percentage between 0 and 100 and allocate that portion of their team’s energy to the semifinal game; the rest of that team’s energy will go toward the final. |
| Since you’re the cleverest manager of the bunch, you can choose an optimal strategy that will maximize Fiddler Nation’s probability of winning the World Cup. What is this optimal probability? |
And for extra credit:
| As it turns out, I spoke too soon. Fiddler Nation has made it to the quarterfinals of the World Cup rather than the semifinals. My mistake. As before, teams must allocate the same total amount of energy across up to three matches. |
| The managers for the other seven teams remain abysmal. Each manager will independently pick a random percentage between 0 and 100 and allocate that amount of their team’s energy to the quarterfinal. If they win, they will allocate a random amount of their remaining energy to the semifinal. And if they win that, the rest of their team’s energy will go toward the final. |
| Fiddler Nation’s strategy must be drawn up in advance, with no specific knowledge of the other teams’ strategies beyond what I have already shared. |
| That said, as the cleverest manager of the bunch you can once again choose an optimal strategy that will maximize Fiddler Nation’s probability of winning the World Cup. What is this optimal probability? |

Solution, possibly incorrect:
Method: Monte Carlo.
- I write a program to simulate the tournament a lot of times.
- A complete strategy is to choose a number for the 1st game. E.g., if I choose 10% for the 1st game, there’s 90% left for the 2nd, no further choices.
- I actually make a mistake the 1st time with my program, because I just assume my opponent in the final used a random amount of energy in the semifinal. An extra element here is, that my opponent also won the 1st game. The result of this is, that they probably used “a lot of energy” in the semifinal, and therefore doesn’t have “a lot” left. I write an extra function to simulate that other part of the tournament.
Curve of the result:

If I use 1% energy in the 1st game, about 1000 out of 100000 simulated tournaments are won. The best result is 58% energy, with 38.696% win ratio. But there’s a little group of results close to that, so that’s just an estimate.
Result: 39%. (See below, 38.5 or 38.6.)
And for extra credit:
Tweak program and go again. Let me just read that 1 more time… Yes. The whole strategy has to be chosen before the 1st game. Heat maps:


If I use 53% in the 1st game and 21% in the 2nd, I win 28328 of 100000 simulated tournaments. But there’s a whole cloud of results in the vicinity.
Result: 28%. (See below, 28.2 or 28.3.)
Trying to become better at making heat maps – now with better numbers on the axis, and the last 2 were made with more accuracy (more loops):




Also, the results with more loops – 38.5 and 38.6 seem probable, as does 28.2 and 28.3:
Result 1, max wins: 0.38572
E1: 0.5540 E2: 0.4460 Wins: 0.3845400
E1: 0.5560 E2: 0.4440 Wins: 0.3845750
E1: 0.5570 E2: 0.4430 Wins: 0.3846450
E1: 0.5600 E2: 0.4400 Wins: 0.3852190 -
E1: 0.5610 E2: 0.4390 Wins: 0.3843620
E1: 0.5630 E2: 0.4370 Wins: 0.3847120
E1: 0.5640 E2: 0.4360 Wins: 0.3844680
E1: 0.5650 E2: 0.4350 Wins: 0.3849760
E1: 0.5660 E2: 0.4340 Wins: 0.3841780
E1: 0.5670 E2: 0.4330 Wins: 0.3851480 -
E1: 0.5680 E2: 0.4320 Wins: 0.3849550
E1: 0.5690 E2: 0.4310 Wins: 0.3844520
E1: 0.5700 E2: 0.4300 Wins: 0.3843820
E1: 0.5710 E2: 0.4290 Wins: 0.3846120
E1: 0.5720 E2: 0.4280 Wins: 0.3843730
E1: 0.5730 E2: 0.4270 Wins: 0.3843730
E1: 0.5740 E2: 0.4260 Wins: 0.3855780 -
E1: 0.5750 E2: 0.4250 Wins: 0.3849750
E1: 0.5760 E2: 0.4240 Wins: 0.3842780
E1: 0.5780 E2: 0.4220 Wins: 0.3847780
E1: 0.5790 E2: 0.4210 Wins: 0.3854960 -
E1: 0.5800 E2: 0.4200 Wins: 0.3851070 -
E1: 0.5810 E2: 0.4190 Wins: 0.3849570
E1: 0.5830 E2: 0.4170 Wins: 0.3847470
E1: 0.5840 E2: 0.4160 Wins: 0.3850320 -
E1: 0.5850 E2: 0.4150 Wins: 0.3844100
E1: 0.5860 E2: 0.4140 Wins: 0.3841980
E1: 0.5870 E2: 0.4130 Wins: 0.3845960
E1: 0.5890 E2: 0.4110 Wins: 0.3847450
E1: 0.5900 E2: 0.4100 Wins: 0.3846460
E1: 0.5910 E2: 0.4090 Wins: 0.3842120
E1: 0.5920 E2: 0.4080 Wins: 0.3846600
E1: 0.5930 E2: 0.4070 Wins: 0.3857210 *
E1: 0.5940 E2: 0.4060 Wins: 0.3849330
E1: 0.5960 E2: 0.4040 Wins: 0.3843630
E1: 0.5980 E2: 0.4020 Wins: 0.3841920
E1: 0.5990 E2: 0.4010 Wins: 0.3840440
E1: 0.6000 E2: 0.4000 Wins: 0.3840040
E1: 0.6030 E2: 0.3970 Wins: 0.3842700
Result 2, max wins: 0.28273
E1: 0.4990 E2: 0.2300 Wins: 0.2822620
E1: 0.5030 E2: 0.2320 Wins: 0.2821100
E1: 0.5040 E2: 0.2300 Wins: 0.2821480
E1: 0.5040 E2: 0.2350 Wins: 0.2822040
E1: 0.5060 E2: 0.2450 Wins: 0.2825120 -
E1: 0.5070 E2: 0.2370 Wins: 0.2821200
E1: 0.5080 E2: 0.2220 Wins: 0.2823350
E1: 0.5080 E2: 0.2410 Wins: 0.2821320
E1: 0.5100 E2: 0.2400 Wins: 0.2822310
E1: 0.5100 E2: 0.2430 Wins: 0.2821000
E1: 0.5110 E2: 0.2230 Wins: 0.2821650
E1: 0.5110 E2: 0.2350 Wins: 0.2821200
E1: 0.5120 E2: 0.2280 Wins: 0.2824650 -
E1: 0.5120 E2: 0.2390 Wins: 0.2822870
E1: 0.5130 E2: 0.2280 Wins: 0.2821010
E1: 0.5150 E2: 0.2310 Wins: 0.2822700
E1: 0.5160 E2: 0.2320 Wins: 0.2821560
E1: 0.5160 E2: 0.2340 Wins: 0.2827280 *
E1: 0.5160 E2: 0.2390 Wins: 0.2822090
E1: 0.5170 E2: 0.2330 Wins: 0.2821160
E1: 0.5170 E2: 0.2340 Wins: 0.2822440
E1: 0.5180 E2: 0.2250 Wins: 0.2821520
E1: 0.5180 E2: 0.2340 Wins: 0.2824180 -
E1: 0.5200 E2: 0.2220 Wins: 0.2824470 -
E1: 0.5200 E2: 0.2240 Wins: 0.2822010
E1: 0.5200 E2: 0.2340 Wins: 0.2821920
E1: 0.5200 E2: 0.2350 Wins: 0.2822610
E1: 0.5210 E2: 0.2340 Wins: 0.2821350
E1: 0.5230 E2: 0.2280 Wins: 0.2822700
E1: 0.5230 E2: 0.2290 Wins: 0.2824650 -
E1: 0.5240 E2: 0.2220 Wins: 0.2821440
E1: 0.5250 E2: 0.2250 Wins: 0.2821790
E1: 0.5250 E2: 0.2320 Wins: 0.2824380 -
E1: 0.5260 E2: 0.2210 Wins: 0.2822790
E1: 0.5260 E2: 0.2250 Wins: 0.2821760
E1: 0.5270 E2: 0.2210 Wins: 0.2823230
E1: 0.5270 E2: 0.2260 Wins: 0.2823710
E1: 0.5280 E2: 0.2200 Wins: 0.2821080
E1: 0.5280 E2: 0.2260 Wins: 0.2824000 -
E1: 0.5280 E2: 0.2290 Wins: 0.2826180 -
E1: 0.5280 E2: 0.2320 Wins: 0.2822990
E1: 0.5290 E2: 0.2210 Wins: 0.2821120
E1: 0.5300 E2: 0.2180 Wins: 0.2821250
E1: 0.5310 E2: 0.2170 Wins: 0.2824390 -
E1: 0.5310 E2: 0.2290 Wins: 0.2822880
E1: 0.5330 E2: 0.2180 Wins: 0.2821450
E1: 0.5330 E2: 0.2230 Wins: 0.2822540
E1: 0.5360 E2: 0.2240 Wins: 0.2824160 -





























