  How does the size of a swarm affect its collective action? Despite being
arguably a key parameter, no systematic and satisfactory guiding principles
exist to select the number of units required for a given task and environment.
Even when limited by practical considerations, system designers should endeavor
to identify what a reasonable swarm size should be. Here, we show that this
fundamental question is closely linked to that of selecting an appropriate
swarm density. Our analysis of the influence of density on the collective
performance of a target tracking task reveals different `phases' corresponding
to markedly distinct group dynamics. We identify a `transition' phase, in which
a complex emergent collective response arises. Interestingly, the collective
dynamics within this transition phase exhibit a clear trade-off between
exploratory actions and exploitative ones. We show that at any density, the
exploration-exploitation balance can be adjusted to maximize the system's
performance through various means, such as by changing the level of
connectivity between agents. While the density is the primary factor to be
considered, it should not be the sole one to be accounted for when sizing the
system. Due to the inherent finite-size effects present in physical systems, we
establish that the number of constituents primarily affects system-level
properties such as exploitation in the transition phase. These results
illustrate that instead of learning and optimizing a swarm's behavior for a
specific set of task parameters, further work should instead concentrate on
learning to be adaptive, thereby endowing the swarm with the highly desirable
feature of being able to operate effectively over a wide range of
circumstances.
