Let be the graph with vertices numbered to . Two vertices and are adjacent if or . The number of connected components in is
View worked solution
Answer: B
Two vertices and are adjacent if and only if or .
If there exists a path between two vertices and , then their difference must be a linear combination of the step sizes and :
By Bézout's identity, the set of all such linear combinations is precisely the set of multiples of the greatest common divisor:
This implies that and can belong to the same connected component only if . This partitions the vertices into equivalence classes modulo :
Since we can transition by using the sequence of steps followed by (and vice versa) without exceeding the boundaries , each of these equivalence classes is fully connected. Thus, there are exactly connected components.
Free practice · Your answers on this page are not saved.
