And, interleaved coordinates (in two or three dimensions) provide a nice sort key for many geometric queries. It's like a space-efficient, cache-efficient quad- or oct-tree. -tom On Tue, Mar 10, 2020 at 12:57 PM Tomas Rokicki <rokicki@gmail.com> wrote:
The nice thing about the interleaving approach is it works for decimals as well:
32.17411852982168
-tom
On Tue, Mar 10, 2020 at 12:45 PM Allan Wechsler <acwacw@gmail.com> wrote:
If the pair is unordered and both numbers are greater than 0, you can use the unordered version of the Cantor pairing function. Suppose your two numbers are A and B, where A does not exceed B. Then an unambiguous encoding is A + B(B+1)/2. For example, suppose A is 31 and B is 41. Then the encoding would be 892.
Decoding requires taking a square root in order to determine the largest triangular number not exceeding 892. The formula to extract the larger number is floor(sqrt(2N)-1/2) (I think); then you can recover the smaller number by subtracting B(B+1)/2 from the encoding N.
On Tue, Mar 10, 2020 at 2:50 PM Henry Baker <hbaker1@pipeline.com> wrote:
Take the *decimal* expansion of A,B, and then reinterpret each decimal digit as a *hexadecimal* digit.
Call these new numbers A', B'.
Finally, concatenate A':a:B', where 'a' is the hex digit for 5+5.
The receiver inverts the process after scanning hex digits looking for 'a'.
Of course, you can get a more compact representation by using base-eleven instead of base-16.
-- Google 'BCD'='Binary Coded Decimal'; compliments to IBM 1620, 1401, system/360, Intel 4004, ...
At 10:30 AM 3/10/2020, Éric Angelini wrote:
Hello Math-Fun,
I would like to transmit two _composite_ numbers A and B in the form of single number C.
How can I do that?
For instance, if Alice concatenates A et B, Bob will have a problem in reconstructing those numbers out of C:
A = 865445 B = 12377007 C = 86544512377007
Is there a clever, economic way to say where C must be split?
Or do you know another technique (dealing perhaps with prime numbers)?
This has nothing to do with cryptography (I guess) -- just a (silly) question.
Best, É.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- -- http://cube20.org/ -- http://golly.sf.net/ --
-- -- http://cube20.org/ -- http://golly.sf.net/ --