MathDB
Expectation of Gecko Jumps

Source:

September 8, 2024
expected value2024

Problem Statement

Let N9N_9 be the answer to problem 9.
In a rainforest, there is a row of nine rocks labeled from 11 to N9N_9. A gecko is standing on rock 11. The gecko jumps according to following rules:
[*] if it is on rock 11, then it will jump with equal probability to any of the other rocks. [*] if it is on rock RR and RR is prime, then it will jump to rock N9N_9. [*] if it is on rock 44, then it will jump with equal probability to rock 11 or rock 66. [*] if it is on rock RR and RR is composite with 4<R<N94<R<N_9, then it will jump with equal probability to rock QQ or SS, where QQ is the greatest composite number less than RR, and SS is the smallest composite number greater than RR. [*] if it is on rock N9N_9, then it stops jumping.
The expected number of jumps the gecko will take to reach rock N9N_9 is pq\tfrac{p}{q}, where pp are qq relatively prime positive integers. Compute p+qp+q.