TITLE: How can I tell if a variety is normal?
QUESTION [13 upvotes]: Suppose $R$ is a subalgebra of ${\mathbb C}[x_1,...,x_N]$ generated by polynomials $p_1,...,p_k.$ I know that ${\mathbb C}[x_1,...,x_N]$ is the integral closure of $R$.
Is there an algorithm to determine if $R={\mathbb C}[x_1,...,x_N]$ which would work for large $N$? (Say $N=20$). 
Clearly, it is a question about the normality of the variety $X=Spec(R).$
The problem is that I don't know relations between the generators of $R$ (and these may be difficult to compute for large $N$)-- otherwise I could check if $X$ is smooth and if the map ${\mathbb C}^n\to X$ is an immersion -- conditions which imply that $R={\mathbb C}[x_1,...,x_N]$.

REPLY [4 votes]: Consider the ideal $(p_1(x_1,\dots,x_n)-p_1(y_1,\dots,y_n),\dots,(p_k(x_1,\dots,x_n)-p_k(y_1,\dots,y_n))$. If the polynomials generate the ring, this is the ideal $(x_1-y_1,\dots,x_k-y_k)$. This is clear, but the converse is also true, since a map is a closed immersion if it is proper and separates points and tangent vectors, which we can check using the ideal.
Proof: To check that  two points $P$ and $Q$ are separated, choose a $p_i$ that does not vanish at $P,Q$. To check that two tangent vectors $t_1$ and $t_2$ at $P$ are separated, choose a $p_i$ such that the derivative of $p_i$ at $P$ in the direction $(t_1,t_2)$ is nonzero, which there must be since $t_1$ and $t_2$ differ along some coordinate $x_j$, so the derivative of $x_j-y_j$ is nonzero.
The map is proper since it is a finitely-generated integral closure, thus finite, thus proper.
A closed immersion of affine schemes is a quotient by an ideal, but this map has no kernel, so it is an isomorphism as long as $(p_1(x_1,\dots,x_n)-p_1(y_1,\dots,y_n),\dots,(p_k(x_1,\dots,x_n)-p_k(y_1,\dots,y_n))=(x_1-y_1,\dots,x_k-y_k)$