Difficulty: Medium
Correct Answer: 8974
Explanation:
Introduction / Context:
This coding question is based on converting letters to digits according to a fixed mapping. We are given the codes for two words, RAINBOW and SNAP, and asked to determine the code for PIANO. The underlying mapping must be consistent for all letters, and once it is deduced from the examples, it can be applied to the new word. Recognising and reusing this mapping is the core skill tested here.
Given Data / Assumptions:
Concept / Approach:
First, we match each letter in RAINBOW with the corresponding digit. Then we do the same for SNAP and check for consistency. This gives us a mapping from letters to digits. Finally, we apply this mapping to PIANO. If the first letter is coded as 0, the resulting number will start with zero, which is often left out when writing the final code as a plain number. The provided answer options are four digit numbers, which suggests that such a leading zero might indeed be dropped.
Step-by-Step Solution:
Step 1: Write RAINBOW and its code together: R A I N B O W → 1 9 8 7 6 4 5.
Step 2: From this, deduce the mapping: R → 1, A → 9, I → 8, N → 7, B → 6, O → 4, W → 5.
Step 3: Now check SNAP → 3 7 9 0. Letters S, N, A, P map as S → 3, N → 7, A → 9, P → 0.
Step 4: N and A already appeared in RAINBOW and match the earlier mappings N → 7 and A → 9, so the code is consistent.
Step 5: We now map PIANO. Letters are P, I, A, N, O.
Step 6: Use the mapping: P → 0, I → 8, A → 9, N → 7, O → 4.
Step 7: The raw code for PIANO is therefore 0 8 9 7 4, that is 08974.
Step 8: Since a leading zero is typically omitted in numerical notation, the code is written as 8974.
Verification / Alternative check:
You can quickly double check by reapplying the mapping to RAINBOW and SNAP and ensuring that you get 1987645 and 3790 respectively. Every letter keeps the same digit value across words. For PIANO, there is no new letter beyond P, I, A, N and O, all of which have already been assigned digits. Among the options, only 8974 matches the digit sequence obtained after omitting the leading zero, so the answer is unique and consistent.
Why Other Options Are Wrong:
Options 8976, 8947, 8977 and 8975 change one or more digits in ways that contradict the established mapping. For example, any code that does not end in 4 would misrepresent the letter O, which must map to 4. Similarly, any code that does not contain the digit 9 in the correct position would misrepresent A. These options therefore cannot be correct under the consistent letter digit mapping required by the code language.
Common Pitfalls:
A common mistake is to assume that each letter's digit is based on its alphabetical position instead of using the explicit mapping from the examples. Another error is to misread the digits of RAINBOW or SNAP, leading to an incorrect mapping for one or more letters. It is also easy to overlook a leading zero and attempt to keep five digits when the options are four digit numbers. Always derive the mapping carefully from the given data and make sure every letter is handled consistently before encoding a new word.
Final Answer:
Using the same code that maps RAINBOW and SNAP, the word PIANO is written as 8974.
Discussion & Comments