31 Aug
2013
31 Aug
'13
12:09 a.m.
Here is a little puzzle. I encourage not spelunking around for the answer on the Internet. ;) Given a 32-bit unsigned integer x, and a positive integer n, let a = XOR(x, RIGHTSHIFT(x, n)) or in C syntax a = x ^ (x >> n) find, if one exists, a function f such that f(a) = x. In other words, invert the operation on x, or show otherwise. Cheers, Robert