Cracking a Two-Step Code
A puzzle code works in two steps. First, every vowel moves forward one place in the alphabet (A→B, E→F) and every consonant moves back one place (T→S, B→A). Second, the resulting letters are written out in reverse order. For example, TIGER becomes QFFJS: T→S, I→J, G→F, E→F, R→Q gives SJFFQ, which reversed is QFFJS.
Ravi is asked to code the word PARTY and explain his method to a partner who was absent. He writes OBQSX and is told it is wrong. His partner, Meena, has not seen the example and is not sure she trusts the reversal step at all.
1. Find exactly where Ravi went wrong and give the correct code for PARTY. Then explain the single check that would have caught his error.
Read the worked answer
Step 1 (shift each letter):
| Letter | Rule | Result |
|---|---|---|
| P | consonant, back 1 | O |
| A | vowel, forward 1 | B |
| R | consonant, back 1 | Q |
| T | consonant, back 1 | S |
| Y | consonant, back 1 | X |
This gives OBQSX - which is precisely what Ravi wrote.
Step 2 (reverse): OBQSX reversed is XSQBO. That is the correct code.
Ravi's error: he did step 1 and stopped. He performed both letter-shifts correctly, so the mistake is not in the alphabet work at all - it is in omitting the second instruction.
The check that catches it: compare the position of a distinctive letter. The original word ends in Y, so the coded word must begin with the shifted Y (X). Ravi's answer starts with O, which comes from the first letter of PARTY - a clear signal that no reversal happened.
2. Meena claims: 'If a coded word ends in a vowel, the original word must have begun with a consonant.' Is she right? Test the claim thoroughly before answering.
Read the worked answer
Meena is right.
Reason it through. The code ends with the shifted version of the first letter of the original word, because of the reversal. So a vowel at the end of the code means the first letter of the word shifted to a vowel.
Now check both cases:
- Vowels shifted forward: A→B, E→F, I→J, O→P, U→V. Every vowel becomes a consonant. So a vowel at the end of the code cannot have come from an original vowel.
- Consonants shifted back: B→A, D→C, G→F, L→K, and so on. Consonants often become vowels.
Since a vowel in the code can only arise from a consonant, the original first letter must be a consonant. Example: PARTY's code XSQBO ends in O, and PARTY starts with P, a consonant.
The judgement skill here is that the reversal is what makes the claim true - Meena is reasoning about the last letter of the code, and the reversal silently turns that into a fact about the first letter of the word.
3. Ravi says: 'To save a step, I could reverse the word first and then do the letter shifts - the answer must be the same.' Decide whether he is correct, and justify it in a way that would convince Meena.
Read the worked answer
Ravi is correct this time, and for a genuine reason.
The shift step acts on each letter independently - the rule for P is the same whatever position P is in. It never looks at neighbouring letters. Reversing only changes the order of the letters, so:
- shift-then-reverse gives: reverse(shift(PARTY))
- reverse-then-shift gives: shift(reverse(PARTY))
Because shifting is applied letter by letter, the two operations pass through each other, so both give reverse(shift(PARTY)) = XSQBO.
Check on a short word: LAMP: L→K, A→B, M→L, P→O gives KBLO, reversed is OLBK. Reverse first: PMAL → shift → O L B K = OLBK. Same.
What would convince Meena: a counter-example to her doubt, plus the reason - the order of two steps can be swapped only when one step does not depend on position. If the code had said 'move the first letter two places and the rest one place', the swapping trick would break.