The Lawfare Academy

Lawfare Group → Knowledge Institute → Lawfare Academy

← Back to program

← Business Analytics: Optimization and Simulation

Unit 2

Linear optimization

Learning objectives

  • Explain linear optimization in your own words.
  • Apply the principle to the worked business case.
  • Evaluate the answer and identify an assumption that could change it.

Linear optimization

Linear programming optimizes a linear objective subject to linear constraints. Formulate variables and units carefully. Corner-point intuition has conditions, and integer requirements can change the solution.

Worked example

Maximize 40x+30y subject to x+y≤10, x≤6, y≤8, x,y≥0.

Current on-site learning

All required original teaching, complete derivations and optional practice models are on LawfareGroup.com. External references are optional provenance or further reading. Florida is the state-law default; federal, historical and comparative contexts remain distinct. Independent human subject review and observed learner testing remain pending. Written business-analytics preparation establishes no actual legal opinion, technical clearance, licensing approval, funding authorization or observed professional competence.

Work through the reasoning

Draw a timeline, label the cash-flow claimant, and distinguish operating assumptions from financing. For this unit, connect the explanation of linear optimization to the worked example before answering the practice question.

Check the limits

Check units, signs, discounting periods, risk assumptions, and the opportunity cost of capital. If the source model and the practical example use different assumptions, state the difference rather than applying the formula or rule mechanically.

Apply it independently

The optimal continuous solution is: Write an answer before opening the model response. Show the calculation or explain the causal or logical steps. Change one material assumption and say whether your conclusion changes. This practice is optional; you can read every part of the course without submitting work.

Extended text lesson

Continue with Verify linear optima and distinguish executable integer decisions for the full worked case, source readings and optional progressive practice.

Complete current conceptual preparation

Investment choices and executable optimization

This original onsite studio supplies investment and formulation preparation for the retained Tideglass certificates. Cedar examples below are independent synthetic cases. They do not replace, amend or add cash to Tideglass. Practice is optional. Independent human subject review and observed learner testing remain separately pending.

Define the decision before calculating its return

An investment uses resources now to change later consequences. Specify whose cash is measured, the comparison alternative, decision date, horizon, currency and whether amounts are nominal or expressed in constant purchasing power. A project can increase accounting earnings while exhausting its cash. Depreciation allocates an asset's accounting cost; it is not another cash payment when the equipment is already paid for. Its tax consequences require an actually applicable tax model rather than an invented universal tax rate.

Use incremental future consequences: revenue gained or lost, avoidable operating costs, foregone use of an owned resource, installation, training, disposal and working capital. A paid feasibility study is sunk for a later decision unless choosing an alternative changes a future recovery. An existing machine's original purchase price is not its current opportunity cost; a feasible resale or alternative use may be. Shared overhead allocated to a project is incremental only to the extent the decision changes the actual resource use or payment. Conversely, an unpriced staff burden is not costless merely because no new invoice arrives.

Receivables and inventory can consume cash before customers pay. Record a working-capital outflow at its commitment date and a recovery only when actually released. Recovery is not a second operating profit. A positive net present value does not itself finance an initial payment, satisfy a minimum cash reserve or authorize a purchase. Put these constraints beside the economic comparison.

Present value, NPV and the cash timeline

For a single consistent discount rate r and end-of-period incremental cash flows C_t, net present value is C_0 + sum C_t/(1+r)^t. C_0 is normally negative. The denominator compounds the opportunity cost from the payment date to the comparison date; it is not a penalty chosen to defeat an unpopular project. Match period lengths: annual inputs require annual rates unless converted coherently. An effective annual rate r corresponds to an effective monthly rate (1+r)^(1/12)-1, not generally r/12. Match nominal cash with a nominal discount rate and real cash with a compatible real rate. Risk differences and financing claims need a coherent valuation method; adding arbitrary cushions to every input and the discount rate can count the same concern repeatedly.

