Input-Output

Input-Output (often called Machine Input-Output or Sequential Output Tracing) is a reasoning topic where a computer-like system processes an initial sequence of words, numbers, or both. The machine rearranges or transforms the elements step by step according to a fixed logical rule until it produces a final, fully sorted output.

Input Output Diagram 1

1. Fundamentals of Input-Output for Beginners

To solve any Input-Output problem, you do not need to memorize formulas. You need to understand how the "machine" thinks and moves items.

The Structure of a Problem

  • Input: A raw, jumbled line of elements (words, numbers, or a mix).
  • Steps: The sequential stages (Step 1, Step 2, Step 3, etc.) where elements shift or change according to a pattern.
  • Final Step: The last step where no more rearrangements are needed because the target pattern is achieved.

Core Logical Rules Used by the Machine

Before tracking positions, examine the Input and the Final Step to decode the logic:

  • For Words:
    • Alphabetical Order: Arranged from A to Z (ascending) or Z to A (descending).
    • Word Length: Arranged based on the count of letters (e.g., 3-letter words, then 4-letter words).
    • Vowel / Consonant Rules: Words starting with vowels arranged first, followed by consonants.
    • Alphabetical Order of Last Letters: Sorting words based on their ending letters rather than starting letters.
  • For Numbers:
    • Numerical Magnitude: Ascending order (lowest to highest) or descending order (highest to lowest).
    • Odd and Even Sorting: All even numbers grouped together, all odd numbers grouped together.
    • Sum of Digits: Arranging numbers based on the sum of their individual digits (e.g., 42 has a sum of 4 + 2 = 6).
    • Prime Numbers: Grouping prime numbers before composite numbers.
Input Output Diagram 2

The Two Laws of Movement

Law 1: Shifting vs. Fixed Arrangement

  • Shifting (Pushing): When an element is moved to the target position (like the extreme left), all existing elements shift one spot to the side to make room.
  • Fixed Position (In-Place): Elements exchange places directly without shifting the rest of the line.

Law 2: The Auto-Arrangement (Self-Arrangement) Rule

This is the most critical concept for competitive exams.

If an element that needs to be moved next is already sitting in its correct place naturally, the machine does not create a new step for it. It automatically counts as arranged, and the machine immediately proceeds to arrange the next element in the same step.

Why this matters: A problem with 6 elements does not necessarily take 6 steps. Because of auto-arrangement, it might finish in 3 or 4 steps.

The Backward Tracing Rule

In standard shifting-based Input-Output, you can never determine the Input or an earlier step from a later step.

  • Going forward is deterministic (one fixed rule).
  • Going backward is impossible because when an element was pushed to an end, its original location among the other items is permanently lost.
  • If a question asks: "What is Step 1 for the given Step 4?", the answer is almost always "Cannot be determined".
Input Output Diagram 3

2. The Main Types of Input-Output

In competitive examinations, Input-Output questions are broadly divided into three major types:

  1. Single-End Shifting (Unilateral Arrangement)
  2. Double-End Shifting (Bilateral Arrangement)
  3. Mathematical & Box-Pattern Transformation (New Pattern)
Input Output Diagram 4

Type 1: Single-End Shifting (Unilateral Arrangement)

In this type, only one element is picked per step and placed at one end (most commonly the extreme left end). The remaining elements shift to the right, keeping their original relative order.

