# Should I kill all of my elves?

I've been playing a simplified variant of The Great Elf Game for a few days now and I'm struggling to identify an optimal strategy.

Rules:

• You start with 12 elves. Each elf is sent to gather a tree each day.

• You can choose to send one (or more) elves to each of the Woods, the Deep Forest or the Mountains.

• Elves will collect one tree per turn. Trees from the Woods are worth £10, trees from the Deep Forest are worth £20 and trees from the Mountains are worth £50.

• A new elf can be bought at the start of a turn for £75.

• Each turn a random number is generated and there's a 1/3 chance of a blizzard. If a blizzard occurs, elves in the Woods will collect trees as normal, elves in the Deep Forest will return empty-handed and elves in the Mountain will die.

• The Winner is the team with the most money at the end of 24 days.

Obviously the highest risk/reward strategy is to simply send all my elves to the Mountain (and hope like hell that the weather stays good) but is there an optimal strategy I can use to maximise my chances of winning over a thousand games?

• I'm reasonably sure the best strategy is to send 10% of my elves to the mountains every day, the rest to the Deep forest and to buy as many elves as possible, then send them all to the Mountains on day 20 onward. I call this the "elf murder" strategy. – Richard Dec 20 '18 at 20:24
• This would be an interesting KotH challenge on the CodeGolf SE! – Robert S. Dec 20 '18 at 20:26
• @RobertS. - I was thinking about that, but I didn't want to look foolish if the optimum strategy is really bloody obvious – Richard Dec 20 '18 at 20:28

How long shopuld I buy elves?

Calculate the expected net worth of a sort of elf after a given day d
A WOOD ELF is worth $$10*(24-d)-75$$ A FOREST ELF is worth $$20*(24-d)*1/3-75$$ A MOUNTAIN ELF is worth $$\50*\sum_{n=1}^{24-d}\frac{2}{3}^{n}-75$$

If you calculate this for every day you get the following:
- Wood elves have a positive net worth until day 17
- Forest elves have a positive net worth until day 19
- Mountain elves have a positive net worth until day 21
=>buy elves including on day 21

Where should I send my elves?

Calculate the Profit on a given day d
A WOOD ELF produces $$10$$ A FOREST ELF produces $$20$$ A MOUNTAIN ELF produces $$\50*\frac{2}{3}-\frac{1}{3}(w_r)$$ with w_r=rest worth of the elf, which is the maximum worth of the three strategies on that day
Calculating this gives us:
- Forest elves are more profitable than mountain elves until day 21
=>send elves in the forest including day 21, then send them into the mountains

I also did a quick simulation on this, which confirms ~$25785 expected after 24 days as the maximum with above mentioned strategy • If you've simmed it out, what do the other strategies achieve, on average? – Richard Dec 22 '18 at 10:50 • TwoBitOperation's Strategy yields on average 21450$, Accumulation's calculations result in the same strategy as mine, so same value as above. – ablerks Dec 23 '18 at 16:27

Woods gives you 10 each day, so the expectation value there is pretty simple. Deep Woods isn't much more complicated; that gives 20 two-thirds of the times, for 40/3. Mountains, though, are much more complicated. The expectation value there is 100/3, but that's the gross amount. You're losing an elf, and the elf's replacement value is 75. If we subtract that from 100, we get 25, giving 25/3.

However, the replacement value isn't always relevant. If we use the value of 100/3 = 33.33, that means that an elf takes over two days to make back their cost. So we don't want to buy any elves when there are fewer than three days remaining. On the last day, going by expectation values the best strategy is clearly to go Mountain (it doesn't matter if they die, since they aren't getting any more trees even if they survive). Since on the last day, an elf has an expectation value of 33, we should subtract that from 100 to find the Mountain expectation value on the second to last day. That gives (100-33)/3, or about 22, which is larger than Deep Woods. Thus, at the beginning second to last day, the expected money from each elf for the next two days is 33+22=55. Thus, the expectation value for Mountain on the third to last day is (100-55)/3, or about 14.8, which is still larger than for Deep Forest. For the fourth to day, we have (100-(33+22+15))/3 = 9.87, which is lower than Deep Forest. So we should send the elves to the Deep Forest up until the third to last day, then send them to Mountain for the last three days.

