  Mutually unbiased bases encapsulate the concept of complementarity - the
impossibility of simultaneous knowledge of certain observables - in the
formalism of quantum theory. Although this concept is at the heart of quantum
mechanics, the number of these bases is unknown except for systems of dimension
being a power of a prime. We develop the relation between this physical problem
and the mathematical problem of finding the number of mutually orthogonal Latin
squares. We derive in a simple way all known results about the unbiased bases,
find their lower number, and disprove the existence of certain forms of the
bases in dimensions different than power of a prime. Using the Latin squares,
we construct hidden-variable models which efficiently simulate results of
complementary quantum measurements.
