Crossing Roads 3

You are placed on a 2 × 100 2\times 100 grid at ( 0 , 0 ) (0,0) . You aim to get to the opposite corner at ( 2 , 100 ) (2,100) by moving along the edges in the quickest time possible.

Each edge takes 1 1 minute to traverse.

The edges are initially randomly coloured Green and Red. You can only see the edges connected to your vertex, and can only travel along Green edges.

Every minute the edges swap colours.

(eg you walk from ( 0 , 99 ) (0,99) to ( 0 , 100 ) (0,100) along a Green edge. When you finish walking the edge turns Red. You discover that the edge from ( 0 , 100 ) (0,100) to ( 1 , 100 ) (1,100) has also turned Red. You then have to wait 1 1 minute for the colours to change so you can move on).

The average fastest time to traverse from ( 0 , 0 ) (0,0) to ( 2 , 100 ) (2,100) can be expressed as n + m n + m , where n n is an integer and 0 < m < 1 0 < m < 1 . Let the prime factorisation of m m be p 1 α 1 p 2 α 2 . . . p_1^{\alpha_1}*p_2^{\alpha_2}*... , where the exponents are non-zero but could be negative.

Find n + i = 1 ( p i + α i ) n + \sum_{i=1} (p_i + | \alpha_i | ) .


See Crossing Roads and Crossing Roads 2


The answer is 488.

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

Alex Burgess
Jun 11, 2019

Treating the problem as getting from ( 2 , 100 ) (2,100) to ( 0 , 0 ) (0,0) makes the notation easier, also we can ignore the 1 minute movement time on each edge for now, and add 102 on at the end:

Let E ( a , b ) E(a,b) be the expected time taken to get from ( a , b ) (a,b) to ( 0 , 0 ) (0,0) .

E ( 0 , n ) = E ( n , 0 ) = n 2 E(0,n) = E(n,0) = \frac{n}{2} .

For a b , E ( a , b ) = 1 4 E ( a 1 , b ) + 3 4 E ( a , b 1 ) + 1 4 a \leq b, E(a,b) = \frac{1}{4}E(a-1,b) + \frac{3}{4}E(a,b-1) + \frac{1}{4} .


Let S n = E ( 1 , n ) = 1 4 E ( 0 , n ) + 3 4 S n 1 + 1 4 = n 8 + 1 4 + 3 4 S n 1 S_n = E(1,n) = \frac{1}{4}E(0,n) + \frac{3}{4}S_{n-1} + \frac{1}{4} = \frac{n}{8} + \frac{1}{4} + \frac{3}{4}S_{n-1} .

S 0 = 1 2 S_0 = \frac{1}{2} , so:

S n = 1 8 i = 0 n 1 ( 3 4 ) i ( n i ) + 1 4 i = 0 n 1 ( 3 4 ) i + 1 2 ( 3 4 ) n S_n = \frac{1}{8}\sum_{i=0}^{n-1} (\frac{3}{4})^i (n-i) + \frac{1}{4}\sum_{i=0}^{n-1} (\frac{3}{4})^i + \frac{1}{2} (\frac{3}{4})^n

= 1 2 ( n 3 ( 1 ( 3 4 ) n ) ) + ( 1 ( 3 4 ) n ) + 1 2 ( 3 4 ) n = n 2 1 2 + ( 3 4 ) n = \frac{1}{2}(n - 3(1-(\frac{3}{4})^n)) + (1 - (\frac{3}{4})^n) + \frac{1}{2}(\frac{3}{4})^n = \frac{n}{2} - \frac{1}{2} + (\frac{3}{4})^n .


For n > 0 n > 0 let F n = E ( 2 , n ) = 1 4 S n + 3 4 F n 1 + 1 4 = ( n 8 1 8 + 1 4 ( 3 4 ) n ) + 1 4 + 3 4 F n 1 F_n = E(2,n) = \frac{1}{4}S_n + \frac{3}{4}F_{n-1} + \frac{1}{4} = (\frac{n}{8} - \frac{1}{8} + \frac{1}{4}(\frac{3}{4})^n) + \frac{1}{4} + \frac{3}{4}F_{n-1} ,

where F 0 = 5 6 F_0 = \frac{5}{6} , so F 1 = E ( 2 , n ) = 17 16 F_1 = E(2,n) = \frac{17}{16} .

F n = n 8 + 1 8 + 1 4 ( 3 4 ) n + 3 4 F n 1 F_n = \frac{n}{8} + \frac{1}{8} + \frac{1}{4}(\frac{3}{4})^n + \frac{3}{4} F_{n-1}

F n = [ 1 2 ( n 3 ( 1 ( 3 4 ) n ) ) ] + [ 1 2 ( 1 ( 3 4 ) n ) ] + [ n 4 ( 3 4 ) n ] + [ 5 6 ( 3 4 ) n ] F_n = [ \frac{1}{2}(n - 3(1-(\frac{3}{4})^n)) ] + [ \frac{1}{2} (1 - (\frac{3}{4})^n) ] + [ \frac{n}{4}(\frac{3}{4})^n ] + [ \frac{5}{6}(\frac{3}{4})^n ]

= n 2 1 + ( 11 6 + n 4 ) ( 3 4 ) n = \frac{n}{2} - 1 + (\frac{11}{6} + \frac{n}{4} ) (\frac{3}{4})^n .


Hence,

E ( 2 , 100 ) = F 100 = 49 + ( 11 6 + 25 ) ( 3 4 ) 100 = 49 + 161 3 100 6 4 100 = 49 + 3 99 × 7 × 23 2 201 E(2,100) = F_{100} = 49 + (\frac{11}{6} + 25 ) (\frac{3}{4})^{100} = 49 + \frac{161 * 3^{100}}{6 * 4^{100}} = 49 + \frac{3^{99} \times 7 \times 23}{2^{201}} .

For our problem, the expected time is 151 + 2 201 × 3 99 × 7 1 × 2 3 1 151 + 2^{-201} \times 3^{99} \times 7^1 \times 23^1 .

So our desired sum is 151 + ( 2 + 3 + 7 + 23 ) + ( 201 + 99 + 1 + 1 ) = 151 + 35 + 302 = 488 151 + (2 + 3 + 7 + 23) + (201 + 99 + 1 + 1) = 151 + 35 + 302 = 488 .

Why does the problem say m < 0 m < 0 ? Your value of m m is positive.

Jon Haussmann - 1 year, 12 months ago

Log in to reply

Thank you, Ill edit.

I meant 0 < m < 1

Alex Burgess - 1 year, 12 months ago

How does the first recursion come?

Pi Maths - 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...