GATE 2024 XH5 (Psychology) – Question 20
Given an input line of numbers and words, a machine rearranges them following a particular rule in each step. Here is an illustration of an input and rearrangement sequence (Step 1 to Step 5):
Input: 61 wb ob 48 45 29 34 sb pb lb
Step 1: lb wb ob 48 45 29 34 sb pb 61
Step 2: lb ob wb 45 29 34 sb pb 61 48
Step 3: lb ob pb wb 29 34 sb 61 48 45
Step 4: lb ob pb sb wb 29 61 48 45 34
Step 5: lb ob pb sb wb 61 48 45 34 29
Step 5 is the last step of the above arrangement.
Based on the rules followed in the above steps, answer the following question:
Input: cb kb eb 58 49 23 38 jb nb gb 69 82
Which of the following represents the position of 58 in the fourth step? (Step-5 is the last step of the arrangement.)
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) Third from the right
Explanation
In each step the next word in alphabetical order goes to the next place from the left, and the largest remaining number goes to the right end. For the new input: Step 3 gives cb eb gb kb 49 23 38 jb nb 82 69 58, and Step 4 gives cb eb gb jb kb 23 38 nb 82 69 58 49, so 58 is second from the right. That is not one of the options, so C (third from the right) is the nearest.