Chapter 29 Quiz: Financial Modeling with Python

Instructions

Answer all questions. Questions 1-10 are multiple choice. Questions 11-15 are short answer. Questions 16-20 involve interpreting code or output. The answer key is at the end.


Multiple Choice

Question 1. You are building a financial model that will be reviewed by your company's CFO and auditors. Which of the following is the best practice for managing assumptions?

A) Embed assumption values directly in formulas to keep the code concise B) Define all assumptions as named constants at the top of the file C) Ask the CFO to input assumptions via input() prompts at runtime D) Store assumptions in a database to prevent unauthorized changes


Question 2. A product has a selling price of $120, a variable cost of $45 per unit, and monthly fixed costs of $30,000. What is the break-even point in units per month?

A) 250 units B) 400 units C) 500 units D) 667 units


Question 3. An investment has the following cash flows:

Year 0:  -$100,000
Year 1:   $25,000
Year 2:   $30,000
Year 3:   $35,000
Year 4:   $40,000
Year 5:   $20,000

At a 10% discount rate, which statement is most likely true?

A) NPV is positive; the investment should be accepted B) NPV is negative; the investment should be rejected C) NPV equals zero; the IRR is exactly 10% D) Cannot determine without calculating IRR


Question 4. What is EBITDA?

A) Net Income before tax B) Earnings Before Interest, Taxes, Depreciation, and Amortization C) The same as Operating Cash Flow D) Total Revenue minus Total Costs


Question 5. A company's Days Sales Outstanding (DSO) increases from 30 to 45 days. Annual revenue is $6,000,000. What is the impact on Accounts Receivable (working capital)?

A) A/R decreases by $246,575 B) A/R increases by $246,575 C) A/R increases by $493,151 D) No change; DSO does not affect working capital


Question 6. Which Python module should you use when calculating payroll taxes to the cent?

A) math B) float arithmetic C) decimal D) fractions


Question 7. The Internal Rate of Return (IRR) of a project is 14%. The company's hurdle rate is 12%. What should management do?

A) Reject the project; the IRR is too high and suggests too much risk B) Accept the project; the IRR exceeds the hurdle rate C) Accept the project only if the payback period is under 3 years D) Reject the project; high IRR typically means high NPV loss


Question 8. You want to model a company's operating expenses as a combination of fixed and variable components. Which approach best reflects business reality?

A) Model all expenses as a fixed percentage of revenue B) Model all expenses as flat dollar amounts C) Use flat amounts for rent/salaries/insurance; use % of revenue for commissions/marketing D) Use regression analysis on historical data for every expense line


Question 9. What is the "margin of safety" in break-even analysis?

A) The profit margin at the break-even volume B) The percentage by which current sales exceed the break-even volume C) The number of units that can be produced above capacity D) The difference between gross margin and net margin


Question 10. In a scenario analysis for a 5-year revenue model, you create Bear, Base, and Bull cases. A colleague says: "The Base Case is most likely to happen, so the other two don't really matter." What is the most important correction to this view?

A) All three scenarios are equally likely; base case is not special B) The Bear Case is more likely than the Base Case in most business environments C) Scenario analysis is about bounding the range of outcomes, not assigning probabilities D) The Bull Case should always be used for budgeting to motivate the team


Short Answer

Question 11. Explain the difference between Net Income and Free Cash Flow. Give one real-world situation where a company could have positive net income but negative free cash flow.


Question 12. What is the difference between sensitivity analysis and scenario analysis? When would you use each approach?


Question 13. Describe what the Newton-Raphson method does in the context of IRR calculation. Why can't IRR be solved with a simple algebraic formula?


Question 14. A financial model has the following sensitivity: a 1% change in gross margin assumptions changes Year 5 net income by $180,000. The gross margin estimate has uncertainty of plus or minus 3 percentage points. What does this tell a decision-maker about the model?


Question 15. When should you use Excel for financial analysis, and when should you use Python? Give two specific situations that favor each tool.


Code Interpretation

Question 16. What does this code calculate, and what is wrong with it?

cash_flows = [-50000, 12000, 15000, 18000, 20000, 22000]
total = sum(cash_flows)
print(f"NPV: ${total:,.0f}")

