Letting $X$ be the number of flips of a fair coin it’ll take to get at least one head and at least one tail, find the value of $E(X)$.
Attempted Solution:
Event Space: ${HT}$, ${TH}$, ${HHT}$, ${TTH}$, ${HHHT}$, ${TTTH}$$,...,$
The value for $X$ for these would be $2,2,3,3,4,4,..,$
The probabilities would be $1\over{4}$,$1\over{4}$,$1\over{8}$,$1\over{8}$,$1\over{16}$,$1\over{16}$$,...,$
Then multiplying the $X$ values by their respective probabilities and summing, we get
$2\over{4}$+$2\over{4}$+$3\over{8}$+$3\over{8}$+$4\over{16}$+$4\over{16}$+...+
= $2$($2\over{4}$+$3\over{8}$+$4\over{16}$+...+)
= $2$($\sum_{i=2}^{\infty}$${i\over{2^i}})$
= $2(1.5)$
= $3$
Did I do this correctly?