In a code, each letter is replaced by its position in the alphabet (A=1, B=2, …) and the numbers…
In a code, each letter is replaced by its position in the alphabet (A=1, B=2, ...) and the numbers are added, so "BAD" = 2 + 1 + 4 = 7. Jiya says "DAB" will also be coded as 7. Her friend says a different word must get a different code. Who is right?
Who do you think is right? Pick one.
The answer: Jiya, "DAB" is also 7
Why
The friend expects a code to keep words apart, and a good code should. But this code adds the numbers, and adding does not care about order: 2 + 1 + 4 and 4 + 1 + 2 are both 7. "DAB" uses the same letters as "BAD", just rearranged, so it gets the same total. That means this code cannot tell "BAD" from "DAB" — when decoding, the number 7 alone could stand for either word, or others. Test: work it out — D(4) + A(1) + B(2) = 7. Jiya is right: "DAB" is also 7, which shows that a sum code loses the order of the letters.
On Socho, you explain your thinking out loud and a coach asks about YOUR reasoning — one question a day, free, in Hindi, Hinglish or English.
Try a question on Socho →More disagreements in Coding-Decoding