Given the costs of production and market-structure characteristics, analyze how the dem functions under (a) perfect completion and (b) imperfect competition. They will each drive a different approach for maximizing profit and allocation of resources.