Let p be the probability that he takes a step to the right, then the probability of his being at position 2k-n after n steps is

If p=1/2 this simplifies to , of course.

By setting x := 2k-n it follows from this that if , we have

Given that, the probability that is

(assuming that ).