Question 17. A colleague shows you this break-even calculation. Identify any errors:

selling_price = 80.00
variable_cost = 35.00
fixed_costs = 24000

contribution_margin = selling_price + variable_cost    # Line A
cm_ratio = contribution_margin / selling_price         # Line B
breakeven_units = fixed_costs / selling_price          # Line C
breakeven_revenue = breakeven_units * selling_price    # Line D

print(f"Break-even: {breakeven_units:.0f} units")

Question 18. Explain what this function does and identify one limitation:

def project_revenue(base_revenue, growth_rates):
    revenues = [base_revenue]
    for rate in growth_rates:
        revenues.append(revenues[-1] * (1 + rate))
    return revenues[1:]

Question 19. This code attempts to calculate IRR for a project. What problem might it encounter, and how would you handle it?

def irr(cash_flows, guess=0.10):
    rate = guess
    for _ in range(1000):
        f = sum(cf / (1 + rate)**t for t, cf in enumerate(cash_flows))
        df = sum(-t * cf / (1 + rate)**(t+1) for t, cf in enumerate(cash_flows))
        rate = rate - f / df
    return rate

Question 20. Read this output from an NPV sensitivity analysis and answer the questions:

Discount Rate    NPV          Decision
    6%        $142,850        Accept
    8%         $98,240        Accept
   10%         $59,847        Accept
   12%         $26,310        Accept
   14%         ($3,218)       Reject
   16%        ($29,440)       Reject
   18%        ($52,720)       Reject

a) Approximately what is the IRR of this investment? b) If the company's hurdle rate is 11%, should they invest? c) If the company believes the discount rate could be anywhere between 10% and 16%, what is the recommendation?


Answer Key

Question 1: B All assumptions should be defined as named constants at the top of the file. This makes them easy to find, change, and audit. Embedding values in formulas (A) creates a maintenance nightmare. Runtime input (C) introduces human error. Database storage (D) is over-engineering for a model.

Question 2: B Contribution margin = $120 - $45 = $75/unit Break-even = $30,000 / $75 = 400 units

Question 3: A The undiscounted sum of inflows is $150,000 vs. $100,000 invested. At a 10% discount rate, the NPV will still be positive (the cash flows are received relatively soon). NPV = $25,000/1.10 + $30,000/1.21 + $35,000/1.331 + $40,000/1.464 + $20,000/1.611 - $100,000 ≈ $17,700.

Question 4: B EBITDA = Earnings Before Interest, Taxes, Depreciation, and Amortization. It is a proxy for operating cash generation but is not the same as cash flow because it does not account for working capital changes or capital expenditures.

Question 5: B Daily revenue = $6,000,000 / 365 = $16,438 A/R at 30 DSO = $16,438 × 30 = $493,151 A/R at 45 DSO = $16,438 × 45 = $739,726 Increase = $739,726 - $493,151 = $246,575 (approximately)

Question 6: C The decimal module provides exact decimal arithmetic. Floating-point arithmetic can introduce rounding errors in cent-level calculations. For payroll, tax, and regulatory calculations, use Decimal.

Question 7: B When IRR exceeds the hurdle rate, the investment earns more than the required return. NPV will be positive at the hurdle rate. Accept the project.

Question 8: C The best model reflects economic reality: some costs are truly fixed (rent, base salaries) and some scale with activity (commissions, variable marketing). Choice A overstates costs in slow periods; B understates costs in growth periods.

Question 9: B Margin of safety = (Current Volume - Break-even Volume) / Current Volume. It represents how far sales can fall before the business becomes unprofitable.

Question 10: C Scenario analysis is not about assigning probabilities. It is about bounding the range of plausible outcomes so decision-makers understand the full landscape. The Bear Case tells you the downside risk; the Bull Case tells you the upside opportunity. Planning only for the Base Case is the equivalent of flying with no knowledge of the weather envelope.

Question 11: Net Income is an accounting measure that includes non-cash charges (like depreciation) and ignores cash timing (accounts receivable may not yet be collected). Free Cash Flow = Operating Cash Flow - CapEx, and reflects actual cash generated.

