Markowitz optimization, Options Pricing, Time Value of Money, Breakeven & EBIT–EPS,
Capital Structure, and Capital Budgeting — every concept explained clearly.
Markowitz optimization is a mathematical framework, introduced by Harry Markowitz in 1952, for constructing a portfolio that maximises expected return for a given level of risk — or equivalently, minimises risk for a target return. With two assets it reduces to finding the optimal weight w invested in Asset 1 (and 1−w in Asset 2) that sits on the efficient frontier.
The portfolio expected return is a weighted average of the two assets' individual expected returns:
E(Rₚ) = w · E(R₁) + (1 − w) · E(R₂)
where w is the weight in Asset 1 and E(R₁), E(R₂) are their respective expected returns. The relationship is always linear — diversification does not affect expected return, only risk.
Portfolio variance depends on the individual variances and the covariance between the two assets:
σ²ₚ = w²σ²₁ + (1−w)²σ²₂ + 2w(1−w)σ₁₂
where σ₁₂ = ρ₁₂ · σ₁ · σ₂ is the covariance and ρ₁₂ is the correlation coefficient. Unlike expected return, variance is a non-linear (quadratic) function of the weights — this is the source of diversification benefit.
Correlation ρ ∈ [−1, +1] is the key driver of diversification:
• ρ = +1 — perfect positive correlation; no diversification benefit. Portfolio risk is a simple weighted average of individual risks.
• ρ = 0 — uncorrelated assets; combining them reduces portfolio risk below the weighted average.
• ρ = −1 — perfect negative correlation; a specific weight w* can reduce portfolio risk to zero (complete hedge).
Lower correlation always produces a better (leftward) efficient frontier.
The MVP is the portfolio with the lowest possible variance across all weight combinations. For two assets, the closed-form solution is:
w*₁ = (σ²₂ − σ₁₂) / (σ²₁ + σ²₂ − 2σ₁₂)
The MVP sits at the leftmost point of the efficient frontier on a risk–return plot. Portfolios below it are inefficient because a higher return can be achieved at the same risk level by moving up the frontier.
The efficient frontier is the set of portfolios that offer the highest expected return for each level of risk. For two assets it is a curve (hyperbola) in risk–return space traced by varying w from 0 to 1. Only the upper half of the curve — from the MVP upward — is efficient. An investor selects their preferred point on this curve based on their risk tolerance.
Yes — when ρ < σ₁/σ₂ (roughly, when correlation is sufficiently below 1), the MVP has a standard deviation lower than both σ₁ and σ₂. This is the mathematical proof of diversification: combining imperfectly correlated risky assets can produce a portfolio that is safer than its least-risky component. It is one of the most important results in all of finance.
The Sharpe Ratio measures reward per unit of risk:
S = (E(Rₚ) − Rᶠ) / σₚ
where Rᶠ is the risk-free rate. When a risk-free asset exists, the optimal risky portfolio is the one with the highest Sharpe Ratio — called the Tangency Portfolio. It is the point where a line from Rᶠ is tangent to the efficient frontier. All rational investors hold a mix of this portfolio and the risk-free asset.
The core assumptions are:
• Mean–variance preferences — investors care only about expected return and variance (implying either normal returns or quadratic utility).
• Single period — the analysis is for one holding period; returns and covariances are stable.
• No transaction costs or taxes — weights can be adjusted freely.
• Divisible assets — any fraction of an asset can be held.
• Inputs are known — expected returns, variances, and the correlation are treated as given. In practice, estimating these reliably is the main empirical challenge.
With a single asset an investor can only choose how much to invest — risk and return are fixed. Adding a second asset introduces the covariance term into the portfolio variance formula, creating a continuous opportunity set (the frontier curve instead of just two points). The investor now has a genuine trade-off to optimise. The two-asset model is the pedagogical foundation for the N-asset case, where the covariance matrix Σ (N×N) replaces the single covariance σ₁₂, and the optimisation becomes a quadratic programming problem.
Options Pricing Estimator
The Black-Scholes model (1973) gives a closed-form price for European call and put options on a stock paying a continuous dividend yield. It assumes the stock follows geometric Brownian motion with constant volatility. The call price is:
C = S·e^(−qT)·N(d₁) − K·e^(−rT)·N(d₂)
where d₁ = [ln(S/K) + (r − q + ½σ²)T] / (σ√T) and d₂ = d₁ − σ√T. The put price follows by put-call parity. Inputs are: spot price S, strike K, time to expiry T (years), implied volatility σ, risk-free rate r, and dividend yield q.
An option's premium splits into two components:
• Intrinsic Value — the immediate exercise value: max(S − K, 0) for a call, max(K − S, 0) for a put. This is the value you would realise if you exercised right now.
• Time Value = Premium − Intrinsic Value. This is the extra amount the market pays for the possibility that the option will move further in-the-money before expiry. Time value decays to zero at expiry (theta decay) and is always ≥ 0 for long options.
Moneyness describes the relationship between the current spot price S and the strike price K:
• In-the-Money (ITM) — a call is ITM when S > K; a put is ITM when S < K. The option has positive intrinsic value.
• At-the-Money (ATM) — S ≈ K. Intrinsic value is zero; the option is pure time value. Delta ≈ 0.5 for calls and −0.5 for puts.
• Out-of-the-Money (OTM) — a call is OTM when S < K; a put when S > K. Only time value remains; intrinsic value is zero.
The moneyness bar in the pricer shows the S/K ratio mapped from Deep OTM to Deep ITM.
The Greeks measure the sensitivity of the option price to changes in each input:
• Delta (Δ) — change in option price per ₹1 change in spot. Call Δ ∈ (0,1); Put Δ ∈ (−1,0). Also equals the risk-neutral probability of expiring ITM.
• Gamma (Γ) — rate of change of Delta per ₹1 spot move. Highest for ATM options near expiry.
• Theta (Θ) — daily time decay in P&L. Always negative for long options; accelerates near expiry.
• Vega (ν) — P&L change per 1% rise in implied volatility. Highest for ATM long-dated options.
• Rho (ρ) — P&L change per 1% rise in the risk-free rate. More significant for long-dated options.
Monte Carlo simulates thousands of possible stock price paths under risk-neutral dynamics:
S_{t+dt} = S_t · exp[(r − q − ½σ²)dt + σ√dt · Z]
where Z ~ N(0,1). The option payoff is computed at each terminal price, then discounted at the risk-free rate and averaged across all paths to get the MC price. The standard error (SE = σ_payoffs / √N) quantifies estimation noise; a 95% confidence interval is ±1.96 × SE. Black-Scholes is exact (for European options); MC converges to it as N→∞. The BS vs MC tab plots the BS curve across volatilities and overlays the MC point with its 95% CI.
The Payoff tab shows the long option profile at expiry:
• Payoff (teal) — intrinsic value at each spot price; kinked at the strike K.
• P&L (gold) — payoff minus the premium paid. This is the actual profit or loss after accounting for the cost of the option.
For a long call: break-even = K + premium; max loss = premium; max gain = unlimited.
For a long put: break-even = K − premium; max loss = premium; max gain = K − premium (stock cannot go below zero).
After running the simulation:
• Paths tab — shows 50 representative simulated stock price paths over the life of the option. Each path is a random walk under risk-neutral drift. The spread of paths illustrates how volatility causes uncertainty in the terminal price.
• Distribution tab — shows the histogram of terminal prices across all N paths. The bars are colour-coded: teal = ITM region (payoff > 0), rust = OTM region. Summary statistics (mean, median, standard deviation, 5th–95th percentile range) are shown above the histogram.
Time Value of Money Calculator
Every TVM problem has five variables: PV (Present Value), FV (Future Value), r (Rate per period), n (Number of periods), and PMT (Payment per period). The fundamental single-sum relationship is:
FV = PV × (1 + r)^n
If any four variables are known, the fifth can be solved. The calculator lets you enter four values and press any "Solve" key to compute the missing one. Sign convention: use a negative sign for cash outflows (money leaving your pocket) and positive for inflows.
An annuity is a series of equal, equally-spaced cash flows (PMT) over n periods. The present value of an ordinary annuity is:
PV = PMT × [1 − (1 + r)^(−n)] / rOrdinary (End) timing — payments occur at the end of each period. This is the default for most loans and bonds.
Annuity Due (Begin) timing — payments occur at the beginning of each period (e.g. rent, leases). Because each payment is one period earlier, the annuity due value = ordinary annuity value × (1 + r). Switch timing in the "Timing" dropdown.
Switch to Loan mode using the mode tabs. Enter:
• PV = loan amount (positive, since the bank gives you money)
• FV = 0 (fully amortised loan ends at zero balance)
• Rate % = periodic interest rate (annual rate ÷ 12 for monthly)
• Periods = total number of payments
Then press Solve PMT. The result will be negative — it represents the payment leaving your account each period. To find the number of periods needed to pay off a loan, enter PV, FV = 0, Rate, PMT and press Solve N.
For the Single Sum mode, the rate is solved analytically:
r = (FV / PV)^(1/n) − 1
For annuity modes there is no closed-form solution, so the calculator uses Newton-Raphson iteration — a numerical root-finding method. Starting from a guess of 10%, it repeatedly refines the estimate until the TVM equation balances to within 10⁻¹⁰. This converges in under 100 iterations for typical inputs. If the inputs are inconsistent (e.g. FV and PV have the same sign in an annuity), the solver may return an unreliable result.
The memory keys mimic a financial calculator's one-register memory:
• STO — stores the current value of the active field into memory. The MEM display updates to show the stored number.
• RCL — recalls the stored value into whichever field is currently active.
This is useful for chained calculations — for example, solve for PMT, store it, switch fields and fields, then recall it as an input to a second problem. The memory persists within the session but is cleared when the page is reloaded.
The four modes affect how PMT is treated in the FV and PV solve formulas:
• Single — PMT is ignored. Pure lump-sum compounding: FV = PV × (1+r)^n.
• Annuity — generic annuity mode; PMT occurs every period. Use this for bond valuation or any regular-payment stream.
• Loan — same math as Annuity (End timing), pre-configured for thinking about debt: PV is the principal, PMT is the repayment, FV is the balloon (usually 0).
• Savings — same math as Annuity, pre-configured for savings goals: FV is the target amount, PMT is the regular deposit, PV is the opening balance.
Breakeven & EBIT–EPS Analyzer
The breakeven point (BEP) is the output level at which total revenue equals total cost — neither profit nor loss. The formula uses the contribution margin per unit (CM = Price − Variable Cost per unit):
BEP (units) = Fixed Cost / (Price − Variable Cost per unit)BEP (revenue) = BEP units × Price
Note that tax does not appear in the standard BEP formula because at exactly the breakeven quantity, EBIT = 0 and there is no taxable income. Tax only affects the target profit calculation above breakeven.
The Margin of Safety (MoS) measures how far current volume is above the breakeven point:
MoS = (Volume − BEP units) / Volume × 100%
A higher MoS means the business can absorb a larger drop in sales before incurring a loss. For example, a MoS of 40% means sales must fall by more than 40% before the firm breaks even. The analyzer shows this as a percentage of base volume, and the breakeven chart annotates both the BEP (star marker) and the base volume (gold dashed line) together with an after-tax profit/loss pill.
EBIT–EPS analysis compares two financing structures — pure equity (unlevered) vs equity + debt (levered) — by plotting Earnings Per Share against EBIT (or volume):
EPS (levered) = (EBIT − Interest) × (1 − Tax) / Shares (levered)EPS (unlevered) = EBIT × (1 − Tax) / Shares (unlevered)
The crossover (indifference) point is the EBIT level at which both structures produce identical EPS. Above the crossover, the levered structure produces higher EPS due to financial leverage. Below it, the unlevered structure is better because interest charges erode EPS when EBIT is low. The red dot on the chart marks this crossover exactly.
Given the Unlevered Equity value (V_U), the D/E ratio, the cost of debt, and the tax rate:
Debt = V_U × D/E RatioLevered Equity = V_U + Tax × Debt − DebtShares (levered) = Levered Equity / Share PriceShares (unlevered) = V_U / Share Price
The levered equity formula reflects the Modigliani–Miller tax shield: debt adds value equal to (Tax × Debt), but the debt claim itself (Debt) is subtracted to isolate equity. Annual interest = Debt × Cost of Debt.
The EBIT–EPS chart supports two x-axis perspectives:
• Units mode — x-axis shows production/sales volume. EBIT is derived from units via the breakeven parameters (EBIT = Volume × Price − Fixed Cost − Volume × Variable Cost). This links the operating and financial leverage analyses on the same axis.
• EBIT mode — x-axis shows EBIT directly. Useful when you want to read off the EPS impact of a specific EBIT target without reference to the underlying volume assumptions.
The crossover annotation updates automatically and shows either the indifference Units or indifference EBIT value depending on the selected mode.
Capital Structure Analyzer
Modigliani–Miller Proposition I with corporate taxes states that the value of a levered firm exceeds that of an unlevered firm by the present value of the interest tax shield:
V_L = V_U + t × Debt
where t is the corporate tax rate. Because interest payments are tax-deductible, each rupee of debt generates a permanent tax saving of t per rupee. This means — absent distress costs — a firm should use as much debt as possible to maximise value. The tax shield is always positive and grows linearly with leverage.
The analyzer solves for Debt consistently with the MM tax-shield model. Given a target D/E ratio and V_U:
Debt = (D/E × V_U) / (1 + D/E × (1 − t))
This ensures that when Debt is plugged back into V_L = V_U + t×Debt, the implied equity value V_L − Debt gives the correct D/E. The D/C ratio (Debt to Capitalisation = Debt / V_L) is also reported and equals 1 − 1/(1 + D/E).
FCF (Free Cash Flow to the Firm) — cash available to all capital providers (debt + equity):
FCF = EBIT × (1 − t) − Capex + Depreciation − ΔNWCFCFE (Free Cash Flow to Equity) — cash available to equity holders after debt service:
FCFE = (EBIT − Interest) × (1 − t) − Capex + Depreciation − ΔNWC
Depreciation is added back because it is a non-cash charge. ΔNWC (change in net working capital) is subtracted because an increase in working capital represents cash tied up in operations. Capex is subtracted as it is a cash outflow not reflected in EBIT.
Pre-distress WACC is computed as FCF / V_L (equivalent to the weighted average of after-tax debt cost and equity cost). When the D/E ratio exceeds the critical threshold, a bankruptcy premium is added:
WACC (distress) = WACC (clean) + (BK_direct + BK_indirect) × [(D/E − threshold) / threshold]²
The premium grows quadratically as leverage moves further beyond the threshold, reflecting increasing direct costs (legal fees, restructuring) and indirect costs (lost customers, talent drain). The firm value above the threshold is recalculated as (FCF − distress cost) / WACC_distress, causing firm value to peak and then fall — this is the Trade-Off Theory of capital structure in action.
The chart has two y-axes and three lines:
• Teal line (left axis) — Firm Value (V_L or FCF÷WACC). Rises with leverage up to the critical D/E due to the tax shield, then falls sharply as distress costs dominate.
• Rust line (right axis) — WACC including the distress premium. Declines initially as cheap after-tax debt replaces expensive equity, then rises steeply beyond the threshold.
• Faint rust dashed (right axis) — pre-distress WACC for reference.
• Red dashed vertical — the critical D/E threshold. Left of this line the firm is in the "safe" zone; right of it the firm enters the distress zone. Hovering shows a tooltip with exact values.
Capital Budgeting — NPV · IRR · Payback · PI
NPV is the sum of all cash flows discounted at the WACC:
NPV = Σ [CF_t / (1 + WACC)^t] for t = 0, 1, …, n
NPV measures the value created by a project in today's money. The decision rule is:
• NPV > 0 — accept (the project adds value above the cost of capital).
• NPV = 0 — break even (the project exactly covers the cost of capital).
• NPV < 0 — reject (the project destroys value).
NPV is considered the most reliable capital budgeting metric because it accounts for the time value of money, risk (via WACC), and the absolute magnitude of value creation.
IRR is the discount rate that makes NPV = 0:
Σ [CF_t / (1 + IRR)^t] = 0
There is no closed-form solution, so the analyzer uses bisection search between −99.9% and 1000%. The decision rule: accept if IRR > WACC. Caveats: IRR assumes reinvestment at the IRR itself (often unrealistic), may have multiple solutions for non-conventional cash flows (sign changes > 1), and can rank mutually exclusive projects incorrectly. Always cross-check with NPV.
The Payback Period is the time required for cumulative after-tax cash flows to recover the initial investment. The calculator uses fractional-year interpolation:
Payback = (last negative year) + |cumulative CF at that year| / CF in next yearLimitations: it ignores the time value of money (the discounted payback period — not shown — addresses this), ignores all cash flows after the payback date, and gives no signal about value created. It is best used as a liquidity screen alongside NPV, not as a standalone decision criterion.
The Profitability Index (PI) is the ratio of the present value of future cash flows to the initial investment:
PI = (NPV + |Initial Investment|) / |Initial Investment|
Decision rule: PI > 1 — accept; PI < 1 — reject. PI is especially useful when capital is rationed — i.e. the firm cannot fund all positive-NPV projects. Ranking projects by PI ensures the highest NPV is extracted from each rupee invested. For a single project PI and NPV always give the same accept/reject signal.
The analyzer uses straight-line depreciation of the total initial investment over the project life. For each intermediate year:
Depreciation = Total Initial Outlay / YearsEBT = Inflows + Outflows − DepreciationTax = EBT × Tax Rate (only if EBT > 0)CF After Tax = EBT × (1 − Tax Rate) + Depreciation
Depreciation is added back to CF After Tax because it is a non-cash charge that reduced taxable income but did not require a cash outflow. Initial and final-year cash flows are passed through without depreciation or tax adjustment (they are typically capital transactions).
The NPV Profile plots NPV against discount rate from 0% to 50%. Key features:
• The curve starts at Σ(undiscounted CF) at r = 0 and declines as r rises.
• The x-intercept (where NPV = 0) is the IRR. A steeper curve implies greater sensitivity to the discount rate assumption.
• The teal dot marks the current WACC; the green shaded region above the zero-line is where NPV > 0 (project adds value); the rust-shaded region below is where NPV < 0.
• If the curve never crosses zero, the project has no real IRR (shown as N/A in the metric card).
The three cash flow types map to the project timeline:
• Initial — occurs at Year 0 (the investment decision point). Typically negative (capital expenditure, working capital injection). All initial CFs are summed to form the project cost used for depreciation, PI, and the payback calculation.
• Intermediate — occurs in each of Years 1 through n (operating years). The same amount is repeated every year. Subject to depreciation and tax adjustment.
• Final — occurs at Year n+1 (end of project). Typically positive (salvage value, working capital recovery). Passed through without tax adjustment — use the after-tax salvage value if taxes on disposal are relevant.