Social interactions, nonlinear dynamics and task allocation in groups.