Advertisement

Double Transposition

Two separate pairs of adjacent characters are swapped.

Learn

Two separate pairs of adjacent characters are swapped.

Double transposition errors occur when two separate pairs of adjacent characters are swapped in the same string. This creates a more complex error pattern that can be harder to detect because the errors are distributed across the string.

Original: ABCDEF → Error: BADCEF (AB swapped AND CD swapped)

  • 123456 → 213465 (12 swapped AND 45 swapped)
  • ABCDEF → BACDEF → BADCEF (two transpositions)
  • AB-1234 → BA-1324 (AB swapped AND 23 swapped)

How to recognize it

  • Two separate pairs of adjacent characters are reversed
  • Length remains the same
  • All original characters are present

Common mistakes

  • Missing one of the two transpositions
  • Confusing with single transposition
  • Not scanning the entire string

Step-by-step walkthrough

Find the error: Original '123456' vs Given '213465'

  1. Compare position 1: '1' vs '2' - mismatch
  2. Compare position 2: '2' vs '1' - mismatch
  3. First swap identified: '1' and '2' are transposed
  4. Compare position 3: '3' = '3'
  5. Compare position 4: '4' vs '4'
  6. Compare position 5: '5' vs '6' - mismatch
  7. Compare position 6: '6' vs '5' - mismatch
  8. Second swap identified: '5' and '6' are transposed

Answer: Double transposition error: '1-2' swapped at positions 1-2 AND '5-6' swapped at positions 5-6

Practice guidance

Error Checking

Advertisement