Dice: Expected highest value with a tricky condition

347 Views Asked by At

I know how to calculate the expected value "E" of a roll of n k-sided dice if we are supposed to keep the highest number rolled. If I am not wrong, the formula is:

E = k − (1^n + 2^n + ... + (k-1)^n)/k^n

But what I would like to know is how would affect to that expected value the following condition: every 1 that is rolled will cancel the highest remaining number rolled. If the number of 1s is at least half of the total number of dice, then the value of the roll is 0.

For example, rolling 6 10-sided die:

  • Roll #1: 7, 4, 1, 10, 1, 9 ----> The 1 cancels the 10, the second 1 cancels the 9, value of the roll is 7

  • Roll #2: 1, 9, 6, 1, 1, 3 ----> The first 1 cancels the 9, the second 1 cancels the 6, the third 1 cancels the 3, there are no more dice, the value of the roll is 0

  • Roll #3: 8, 1, 1, 1, 6, 1 ----> The first 1 cancels the 8, the second 1 cancels the 6, the only remaining dice are 1s which count as fails, so the value of the roll is 0.

As I said, I know how to calculate the expected value of the highest number in a roll of n dice, but I do not know where to start to add the condition of the 1s canceling out the highest numbers, so I would appreciate some help.

Thanks a lot.

1

There are 1 best solutions below

0
On

If you go to http://topps.diku.dk/torbenm/troll.msp

and put in n:=5; m := n d10; a := count 1 = m; res := max m -- largest a m; if res then res else 0

You can brute force the answer on n dice. Note this doesn't scale real well, but if might give you an intuition.

I strongly doubt there is a clean closed form solution to this, it's likely going to be a large piecewise function using the sums of the probability of rolling k 1's for k = 0 to n/2.