A circle has 29 points arranged in a clockwise manner and numbered 0 to 28. A…

2024

A circle has 29 points arranged in a clockwise manner and numbered 0 to 28. A bug moves on the circle according to the following rule: if it is at point i, it moves clockwise by (1 + r) places in one second, where r is the remainder when i is divided by 11. If the bug starts at position 23, at what position will it be after 2012 seconds?

  1. A.

    3

  2. B.

    7

  3. C.

    15

  4. D.

    20

Show answer & explanation

Correct answer: D

Whenever a rule repeatedly maps a state to a new state within a finite set of possible states (here, the 29 points on the circle), the sequence of states must eventually revisit a state it has already reached — and from that point on, the same block of states repeats forever. This repeating block is called a cycle. Once the cycle's starting point and length are known, the state after a very large number of steps (2012 seconds here) is found by locating where that step number falls inside the cycle, instead of simulating every single step.

  1. Start: position = 23.

  2. Second 1: r = 23 mod 11 = 1, so move 1 + 1 = 2 places. New position = (23 + 2) mod 29 = 25.

  3. Second 2: r = 25 mod 11 = 3, so move 1 + 3 = 4 places. New position = (25 + 4) mod 29 = 0.

  4. Second 3: r = 0 mod 11 = 0, so move 1 + 0 = 1 place. New position = (0 + 1) mod 29 = 1.

  5. Second 4: r = 1 mod 11 = 1, so move 1 + 1 = 2 places. New position = (1 + 2) mod 29 = 3.

  6. Second 5: r = 3 mod 11 = 3, so move 1 + 3 = 4 places. New position = (3 + 4) mod 29 = 7.

  7. Second 6: r = 7 mod 11 = 7, so move 1 + 7 = 8 places. New position = (7 + 8) mod 29 = 15.

  8. Second 7: r = 15 mod 11 = 4, so move 1 + 4 = 5 places. New position = (15 + 5) mod 29 = 20.

  9. Second 8: r = 20 mod 11 = 9, so move 1 + 9 = 10 places. New position = (20 + 10) mod 29 = 1.

Position 1 reappears at second 8, exactly as it first appeared at second 3 — so the sequence of positions repeats from second 3 onward, with cycle length 8 − 3 = 5. The repeating block of positions, in order, is 1, 3, 7, 15, 20.

To locate second 2012 inside this cycle, first count how many seconds past the cycle's start (second 3) it is: 2012 − 3 = 2009. Reducing this modulo the cycle length: 2009 mod 5 = 4, since 2009 = 401 × 5 + 4. So second 2012 lands on the position at index 4 (0-indexed) of the repeating block 1, 3, 7, 15, 20, which is 20.

As a self-consistency check on this indexing: second 8 is 8 − 3 = 5 steps past the cycle's start, i.e. index 5 mod 5 = 0 of the block, which correctly points to position 1 — matching the direct trace above. Applying the same indexing rule to 2012 (remainder 4) is therefore reliable.

So the bug is at position 20 after 2012 seconds.

Explore the full course: Tcs Live Preparation