7 Comments

Zach, why didn't you mention my Fibonacci sequence observation thingy when the number of contestants was less then 7 or so.

The probability for the most likely contestant was f_n/2^(n-1), where f_n is the nth Fibonacci number... this worked up to about n = 7

Expand full comment
author

No doubt that's an interesting observation. I suggest using the Comments here to make additional observations and continue the conversation with fellow solvers. I'm never able to write about every interesting detail in every puzzle.

Expand full comment

Bug in my code. Random should have been to 6.

2 Rolls=16742

3 Rolls=7155

4 Rolls=1472

5 Rolls=170

6 Rolls=15

7 Rolls=1

Over 7 Rolls=74445

Didn't change the conclusion.

Expand full comment

2 Rolls=15917

3 Rolls=12056

4 Rolls=3258

5 Rolls=472

6 Rolls=39

7 Rolls=2

Rolls Where Count EXCEEDED 7=68256

public static void main(String[] args) {

int over7 = 0;

for (int r=0; r<100000; r++) {

try {

int rolls = rollDice();

rollCount[rolls]++;

}

catch (Exception e) {

over7++;

}

}

for (int c=2; c<8; c++) {

System.out.println( c + " Rolls=" + rollCount[c]);

}

System.out.println( "Over 7 Rolls=" + over7);

}

private static int rollDice() throws Exception {

int rolls=1;

int sum = diceRoll.nextInt(5)+1;

while (sum !=7 ) {

sum = sum + diceRoll.nextInt(5)+1;

if (sum > 7) throw new Exception("Sum >7");

rolls++;

}

return rolls;

}

I didn't see any other place to share this.

Expand full comment
Aug 1, 2023·edited Aug 1, 2023

This is one case where a computer is not actually needed. Consider all strings of 7 rolls where the first n add up to 7 for each n from 1 to 7. For instance, when n = 7, the only valid string is 1111111, but when n = 5, possible strings are 11113, 11122,, and all permutations of those, with any two rolls at the end, for 6²×[(5 choose 1) + (5 choose 2)] = 540 valid strings. (Examples of valid strings with n = 5 are 1131166 and 1212121.) Note that each string (valid or invalid) is equally likely, with likelihood 1/6⁷. So the probability for each n=k, given the string was valid, is the number of valid strings with n=k divided by the total number of valid strings with any n from 1 to 7.

So you can actually do it all by hand quite easily. You just might want a calculator for the division at the end, to get a decimal result.

Expand full comment

It is easier for me with a computer these days then by probabilities.

Expand full comment

170935/70813 well ok I guess that means there's no clever way to do it ...

Expand full comment