  We write exact equations for the thermodynamic properties of a linear polymer
molecule confined to walk on a lattice of finite size. The dimension of the
space in which the lattice resides can be arbitrary. We also calculate polymer
density. The boundary can be of arbitrary shape and the attraction of the
monomers for the sites can be an arbitrary function of each site. The formalism
is even more general in that each monomer can have its own energy of attraction
for each lattice site. Multiple occupation of lattice sites is allowed which
means that we have not solved the excluded volume problem. For one dimension we
recover results obtained previously. The 2-d solution obtained here also solves
the problem of an infinite parallelepiped. The method is easily extended by the
methods of a previous paper to treat the problem of polymer stars or of
branched polymers confined within a finite volume. This exact matrix formalism
results in sparse matrices with approximately zM non-zero matrix elements where
z is the lattice coordination number and the linear dimension M of the Matrix
is equal to the number of lattice sites.
