Given the following game:
There is a hider and a seeker, each game consists of the hider randomly selecting one of two places to hide that is $A$ with probability $p$ and $B$ with $1 - p$, and the seeker randomly chooses to search in $A$ with probability $q$ and $B$ with $1 - q$. If seeker finds hider then the game ends, else both randomly pick again. This continues each time both randomly picking where to hide and search until the seeker finds hider.
I want to know how to formulate the average number of game iterations to expect using theory...that is using $p$ and $q$, how can I express how long I should expect it to take for the seeker to find hider?
The probability that the game doesn't end in a particular round is $x = p(1 - q) + q(1 - p)$, so the probability that the game lasts for exactly $n$ rounds is $x^{n-1}(1 - x)$. This means that the expected length of a game is
$$\sum_{n \ge 1} n x^{n-1} (1 - x).$$
This sum can be found by various methods, depending on what you're comfortable with; for now I'll just say that the answer works out to be $\frac{1}{1 - x}$. In other words, it's the reciprocal of the probability that the game ends.