For example, I have two numbers ranging from 0 to 15. And I wonder if there is any way to encode these two numbers in just 4-bit binary string (or possibly 5-bit)? It is known that 4 bits are needed to represent any single number from 0 to 15, but maybe you could think of your own operation on binary strings, and then recover the input numbers back from the result. For example, if I add 0010 + 1011 as standard, I get1101. But with the result of adding it is impossible to predict the components of the sum completely and unambiguously. Cases would have to be considered. But maybe some other own defined action? Was anyone wondering about something like that?
I know that the above question may not meet some portal conditions, but treat this question purely abstractly :)
bin()?(0..15,0..15). For reasons mentioned above, you cannot encode all possible ranges. What you ask is quite like "I can write on one side of a page and on the other. Is there a third side?"