Let $X$ denote a finite nonempty set, and let $W$ denote a matrix
whose rows and columns are indexed by $X$ and whose entries belong to
some field $\fld{K}$. We study three planar algebras related to $W$.
Briefly, a planar algebra is a graded vector space
$\palg{V}=\cup_{n\in \fld{Z}^{+}\cup\{+,\,-\}} \palg{V}_{n}$ which is
closed under ``planar'' operators.
The first planar algebra which we study, $\fp{}^{W}=\cup\fp{n}^{W}$,
is defined by the group theoretic properties of $W$. For $n\in
\fld{Z}^{+}$, $\fp{n}^{W}$ is the vector space of functions from
$X^{n}$ to $\fld{K}$ which are constant on the $\aut(W)$-orbits of
$X^{n}$, and $\fp{+}^{W}$, $\fp{-}^{W}$ are identified with
$\fld{K}$. The second planar algebra, $\sg{}^{W}=\cup\sg{n}^{W}$, is
the planar algebra generated $W$. We define it combinatorially:
$\sg{n}^{W}$ is spanned by functions from $X^{n}$ to $\fld{K}$ defined
via statistical mechanical sums on certain planar open graphs. The
third planar algebra, $\og{}^{W}=\cup\og{n}^{W}$, differs from
$\sg{}^{W}$ only in that the open graphs defining the functions need
not be planar.
It turns out that
$\sg{}^{W}\subseteq\og{}^{W}\subseteq\fp{}^{W}$. We show that
$\sg{}^{W}=\og{}^{W}$ if and only if $\sg{4}^{W}$ contains a
single special function known as the ``transposition''. We show
that $\og{}^{W}=\fp{}^{W}$ whenever $|X|!$ is not divisible by the
characteristic of $\fld{K}$.