finite commutative ring with n elements and its zero divisors Is there a relation between the number of elements in a commutative ring and its zero-divisors? i mean like in $Z_n$ but in general. That in $Z_n$ the greatest common divisor between n and any zero-divisor is not 1 , is there a general relation for finite commutative rings? 
 A: In a finite ring $R$, every element $a$ is either a unit or a zero divisor. To see this, repeatedly take powers of $a$. By the pigeonhole principle, we eventually have $a^k = a^n$ for some exponents $k \neq n \le |R| + 1$, hence
$$a^k(a^{n-k} - 1) = 0.$$
So either $a^{n-k} - 1 = 0$, in which case $a$ is a unit, or not, in which case $a^k$, and hence $a$, is a zero divisor.
So counting the number of zero divisors is equivalent to counting the number of units, which is nicer. Next, every finite ring is the product of its "Sylow subrings" (not actually subrings)
$$R \cong \prod_p R_p$$
where, if $|R| = \prod_p p^{e_p}$, then $|R_p| = p^{e_p}$, and the product runs over all primes. Furthermore, we have
$$R^{\times} \cong \prod_p R_p^{\times}$$
hence
$$|R^{\times}| \cong \prod_p |R_p^{\times}|$$
(this is why it's nicer to count units), so the question reduces to the prime power case. As Thomas Andrews points out in the comments, there are various possibilities here. The maximum possible number of units (and hence the minimum possible number of zero divisors) occurs when
$$R_p \cong \mathbb{F}_{p^{e_p}}$$
is a finite field, with $p^{e_p} - 1$ units and $1$ zero divisor. On the other hand, we might have
$$R_p \cong \mathbb{F}_p^{e_p}$$
with $(p - 1)^{e_p}$ units and $p^{e_p} - (p - 1)^{e_p}$ zero divisors. I'm not sure if this is minimal (unless $p = 2$ where it clearly is).
In any case, we can at least say that if $|R| = \prod_p p^{e_p}$ then $R$ has at least
$$\prod_p p^{e_p} - \prod_p (p^{e_p} - 1)$$
zero divisors (including zero).
Edit: Okay, in fact I can prove that $R_p \cong \mathbb{F}_p^k$ has the fewest possible units for its cardinality. Recall that the Jacobson radical $J(R)$ of an artinian ring has the following properties: first, $R/J(R)$ is semisimple, and second, $1 + rx$ is invertible for every $r \in R, x \in J(R)$. In this case $R_p/J(R_p)$ must therefore be a product of finite fields of characteristic $p$, and since a unit plus an element of the Jacobson radical is still a unit, we have
$$|R_p^{\times}| = |(R_p/J(R_p)^{\times}| |J(R_p)|.$$
A product of finite fields of fixed cardinality has fewer units the more fields there are, and it's always better to decrease the size of $J(R_p)$ and increase the size of $R_p/J(R_p)$, so the product above is minimized when $J(R_p) = 0$ and $R_p$ is a product of as many fields as possible, namely $\mathbb{F}_p^{e_p}$. So, summarizing:

Claim: A finite commutative ring of order $n = \prod p^{e_p}$ has at least
$$\prod_p p^{e_p} - \prod_p (p^{e_p} - 1)$$
and at most
$$\prod_p p^{e_p} - \prod_p (p - 1)^{e_p}$$
zero divisors.

