TITLE: How many subgraphs of this simple graph?
QUESTION [5 upvotes]: How can I go about finding the amount of subgraphs easily?
I tried doing this:
Remove only vertices in $\binom{4}1 + \binom{4}2 + \binom{4}3 + \binom{4}4 = 20$ ways.
Remove only edges in $\binom{3}{1} +\binom{3}2 + \binom{3}3 = 7$ ways.
Remove nothing in $1$ ways.
So total is $28$.
However, the answer says that it is $35$. How did they get this?

REPLY [3 votes]: The problem is that you can't remove vertices without removing edges. What does having edge $ab$ in the subgraph mean if you don't have vertex $a$?
In fact, if we get rid of vertex $a$, we have to get rid of all the edges. That leaves $2^3 = 8$ subgraphs, depending on which subset of the vertices $\{b,c,d\}$ are included.
If we do keep $a$, then for each vertex $x \in \{b,c,d\}$ we can do one of three things:

Keep both vertex $x$ and edge $ax$.
Keep vertex $x$, but remove edge $ax$.
Remove both vertex $x$ and edge $ax$.

This gives us $3^3 = 27$ subgraphs.
With $27$ subgraphs containing $a$ and $8$ subgraphs not containing $a$, we have $8+27 = 35$ subgraphs total.