Problem #133
The drunk boyfriend
In a single dimension world, a girl is standing at the point x = 0 . Her boyfriend is standing at some point x = x_0 . He is drunk. So, he either takes a step towards her girlfriend or a step away,with equal probability. But he can’t go beyond x = n ,because of a wall placed there, So whenever he reaches x = n ,he has to go back to x = ( n - 1 ) . Let the expected number of steps for him to reach his girlfriend be F ( x_0 , n ) where x_0 is his starting point.
Find the value of \sum_{i=1}^{N} F (i, N) for N = 10^7