patternCritical
Is Morse code without spaces uniquely decipherable?
Viewed 0 times
withoutspacesdecipherableuniquelycodemorse
Problem
Are all Morse code strings uniquely decipherable? Without the spaces,
could be
One might possibly use the Kraft inequality but that only applies to prefix codes.
Morse code with spaces is prefix code in which messages can always be uniquely decoded. Once we remove the spaces this is no longer true.
In the case I am right, and all Morse code message can't be uniquely decoded, is there a way to list all the possible messages? Here are some related exercise I found on codegolf.SE
......-...-..---.-----.-..-..-..could be
Hello World but perhaps the first letter is a 5 -- in fact it looks very unlikely an arbitrary sequence of dots and dashes should have a unique translation.One might possibly use the Kraft inequality but that only applies to prefix codes.
Morse code with spaces is prefix code in which messages can always be uniquely decoded. Once we remove the spaces this is no longer true.
In the case I am right, and all Morse code message can't be uniquely decoded, is there a way to list all the possible messages? Here are some related exercise I found on codegolf.SE
- https://codegolf.stackexchange.com/questions/36735/morse-decode-golf
- https://codegolf.stackexchange.com/questions/131/morse-code-translator
Solution
The following are both plausible messages, but have a completely different meaning:
SOS HELP = ...---... .... . .-.. .--. => ...---.........-...--.
I AM HIS DATE = .. .- -- .... .. ... -.. .- - . => ...---.........-...--.Code Snippets
SOS HELP = ...---... .... . .-.. .--. => ...---.........-...--.
I AM HIS DATE = .. .- -- .... .. ... -.. .- - . => ...---.........-...--.Context
StackExchange Computer Science Q#34067, answer score: 98
Revisions (0)
No revisions yet.