I'm trying to solve a stats problem as outlined below; I'm a bit new, however, and I'm not sure how I could solve this problem.
Assume someone has lost their keys, and uses an inefficient random walk to search. He starts at 0, and moves 1 unit to the left or right with equal probability. On the next step, he moves 2 units to the left or right again, with equal probability. For subsequent turns he follows the pattern 1,2,1 etc. How many "moves" are expected to be made until he returns to the origin?
I've written a python script to simulate it, but I'm not quite sure how I could theoretically calculate this expected value.