  We develop an analytical formalism that is suitable for studying
inhomogeneous structure formation, by studying the joint statistics of dark
matter halos forming at two points. Extending the Bond et al. (1991) derivation
of the mass function of virialized halos, based on excursion sets, we derive an
approximate analytical expression for the ``bivariate'' mass function of halos
forming at two redshifts and separated by a fixed comoving Lagrangian distance.
Our approach also leads to a self-consistent expression for the nonlinear
biasing and correlation function of halos, generalizing a number of previous
results including those by Kaiser (1984) and Mo & White (1996). We compare our
approximate solutions to exact numerical results within the excursion-set
framework and find them to be consistent to within 2% over a wide range of
parameters. Our formalism can be used to study various feedback effects during
galaxy formation analytically, as well as to simply construct observable
quantities dependent on the spatial distribution of objects. A code that
implements our method is publicly available at
http://www.arcetri.astro.it/~evan/Gemini
