In January 1956, the economist Vernon L. Smith decided to use his classroom as a laboratory to answer that exact question. Today this would hardly be surprising. Economists routinely use classroom experiments to test out economic hypotheses and to try to understand how human behavior affects the way markets work. But fifty years ago, the idea was a radical one. Economics was a matter of proving mathematical theorems or of analyzing real-world markets. The assumption was that lab tests could tell you nothing interesting about the real world. In fact, in all the economic literature, there were hardly any accounts of classroom experiments. The most famous had been written by Harvard professor Edward Chamberlin, who every year set up a simulated market that allowed his students to trade among themselves. One of those students, as it happened, was Vernon Smith.

The experiment Smith set up was, by modern standards, uncomplicated. He took a group of twenty-two students, and made half of them buyers and half of them sellers. Then he gave each seller a card that indicated the lowest price at which she’d be willing to sell, and gave each buyer a card that indicated the highest price at which she’d be willing to buy. In other words, if you were a seller and you got a card that said $25, you’d be willing to accept any offer of $25 or more. You’d look for a higher price, since the difference would be your profit. But if you had to, you’d be willing to sell for $25. The reverse was true for buyers. A buyer with a card that said $20 would try to pay as little as possible, but if necessary she’d be willing to shell out the double sawbuck. With that information, Smith was able to construct the class’s supply-and-demand curves (or “schedules”) and to figure out therefore at what price they would meet.

Once all the students had their cards and the rules had been explained, Smith let them start trading among themselves. The market Smith set up was what’s called a double auction, which is much like a typical stock market. Buyers and sellers called out bids and asks publicly, and anyone who wanted to accept a bid or ask would shout out his response. The successful trades were recorded on a blackboard at the front of the room. If you were a buyer whose card said $35, you might start bidding by shouting out “Six dollars!” If no one accepted the bid, then you’d presumably raise it until you were able to find someone to accept your price.

Smith was doing this experiment for a simple reason. Economic theory predicts that if you let buyers and sellers trade with each other, the bids and asks will quickly converge on a single price, which is the price where supply and demand meet, or what economists call the “market-clearing price.” What Smith wanted to find out was whether economic theory fit reality

It did The offers in the experimental market quickly converged on one price. They did so even though none of the students wanted this result (buyers wanted prices to be lower, sellers wanted prices to be higher), and even though the students didn’t know anything except the prices on their cards. Smith also found that the student market maximized the group’s total gain from trading. In other words, the students couldn’t have done any better had someone with perfect knowledge told them what to do.

In one sense these results could be -thought of as unsurprising. In fact, when Smith submitted a paper based on his experiment to the Journal of Political Economy, an ardently pro-market academic journal which was run by economists at the University of Chicago, the paper was rejected at first, because from the editors’ perspective all Smith had done was prove that the sun rose in the east. (The journal eventually did publish the paper, even though four referee judgments on it had come back negative.) After all, ever since Adam Smith economists had been arguing that markets did an excellent job of allocating resources. And in the 1950s, the economists Kenneth J. Arrow and Gerard Debreu had proved that, under certain conditions, the workings of the free market actually led to an optimal allocation of resources. So why were Smith’s experiments so important?

They were important because they demonstrated that markets could work well even when real people were trading in them. Arrow and Debreu’s proof of the efficiency of markets—which is called the general equilibrium theorem—was beautiful in its perfection. It depicted an economy in which every part fit together and in which there was no possibility of error. The problem with the proof was that no real market could fulfil its conditions. In the Arrow-Debreu world, every buyer and seller has complete information, meaning that every one of them knows what all the other buyers and sellers are willing to pay or to sell for, and they know that everyone else knows that they know. All the buyers and sellers are perfectly rational, meaning that they have a clear sense of how to maximize their own self-interest. And every buyer and seller has access to a complete set of contracts that cover every conceivable state of the world, which means that they can insure themselves against any eventuality.

But no market is like this. Human beings don’t have complete information. They have private, limited information. It may be valuable information and it may be accurate (or it may be useless and false), hut it is always partial. Human beings aren’t perfectly rational either. They may want, for the most part, to maximize their self-interest, but they aren’t always sure how to do that, and they’re often willing to settle for less-than-perfect outcomes. And contracts are woefully incomplete. So while Arrow-Debreu was an invaluable tool—in part because it provided a way of measuring what an ideal outcome would look like—as a demonstration of the wisdom of markets, it didn’t prove that real-world markets could be efficient.

Smith’s experiment showed that they could, that even imperfect markets populated by imperfect people could still produce near-ideal results. The people in Smith’s experiments weren’t always exactly sure of what was going on. Many of them saw the experience of trading as chaotic and confusing. And they described their own decisions not as the result of a careful search for just the right choice but rather as the best decisions they could come up with at the time. Yet while relying only on their private information, they found their way to the right outcome.

In the four decades since Smith published the results of that first experiment, they have been replicated hundreds, if not thousands, of times, in ever more complex variations. But the essential conclusion of those early tests—that, under the right conditions, imperfect humans can produce near-perfect results—has not been challenged.

Does this mean that markets always lead to the ideal outcome? No. First of all, even though Smith’s students were far from ideal decision makers, the classroom was free of the imperfections that characterize most markets in the real world (and which, of course, make business a lot more interesting than it is in economics textbooks). Second, Smith’s experiments show that there’s a real difference between the way people behave in consumer markets (like, say, the market for televisions) and the way people behave in asset markets (like, say, the market for stocks). When they’re buying and selling “televisions,” the students arrive at the right solution very quickly. When they’re buying and selling “stocks,” the results are much more volatile and erratic. Third, Smith’s experiments— like the Arrow-Debreu equations—can’t tell us anything about whether or not markets produce socially, as opposed to economically, optimal outcomes. If wealth is unevenly distributed before people start to trade in a market, it’s not going to be any more evenly distributed afterward. A well-functioning market will make everyone better off than they were when trading began—but better off compared to what they were, not compared to anyone else. On the other hand, better off is better off.

Regardless, what’s really important about the work of Smith and his peers is that it demonstrates that people who can be, as he calls them, “naïve, unsophisticated agents,” can coordinate themselves to achieve complex, mutually beneficial ends even if they’re not really sure, at the start, what those ends are or what it will take to accomplish them. As individuals, they don’t know where they’re going. But as part of a market, they’re suddenly able to get there, and fast.