IAE Academy

GATE 2026 IN GA Q.5: solution and answer

GATE 2026 · INGA Q.5 · 1 mark · MCQ

A coin with heads facing up is shown as (H) and a coin with tails facing up is shown as (T) .

Six coins are placed in the Starting Arrangement, as shown in the figure below. A “step” is defined as interchanging a pair of adjacent coins without flipping them. The minimum number of steps needed to go from the Starting Arrangement to the Final Arrangement, as shown in the figure, is ______.

GATE 2026 IN GA question 5: The coins are drawn as small circles with a letter inside: a circle containing H is a coin with heads up, and a circle…Tap to open full size
Figure from the GATE 2026 IN paper. It is part of the question.
Figure description

The coins are drawn as small circles with a letter inside: a circle containing H is a coin with heads up, and a circle containing T is a coin with tails up. Below the text there are two rows of six circles side by side in a horizontal line. On the left, under the heading "Starting Arrangement", the row reads from left to right: H, H, H, T, T, T. On the right, under the heading "Final Arrangement", the row reads from left to right: T, T, T, H, H, H.

  1. (A)

    3

  2. (B)

    6

  3. (C)

    9

  4. (D)

    12

Answer and solution

ANSWER

The minimum number of steps is 9, which is option (C).

Official answer: CSource: Official answer key, GATE 2026 IN (IIT Guwahati)

  1. We need to turn into . A step swaps two neighbouring coins without flipping them. Swapping two coins that show the same face leaves the arrangement unchanged, so every useful step swaps an with a next to it.

  2. Count out-of-order pairs. Call a pair made of one and one out of order when the is to the left of the . In the final arrangement every is to the left of every , so the final arrangement has out-of-order pairs.

  3. In the starting arrangement every is to the left of every , so all possible – pairs are out of order.

  4. Swapping a neighbouring and reverses the order of that one pair only. Every other pair keeps its relative order, because no other coin passes over another. So each step lowers the count by at most , and going from to needs at least steps.

  5. steps are also enough. Move the rightmost three places to the right ( steps), then the middle ( steps), then the leftmost ( steps):

  6. Minimum number of steps , which is option (C).

KEY IDEA

Count inversions. An adjacent swap reverses the order of exactly one H–T pair, so the minimum number of adjacent swaps equals the number of pairs that must change order: 3 heads × 3 tails = 9.

WATCH OUT FOR

Answering 3 by thinking of each H trading places with a T in one move. A step only swaps neighbours, so every H must pass each of the 3 T's one step at a time, which gives 3 × 3 = 9. Answering 6 is another common slip, from counting only how far the blocks shift and not the number of crossings.

From the GATE 2026 IN paper. Every question of this paper · Download the full paper · All 41 Reasoning questions, with notes

More Reasoning questions