Let $S$ be a set of $n$ elements $\{1,2,\dots,n\}$ and $G$ a graph with $2^n$ vertices, each vertex corresponding to a distinct subset of $S$. Two vertices are adjacent iff the symmetric difference of the corresponding sets has exactly 2 elements. Note: The symmetric difference of two sets $R_1$ and $R_2$ is defined as $(R_1\setminus R_2) ∪ (R_2\setminus R_1)$
Every vertex in $G$ has the same degree. What is the degree of a vertex in $G$?
How many connected components does $G$ have?
================================================================
My take-I am able to solve it only by taking small example like take $n=2$ and $n=3$ and not able to understand the solution in formal way.
Please, explain how do I solve such question(s) formally.
Any help is highly appreciated in advance.
To find the degree of each vertex, you can compute the degree of {}, as Ivan Neretin proposed. So you have to ask yourself: which nodes are adjacent to {}? The answer is: all nodes with exactly two elements. So the node {} has degree $n*(n-1)/2$. Using the information given, we now know that all nodes must have this degree.
For the connectivity:
1): You can prove that for all $0 < i \leq n$ each node with exactly i elements is adjacent to any other node with exactly i elements. In other words: The induced subgraph containing all the nodes with exactly i elements is a complete graph.
2): You can also prove that there is no edge between two sets $A$ and $B$ if $|A| \not\equiv_2 |B|$.
3): If you have a set $A$ with $i < n - 1$ elements, then you can add two elements to that set such that you get a set $B$ with two more elements than $A$. Now it is clear that there is an edge between $A$ and $B$.
If you combine these facts, you will find that there are exactly 2 connected components in G.