A word and number arrangement machine, when given an input line of words and…

2025

A word and number arrangement machine, when given an input line of words and numbers, rearranges them following a particular rule in each step. The following is an illustration of input and rearrangement.

Input : Various 26 Target 21 For 88 Host 54 Taste 46

Step I : For Various 26 Target 21 88 Host 54 Taste 46

Step II : Host For Various 26 Target 88 54 Taste 46 21

Step III : Taste Host For Various 26 Target 54 46 21 88

Step IV : Target Taste Host For Various 54 46 21 88 26

Step V : Various Target Taste Host For 46 21 88 26 54

Step V is the last step. Find the various steps and final output for the input given below :

Input : Strike 82 Reference 25 Depends 38 Of 53 Wind 36

Which of the following elements is second to the left of third element from right end in Step V ?

  1. A.

    Wind

  2. B.

    Depends

  3. C.

    82

  4. D.

    38

Show answer & explanation

Correct answer: D

Concept: In a word-and-number rearrangement (machine input-output) question, the input line is really two separate sequences running together -- the words, in their original left-to-right order, and the numbers, in their original left-to-right order. A fixed pair of rules is applied once per step: among the words, the shortest word (by letter count) that has not yet been moved is sent to the very front of the line, ahead of every word moved in an earlier step; and, starting one step later, among the numbers, the machine alternately removes the smallest and then the largest of whichever numbers are still un-moved and sends that number to the very end of the line. With five words and five numbers, all five word-moves happen across Steps I-V (one per step, in ascending order of word length) and the four number-moves happen across Steps II-V, so by Step V the words occupy the first five positions in the reverse of the order they were moved (since each newly relocated word is placed ahead of every word relocated earlier), and the numbers occupy the last five positions in the order they were moved (since each relocated number is appended after the ones already sent to the end), with the one number never singled out for a move keeping the front-most spot of the number block.

Application: For the given input -- Strike 82 Reference 25 Depends 38 Of 53 Wind 36 -- the five words ranked by letter count are Of (2), Wind (4), Strike (6), Depends (7), Reference (9), and the five numbers are 82, 25, 38, 53, 36.

  1. Step I: Of, the shortest word, moves to the front; the numbers keep their original order on this first step. Step I: Of Strike 82 Reference 25 Depends 38 53 Wind 36

  2. Step II: Wind (4 letters), the next-shortest word, moves to the front ahead of Of. Among the numbers, the overall smallest, 25, is sent to the very end. Step II: Wind Of Strike 82 Reference Depends 38 53 36 25

  3. Step III: Strike (6 letters) moves to the front next. Among the numbers still un-moved (82, 38, 53, 36), the largest, 82, is sent to the end. Step III: Strike Wind Of Reference Depends 38 53 36 25 82

  4. Step IV: Depends (7 letters) moves to the front next. Among the numbers still un-moved (38, 53, 36), the smallest, 36, is sent to the end. Step IV: Depends Strike Wind Of Reference 38 53 25 82 36

  5. Step V: Reference (9 letters), the longest word, moves to the front last. Among the numbers still un-moved (38, 53), the largest, 53, is sent to the end -- leaving 38, the middle value of the five numbers, as the one number that is never moved. Step V (final): Reference Depends Strike Wind Of 38 25 82 36 53

Cross-check:

  • Word-order check: since each step's word is placed at the very front, the final left-to-right word order is exactly the reverse of the move order (Of, Wind, Strike, Depends, Reference), giving Reference, Depends, Strike, Wind, Of -- matching the Step V word block above.

  • Number-order check: since each moved number is appended at the very end, the final number block is the one un-moved number (38) followed by the other four numbers in the exact order they were moved (25, 82, 36, 53), giving 38, 25, 82, 36, 53 -- matching the Step V number block above.

Result: Step V, ten positions in all, reads Reference(1) Depends(2) Strike(3) Wind(4) Of(5) 38(6) 25(7) 82(8) 36(9) 53(10). The third element from the right end is position 10 - 3 + 1 = 8, which holds 82. Second to the left of that element is position 8 - 2 = 6, which holds 38. So the element that is second to the left of the third element from the right end in Step V is 38.

Explore the full course: Niacl Ao It Specialist

Loading lesson…