Consider a one-dimensional random walker starting at the origin. We know how many steps the walker will take, and we also know the number of steps forwards and backwards the walker will perform. Is there a formula that can be used to quickly compute the exact probability for the walker to reach a certain maximal distance from the origin during the walk?
In other words: consider a binary string made of zeros and ones. If we know the length of the string, and the number of zeros and ones in the string, can we compute the exact probability, using a simple function (not through simulations or dynamic programming but an analytical solution), of the absolute value of the maximum running sum for the string (computed with adding 1 for 1’s and subtracting 1 for 0’s) during the traversal of the string from left to right?
Example:
For strings of length 3 we can have 000, 001, 010, 011, 100, 101, 110, and 111.
The probabilities are for 000 and 111 100% to reach level 3
For 001, 010 and 100 (or in other words when there are 2 zeros and 1 one) 33.3% to reach level 2 and 66% to reach level one. The same distribution of probabilities is true for 011,101 and 110 (or 2 ones and 1 zero).
For longer strings such probabilities can be represented in a table where the columns represent the number of ones in the string and the rows represent the maximal distance from the origin:
0 1 2 3 4
1 0 0 4 0 0
2 0 3 2 3 0
3 0 1 0 1 0
4 1 0 0 0 1
0 1 2 3 4 5
1 0 0 4 4 0 0
2 0 0 5 5 0 0
3 0 4 1 1 4 0
4 0 1 0 0 1 0
5 1 0 0 0 0 1
0 1 2 3 4 5 6
1 0 0 0 8 0 0 0
2 0 0 9 10 9 0 0
3 0 0 5 2 5 0 0
4 0 5 1 0 1 5 0
5 0 1 0 0 0 1 0
6 1 0 0 0 0 0 1
0 1 2 3 4 5 6 7
1 0 0 0 8 8 0 0 0
2 0 0 0 19 19 0 0 0
3 0 0 14 7 7 14 0 0
4 0 0 6 1 1 6 0 0
5 0 6 1 0 0 1 6 0
6 0 1 0 0 0 0 1 0
7 1 0 0 0 0 0 0 1
0 1 2 3 4 5 6 7 8
1 0 0 0 0 16 0 0 0 0
2 0 0 0 27 38 27 0 0 0
3 0 0 0 21 14 21 0 0 0
4 0 0 20 7 2 7 20 0 0
5 0 0 7 1 0 1 7 0 0
6 0 7 1 0 0 0 1 7 0
7 0 1 0 0 0 0 0 1 0
8 1 0 0 0 0 0 0 0 1
0 1 2 3 4 5 6 7 8 9
1 0 0 0 0 16 16 0 0 0 0
2 0 0 0 0 65 65 0 0 0 0
3 0 0 0 48 35 35 48 0 0 0
4 0 0 0 27 9 9 27 0 0 0
5 0 0 27 8 1 1 8 27 0 0
6 0 0 8 1 0 0 1 8 0 0
7 0 8 1 0 0 0 0 1 8 0
8 0 1 0 0 0 0 0 0 1 0
9 1 0 0 0 0 0 0 0 0 1
0 1 2 3 4 5 6 7 8 9 10
1 0 0 0 0 0 32 0 0 0 0 0
2 0 0 0 0 81 130 81 0 0 0 0
3 0 0 0 0 83 70 83 0 0 0 0
4 0 0 0 75 36 18 36 75 0 0 0
5 0 0 0 35 9 2 9 35 0 0 0
6 0 0 35 9 1 0 1 9 35 0 0
7 0 0 9 1 0 0 0 1 9 0 0
8 0 9 1 0 0 0 0 0 1 9 0
9 0 1 0 0 0 0 0 0 0 1 0
10 1 0 0 0 0 0 0 0 0 0 1
0 1 2 3 4 5 6 7 8 9 10 11
1 0 0 0 0 0 32 32 0 0 0 0 0
2 0 0 0 0 0 211 211 0 0 0 0 0
3 0 0 0 0 164 153 153 164 0 0 0 0
4 0 0 0 0 111 54 54 111 0 0 0 0
5 0 0 0 110 44 11 11 44 110 0 0 0
6 0 0 0 44 10 1 1 10 44 0 0 0
7 0 0 44 10 1 0 0 1 10 44 0 0
8 0 0 10 1 0 0 0 0 1 10 0 0
9 0 10 1 0 0 0 0 0 0 1 10 0
10 0 1 0 0 0 0 0 0 0 0 1 0
11 1 0 0 0 0 0 0 0 0 0 0 1
Hints: Catalan Triangle, “Gauss early years second paragraph http://en.wikipedia.org/wiki/Carl_Friedrich_Gauss”:
http://en.wikipedia.org/wiki/Carl_Friedrich_Gauss

