EDPT study materials
EDPT study resources

Check Character Under Two Moduli

EDPT · Put your knowledge to work in context.

All case studies

Check Character Under Two Moduli

A claims system issues a seven-character code: six digits followed by one check character. The check is a weighted sum of the six digits with weights 2, 3, 4, 5, 6, 7 applied left to right; the sum is divided by 11 and the remainder is the check character, with remainder 10 written as X. One valid code on file is 415263X. Three transcription errors have been reported against codes in this format: an operator swapped the second and third digits of 415263X; an operator keyed the fourth digit as 9 instead of 2; and an operator swapped the first and fifth digits of 415263X. Separately, a vendor proposes keeping the same weights but reducing the modulus to 10 so the check character can be a single decimal digit with no X case.

1. Verify 415263X and determine whether each of the three reported errors would be detected.

Read the worked answer

Verification: 4x2=8, 1x3=3, 5x4=20, 2x5=10, 6x6=36, 3x7=21. Sum = 98. 98 / 11 = 8 remainder 10, and remainder 10 is written X, so 415263X is valid.

Error 1, swapping positions 2 and 3 (1 and 5), gives 451263: 8 + 15 + 4 + 10 + 36 + 21 = 94. 94 / 11 = 8 remainder 6. The check character would have to be 6, not X, so the error is detected.

Error 2, keying the fourth digit as 9, gives 415963: 8 + 3 + 20 + 45 + 36 + 21 = 133. 133 / 11 = 12 remainder 1, not 10. Detected.

Error 3, swapping positions 1 and 5 (4 and 6), gives 615243: 12 + 3 + 20 + 10 + 24 + 21 = 90. 90 / 11 = 8 remainder 2. Detected.

All three are caught. With a prime modulus of 11, distinct weights, and digits smaller than the modulus, neither a single-digit substitution nor any transposition can leave the remainder unchanged.

2. For the vendor's modulus-10 proposal, give a concrete transposition that would no longer be detected and explain the general condition.

Read the worked answer

Take the code 145263 (sum 2 + 12 + 20 + 10 + 36 + 21 = 101, remainder 1 under modulus 10) and swap positions 1 and 5, giving 645213 (12 + 12 + 20 + 10 + 6 + 21 = 81, remainder 1). Both pass under modulus 10, so the transposition is undetected. Under modulus 11 the same pair gives remainders 2 and 4 and is caught.

The general condition: swapping positions i and j changes the weighted sum by (w_i - w_j)(d_i - d_j). Detection fails whenever that product is a multiple of the modulus. Here w_1 - w_5 = 2 - 6 = -4 and d_1 - d_5 = 1 - 6 = -5, so the change is 20, which is 0 under modulus 10.

Because weights 2 through 7 differ by at most 5 and digits differ by at most 9, several such collisions exist under modulus 10 whenever the weight difference and the digit difference are both 5, or one is 2 and the other is 5, and so on. Under modulus 11, neither factor can be a multiple of 11, so the product never vanishes.

3. Recommend accept or reject the vendor proposal, and state what neither scheme can catch.

Read the worked answer

Reject the proposal. Modulus 10 with these weights detects single-digit errors but loses a predictable share of transpositions, and transposition is the error class this check exists to catch. The saving is the X case, which is a trivial formatting convenience. If the X is genuinely unacceptable downstream, change the representation (for example, map remainder 10 to a digit by a documented rule) rather than weakening the arithmetic.

Neither scheme detects:

  • A transposition of two identical digits, because no error occurred and the value is unchanged.
  • Two errors that cancel: a substitution in one position plus a compensating substitution in another. A single check character catches one error, not a pair that happens to preserve the weighted sum.
  • Field-level errors outside the check, such as a valid code attached to the wrong claim or a code copied from another record.

A check character validates the digits, not the transaction. The system still needs a duplicate-key check and a reconciliation of accepted codes to issued codes to catch a valid code used on the wrong record.