You are placed on a grid at . You aim to get to the opposite corner at by moving along the edges in the quickest time possible.
Each edge takes 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 to along a Green edge. When you finish walking the edge turns Red. You discover that the edge from to has also turned Red. You then have to wait minute for the colours to change so you can move on).
The average fastest time to traverse from to can be expressed as , where is an integer and . Let the prime factorisation of be , where the exponents are non-zero but could be negative.
Find .
See Crossing Roads and Crossing Roads 2
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.
Treating the problem as getting from ( 2 , 1 0 0 ) to ( 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 ) be the expected time taken to get from ( a , b ) to ( 0 , 0 ) .
E ( 0 , n ) = E ( n , 0 ) = 2 n .
For a ≤ b , E ( a , b ) = 4 1 E ( a − 1 , b ) + 4 3 E ( a , b − 1 ) + 4 1 .
Let S n = E ( 1 , n ) = 4 1 E ( 0 , n ) + 4 3 S n − 1 + 4 1 = 8 n + 4 1 + 4 3 S n − 1 .
S 0 = 2 1 , so:
S n = 8 1 ∑ i = 0 n − 1 ( 4 3 ) i ( n − i ) + 4 1 ∑ i = 0 n − 1 ( 4 3 ) i + 2 1 ( 4 3 ) n
= 2 1 ( n − 3 ( 1 − ( 4 3 ) n ) ) + ( 1 − ( 4 3 ) n ) + 2 1 ( 4 3 ) n = 2 n − 2 1 + ( 4 3 ) n .
For n > 0 let F n = E ( 2 , n ) = 4 1 S n + 4 3 F n − 1 + 4 1 = ( 8 n − 8 1 + 4 1 ( 4 3 ) n ) + 4 1 + 4 3 F n − 1 ,
where F 0 = 6 5 , so F 1 = E ( 2 , n ) = 1 6 1 7 .
F n = 8 n + 8 1 + 4 1 ( 4 3 ) n + 4 3 F n − 1
F n = [ 2 1 ( n − 3 ( 1 − ( 4 3 ) n ) ) ] + [ 2 1 ( 1 − ( 4 3 ) n ) ] + [ 4 n ( 4 3 ) n ] + [ 6 5 ( 4 3 ) n ]
= 2 n − 1 + ( 6 1 1 + 4 n ) ( 4 3 ) n .
Hence,
E ( 2 , 1 0 0 ) = F 1 0 0 = 4 9 + ( 6 1 1 + 2 5 ) ( 4 3 ) 1 0 0 = 4 9 + 6 ∗ 4 1 0 0 1 6 1 ∗ 3 1 0 0 = 4 9 + 2 2 0 1 3 9 9 × 7 × 2 3 .
For our problem, the expected time is 1 5 1 + 2 − 2 0 1 × 3 9 9 × 7 1 × 2 3 1 .
So our desired sum is 1 5 1 + ( 2 + 3 + 7 + 2 3 ) + ( 2 0 1 + 9 9 + 1 + 1 ) = 1 5 1 + 3 5 + 3 0 2 = 4 8 8 .