Solution (source code)

= Solution

Let $I_i$ indicate that $v_i$ is isolated. All its $n-1$ incident edges must be absent, so
$$
\mathbb E I_i=\mathbb P(I_i=1)=(1-p)^{n-1}.
$$
Since $N=\sum_{i=1}^nI_i$, <linearity of expectation> gives
$$
\boxed{\mathbb E(N)=n(1-p)^{n-1}}.
$$