Swarm robotics and programmable active matter both explore how individual agents can come together to perform useful tasks collectively. How effectively they can do this depends on the individuals' computational capabilities, the size of their memory, how easily they can communicate, and on the complexity of the task. We will look at this question through the lens of distributed algorithms and stochastic processes to understand how and when individual agents with limited resources can collectively accomplish tasks that are greater than the sums of their parts.