Independent Cedar equipment costs 1000 at date zero and returns 600 at each of year ends one and two. At 10%, NPV is -1000 + 600/1.1 + 600/1.1^2 = 5000/121, approximately 41.3223. Its simple undiscounted surplus is 200; that is a different quantity. At a 20% opportunity cost its NPV is -250/3, approximately -83.3333. Acceptance therefore depends on the specified comparison return and actual feasibility, not merely on receiving more dollars than originally paid.

Add 100 working capital paid at date zero and released at year two, with no additional operating return. The incremental present-value cost of that commitment is 100 - 100/1.1^2 = 2100/121, approximately 17.3554. Total project NPV becomes 2900/121, approximately 23.9669. Do not omit the initial 100 because it is later recovered, or count the recovery at date zero. The initial funding requirement is now 1100 even though the permanent economic cost of the working-capital commitment is smaller than 100.

Payback is a liquidity screen with omissions

Simple payback is the time until cumulative undiscounted net receipts recover the initial outlay. Cedar's 1000 is not recovered at the first year end; cumulative receipts reach 1200 at year two. With only year-end receipts, recovery occurs at year two. A commonly reported 1 + 400/600 = 5/3 years additionally assumes the second year's receipts accrue evenly and are available during that year. State the convention instead of assigning false precision to discrete cash dates.

Discounted payback accumulates discounted receipts. At 10%, the first receipt has present value 6000/11 and the remaining unrecovered amount is 5000/11. The second discounted receipt is 60000/121. A fractional interpolation gives 1 + 11/12 = 23/12 years under the same continuous-arrival approximation; actual end-of-year recovery is again year two. At 20%, discounted receipts through year two total less than 1000, so there is no discounted payback within the horizon. Neither payback rule values benefits after its cutoff, and simple payback ignores the time value of money. A rapid-payback project can destroy value; a long-payback project can create it. Use a declared liquidity screen with NPV and dated cash, rather than treating a chosen payback cutoff as a valuation theorem.

IRR and alternative comparisons

An internal rate of return solves NPV(r)=0. For Cedar, let z=1+r: 1000 z^2-600 z-600=0. The positive economic solution gives r=(3+sqrt(69))/10-1, approximately 13.0662%. For the conventional single-outflow, later-inflow pattern, a discount rate below that root produces positive NPV. IRR is a break-even discount rate under the specified cash stream; it is not a guaranteed market return or a source of cash to reinvest.

Cash streams with later outflows can have multiple roots or none in an admissible domain. The synthetic stream -100, +230, -132 has IRRs of 10% and 20%: substituting either discount rate gives zero NPV. A spreadsheet's single returned root can depend on its starting guess. Inspect the NPV profile, economic domain and actual alternatives. Modified IRR can impose explicit finance and reinvestment rates, but those additional assumptions must be disclosed; it does not make project size, timing or capital constraints disappear.

The profitability index can express present value of positive future receipts per initial investment for a simple conventional stream. Cedar's index at 10% is 126/121, approximately 1.04132. Ratios can help describe scarce funding but do not solve every indivisible allocation: the highest ratio may leave funds unused while a different combination creates more total value. Accounting return uses earnings and an accounting investment base, with conventions such as average book value; it measures a different object from cash NPV. Define the numerator, denominator and depreciation convention before comparing reported accounting rates.

For mutually exclusive alternatives, compare incremental NPV at a consistent opportunity cost and service scope. A small project's higher IRR need not outweigh a larger project's greater absolute value. If projects have unequal lives, an equivalent annual value can aid a common-service comparison only with justified replacement and repetition assumptions. Salvage, retirement duties, inflation and changes in technology can defeat automatic repetition. With capital rationing, model actual funding by date and feasible combinations, not just an unconstrained ranking.

Translate project economics into a mathematical program

Name variables with their units and decision dates. A continuous variable describes divisible activity; a binary variable describes a yes/no commitment; a nonnegative integer describes whole units. The objective measures the declared consequence, while constraints limit resources or impose obligations. A project's initial cost can appear in its net-value calculation and a cash constraint without being charged twice: the objective values the project, whereas the cash row restricts availability.

