Roll Me A Square

Spongebob loves square numbers. So, he decides to keep rolling a fair six-sided die, until any consecutive substring represent(s) a perfect square less than 100. e.g. If his last two rolls were first a 2 and then a 5, he would be done since 25 is a perfect square. Or, for example, any time he rolls a 4 he would also be done since 4 is a square number.

If the expected number of rolls he must make is a b \dfrac{a}{b} , where a a and b b are coprime positive integers , what is a + b a+b ?


The answer is 25.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Geoff Pilling
Aug 6, 2016

Relevant wiki: Expected Value - Problem Solving

Let E n = E_n = The expected number of remaining rolls given that n n was the last number rolled.

Since 1 1 and 4 4 are both square, clearly E 1 = E 4 = 0 E_1 = E_4 = 0 .

Also, the only two digit squares (consisting of the numbers 1 1 ... 6 6 ) are 25 25 , 36 36 , and 64 64 . But, 64 64 doesn't "buy you anything new" since 4 4 is also a square, so rolling a 6 6 is essentially like starting over. So, E 6 = E 0 E_6 = E_0 . Translating these into a set of linear equations:

  • E 0 = 1 + ( 1 / 3 ) E 0 + ( 1 / 6 ) E 2 + ( 1 / 6 ) E 3 E_0 = 1 + (1/3)*E_0 + (1/6)*E_2 + (1/6)*E_3
  • E 2 = 1 + ( 1 / 6 ) E 0 + ( 1 / 6 ) E 2 + ( 1 / 6 ) E 3 E_2 = 1 + (1/6)*E_0 + (1/6)*E_2 + (1/6)*E_3
  • E 3 = 1 + ( 1 / 6 ) E 0 + ( 1 / 6 ) E 2 + ( 1 / 6 ) E 3 E_3 = 1 + (1/6)*E_0 + (1/6)*E_2 + (1/6)*E_3

The above equations are derived by considering states 0 0 , 2 2 , and 3 3 labeled by what the last number you rolled is (except for 0 0 which is the state you start in). So, E n = E_n = The expected number of rolls from state n n . Then you can derive the above equations, for example for E 2 E_2 , from state 2 2 you use up 1 1 roll (the first term, 1 1 ) and you have 1 / 6 1/6 probability of getting to 0 0 , 2 2 or 3 3 . This translates to the second equation in the solution. You set up similar equations for 0 0 , 4 4 and 6 6 .

Solving for E 0 E_0 , you get, E 0 = 18 / 7 E_0 = 18/7

18 + 7 = 25 18+7 = \boxed{25}

The problem statement could be clarified greatly. "Until he rolls a square number less than 100" would refer to just the last roll.

Calvin Lin Staff - 4 years, 10 months ago

Log in to reply

Ah, good point... I've clarified the question above.

Geoff Pilling - 4 years, 10 months ago

Log in to reply

I do not see any edits that you made (from the time of your comment). Did you remember to save after previewing?

Calvin Lin Staff - 4 years, 10 months ago

Log in to reply

@Calvin Lin OOooops, must have forgotten to save it... There, I just saved it...

Geoff Pilling - 4 years, 10 months ago

Log in to reply

@Geoff Pilling Looks good. Any thoughts on how to deal with "any consecutive substring is a square"?

Calvin Lin Staff - 4 years, 10 months ago

Log in to reply

@Calvin Lin I've rephrased it a bit... Lemme think if there is a clearer way to explain what I'm trying to convey in this problem...

Geoff Pilling - 4 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...