A Theory of the Production and Allocation of Effort