Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • \$\begingroup\$ Do you want a consistent truthy value or could it be e.g. "some positive integer" (which might vary between different inputs). \$\endgroup\$ Commented May 2, 2016 at 6:50
  • \$\begingroup\$ @MartinBüttner Any positive integer is fine. \$\endgroup\$ Commented May 2, 2016 at 6:51
  • \$\begingroup\$ @DrGreenEggsandHamDJ I don't think that answer is meant to address the consistency of outputs at all, hence the question. ;) \$\endgroup\$ Commented May 2, 2016 at 6:52
  • \$\begingroup\$ Just out of curiosity: The challenge says: "The biggest advantage of this, is that the encoded text can be written down with no separator between them, and it will still be uniquely decipherable.". How would something like 001 be uniquely decipherable? It could be either 00, 1 or 0, 11. \$\endgroup\$ Commented May 2, 2016 at 13:21
  • 2
    \$\begingroup\$ @Joba It depends on what your keys are. If you have 0, 00, 1, 11 all as keys, this is not a prefix-code because 0 is a prefix of 00, and 1 is a prefix of 11. A prefix code is where none of the keys starts with another key. So for example, if your keys are 0, 10, 11 this is a prefix code and uniquely decipherable. 001 is not a valid message, but 0011 or 0010 are uniquely decipherable. \$\endgroup\$ Commented May 2, 2016 at 16:10