Revert array shuffle faster than in O(n^2)
It's not very clear what you are asking. It seems you want to find the values of f(i) for all i.

Problem: You can't distinguish between f(0) = 1, f(1) = 0, and f(0) = 0, f(1) = 1.