  Many ant species employ distributed population density estimation in
applications ranging from quorum sensing [Pra05], to task allocation [Gor99],
to appraisal of enemy colony strength [Ada90]. It has been shown that ants
estimate density by tracking encounter rates -- the higher the population
density, the more often the ants bump into each other [Pra05,GPT93].
  We study distributed density estimation from a theoretical perspective. We
prove that a group of anonymous agents randomly walking on a grid are able to
estimate their density within a small multiplicative error in few steps by
measuring their rates of encounter with other agents. Despite dependencies
inherent in the fact that nearby agents may collide repeatedly (and, worse,
cannot recognize when this happens), our bound nearly matches what would be
required to estimate density by independently sampling grid locations.
  From a biological perspective, our work helps shed light on how ants and
other social insects can obtain relatively accurate density estimates via
encounter rates. From a technical perspective, our analysis provides new tools
for understanding complex dependencies in the collision probabilities of
multiple random walks. We bound the strength of these dependencies using
$local\ mixing\ properties$ of the underlying graph. Our results extend beyond
the grid to more general graphs and we discuss applications to size estimation
for social networks and density estimation for robot swarms.
