# How comes plotting affine curve as shadows of gray modulo integer resembles its real locus?

Let $$f(x,y)$$ be polynomial with integer coefficients.

Pick integer $$n>2$$.

Let $$M$$ be $$n \times n$$ matrix. Set $$M_{i,j}=f(i,j) \mod n$$.

Plot $$M$$ as bitmap in shadows of gray where larger value is lighter and smaller is darker. (Zero is black).

Experiments suggest the resulting plot in shadows of gray sometimes resembles the real locus of the affine curve $$f(x,y)=0$$.

Is this true?

If this is true how to explain it?

Actually such relation between discrete and continuous surprises dumb me.

Here are some plots for $$n=213$$ done in Sage. $$x^2+y^2-1$$

$$x^2+2y^2-1$$

$$x^2-y^2-1$$

$$x^3-y^2-1$$ (might be counterexample)

$$x^2+y^2-1$$, white is zero, black is nonzero.

$$x^2+2y^2-1$$ with colormap 'gnuplot', check sage's documentation.

• Do you mean that the zero locus of the curve seems to be recurrent (scaled and translated) throughout the plot? Commented Aug 20, 2015 at 11:06
• Part of the explanation is surely that $x^2+y^2-1$ is symmetric in pretty much every way imaginable. This is also why $x^3-y^2-1$ doesn't work; there no symmetry between $x$ and $-x$ values, and no symmetry between $x$ and $y$. Commented Aug 20, 2015 at 11:13
• @user2520938 I edited adding $x^2+2y^2-1$. Your first question appears subjective to me -- judge for yourself. Agree about the symmetry.
– joro
Commented Aug 20, 2015 at 11:26
• This happens where $df/dx$ and $df/dy$ simultaneously vanish. Then you can see "half"-patterns where those derivatives are of order $2$, etc. Commented Aug 20, 2015 at 12:45
• @mercio What is "this" in "this happens"? There are too many patterns IMHO.
– joro
Commented Aug 20, 2015 at 13:04