Input Output Diagram 5
Example 1.1: Pure Numbers in Ascending Order
Logic: In each step, the smallest available number moves to the extreme left.
Input: 54   28   89   12   43   71
Step 1: 12   54   28   89   43   71 (12 moves to the first position)
Step 2: 12   28   54   89   43   71 (28 moves to the second position)
Step 3: 12   28   43   54   89   71 (43 moves to the third position)
Step 4: 12   28   43   54   71   89 (54 is already in place; 71 moves next, which auto-arranges 89)
Step 4 is the final step.
Example 1.2: Words in Reverse Alphabetical Order (Z to A)
Logic: In each step, the word that comes latest in the dictionary moves to the left.
Input: pen   book   zebra   apple   mango   dog
Step 1: zebra   pen   book   apple   mango   dog ("zebra" moves to position 1)
Step 2: zebra   pen   mango   book   apple   dog ("pen" auto-arranged; "mango" moves to position 3)
Step 3: zebra   pen   mango   dog   book   apple ("dog" moves to position 4; "book" and "apple" auto-arrange)
Step 3 is the final step.
Example 1.3: Alternating Words and Numbers
Logic: Word in alphabetical order (A to Z), then number in ascending order, alternating at the left side.
Input: 65   cat   24   fish   91   ball
Step 1: ball   65   cat   24   fish   91 ("ball" moves to position 1)
Step 2: ball   24   65   cat   fish   91 (24 moves to position 2)
Step 3: ball   24   cat   65   fish   91 ("cat" moves to position 3; 65, "fish", and 91 auto-arrange)
Step 3 is the final step.
Example 1.4: Word Length Ordering (Shortest to Longest)
Logic: Words are arranged by the number of letters. If word lengths are equal, alphabetical order is used as a tie-breaker.
Input: elephant   cat   rhinoceros   tiger   dog
Step 1: cat   elephant   rhinoceros   tiger   dog ("cat" has 3 letters, comes before "dog")
Step 2: cat   dog   elephant   rhinoceros   tiger ("dog" has 3 letters)
Step 3: cat   dog   tiger   elephant   rhinoceros ("tiger" has 5 letters; "elephant" (8) and "rhinoceros" (10) auto-arrange)
Step 3 is the final step.
Example 1.5: Sum of Digits Ordering
Logic: Numbers are arranged in ascending order based on the sum of their individual digits.
• 42 = 4 + 2 = 6
• 18 = 1 + 8 = 9
• 31 = 3 + 1 = 4
• 95 = 9 + 5 = 14
• 50 = 5 + 0 = 5
Input: 42   18   31   95   50
Step 1: 31   42   18   95   50 (31 has the smallest digit sum: 4)
Step 2: 31   50   42   18   95 (50 has the next digit sum: 5; 42, 18, and 95 auto-arrange)
Step 2 is the final step.

Type 2: Double-End Shifting (Bilateral Arrangement)

In this type, two elements move in every single step: one element moves to the extreme left, and another element moves to the extreme right. The inner elements shift inward to make room.