Independent Cedar has three indivisible projects. A costs 6 and has NPV 5; B costs 5 and has NPV 4; C costs 4 and has NPV 3, in thousands. Available initial cash is 10, and projects are otherwise compatible. Write maximize 5 a+4 b+3 c subject to 6 a+5 b+4 c<=10 and a,b,c in {0,1}. Feasible combinations are none, A, B, C, A+C and B+C. A+B costs 11 and all three cost 15, so both are excluded. A+C uses 10 and yields NPV 8, exceeding B+C's 7. This enumeration is a transparent certificate for the small finite case, not evidence that the stated project estimates are true.

Now require a distinct fixed setup payment of 2 whenever A is selected. If the quoted NPV 5 omitted this new payment, subtract 2 a once from the objective and add 2 a to the funding row. A+C then requires 12 and fails the budget; A alone yields corrected NPV 3. B+C remains funded at 9 and yields 7. It becomes the best choice. If a later cash contribution funds setup but the payment remains economically necessary, the budget and objective must each reflect their own boundary; a funding gift does not automatically erase a real setup cost from every claimant's valuation.

For an activity level x requiring activation binary z, a relationship x<=Mz can enforce no activity without activation when M is a defensible upper bound. A needlessly enormous M can weaken numerical reliability; an understated M can wrongly exclude valid actions. A minimum run requires a separate lower condition when activated. Logical dependencies, exclusive choices and precedence need explicit relationships. Resource rows must describe the same period and units as their coefficients; minutes, hours and thousands of dollars cannot be silently combined.

Understand certificates and failure messages

For a continuous linear maximization, the feasible region is convex. If a finite optimum exists, a vertex can attain it, although a whole edge may tie. Infeasible means no point satisfies every row, not that the best objective is zero. Unbounded means the formulation admits arbitrarily large objective improvement; inspect missing limits before interpreting it as unlimited commercial opportunity.

The retained Tideglass application derives a primal feasible plan and a matching dual upper bound. This studio does not replace its 30 x+50 y resource case with Cedar's project enumeration. Weak duality says a feasible dual pricing vector bounds every feasible primal plan under the stated sign/domain assumptions. Matching values certify continuous optimality. Complementary slackness links positive activities to tight coverage rows and positive resource prices to exhausted resources; a binding resource can still have zero multiplier. Degeneracy can yield nonunique certificates or unstable-looking basis labels without changing the actual optimum. A multiplier is local and conditional, not a permission to buy unlimited resources. Integer restrictions invalidate direct implementation of a fractional solution; a continuous relaxation supplies a bound, while enumeration or an integer method must establish the executable result.

A reproducible worksheet is an implementation, not an oracle

Create a visible assumptions area, a dated cash-flow row, separate funding/reserve rows, discount factors and an independently recomputed objective. Label positive receipts and negative payments consistently. For the simple Cedar cash stream, if B 2 contains -1000, C 2 and D 2 contain 600, and B 5 contains 10%, the expected spreadsheet expression is =NPV(B 5,C 2:D 2)+B 2. Period-zero cash is outside the function's discounted future-flow range. Expected IRR is =IRR(B 2:D 2), interpreted alongside the full cash pattern. These expressions are teaching specifications, not a claim of an executed Excel/device session in this review.

For a binary model, list each project's cost and NPV in separate columns and use a decision column. SUMPRODUCT of costs and decisions supplies funding use; SUMPRODUCT of values and decisions supplies the objective. Set the objective to maximize, the resource row to its actual limit and decision cells to binary. A linear solver choice suits linear continuous relationships; whole-choice restrictions require the corresponding discrete solve. Products of decision cells, discontinuous IF constructions or nonlinear response curves can change the mathematical task. Read the status and tolerances, then independently substitute the reported plan into every original equation and compare a small enumerated case. Save the model version and a rejected or infeasible plan's reason rather than overwriting its history.

Optional progressive practice

Foundation: explain Cedar's NPV, funding and payback without merging them

At 10%, the original project's NPV is 5000/121, while initial funding is 1000 and cash recovery occurs at year two if receipts occur only at year ends. The fractional 5/3-year simple payback requires an extra within-year receipt assumption. Adding 100 working capital increases initial funding to 1100; recovering it at year two reduces NPV by 2100/121, leaving 2900/121. A positive NPV cannot pay a date-zero bill with a later receipt.

