Prices serve a rationing function. When quantity demanded exceeds quantity supplied, prices rise to alleviate the shortage. When quantity supplied exceeds quantity demanded, prices fall to alleviate the surplus. However, when prices are inflexible, shortages and surpluses persist. Other rationing mechanisms must develop.