expected length of linked list
$E(X) = something \cdot (k-1)$ 


That $something$ is $p$. The full formula should be $E(Y)=1+p(k-1)$, where $Y$ is the random variable that is the length for the linked list just before the $k$-th operation is performed.

To convince yourself that $p$ is the right answer, try a few cases. When $p=1$, every operation adds one element to $T$. When $p=0$, no prepend operation will happen. When $p=1/2$, an element is added about half of the times. Make sense?

Here is the simple reason why. Let $Y_i$ be the increase of length in step $i$. Then 


$Y_1, Y_2, \cdots, Y_n$ are independent random variables,
$E(Y_i)=p$ for all $i$ since the probability of prepending is $p$ for each operation.


Since the expectation of the sum is the sum of the expectations for independent variables, we have
$$\begin{align}
E(Y)
&amp;=E(1+ Y_1+ Y_2+ \cdots+ Y_{k-1})\\
&amp;=1+ E(Y_1)+E(Y_2)+\cdots+E(Y_{k-1})\\
&amp;=1+ p(k-1)
\end{align}$$
where 1 comes from the initial one element in $T$.