0

I am reading a book called "Artificial Intelligence: A Modern Approach". The following sentence appears:

"It is easy to show that the agent will reach the other square in an average of two steps."

To give some context, the book is talking about a simple reflex agent. Basically the environment the agent works in is a two square environment. The agent flips a coin and if it comes up as a head it moves square and if it comes up with tails it stays where it is.

I am trying to prove the above sentence. If we let $N$ be the number of flips required to move to the other square. Then:

$$E(N) = \sum_{x=1}^{\infty}x{2^{-x}}$$

But I do not think this series converges. I have tried google but i'm getting nothing! I am not very good with probability. There is probably an easier way to think of this

HMPtwo
  • 651
  • 2
  • 11
  • Probably useful: https://math.stackexchange.com/questions/1196452/expected-value-of-the-number-of-flips-until-the-first-head. The Answers show your formula is correct, and that it does converge to 2. But the Answers also give some alternative explanations and methods to see that the expected number of moves is 2. – Bram28 Aug 20 '24 at 10:21

1 Answers1

3

This does converge. It is an arithmetico-geometric sequence, which in its simplest case has the form $\sum_{k=1}^\infty kr^k$ and converges to $\frac{r}{(1-r)^2}$ provided $0<r<1$. In your example $r=1/2$.

See also geometric random variables, of which this is an example.