0

If I want to generate two independent uniform random variables $Y_1,Y_2$ from a single uniform random variable $X$, I know I can do it by converting $X$ into its binary representation, then taking its odd decimal digits as $Y_1$ and even decimal digits as $Y_2$ based on this answer.

However, can I do it without the binary representation and just use $X$'s decimal representation? Specifically, for $X=0.x_1 x_2 x_3 ...$, take $Y_1=0.x_1 x_3 x_5...$ and $Y_2=0.x_2 x_4 x_6...$?

1 Answers1

1

You can use Hilbert's space filling curve, however this still uses binary representation albeit in disguise.

Here is a Wiki link for Hilbert Curve's definition: https://en.m.wikipedia.org/wiki/Hilbert_curve

Hilbert curve, in essence, is a mapping of a 1D line segment to a 2D square plane and vice versa. One of its properties is that it preserves locality which might be helpful for you.

I had tried creating one myself and I learned that it is just a binary manipulation, and instead of separating the bits with odd and even index, it is clumping them into small groups with very small Hamming distance between them.

Having a decimal solution for this problem is not efficient information-wise. Converting it into binary and separating it, is the easiest solution. If you want locality, then use the Hilbert Space Filling Curve or any other space filling curves. Any decimal solution will have information loss greater than a good binary solution. This is evident from the radix economy between base 2 and 10.

It is also easy to convert a uniform random variable into binary.

def Bin(n, v):
    b = []
    for i in range(v):
        if n > 0.5:
            b.append(1)
            n = 2*n-1
        else:
            b.append(0)
            n = 2*n
    return b

def BinInv(b, v): n = 0 for i in range(v): n += 2*(-i-1)b[i] return n

v is the size of the binary number, n is the decimal number, and b is a binary number represented as a list.