In the last decade, interest in the “wisdom of crowds” effect has gained momentum in both organizationalresearch and corporate practice. Crowd wisdom relies on the aggregation of independent judgments. Theaccuracy of a group’s aggregate prediction rises with the number, ability, and diversity of its members. Weinvestigate these variables’ relative importance for collective prediction using agent-based simulation. We replicatethe “diversity trumps ability” proposition for large groups, showing that samples of heterogeneous agentsoutperform same-sized homogeneous teams of high ability. In groups smaller than approximately 16 members,however, the effects of group composition depend on the social decision function employed: diversity is key onlyin continuous estimation tasks (averaging) and much less important in discrete choice tasks (voting), in whichagents’ individual abilities remain crucial. Thus, strategies to improve collective decision making must adapt to thepredictive situation at hand.