A company could show positive net income but negative free cash flow if it is growing rapidly and has significant increases in accounts receivable (customers owe money not yet collected) or if it is investing heavily in capital expenditures for growth. A fast-growing manufacturer shipping product in December that won't be paid until February might show strong December net income but negative FCF for that period.

Question 12: Sensitivity analysis varies one or two inputs at a time while holding everything else constant, to understand which assumptions drive outcomes most. It answers "what happens if gross margin is 2 percentage points lower?"

Scenario analysis defines complete, internally consistent stories (Bear/Base/Bull) where multiple assumptions change simultaneously in a coherent way. It answers "what does the world look like if everything goes wrong at once?"

Use sensitivity analysis to identify the most important assumptions. Use scenario analysis to communicate a range of outcomes to decision-makers.

Question 13: Newton-Raphson is an iterative root-finding algorithm. For IRR, it starts with a guess, evaluates the NPV at that rate, looks at the slope of the NPV curve (the derivative), and adjusts the guess in the direction that moves NPV toward zero. It repeats until the guess converges.

IRR cannot be solved algebraically because the NPV equation is a polynomial of degree N (where N is the number of periods). Polynomials of degree 5 or higher have no general closed-form algebraic solution (Abel-Ruffini theorem). Numerical methods are required.

Question 14: The decision-maker should understand that gross margin is a high-leverage assumption. A 3-point uncertainty (±3%) translates to a ±$540,000 range in Year 5 net income. Before relying on this model for a major decision, the analyst should investigate the source of gross margin assumptions and attempt to narrow the uncertainty. The model is highly sensitive to this variable.

Question 15: Use Python when: (1) Running many scenarios or simulations (10+ variants), (2) Pulling data automatically from a database or API, (3) Building a model that will be re-run regularly with updated data, (4) The model involves complex iterative calculations or large datasets.

Use Excel when: (1) The output must be shared with stakeholders who cannot run Python (auditors, bankers, board members), (2) A quick one-time what-if analysis on a handful of numbers, (3) Final presentation tables and formatted financial statements.

Question 16: The code attempts to calculate NPV but simply sums the raw cash flows without discounting them. It does not account for the time value of money. This calculation gives the undiscounted net total cash flow, not the NPV. The correct calculation should discount each cash flow by (1 + rate)^t. The output label "NPV" is therefore incorrect and misleading.

Question 17: There are two errors: - Line A: contribution_margin = selling_price + variable_cost should be selling_price - variable_cost (contribution margin is price MINUS variable cost) - Line C: breakeven_units = fixed_costs / selling_price should be fixed_costs / contribution_margin

Because Line A is wrong, Lines B and C compound the error. The correct break-even is $24,000 / ($80 - $35) = $24,000 / $45 = 533 units.

Question 18: The function projects revenue by applying a list of annual growth rates to a base revenue, compounding each year. It returns Years 1 through N (excluding the base year, which is revenues[0]).

One limitation: the function applies constant compound growth even if growth rates could be negative (which it handles correctly numerically) but does not validate inputs. If growth_rates is an empty list, the function returns an empty list with no warning. It also does not check for unrealistic inputs like a growth rate of -1.5 (which would produce negative revenue).

Question 19: The function could encounter a ZeroDivisionError if df (the derivative) equals zero, which can happen if the discount rate lands at a local flat spot of the NPV function. It also does not handle divergence — if the rate oscillates or goes negative (below -1), the calculation (1 + rate)^t will produce an error. The function should include a check for abs(df) < tolerance before dividing, a bounds check on the rate value, and a fallback method (like bisection) if Newton-Raphson fails to converge.

Question 20: a) The IRR is approximately 13.5% (between 12% where NPV = $26,310 and 14% where NPV = -$3,218). Linear interpolation: $26,310 / ($26,310 + $3,218) × 2% + 12% ≈ 13.8%.

b) At an 11% hurdle rate, the NPV is positive (between $59,847 at 10% and $26,310 at 12%). The investment should be accepted.

c) If the discount rate could be anywhere between 10% and 16%, the decision is not clear-cut. The investment is positive at 10%-12% and negative at 14%-16%. The IRR of ~13.8% is the break-even discount rate. Management should consider whether the 11% hurdle rate is firm or whether additional risk factors justify a higher required return before committing.