- Get link
- X
- Other Apps
Is there a mathematical function that converts two numbers into one so that the two numbers can always be extracted again?
Sure. For example, supposing by "number", you mean "natural number", you can interweave the digits (taking the least significant digit of the second number to be the least significant digit of the result, say): 26 and 53 would become 2563. 902 and 8 (i.e, 008) would become 900028. And so on.
This method is so simple a child could understand it, is quite efficient space-wise (the size of the output, measured in number of digits, is about twice as large as the larger of the two inputs, so that it is as efficient as possible for inputs of about the same size), is bijective (every natural number represents a unique pair of natural numbers and vice versa), and generalizes readily to any fixed number of inputs. Not too shabby.
This method is so simple a child could understand it, is quite efficient space-wise (the size of the output, measured in number of digits, is about twice as large as the larger of the two inputs, so that it is as efficient as possible for inputs of about the same size), is bijective (every natural number represents a unique pair of natural numbers and vice versa), and generalizes readily to any fixed number of inputs. Not too shabby.
- Get link
- X
- Other Apps
Comments
Post a Comment