-1
$\begingroup$

Does the bitwise-& between two uniformly distributed input produce an output that seems uniformly distributed ? To be more specific, assume to take x and y uniformly from {0,1}^n and compute z = x & y. Assume then to uniformly choose a w from {0,1}^n. Do z and w have the same distribution over {0,1}^n ?

$\endgroup$
1
  • 2
    $\begingroup$ Take the case $n=1$ and compute the probability of the output depending of the different inputs. That should give you a beginning of an answer. $\endgroup$
    – user69015
    Commented Jul 6, 2019 at 18:10

1 Answer 1

3
$\begingroup$

Not very. A few lines of code produces this for a & b with both variables uniformly distributed across $2^8$:-

histogram

I don't think that it has a specific distribution name, other than a classic "bitwise AND function".


From :-

for x in range(256 * 256):
    a = random.randrange(pow(2, 8))
    b = random.randrange(pow(2, 8))
    results.append(a & b)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.