With reference to the graph, when competitive markets are in equilibrium, the market forces of demand and supply are used to allocate resources, where goods are sold at price P0 and quantity Q0. Since the demand curve outlines the quantities of a good that consumers are willing and able to purchase at various price levels, it represents the marginal benefit curve, which is the benefit that the consumption of each additional unit of good entails. Similarly, the supply curve outlines the quantities of a good that producers are willing and able to pay for to produce units of goods at various price levels, and thus represents the marginal supply curve, which is the cost that the production of each additional unit of good entails. Where marginal benefit equals to marginal cost, the consumer surplus and producer surplus is maximized, at the area bounded by P1 E0 P0 and P0 E0 P2 respectively. At this point, allocative efficiency is achieved, as societal welfare (consumer plus producer surplus) is maximized, and the condition of marginal benefit equals to marginal cost is met. If price is above the equilibrium price at P3, or is price is below the equilibrium price at P4, neither consumer surplus nor producer surplus is maximized, and the welfare loss that exists for both is the area bounded by A E0 B (the shaded triangle). Thus, since consumer and producer surplus is not maximized, and the condition of marginal benefit equals to marginal cost is not met, allocative efficiency is not achieved.
Work Step by Step