Now, when should we stop buying elves? Well, the expectation value of elves at the beginning of the third day is 70, so we shouldn't buy any elves then. But at the beginning of the fourth to last day, the value is 84, so we should buy them.

All of this is based on expectation value calculations. However, if your goal is maximize the probability of having the highest amount, rather than maximizing your expected value, then the calculation is more complicated. Then it depends on how many other players there are, and what their strategies are. If everyone else are going for the above strategy, then you'll all be tied at the beginning of the fourth to last day. So it would be a good idea to send all your elves to Mountain then: you'll have a one third chance of dropping to last place, and a two thirds chance of jumping ahead of everyone else.

• The last paragraph is quite important. Even something simple like "how much do I bet on this coin toss" becomes complicated when there are many players with different amounts of money, and the goal is just to wind up with slightly more than anyone else. – deep thought Dec 21 '18 at 0:26

There are two factors to think about here: Where do you send the elves, and when do you buy new elves?

I think you can optimize by looking at the expected value of each decision.

Woods
E(Woods): \$10 per elf per day Note: an elf pays for itself (turns profit for priceof \$75) after 8 days.

Deep Forest:
E(T): \$20*(2/3)+ \$0*(1/3) = \$13.33 per elf per day An elf pays for itself after 6 days. Mountain: E(M): \$50*(2/3) +(\$-75)*(1/3) = \$8.33 per elf per day if replacing elf
An elf pays for itself after 9 days.
OR
\$33.33 - (1/3) *(max expected profit per elf per day)*(days remaining) if elf is not replaced. This is only a better option if there are 1 or less days remaining. ie, only on the last day This tells us that we should start by sending all the elves to the deep forest every day, then buy as many elves as we can with the profit up until the end of day 18 (6 days left). From day 19-23 send all the elves to the deep forest, and keep the profit, new elves wont be profitable now. Then, on day 24, take a gamble and send them all to the mountains. Since this is the last day, the expected value becomes \$33.33 - (1/3) * (\$13.33)*(1) = \$20

To summarize:

Days 1-18: send all to Forest, buy max elves
Days 19-23: Send all to Forest, buy no elves
Days 24: Send all to mountains

• Wouldn't I do better sending them all to the mountains earlier, risking a higher reward? Since there's only a 1/3 chance of them dying. – Richard Dec 20 '18 at 20:46
• No. Assuming all of them get wiped out 1/3 of the time, you can only expect a profit of \$8.33 per elf per day near the beginning since you need to replace them if/when they die. And you NEED to replace them, because each elf not sent equals lost profit every day. On the other hand, the forest provides \$13.33 per elf per day since no deaths occur. The only time to use the mountains is at the end, where dead elves don't lose profit, because no one is being sent out again anyway. Your strategy might beat mine sometimes, but this one is safer and will win more consistently. – TwoBitOperation Dec 20 '18 at 20:52
• But surely If I send 50 elves to the mountain on day 23, there's a 33% chance they'll die but a 66% chance they won't. Sure, I'd get absolutely killed one game in three, but I'd win two out of three in the long run? – Richard Dec 20 '18 at 20:53
• Send an elf to the mountain on 2 consecutive days, and there's a 4/9 chance he survives both days and nets \$100, a 2/9 chance he survives the first day only for \$50, and a 3/9 chance he dies the first day for \$0. That gives an expected value of$55.55 over the two days, which is better than the other options, no? – Nuclear Wang Dec 20 '18 at 21:06
• But Richard's strategy could be beaten by going to the mountain for the last 3 days, which is beaten by going for the last 4 days and so on. At some point this is probably beaten by the original strategy. I suspect this might be a rock paper scissor scenario, where no strategy beats everything else. – Kruga Dec 21 '18 at 8:51
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 6, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3203318417072296, "perplexity": 1170.8751988393517}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579250620381.59/warc/CC-MAIN-20200124130719-20200124155719-00397.warc.gz"}