Changed facts: the 100 working capital is not released within the two-year comparison horizon. Without another terminal recoverable value, its whole 100 remains an outflow, so NPV becomes -7100/121, approximately -58.6777. Investigate the actual terminal asset claim before assuming permanent loss or immediate recovery.

Application: choose a funded Cedar project combination and repair setup

Under the original 10 budget, A+C costs 10 and yields 8; B+C costs 9 and yields 7. A+B and all three fail funding. Choose A+C under the stipulated objective. A new omitted setup 2 for A raises A+C's use to 12 and lowers its corrected value to 6; it is infeasible regardless of that value. B+C remains the best funded plan at 7. Charging setup only in the objective would fail to repair the cash constraint.

Changed facts: the initial budget is genuinely raised to 12. A+C becomes funded and yields 6, but B+C still yields 7. A+B with setup costs 13 and remains infeasible. More money restores feasibility without restoring optimality. Compare the same alternatives under the same changed budget.

Transfer: audit a confident spreadsheet recommendation

Require the dated incremental cash definition, independent alternative, objective, resource rows, variable domains, rate conventions and actual authority. Check period-zero treatment, a deterministic small example, NPV profile when cash signs change, statewise funding and every reported constraint. A solver certificate establishes a result for the formulation; it does not verify customer demand, qualification, financing commitment or the omission of other obligations.

Changed facts: a returned IRR is 20% for -100,+230,-132 and the report treats it as a unique ranking. Demonstrate that 10% is another root, inspect NPV at the actual opportunity cost and compare relevant alternatives directly. Preserve the original output as incomplete; selecting the more attractive root is not validation.

Optional 20-point review rubric

Award 0–5 for each dimension: (1) coherent incremental cash timeline, claimant and funding; (2) NPV/IRR/payback/alternative-method assumptions and independent calculations; (3) correct continuous/integer/setup formulation and executable comparison; (4) reproducible worksheet checks, strong rival, changed facts and evidence limits. Full credit explains the reasoning; partial credit supplies a correct number with incomplete assumptions. Correct unavailable cash, double-counting, fractional commitments or invented source/market observations regardless of total points. This supports written study, not a degree, certification, actual investment clearance or demonstrated professional competence. Florida remains the state-law default; no current legal rule is asserted here.

Source and execution boundary

This is original teaching using standard valuation and optimization reasoning and synthetic Cedar inputs. No new publisher consultation, Excel execution or actual investment result is claimed for this studio. The original course source references and Tideglass methods remain preserved. The complete current onsite studios and original applications supply required instruction; external sources are optional provenance.

Apply the idea

Maximize 40x+30y subject to x+y≤10, x≤6, y≤8, x,y≥0.

The optimal continuous solution is: Explain your reasoning, then identify one changed fact that could alter the conclusion.

Read the worked reasoning

x=6, y=4. The first uses ten units with more of the higher-value x while respecting x≤6; objective is 360. In an independent response, state the given facts, identify the governing relationship, work through the calculation or comparison, and distinguish the conclusion from assumptions that still need evidence.

Check understanding

The optimal continuous solution is:

  1. x=2, y=8
    Feedback

    This alternative does not follow from the stated facts. The first uses ten units with more of the higher-value x while respecting x≤6; objective is 360.

  2. x=10, y=0
    Feedback

    This alternative overlooks the relevant mechanism. The first uses ten units with more of the higher-value x while respecting x≤6; objective is 360.

  3. x=6, y=4
    Feedback

    The first uses ten units with more of the higher-value x while respecting x≤6; objective is 360.

Further reading

All required original teaching, complete derivations and optional practice models are on LawfareGroup.com. External references are optional provenance or further reading. Florida is the state-law default; federal, historical and comparative contexts remain distinct. Independent human subject review and observed learner testing remain pending. Written business-analytics preparation establishes no actual legal opinion, technical clearance, licensing approval, funding authorization or observed professional competence.

My learning →