Consumer surplus, producer surplus, and market efficiency

A market is efficient when it provides the most consumer surplus and the most producer surplus possible.  An inefficient market creates what economists call a deadweight loss. 

Consumer Surplus, Producer Surplus, and Market Efficiency

Consumer Surplus is defined as the difference in the market price of a good and how much an individual or individuals would be willing to pay.  

An example would be  a person who is willing to spend $4 on a milk shake but the price is only $3 yielding a surplus of $1.  

Producer Surplus is defined as the difference between what it costs to produce a good and what price the market provides.  

An example would be a firm that makes milk shakes for $2 and sells them for $3 yielding a producer surplus of $1.