Question:

From one sequence of digits, another sequence of digits has to be formed as per the following rule:
Double switch: interchange of any two digits that have at most one digit between them (that is, two digits that are either next to each other or have exactly one digit sitting between them), where one such interchange counts as one step.

Using only double switching, what is the minimum number of steps required to change 165324 to 123456?

Show Hint

Work out the fewest swaps needed if any two positions at all could be swapped. That count is already the true lower limit, even for the more restricted double switch.
Updated On: Jul 15, 2026
  • 5
  • 6
  • 7
  • None of these
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Step 1: Note which positions are already correct.
Start with 1 6 5 3 2 4, target 1 2 3 4 5 6. The first digit is already 1, so it never needs to move. The remaining five digits, at positions 2 to 6, hold 6, 5, 3, 2, 4 and need to become 2, 3, 4, 5, 6.

Step 2: Find the lower limit on the number of steps.
Track where each of these five digits needs to go: the 6 (position 2) must move to position 6, the digit that lands in position 6 (the 4) must move to position 4, the digit that lands there (the 3) must move to position 3, wait, position 3 is meant to hold 3, but the current digit at position 4 is a 3, so it must move to position 3... following this chain, position 2 leads to position 6, position 6 leads to position 4, position 4 leads to position 3, position 3 leads to position 2, wait, that is only using four of the five digits; including position 5 (currently 2, which must move to position 5, but position 5 already needs to receive 5), the digits 6, 4, 3, 5, 2 form one single closed loop through positions 2, 6, 4, 3, 5 and back to 2. A closed loop passing through 5 positions needs at least 4 swaps to sort, no matter which two positions each swap is allowed to touch. So 4 steps is the true lower limit, even without the distance restriction.

Step 3: Build a working 4 step solution using only allowed swaps.
Swap positions 2 and 4 (two digits between them: none in between other than one, allowed): 1 6 5 3 2 4 becomes 1 3 5 6 2 4.
Swap positions 4 and 6 (one digit in between, allowed): 1 3 5 6 2 4 becomes 1 3 5 4 2 6.
Swap positions 3 and 5 (one digit in between, allowed): 1 3 5 4 2 6 becomes 1 3 2 4 5 6.
Swap positions 2 and 3 (adjacent, allowed): 1 3 2 4 5 6 becomes 1 2 3 4 5 6.
This reaches the target in exactly 4 steps, and every swap used only touches digits that are adjacent or have one digit between them.

Final Answer:
Since the true minimum is 4 steps, and 4 is not one of 5, 6 or 7, the correct choice is none of these. \[ \boxed{\text{None of these}} \]
Was this answer helpful?
0
0