Looking to find the expected value/variance of the following geometric variable defined as having success rate p, where trials are taken until we have a success (which happens with probability p) or we have taken n trials. Successfully calculated the expected value, and ideas on variance? Not sure how to proceed.
For expected value, first tried to use the definition of expectation (and LOE), but got a pretty ugly expression: $\sum_{i=1}^{n-1}{i(p)(1-p)^{i-1}} + n(1-p)^{n-1}$. Is there any nice formula/trick for solving this question?