Step 1: Let $x$ = number of degree 1 vertices, $y$ = number of degree 3 vertices. Then total vertices $n = 1 + x + y$.}
Step 2: Sum of degrees = $2(n-1) = 2(1) + 1(x) + 3(y) = 2 + x + 3y$. Also $n-1 = x+y$. Solve: $2(x+y) = 2 + x + 3y \Rightarrow 2x+2y = 2+x+3y \Rightarrow x - y = 2$. So $x = y+2$. For tree, need integer solution. $x=4,y=2$ gives $n=7$. So pendant vertices = $x=4$.}