In: Statistics and Probability
A random walker starts out 10 paces to the left of a fence. Normally p=q=1/2 except at the fence, where q=1. What is the probability that the walker will be back at his starting point after N paces?
Your question could use more details. I’m going to assume p is probability of choosing to move right 1 step, and q left 1 step.
By starting pt, I assume you mean that 10 pace distance left of the fence.
The key to return is that the N paces you take features equal steps made in p as in q. Thus your N must be an even by definition in order to achieve that.
For instance if 0 is the starting pt, and I move forward 4 times: 1,2,3,4, then back 4 times: 3,2,1,0 this gets me back to 0.
I could move forward 3 times, back 2, forward 3 then backward 4 times.
1,2,3 → 2,1 → 2,3,4 → 3,2,1,0. Again same idea.
This then becomes simple binomial probability.
(p)^N/2 * (q)^N/2 = (pq)^N/2 = (0.25)^N/2
Of course what if you end up getting to the fence where you are forced to turn back once? I will use a simple case of a fence 3 steps away to illustrate.
Starting from 0. Move 3 steps forward, then turn away from the fence one step (forced, F) and continue.
1,2,3 → 2F, 1,0
So I make 3 steps forward and 2 back voluntarily to return to 0.
You can try 1,2,3 → 2F,1 → 2→ 1,0
3 forward, 1 back, 1 forward and 2 back = 4 forward and 3 back. Hopefully you see that the number of back steps is one less than the forward steps.
In this case one of the q becomes 1, and you have one less power of q. So N2−1=N−22N2−1=N−22
This would be (p)^N/2 * (q)^(N−2)/2 = (0.5)^N/2 * (0.5)^(N−2)/2 = (0.5)^(2N−2)/2=(0.5)N−1
Of course you could get the fence multiple times perhaps, back and forth.
In this case, the power of q would be reduced by M, where M is the number of times you had to turn from the fence:
(p)^N/2 * q^(N/2−M)
This is actually the most general case, since when M = 0, you get the same equation as the first case I pointed out.