When computing the expectation of $S_n^{-1}I_{[S_n > 0]}$ with $S_n \sim \text{binomial}(n, p)$, I need to evaluate the sum:
\begin{align*} \sum_{k = 1}^n \frac{1}{k}\binom{n}{k}p^{k}(1 - p)^{n - k} \end{align*} for $p \in (0, 1)$.
Is there any well-known binomial identity that can be directly applied to get the above sum? Or any other methods?
My attempt:
Denote $\sum_{k = 1}^{n - 1} \frac{1}{k}\binom{n}{k}p^{k}(1 - p)^{n - k}$ by $f(p), p \in (0, 1)$. Differentiating once with respect to $p$, we get \begin{align*} f'(p) = - \frac{n}{1 - p}f(p) + \frac{1}{p(1 - p)}(1 - p^n - (1 - p)^n) \end{align*}
This nonhomogeneous linear ODE seems solvable but could be tedious...
Here is a transformation which simplifies the sum somewhat by extracting Harmonic numbers $H_n=1+\frac{1}{2}+\cdots+\frac{1}{n}$.
Iterating this recurrence relation we get with $f_1=p$
Comment:
In (1) we change the order of summation $k\rightarrow n-2-k$, use $f_1=p$ and do some simplifications.
In (2) we do some simplifications, shift the index and start with $k=1$.