• edited by
16,241 views
61 61 votes

Let $G$ be the graph with $100$ vertices numbered $1$ to $100$.  Two vertices $i$ and $j$ are adjacent  if $\vert i-j \vert =8$ or $\vert i-j \vert=12$. The number of connected components in $G$ is

  1. $8$
  2. $4$
  3. $12$
  4. $25$

9 Answers

Best answer
95 95 votes
From the description it is clear that vertices are connected as follows:

$1-9-17-...-97$
$2-10-18-...-98$
$3-11-19-...-99$
$4-12-20-...-100$
$5-13-21-...-93$
$6-14-22-...-94$
$7-15-23-...-95$
$8-16-24-...-96$

We have covered all vertices using $8$ vertex sets considering only $\mid i - j \mid = 8$. Using $\mid i - j \mid = 12$ we can see the vertex $1$ is connected to $13, 2-14, 3-15$ and $4-16$, so the top $4$ vertex sets are in fact connected to the bottom $4$ sets, thus reducing the connected components to $4$.

Correct Answer: $B$
• edited by
35 35 votes

Lets reduce this problem to n=20 only, bcoz it doesn't matter if n=100 or 1000 or 20

Even this type of question can also be solved using GCD(8,12)=4. I have also tested drawing this above graph for GCD(5,7)=1 and many more.

So answer is 4 here.

11 11 votes

Answer is 4 because GCD(8,12) = 4 (means you can measure multiple of 4)

For more information related to applied method refer -->

https://mindyourdecisions.com/blog/2015/09/13/the-3-jug-riddle-sunday-puzzle/

https://math.stackexchange.com/questions/145346/diophantine-equations-with-multiple-variables

https://math.stackexchange.com/questions/514105/how-do-i-solve-a-linear-diophantine-equation-with-three-unknowns.

I hope this helps and now you can think about other variation of this question as well.

• edited by
8 8 votes
there will be 4 connected component.(1 5 9 13 17......)(2 6 10 14 18....) (3 7 11 15 19 .....)(4 8 12 16......)
0 0 votes

A method I tried,  sir,  sir please check:

P(Number of disconnected components with |i-j|=12)   floor(12/100)/100= 8/100

P(Number of disconnected components with |i-j|=8)   floor(8/100)/100= 12/100

P(Number of disconnected components with |i-j|=12 or |i-j|=8)   12/100 * 8/100 = 96/100

Therefore connected components=1-96 = 4/100 i.e 4? 

Does it makes sense? please check

Answer:
Position:
Show:

Related questions

38 38 votes
3 answers 3 answers
8.2k
8.2k views
Kathleen asked Sep 29, 2014
8,208 views
Consider the following piece of 'C' code fragment that removes duplicates from an ordered list of integers.Node *remove-duplicates (Node* head, int *j) { Node *t1, *t2; ...
38 38 votes
2 answers 2 answers
8.6k
8.6k views
Kathleen asked Sep 29, 2014
8,639 views
An array $A$ contains $n \geq 1$ positive integers in the locations $A , A , \dots A[n]$. The following program fragment prints the length of a shortest sequence of conse...
30 30 votes
3 answers 3 answers
8.8k
8.8k views
Kathleen asked Sep 29, 2014
8,780 views
A size-balanced binary tree is a binary tree in which for every node the difference between the number of nodes in the left and right subtree is at most $1$. The distance...
76 76 votes
7 answers 7 answers
17.9k
17.9k views
Kathleen asked Sep 29, 2014
17,940 views
Consider a hash table with $n$ buckets, where external (overflow) chaining is used to resolve collisions. The hash function is such that the probability that a key value ...