  We use analytical calculations and event-driven molecular dynamics
simulations to study a small number of hard sphere particles in a spherical
cavity. The cavity is taken also as the thermal bath so that the system
thermalizes by collisions with the wall. In that way, these systems of two,
three and four particles, are considered in the canonical ensemble. We
characterize various mean and thermal properties for a wide range of number
densities. We study the density profiles, the components of the local pressure
tensor, the interface tension, and the adsorption at the wall. This spans from
the ideal gas limit at low densities to the high-packing limit in which there
are significant regions of the cavity for which the particles have no access,
due the conjunction of excluded volume and confinement. The contact density and
the pressure on the wall are obtained by simulations and compared to exact
analytical results. We also obtain the excess free energy for N=4, by using a
simulated-assisted approach in which we combine simulation results with the
knowledge of the exact partition function for two and three particles in a
spherical cavity.
