Unit Sales Target After Fixed Cost Increase
Math & Bit ManipulationAuto-graded · 19 test casesLast updated
Tests cost-volume-profit analysis by computing last period's profit and the sales volume needed to maintain that profit when fixed costs rise.
You're analyzing a business that sells one product. You need to determine how last period's profitability translates into a sales target for the next period when overhead expenses increase.
Problem
Given the following information about a business:
- Initial annual fixed costs
- Unit selling price
- Variable cost per unit
- Units sold in the prior period
- Expected increase in fixed costs for the next period
Your task is to:
- Calculate the net profit achieved in the prior period
- Determine how many units must be sold in the next period to achieve that same net profit, given the higher fixed costs
Input
You receive five integers:
initial_fixed_cost: the fixed costs during the prior periodselling_price: the price at which each unit is soldvariable_cost: the variable cost incurred per unit soldprior_units: the number of units sold in the prior periodfixed_cost_increase: the additional fixed costs expected in the next period
Output
Return a list of two numbers:
- The net profit from the prior period (as a float)
- The number of units required in the next period to match that profit (as a float)
Constraints
- All input values are non-negative integers
selling_price > variable_cost(each unit contributes positively)prior_units >= 0- Assume all units produced are sold immediately
- Ignore taxes, interest, and depreciation
- The selling price and variable cost remain constant across both periods
Examples
Example 1
Input: calculate_sales_target(500000, 100, 60, 20000, 100000)
Output: [300000, 22500]
Example 2
Input: calculate_sales_target(100000, 50, 30, 5000, 25000)
Output: [0, 6250]
Example 3
Input: calculate_sales_target(750000, 125, 75, 30000, 150000)
Output: [750000, 33000]
Hints
Hint 1
Calculate the contribution margin first: how much each unit contributes toward covering fixed costs and generating profit
Hint 2
Use the profit formula: Net Profit = (Units × Contribution Margin) - Fixed Costs
Hint 3
The additional fixed costs must be covered by additional contribution margin from extra unit sales
Worked solution
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Approach
This problem applies cost-volume-profit analysis, a fundamental technique in managerial accounting. The key insight is to work with contribution margin rather than treating revenue and costs separately.
The contribution margin per unit is the amount each sale contributes toward covering fixed costs and generating profit:
Contribution Margin = Selling Price - Variable Cost
Once we know the contribution margin, we can express net profit as:
Net Profit = (Units Sold × Contribution Margin) - Fixed Costs
Step 1: Calculate Prior Period Profit
Apply the profit formula with the given values:
- Contribution margin per unit =
selling_price - variable_cost - Prior profit =
prior_units × contribution_margin - initial_fixed_cost
Step 2: Determine Required Units for Next Period
For the next period, fixed costs increase to initial_fixed_cost + fixed_cost_increase. We want to find the unit sales that yield the same profit as before.
Rearranging the profit formula to solve for units:
Units = (Target Profit + Fixed Costs) / Contribution Margin
Substituting our target (the prior profit) and new fixed costs:
Required Units = (Prior Profit + New Fixed Costs) / Contribution Margin
Why This Works
Each unit sold generates contribution_margin dollars toward fixed costs and profit. To cover higher fixed costs while maintaining the same profit, we need enough additional units so that:
Additional Units × Contribution Margin = Fixed Cost Increase
This is equivalent to our formula above.
Complexity
- Time complexity: O(1) — we perform a constant number of arithmetic operations
- Space complexity: O(1) — we use a fixed amount of storage
Implementation
from typing import List
def calculate_sales_target(initial_fixed_cost, selling_price, variable_cost, prior_units, fixed_cost_increase):
contribution_margin = selling_price - variable_cost
prior_profit = prior_units * contribution_margin - initial_fixed_cost
new_fixed_cost = initial_fixed_cost + fixed_cost_increase
required_units = (prior_profit + new_fixed_cost) / contribution_margin
return [prior_profit, required_units]