Input Output Diagram 6
Example 2.1: Words on Left (A to Z), Numbers on Right (Descending)
Logic: Smallest alphabetical word moves to the left; largest number moves to the right.
Input: 62   ink   19   rat   44   sun   85   box
Step 1: box   62   ink   19   rat   44   sun   85 → box   62   ink   19   rat   44   sun   19 is not right; 85 moves right:
• Step 1: box   62   ink   19   rat   44   sun   85 → box   62   ink   rat   44   sun   19   85
• Let us trace cleanly: box to left end, 85 to right end.
• Step 1: box   62   ink   19   rat   44   sun   85
Step 2: Next word is ink (left), next largest number is 62 (right).
• Step 2: box   ink   19   rat   44   sun   62   85
Step 3: Next word is rat (left), next largest number is 44 (right).
• Step 3: box   ink   rat   sun   19   44   62   85
Step 4: sun (word) and 19 (number) are already sitting in their correct final positions between rat and 44. They auto-arrange.
Step 3 is the final step.
Example 2.2: Smallest Number to Left, Largest Number to Right
Logic: Each step places the smallest remaining number at the left end and the largest remaining number at the right end.
Input: 47   12   89   34   76   25
Step 1: 12   47   34   76   25   89 (12 to left, 89 to right)
Step 2: 12   25   47   34   76   89 (25 to left, 76 to right)
Step 3: 12   25   34   47   76   89 (34 to left, 47 to right)
Step 3 is the final step.
Example 2.3: Shortest Word to Left, Longest Word to Right
Logic: Shortest word moves to the left end; longest word moves to the right end.
Input: computer   cat   elephant   tiger   ox   dog
Step 1: ox   cat   elephant   tiger   dog   computer ("ox" [2 letters] to left, "computer" [8 letters] to right)
Step 2: ox   cat   tiger   dog   elephant   computer ("cat" [3 letters] to left, "elephant" [8 letters] to right)
Step 3: ox   cat   dog   tiger   elephant   computer ("dog" [3 letters] to left, "tiger" [5 letters] to right)
Step 3 is the final step.
Example 2.4: Even Numbers to Left (Ascending), Odd Numbers to Right (Descending)
Logic: Smallest even number moves to the left; largest odd number moves to the right.
Input: 35   14   82   71   26   53
Step 1: 14   35   82   26   53   71 (14 is smallest even; 71 is largest odd)
Step 2: 14   26   35   82   53   71 (26 is next even; 53 is next odd)
Step 3: 14   26   82   35   53   71 (82 is last even; 35 is last odd)
Step 3 is the final step.
Example 2.5: Vowel Words to Left, Consonant Words to Right
Logic: Words starting with a vowel move to the left (A to Z); words starting with a consonant move to the right (Z to A).
Input: red   owl   cup   ice   pen   ant
Step 1: ant   owl   cup   ice   pen   red ("ant" to left, "red" to right)
Step 2: ant   ice   owl   cup   pen   red ("ice" to left, "pen" to right)
Step 3: The remaining middle elements are owl (vowel) and cup (consonant). They are already in their correct places relative to each other.
Step 2 is the final step.

Type 3: Mathematical & Box-Pattern Input-Output (New Pattern)

In this type, words and numbers do not just change positions. Instead, numbers in boxes undergo arithmetic operations (addition, subtraction, multiplication, digit-splitting) from step to step. The number of boxes decreases in each step until a single final value or pair remains.

