# Expected number of vertices with degree 2

A simple graph with $n$ vertices is constructed by randomly and independently placing an edge between every two vertices with probability $p$. What is the expected number of nodes with degree two?

I was only able to find the probability of any vertex having degree 2. Let me explain what I tried. For any vertex we can have n-1 edges connecting it(since its a simple graph), so for it to have degree = 2, two of these n-1 edges should be there, and rest not.

This gives: $\binom{n−2}{2}p^2(1−p)^{n−3}$.

• What did you try? – Curious_Dim Jan 29 '18 at 15:24
• I was only able to find the probability of any vertex having degree 2. Let me explain what I tried. For any vertex we can have n-1 edges connecting it(simple graph), so for it to have degree = 2, two of these n-1 edges should be there, and rest not. This gives $\binom{n-1}{2}p^2(1-p)^{n-3}$. – Rishabh Gupta Jan 29 '18 at 15:36
• That is correct, but I think from that point you can not just add up this probability $n$ times because the degree of each vertex is not independent from each other vertex – Curious_Dim Jan 29 '18 at 15:49