Irish Logical Thinking study materials
Irish Logical Thinking study resources

Car Park Ticket Codes

Irish Logical Thinking · Put your knowledge to work in context.

All case studies

Car Park Ticket Codes

A ticket-validation device at a Dublin car park prints a two-character code for each vehicle registration entered. Staff have logged four pairs and are confident the device is working correctly: GARDEN → I7, PLANET → R4, THRONE → V5, BISCUIT → E8. The device always outputs one letter A–Z followed by one digit 0–9, with alphabet positions counted as A=1 to Z=26. It has no memory, so a given registration always produces the same code, and different registrations may share a code. A new attendant is told only that 'the letter depends on the vowels and the digit depends on the alphabet', and offers M4 for MAPLE. The supervisor says the attendant has misunderstood the letter rule and has also mishandled the arithmetic, and asks for the rule to be written down, the code corrected, and a note on why the code cannot be used to recover a registration.

1. Derive the letter rule and the digit rule from the four logged pairs, and give the correct code for MAPLE and for CUSHION.

Read the worked answer

Letter rule: move the first letter forward by the number of vowel letters in the registration (A, E, I, O, U), wrapping from Z to A.

  • GARDEN: A, E → 2; G + 2 = I ✓
  • PLANET: A, E → 2; P + 2 = R ✓
  • THRONE: O, E → 2; T + 2 = V ✓
  • BISCUIT: I, U, I → 3; B + 3 = E ✓

BISCUIT is the pair that proves the count is of vowel occurrences, not distinct vowels - counting distinct vowels would give 2 and produce D, not E.

Digit rule: take the alphabet position of the last letter minus that of the first letter, then take the result modulo 10 (and a negative result is read as its positive equivalent mod 10).

  • GARDEN: 14 − 7 = 7 ✓
  • PLANET: 20 − 16 = 4 ✓
  • THRONE: 5 − 20 = −15 → 5 ✓
  • BISCUIT: 20 − 2 = 18 → 8 ✓

Applying it. MAPLE: vowels A, E → 2; M + 2 = O; 5 − 13 = −8 → 2, giving O2. The attendant's M4 leaves the first letter unshifted and gets the digit wrong. CUSHION: vowels U, I, O → 3; C + 3 = F; 14 − 3 = 11 → 1, giving F1.

2. Explain how the two mod-10 and mod-26 wrappings must be handled, and give a registration for which ignoring them produces an impossible output.

Read the worked answer

Both rules are cyclic and must be applied as such. The letter shifts within a 26-letter cycle: the successor of Z is A. The digit is a difference reduced into a single 0–9 digit, and subtracting a larger first letter from a smaller last letter gives a negative number that is not a valid output until it is reduced.

Example: ZEBRA. Vowels E, A → 2, so Z + 2 wraps to B. For the digit, 1 − 26 = −25; reduced mod 10 (adding 30, or taking the remainder) gives 5. Correct code: B5.

Ignoring the wrappings fails twice here: shifting Z by 2 without cycling gives something past Z, which the device cannot output, and leaving the digit as −25 is not a digit at all. Even a partial treatment - taking the absolute value, 25, and then failing to reduce it - yields an invalid two-digit result. THRONE in the log is the same trap in miniature: 5 − 20 is negative, and the device's '5' is the reduced value, not a sign-bearing number.

3. The supervisor wants to use the code as a unique vehicle identifier. Using the structure of the rule, explain why this cannot work.

Read the worked answer

The rule loses information at both characters, so it is many-to-one by construction.

Letter. The output letter reveals the first letter only up to an unknown shift: it tells you first letter + vowel count, not either quantity alone. Any registration whose first letter is L, which contains exactly three vowels and whose last letter is N (position 14), also yields O2 - because L + 3 = O and 14 − 12 = 2. A real-word example is easy to construct with four or five letters, so O2 certainly does not identify MAPLE.

Digit. Only a difference modulo 10 survives. Registrations whose first and last letters differ by 10, 20, 30 and so on collapse onto the same digit, and the sign information is discarded: a first letter of 20 with a last of 5 gives the same 5 as a first letter of 5 with a last of 10.

Combining the two, there are 26 × 10 = 260 possible codes against effectively unbounded registrations, so collisions are certain well before the car park fills. It is fine as a human-readable check code - a mistyped registration will usually produce a mismatch - but it must not be used as a key. Identification should rest on the registration itself or on a sequential ticket number stored in a database.