Loading [MathJax]/jax/output/HTML-CSS/jax.js

Sunday, January 26, 2025

The Infinite Lily Pad Problem

Once again, you are a frog in a pond. But this time, the pond has infinitely many lily pads, which are numbered “1,” “2,” “3,” etc. As before, you are currently on pad 2, and your goal is to make it to pad 1, which you would happily stay on forever.

Whenever you are on pad k, you will hop to pad k1 with probability 1/k, and you will hop to pad k+1 with probability (k1)/k. Now, what is the probability that you will ultimately make it to pad 1?

Taking off where we landed from the Classic Fiddler, let's expand the 4 lily pad Markov chain to an n state Markov chain and then see what happens when n. Skipping right to the canonical form of the transition matrix we get ˆTn=(01n1000000n2n1n3n201n20000000n4n301n3000000000230130000000120120000000010000000001)=(QR0I). Again, we have the fundamental matrix N=(IQ)1 and P=NR, where here can focus of wanting Pn2,1. Instead of trying to code up an (n2)×(n2) matrix inversion, let's instead rewrite the matrix equation as a tridiagonal system of equations (IQ)x=(11n100000n3n211n200000n4n311n300000002311300000121)x=12en2, and use the Thomas algorithm to find the probability of ending up on pad 1 forever in the case of n lily pads as p1,n=xn2=Pn2,1. In particular, the main diagonal entries are bi=1,i=1,2,,n2. The upper diagonal is ci=1ni,i=1,2,,n3 and lower diagonal are ai=ni1ni,i=2,3,,n2. The Thomas algorithm consists of two sweeps, first cRn3 and dRn2 and then another that starts with solving for xn2 and then sweeps backward from i=n1 to i=1. In particular, we define c1=c1=1n1 and ci=ci1aici1,i=2,,n3 and d1=d1, and di=diaidi11aici1,i=2,3,,n2, and finally xn2=dn2 and xi=dicixi+1,i=n1,n2,,1. Additionally, since di=0,i=1,,n3, we have di=0,i=1,,n3, with p1,n=Pn2,1=xn2=dn2=121(12)cn3=12+cn3, and since we only care about xn2, we don't have to do any of the backward sweep.

So we can simply code up one recursive function that sweeps through the ci variables for any i=1,,n3, for instance the following Python script:

def prob_zero(N):
    c = -1.0 / float(N - 1.)
    for i in range(2, N-2):
        c = (-1.0 / float(N - i)) / (1. - (-1. + 1.0 / float(N - i)) * c)
    return (0.5 / (1 + 0.5 * c))

We can just get the values of the probability of absorption at pad 1 for many, many values of n and emprically see that as n gets large we get close (fairly quickly to limnp1,n=63.21205588285577....%, which is disturbingly close to 1e1. So much so, that if we wanted we could likely call it quits here and claim that the probability of ending up forever on pad 1 in the inifinite lily pad case is p1,=1e1.

# of Lily Pads Absorption Prob.
460%
562.5%
663.07692307692307%
763.19018404907976%
863.20899335717935%
963.21167883211679%
1063.21201448891889%
1163.21205178374104%
1263.21205551321910%
1363.21205585226252%
1463.21205588051614%
1563.21205588268949%
1663.21205588284473%
1763.21205588285508%
1863.21205588285572%
1963.21205588285577%
2063.21205588285577%

However, perhaps we can do better than just our anecdotal, experimental evidence. Let's start at p1,n=12+cn3(n). Using the recursive formula, we get cn3(n)=cn31an3cn4(n)=131+23cn4(n)=13+2cn4(n). Going a step further we get cn4(n)=14134cn5(n)=14+3cn5(n), which plugging back into the previous equation gives cn3(n)=13+214+3cn5(n)=4+3cn5(n)10+9cn5(n). We see that we can define cn3(n) as a rational function of cnk(n), for each k=4,,n1. In particular, let's say that cn3(n)=αk+(αk1)cnk(n)βk+(βk1)cnk(n), where α4=1 and β4=3. From the recursion formula for c we get that cn3(n)=αk+(αk1)1k+(k1)cnk1(n)βk+(βk1)1k+(k1)cnk1(n)=kαk(αk1)+(k1)αkcnk1(n)kβk(βk1)+(k1)βkcnk1(n), so we can derive the recursion formulae for αk and βk as αk+1=(k1)αk+1βk+1=(k1)βk+1, for all k4, with initial conditions α4=1 and β4=3.

So, trying to organize the situation a bit, we notice that since c1(n)=1n1 we would then have to stop the recursion, we get cn3(n)=αn1αn11n1βn1βn11n1=αn1(n2)+1βn1(n2)+1, where αn1 and βn1 can be read from the recursion formulae above. Plugging this back into the absorption probability, we see that p1,n=12+cn3(n)=12αn1(n2)+1βn1(n2)+1=βn1(n2)+1(2βn1αn1)(n2)+1=βn1+O(n1)(2βn1αn1)+O(n1). Now, let's turn our attention to the growth of αn1 and βn1.

Given the recursion formulae and initial conditions, we can show that in fact αk=(e2)(k2)! and βk=(e1)(k2)! for all k4. Clearly, the initial conditions hold since (e2)(42)!=1.436=1 and (e1)(42)!=3.436=3. Assume that for some j4 that αj=(e2)(j2)!βj=(e1)(j2)!. From the recursion formula, we get αj+1=(j1)αj+1=(j1)(e2)(j2)!+1βj+1=(j1)βj+1=(j1)(e1)(j2)!+1. Now at this point we will rely on the following lemma (that can be proven using an application of the Taylor remainder theorem) that states that for any =2,,, k=1k!<1(1)!. So using this lemma we see that e(j1)!=j1k=0(j1)!k!+(j1)!k=j1k!=(j1)!j1k=01k!=(j1)!j2k=01k!+1=(j1)((j2)!j2k=01k!)+1=(j1)e(j2)!+1. So plugging back into the recursion formulae above, since j! and 2j! are always integers for any j, we confirm the induction step, since αj+1=(j1)(e2)(j2)!+1=(e2)(j1)!βj+1=(j1)(e1)(j2)!+1=(e1)(j1)!, thus proving the formulae αk=(e2)(k2)!,βk=(e1)(k2)!,k4.

Finally, returning our attention to the formula for the absorption probability we get p1,n=βn1+O(n1)(2βn1αn1)+O(n1)=(e1)(n2)!+O(n1)(2(e1)(n2)!(e2)(n2)!+O(n1)=(n2)!n2k=11k!+O(n1)(n2)!(2n2k=11k!n2k=21k!)+O(n1)=n2k=11k!+O(1(n1)!)(2n2k=11k!n2k=11k!)+O(1(n1)!), so we have that the probability of ending up on pad 1 in the infinite lily pad problem is p1,=limnp1,n=limnn2k=11k!+O(1(n1)!)(2n2k=11k!n2k=11k!)+O(1(n1)!)=k=11k!2k=11k!k=21k!=e12(e1)(e2)=1e1, as experimentally derived.

No comments:

Post a Comment