Input Output Diagram 7
Example 3.1: Cross-Box Digit Multiplication and Differences
Input: Six 2-digit boxes:
• Box 1: [2, 3] | Box 2: [4, 1] | Box 3: [1, 2] | Box 4: [3, 1] | Box 5: [2, 4] | Box 6: [5, 3]
Step 1: Pair Box 1 with Box 4, Box 2 with Box 5, and Box 3 with Box 6. Multiply corresponding digits:
• Box A (from 1 & 4): First digit = 2 * 3 = 6; Second digit = 3 * 1 = 3 → [6, 3]
• Box B (from 2 & 5): First digit = 4 * 2 = 8; Second digit = 1 * 4 = 4 → [8, 4]
• Box C (from 3 & 6): First digit = 1 * 5 = 5; Second digit = 2 * 3 = 6 → [5, 6]
• Step 1 Result: Box A: [6, 3] | Box B: [8, 4] | Box C: [5, 6]
Step 2: Combine Box A with Box B, and Box B with Box C using differences:
• Box D (from A & B): Difference of first digits = 8 - 6 = 2; Difference of second digits = 4 - 3 = 1 → [2, 1]
• Box E (from B & C): Difference of first digits = 8 - 5 = 3; Difference of second digits = 6 - 4 = 2 → [3, 2]
• Step 2 Result: Box D: [2, 1] | Box E: [3, 2]
Step 3: Multiply digits across boxes and add:
• Value = (First digit D * First digit E) + (Second digit D * Second digit E)
• Value = (2 * 3) + (1 * 2) = 6 + 2 = 8
Step 3 Result: [8]
Example 3.2: Step-by-Step Mathematical Number Transformation
Input: 18   25   42   67   34   59
Step 1: Add 2 to each even number; subtract 3 from each odd number:
• 18 + 2 = 20
• 25 - 3 = 22
• 42 + 2 = 44
• 67 - 3 = 64
• 34 + 2 = 36
• 59 - 3 = 56
• Step 1: 20   22   44   64   36   56
Step 2: Divide every number by 2:
• 20 / 2 = 10
• 22 / 2 = 11
• 44 / 2 = 22
• 64 / 2 = 32
• 36 / 2 = 18
• 56 / 2 = 28
• Step 2: 10   11   22   32   18   28
Step 3: Multiply the digits of each number:
• 10 → 1 * 0 = 0
• 11 → 1 * 1 = 1
• 22 → 2 * 2 = 4
• 32 → 3 * 2 = 6
• 18 → 1 * 8 = 8
• 28 → 2 * 8 = 16
• Step 3: 0   1   4   6   8   16
Step 4: Arrange in descending order:
Step 4: 16   8   6   4   1   0
Example 3.3: Cross-Box Digit Sum and Product
Input: Six boxes:
• Box 1: [1, 4] | Box 2: [2, 3] | Box 3: [3, 1] | Box 4: [4, 2] | Box 5: [1, 2] | Box 6: [2, 5]
Step 1: Pair opposite ends (Box 1 with 6, Box 2 with 5, Box 3 with 4). Add corresponding digits:
• Box A (from 1 & 6): 1 + 2 = 3; 4 + 5 = 9 → [3, 9]
• Box B (from 2 & 5): 2 + 1 = 3; 3 + 2 = 5 → [3, 5]
• Box C (from 3 & 4): 3 + 4 = 7; 1 + 2 = 3 → [7, 3]
• Step 1 Result: Box A: [3, 9] | Box B: [3, 5] | Box C: [7, 3]
Step 2: Multiply digits within each box pair and sum:
• Box D (from A & B): (3 * 3) + (9 * 5) = 9 + 45 = 54 → [5, 4]
• Box E (from B & C): (3 * 7) + (5 * 3) = 21 + 15 = 36 → [3, 6]
• Step 2 Result: Box D: [5, 4] | Box E: [3, 6]
Step 3: Difference between the two values:
• 54 - 36 = 18
Step 3 Result: [1, 8]
Example 3.4: 3-Digit Number Operations
Input: 632   481   725   914   536
Step 1: Multiply the first and third digits of each number:
• 632 → 6 * 2 = 12
• 481 → 4 * 1 = 4
• 725 → 7 * 5 = 35
• 914 → 9 * 4 = 36
• 536 → 5 * 6 = 30
• Step 1: 12   4   35   36   30
Step 2: Add the original middle digit to each result:
• For 12 (original middle was 3): 12 + 3 = 15
• For 4 (original middle was 8): 4 + 8 = 12
• For 35 (original middle was 2): 35 + 2 = 37
• For 36 (original middle was 1): 36 + 1 = 37
• For 30 (original middle was 3): 30 + 3 = 33
• Step 2: 15   12   37   37   33
Step 3: Arrange in ascending order:
• Step 3: 12   15   33   37   37
Step 4: Sum of all elements:
• 12 + 15 + 33 + 37 + 37 = 134
Step 4 Result: 134
Example 3.5: Digital Sums and Difference Reductions
Input: 84   57   93   68   76
Step 1: Calculate the sum of the digits for each number:
• 84 → 8 + 4 = 12
• 57 → 5 + 7 = 12
• 93 → 9 + 3 = 12
• 68 → 6 + 8 = 14
• 76 → 7 + 6 = 13
• Step 1: 12   12   12   14   13
Step 2: Square each number:
• 12 * 12 = 144
• 12 * 12 = 144
• 12 * 12 = 144
• 14 * 14 = 196
• 13 * 13 = 169
• Step 2: 144   144   144   196   169
Step 3: Calculate the positive difference between consecutive terms from left to right:
• 144 - 144 = 0
• 144 - 144 = 0
• 196 - 144 = 52
• 196 - 169 = 27
• Step 3: 0   0   52   27
Step 4: Add all remaining numbers:
• 0 + 0 + 52 + 27 = 79
Step 4 Result: 79

Ready to Test Your Speed?

Put your machine input-output tracing speed and shortcut identification skills to the test with real exam drills.