# a simple graph has 7 vertices and 10 edges. each vertex has degree at most 3. Find the number of vertices of degree 2

I have created two equations based on this statement, let x be the number of vertices with degree 1, y be number of vertices with degree 2, z be number of vertices with degree 3.

$x+2y+3z=20$ from the handshake theorem

and $x+y+z=7$

But am not sure where to proceed. Can anyone help me out. Thanks.

• Put it as a matrix equation, $\begin{bmatrix} 1&2&3\\1&1&1 \end{bmatrix} \begin{bmatrix} x\\y\\z \end{bmatrix} = \begin{bmatrix} 20\\7 \end{bmatrix}$. Row reduce. You want positive integer solutions. – Morgan Rodgers Jun 11 '18 at 6:42

We have $$x+2y+3z = 20 \tag1$$$$x+y+z = 7 \tag2 .$$ Multiplying $(2)$ by $3$ and subtracting $(1)$ from it we get $$2x + y = 1.$$ Since $x,y$ are integers we conclude that $x=0$, $y=1$ and so $z = 6$.