Skip to content
The Lumenary

Practice · Grades 6–8

Check digits and error detection

Check digits and error detection

Warm-upHuman

The first nine digits of an ISBN-10 are 9-97150-2139\text{-}97150\text{-}213. What is the check digit? (If it is X, answer 1010.)

Check digits and error detection

Warm-upHuman

Exactly one of these is a valid ISBN-13. Which one?

Choose one

Check digits and error detection

CoreHuman

Find the check digit d13d_{13} of the ISBN-13 that begins 978-9966-25-118978\text{-}9966\text{-}25\text{-}118.

Check digits and error detection

Warm-upHuman

What parity bit should be added to the message 11010111101011 so that the total number of 1s is even? (Answer 00 or 11.)

Check digits and error detection

CoreHuman

Which swap of two neighbouring digits can go undetected in an ISBN-13?

Choose one

Check digits and error detection

CoreHuman

In the proof that ISBN-10 catches every swap of neighbours, xx is in position kk and yy in position k+1k + 1. By how much does the swap change the check sum?

Choose one

Check digits and error detection

StretchHuman

One digit of a valid ISBN-10 is smudged: 3-16-14 ? 410-X3\text{-}16\text{-}14\,?\,410\text{-}X. The smudged digit is in position 66. Find it. (Hint: you will need a partner modulo 1111.)

Check digits and error detection

CoreHuman

A received ISBN-10 fails the check. Which statement is true?

Choose one

Check digits and error detection

CoreFormal

In Lean, a code number is a list of digits and pre ++ x :: post is the list pre, then the digit x, then the list post. Which statement says that ISBN-10 detects every single-digit error?

Choose one

Check digits and error detection

StretchComputational

Write luhn_valid(number), where number is a string of digits, returning True if it passes the Luhn test: from the right, keep the 1st, 3rd, 5th, … digits as they are; double the 2nd, 4th, … digits, subtracting 99 when the double is more than 99; the total must be a multiple of 1010. Then check the blind spot: 1099 and 1909 differ by a 09↔9009 \leftrightarrow 90 swap.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.