TITLE: Expected Value of flipping through a book
QUESTION [7 upvotes]: Suppose that a book has $N$ pages, and we read through the book as follows. We start from page 0, and if we're on page $i$, we randomly flip to a page $i + 1, i + 2, ..., N$ with equal probability.

What is the expected value of number of flips we need to finish the book?

Intuition tells me that we can, on average, expect to halve the number of pages remaining.  This  yields  $\log_2(N)$, but I'm having trouble formalizing it.

If $N = 26$, what is the probability we flip to page 13 at some point? Assume we start at page 0.

I let $P_i$ be the probability we land on page 13 eventually, starting from page $i$. Then, $P_{13} = 1$, and in general, $$P_{i} = \frac{1}{26 - i}\sum_{k = i + 1}^{13}P_k$$
Evaluating terms like $P_{12}, P_{11}, P_{10}$, I see that all of these values are $\frac{1}{14}$, including $P_0$. Is there a more intuitive reason for such a simple answer?

REPLY [2 votes]: Here is how I approached the first part of the problem. Consider a book with exactly $n$ pages. Let $P_1$ denote the first page you flipped to, and let $X_n$ represent the number of pages you flipped until you get to the last page. Note $P_1$ is uniformly distributed on the set $\{1,...,n\}$ and $E(X_1)=1$. Using the total law of expectation we get for $n\geq2$ that $$E(X_n)=\sum_{k=1}^{n}E(X_n|P_1=k)P(P_1=k)=\frac{1}{n}\sum_{k=1}^{n}E(X_n|P_1=k)$$
Notice $E(X_n|P_1=k)=1+E(X_{n-k})$ and so $$E(X_n)=\frac{1}{n}\sum_{k=1}^{n}\Big[1+E(X_{n-k})\Big]=1+\frac{E(X_0)+\dots+E(X_{n-1})}{n}$$
Replace $n$ with $n+1$ to get $$E(X_{n+1})=1+\frac{E(X_0)+\dots+E(X_{n})}{n+1}$$
Combining the previous two equations unveils the relation $$(n+1)(E(X_{n+1})-1)=(n+1)E(X_n)-n$$ which is equivalent to saying $$E(X_{n+1})=E(X_n)+\frac{1}{n+1}$$ So finally $$E(X_n)=\sum_{k=1}^{n}\frac{1}{k}$$