During the fourth year of the Peloponnesian War, the Plataeans were besieged by the Peloponnesians and the Boeotians. The Spartans have built a double wall made of bricks around Plataea, from one side preventing anyone escaping the city and from the other side protecting the besieging troops against Athenian forces that could come to the rescue of Plataea. In December 482 BCE, at the beginning of winter, hunger forced the Plataeans to think about escaping through the siege wall. The plan was based on preparing ladders of appropriate height to climb the walls. But how tall should the ladders be? Too short and no men would be able to reach the top of the wall. Too long and the ladders may be easily pushed back by the troops standing on the wall or the ladders could break under the weight of the climbing soldier if leaning at a too shallow angle.
Ladders were made to match the height of the enemy’s wall, which they measured by the layers of bricks, the side turned towards them not being thoroughly whitewashed. These were counted by many persons at once; and though some might miss the right calculation, most would hit upon it, particularly as they counted over and over again, and were no great way from the wall, but could see it easily enough for their purpose. The length required for the ladders was thus obtained, being calculated from the breadths of the brick.Thucydides, The history of the Peloponnesian War, translated by Richard Crawley.
In essence, they calculated the mode of the distribution of the number of brick layers counted independently by many different people. I think that this is perhaps the first written description of such calculation.
Note: some people say that the Plataeans calculated the average, but this doesn’t make any sense to me.