Every economy must answer the basic economic question of "what to produce": which goods and services to produce, and in what quantities, with its scarce resources. In a market economy, this question is answered by the price mechanism, "the system where the forces of demand and supply determine the prices of products." Prices allocate resources through three functions. Through the signalling function, prices communicate information to consumers and producers: "a rising price gives a signal to producers that they should increase their quantity supplied, and signals to consumers that they should decrease the quantity demanded." Through the incentive function, prices motivate them to respond to this information: "a rising price gives producers the incentive to … increase the quantity supplied, as the higher price may allow them to earn higher revenues." Through the rationing function, prices decide who receives the available goods: all those who are willing and able to pay the price receive the good, and those who are not do not.
Suppose consumers' tastes change, and more people want electric bicycles, for example because they become a popular way to travel to work. In Figure 1, the demand for electric bicycles increases from D1 to D2. At the original price P1, consumers now want to buy Q3, at point B, but producers are still supplying only Q1, at point A. There is excess demand, a shortage equal to Q3 − Q1, which causes the price of electric bicycles to rise.
The rising price acts as a signal. It communicates to producers that consumers want more electric bicycles than are currently being made, information that no single producer could easily gather otherwise. At the same time, it signals to consumers that electric bicycles have become scarcer and more costly to obtain. Through these signals, consumers' changing wishes are passed on to the firms that decide what to produce, without any central authority being involved.
The higher price also creates an incentive to respond. At P2, producing electric bicycles is more profitable than before, so existing producers expand their output, and new firms may enter the industry. Producers move up the supply curve from A to C, and quantity supplied rises from Q1 to Q2. To do so, they draw additional resources, such as labour, components and factory space, away from the production of other goods. At the same time, the higher price gives consumers an incentive to buy fewer bicycles than they wanted at P1, so they move along D2 from B to C.
The price keeps rising until it reaches P2, where quantity demanded equals quantity supplied at C, and the shortage disappears. At this price, the rationing function decides who receives the Q2 bicycles available: they go to the consumers who are willing and able to pay P2, while those who are not willing or able to pay that price go without. Through these three functions, the price mechanism answers the question of what to produce. More resources are allocated to electric bicycles, the good that consumers now value more highly, and fewer to the goods they value less. In the opposite case, if demand for a good fell, its price would fall, signalling to producers that it is less wanted and giving them an incentive to reduce output, so resources would move out of its production and into goods that consumers value more.