It's just Hadamard test plus binary search.
It's just Hadamard test plus binary search.
I like to say,
"Let p|A denote distribution p conditioned on event A.
Imagine a world where the laws of probability are the same, except (p|A)|B need not equal (p|B)|A.
Except you don't have to imagine, because it's literally our world!
Now explore probabilistic algorithms in this world."
I like to say,
"Let p|A denote distribution p conditioned on event A.
Imagine a world where the laws of probability are the same, except (p|A)|B need not equal (p|B)|A.
Except you don't have to imagine, because it's literally our world!
Now explore probabilistic algorithms in this world."
Finally, we posit: Doing "x1 += x2" 256 times in a row is equivalent to doing nothing
(maybe shoulda called it "x1 += x2 mod 256")
and sim. for doing "x2 += x3", "x3 += x4" 256x in a row.
Can you prove "x1 -= x3" commutes with "x2 -= x4"?
Finally, we posit: Doing "x1 += x2" 256 times in a row is equivalent to doing nothing
(maybe shoulda called it "x1 += x2 mod 256")
and sim. for doing "x2 += x3", "x3 += x4" 256x in a row.
Can you prove "x1 -= x3" commutes with "x2 -= x4"?