  The 2-twist spun trefoil is an example of a sphere that is knotted in
4-dimensional space. Here this example is shown to be distinct from the same
sphere with the reversed orientation.
  To demonstrate this fact a state-sum invariant for classical knots and
knotted surfaces is developed via a cohomology theory of racks and quandles
(also known as distributive groupoids).
  A quandle is a set with a binary operation --- the axioms of which model the
Reidemeister moves in the classical theory of knotted and linked curves in
3-space. Colorings of diagrams of knotted curves and surfaces by quandle
elements, together with cocycles of quandles, are used to define state-sum
invariants for knotted circles in 3-space and knotted surfaces in 4-space.
  Cohomology groups of various quandles are computed herein and applied to the
study of the state-sum invariants of classical knots and links and other linked
surfaces. Non-triviality of the invariants are proved for variety of knots and
links, including the trefoil and figure-eight knots, and conversely, knot
invariants are used to prove non-triviality of cohomology for a variety of
quandles.
