5

I came through this problem three years ago when I prepared for interview. Today when reviewing it, I still couldn't think out a mathematical way to solve it. Any help would be appreciated.

$4$ players roll a fair $30$-sided dice. Each of them rolls once and the $4$ numbers rolled are different. The $2$ individuals that rolled the biggest and small value will be in a team while the $2$ individuals who rolled the $2^{\text{nd}}$ and $3^{\text{rd}}$ smallest value will be on the opposite team. The team with the largest average wins and the loser has to pay the winners' average number (for example, if the dice outcome is $27, 20, 15,$ and $11,$ then the people who get $27$ and $11$ get paid $19$).

Q) If you are the first to roll, what number would you prefer to maximize your payout?

TShiong
  • 1,280
ggkkll
  • 115
  • Wouldn't the answer be thirty, so you could maximize the average of the team you get? Or am I misunderstanding the problem? – Mathemagician314 Dec 22 '20 at 21:37
  • 30 is also my guess. I have the same thought process as you. But if it is a 5-dided dice, then the answer should be 4 rather than 5. – ggkkll Dec 22 '20 at 21:40
  • By brute force, the answer seems to be 24, but I wish there was a straightforward elegant way to find the answer ( and I may be wrong because I try to work in Pari terminal from a lousy smartphone keyboard) – Hagen von Eitzen Dec 22 '20 at 21:40
  • @HagenvonEitzen I get the same as you. 30 is worse than average, which surprised me. The worst number to pick is 7. – Especially Lime Dec 22 '20 at 22:11
  • 2
    How did you guys get the 24? – ggkkll Dec 22 '20 at 22:18
  • @ggkkll I wrote a program to loop through all possible 4-tuples, work out how much the person with each number won or lost, and tally them up by number rolled. I don't think there's a simple mathematical way to get it. – Especially Lime Dec 23 '20 at 10:15
  • The reason that $~30~$ is not correct is that it makes it certain that you will be paired with the worst roll. – user2661923 Aug 04 '23 at 22:13

1 Answers1

1

Here's a simple python program to find the answer:

from itertools import combinations
score=[0]*31
for x in combinations(range(1,31),4):
    outer=x[0]+x[3]
    inner=x[1]+x[2]
    if outer>inner:
        score[x[0]]+=outer
        score[x[1]]-=outer
        score[x[2]]-=outer
        score[x[3]]+=outer
    elif inner>outer:
        score[x[0]]-=inner
        score[x[1]]+=inner
        score[x[2]]+=inner
        score[x[3]]-=inner
for i in range(1,31):
    print(i,score[i],sep="\t")

I assumed that if both totals are equal no-one wins or loses anything. To avoid floats I also doubled everything (so that you win or lose the sum, rather than the average). The highest value is best; here that is 24.