module.exports = { slug: "break-even-units", title: "Break-even units", deck_category: "finance", description: "Computes the number of units a business must sell to cover fixed costs, given the unit price and unit variable cost.", inputs: [ { name: "fixed_cost", type: "number", unit: "currency units", required: true, description: "Total fixed costs for the period", min: 0 }, { name: "unit_price", type: "number", unit: "currency units", required: true, description: "Selling price per unit", min: 0 }, { name: "unit_variable_cost", type: "number", unit: "currency units", required: true, description: "Variable cost per unit", min: 0 } ], outputs: [ { name: "break_even_units", unit: "units", description: "Units needed to break even, rounded up to the next whole unit" }, { name: "contribution_margin", unit: "currency units", description: "Unit price minus unit variable cost" } ], steps: [ "contribution_margin = unit_price - unit_variable_cost; this must be greater than 0 or break-even is impossible.", "break_even_units (exact) = fixed_cost / contribution_margin.", "Round break_even_units up to the next whole unit (a business cannot sell a fraction of a unit).", "Round contribution_margin to 2 decimals (money to cents)." ], constants: [], sources: [ { kind: "edition_page", value: "Brealey, Myers, Allen, Principles of Corporate Finance, 13th ed., Chapter 10, section on break-even analysis", title: "Principles of Corporate Finance", publisher: "McGraw-Hill", retrieved_utc: "2026-09-30T19:31:29Z", note: "Break-even units = Fixed costs / (Price - Variable cost per unit)" } ], disclaimer: null, questionText(inputs) { return `A business has $${inputs.fixed_cost} in fixed costs, sells each unit for $${inputs.unit_price}, and pays $${inputs.unit_variable_cost} in variable cost per unit. How many units must it sell to break even?`; }, run(inputs) { const { fixed_cost, unit_price, unit_variable_cost } = inputs; if (typeof fixed_cost !== "number" || fixed_cost < 0) throw new Error("fixed_cost must be a non-negative number"); if (typeof unit_price !== "number" || unit_price < 0) throw new Error("unit_price must be a non-negative number"); if (typeof unit_variable_cost !== "number" || unit_variable_cost < 0) throw new Error("unit_variable_cost must be a non-negative number"); const contribution_margin = Math.round((unit_price - unit_variable_cost) * 100) / 100; if (contribution_margin <= 0) throw new Error("unit_price must exceed unit_variable_cost for break-even to be possible"); const break_even_units = Math.ceil(fixed_cost / contribution_margin); return { answer: `${break_even_units.toLocaleString("en-US")} units`, values: { break_even_units, contribution_margin } }; }, examples: [ { name: "worked example", inputs: { fixed_cost: 50000, unit_price: 25, unit_variable_cost: 15 }, expected: { answer: "5,000 units" }, check: "hand computation: contribution_margin = 25-15 = 10.00; break_even = 50000/10 = 5000, already whole" }, { name: "test vector: non-integer result rounds up", inputs: { fixed_cost: 10000, unit_price: 12, unit_variable_cost: 9 }, expected: { answer: "3,334 units" }, check: "hand computation: contribution_margin = 12-9 = 3.00; break_even = 10000/3 = 3333.33..., rounds up to 3334" } ] };