In the decision frame of a firm making economic choices regarding production—how much of each factor input to use to produce how much output—and facing market prices for output and inputs, the production function represents the possibilities afforded by an exogenous technology. Under certain assumptions, the production function can be used to derive a marginal product for each factor. The profit-maximizing firm in perfect competition (taking output and input prices as given) will choose to add input right up to the point where the marginal cost of additional input matches the marginal product in additional output. This implies an ideal division of the income generated from output into an income due to each input factor of production, equal to the marginal product of each input.