aez-notes

The Cliff-Hanger

From where he stands, one step toward the cliff would send the drunken man over the edge. He takes random steps, either toward or away from the cliff. At any step his probability of taking a step away is \(2/3\), of a step toward the cliff \(1/3\). What is his chance of escaping the cliff?

A very slick solution can be obtained by recognising that the probability of ruin from 1 is the same as a step to 2 followed by ruin from 1 twice. But we can also use maxima to do the heavy lifting instead.

load(solve_rec)$

my_deq : p[n] = (1/3) * p[n-1] + (2/3) * p[n+1];
my_sol : solve_rec(my_deq, p[n], p[0] = 1);

const_sol : solve(part(limit(my_sol, n, inf), 2));

print(ev(my_sol, const_sol, n=1));
/*
     1
p  = -
 1   2
*/

Author: Alex Zarebski

Created: 2022-04-15 Fri 12:29

Validate