Best,

Terry

]]>That is a nice solution to the problem! The one drawback (for the applications I have in mind) is that it is not too robust with respect to noise; if for instance the parity condition is violated by g for o(n^2) of the pairs x,y then it is not clear how to do “robust linear algebra over F_2” and make the distinguisher work in this case. (In other words, as you say, it is not a quasirandomness certificate.) Though if the noise was much smaller, say only O(log n) errors, then presumably your earlier random sampling trick would work to eradicate it.

(I’m also interested in the case when the functions f, g are only partially defined, say on 1% of the pairs x,y, and possibly multi-valued and non-injective (e.g. each (z,w) could be hit by as many as 100 (x,y)). But any reasonably robust distinguisher for the permutation case should extend to this more general case – for instance, your linear algebra distinguisher seems to work in this case as long as there is only a negligible amount of noise.)

]]>I think that the following solves your revised problem as stated (without certifying non-quasirandomness).

Let h be a permutation in question. For x, y, z, w in [n], if h(x, y) = (z, w), write the equation c1(x) + c2(y) = c3(z) + c4(w); thus obtain n^2 mod-2 linear equations in 4n unknowns. Solve the linear system to see if it has a solution such that at least one of c1, c2, c3, c4 is not constant, i.e., not all-0 nor all-1. (This is equivalent to the kernel having dimension at least 4; it can be easily checked.)

With high probability, a random permutation f does not have such a solution: There are 2^(4n) possible colorings(=solutions); for each coloring, the probability that a random permutation respects the coloring is smaller than n^(-Omega(n)).

]]>Just one note to your remark (in your comment 1) “Unfortunately, f and g seem to be too sparse (only n^2 hyperedges among n^4 possible hyperedges) to get anywhere. ”

If there are cn^2 hyperdedges for sufficiently large constant c, I think it suffices to certify non-quasirandomness of g by the procedure explained in the last part of the main post. In particular, for your revised problem, given 16 independent copies of f and g (independent random g that are parity-preserving with respect to fixed colorings), I think we can distinguish them with high probability.

]]>The best distinguisher I know that accepts all g and rejects most f has exponential cost in n, so anything polynomial in n or even subexponential would be an improvement. (In particular this means that lookup tables for and are essentially free.)

]]>is it OK to assume I can compute and in constant time?

Also, what do you mean by efficient distinguisher in your initial post? Since $n$ is large, do you expect it to take poly(log(n)) to compute it? or linear of n or maybe poly(n) is OK?

]]>Your analysis looks correct, and does provide a probabilistic distinguisher between f and g that has a greater than 50% chance of being accurate, though it does not seem obvious how to iterate it and create a distinguisher which is accurate with arbitrarily high probability for any fixed f and g. (At the risk of seeming to constantly move the goal posts, I actually want a little bit more than this: I want a rigorous certificate of quasirandomness which cannot be satisfied by any g, but is satisfied by most f. But a 99% accurate distinguisher would already be progress, and more than I am currently able to do.)

I guess I should have qualified my previous assertion on equivalence of local statistics; my analysis was only for those patterns which occurred quite frequently (at least n^c of them for some c > 0). In such cases, the number of independent variables exceeds twice the number of equations and so the parity constraints have only a negligible effect. But as you point out, the statistics do shift a little bit for those patterns which only occur O(1) times.

]]>