Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

2.1 Systems of Linear Equations

The question

Reading Example 2.1 (the production-plan model) with a background of SPM/additional mathematics, ACCA and a hands-on Oracle MRP implementation:

The question (in substance), 2026-09-29:

These are from Mathematics for Machine Learning. Having studied SPM math and additional math, ACCA and implemented Oracle MRP, this production plan doesn’t make sense. Is it listing out each individual resource?

The instinct to push back is correct, and the mismatch is structural rather than a misreading of the algebra.

Screenshots

The two pages the question refers to, from Section 2.1 “Systems of Linear Equations”.

Answer

Short answer: yes — but only in the accounting sense, and that is exactly why it does not line up with MRP.

Attention to the indices is what makes (2.3) readable:

  • runs over resources (steel, machine hours, labour, …)
  • runs over products
  • = units of resource needed for one unit of product
  • = the unknown decision variable: how many units of product to make
  • = units of resource available

Each row is one resource’s conservation statement:

Each column is one product’s recipe — its resource-consumption vector . So is with rows = resources, columns = products, and is the -dimensional resource-availability vector.

Two things the framing leaves loose:

  1. “Optimal” does no work in (2.3). The system is only the feasibility constraint set: consume exactly what is available, leaving nothing over. Optimality needs a separate objective (max profit, min cost), which is where linear programming enters. (2.3) alone just says “don’t waste material.”
  2. The row/column reading is the whole content. Reading a row gives one resource’s demand ledger; reading a column gives one product’s bill of materials.

Why only two indices. is the simplest version of the model. It assumes every unit of resource is interchangeable regardless of when it is bought or where it is stored, and every unit of product is identical regardless of which factory makes it or which customer buys it. Drop either assumption and one index is not enough — resource in factory during week for customer is , and stops being a matrix. It becomes a tensor, which is exactly what deep-learning frameworks manipulate (and part of why the book’s 2-D framing is deliberately a simplification). The general structure survives — resources still balance against supply — but the object is no longer a matrix and the algebra is no longer matrix multiplication.

In practice

The gap between (2.3) and a real MRP run is the point of the example, not a defect in it:

Textbook (2.3)Oracle MRP / ERP
Structureone flat level, all products independentmulti-level BOM explosion, parent → component
Coefficientsfixed for the whole problemper-item, per-BOM quantity-per-assembly, often phantom/optional
Timea single static periodtime-phased buckets, lead times, offsets
Quantitiesany real number order quantities, lot-sizing rules, sometimes integer
Resourcean equation to satisfy exactlya capacity check you may violate (overload/underload)

In MRP terms, is roughly the quantity-per-assembly, is roughly available supply/capacity, and solving is a single-level, infinite-capacity, exact-satisfaction feasibility question. Oracle MRP instead performs recursive netting (gross requirement → on-hand → scheduled receipts → net requirement → planned orders), which is why the example feels incomplete: it captures the arithmetic of resource consumption while dropping all the machinery MRP adds.

The most consequential difference is the last row of that table. (2.3) demands that every resource be consumed exactly. Real planning almost never wants that — it wants to stay feasible under capacity and then optimise. That distinction is what makes §2.3’s free-variable machinery, and later the whole optimisation half of the book, necessary.

Worked example

Two resources, three products. Let resource 1 be plastic and resource 2 be wire:

so each unit of product 1 needs 2 plastic and 1 wire, and so on. Here but there are unknowns, so

The null space is spanned by the exact integer vector

which is easily checked by hand. So the minimum-norm solution is not the only plan: every

is an exact solution of , e.g.

plan

All four consume exactly 100 plastic and 80 wire. No MRP run would ever return a one-parameter family — it returns one plan. That single fact is the crux of the intuition, and it is the question §2.3 answers (the choice is the free variable).

The freedom can be larger. Drop one independent constraint by making resource 2’s row a multiple of resource 1’s:

Now , so and the solution set is a plane through . In general the number of free directions is — this is the single most useful fact for reading the rest of the chapter, and §2.3 shows what the book does with it.

Every number in this section is reproduced by scripts/explore_example_2_1.py.

Corrections and additions

2026-09-30 — the earlier “correction” below was itself wrong; this page now carries the correct result

This page previously argued that because , the matrix has “full row rank” and therefore a trivial null space, making the unique solution. That is false. Full row rank does not imply a unique solution when . With and , , and the null space is — verified above in exact integer arithmetic. The original claim of infinitely many exact plans was right; the correction that retracted it was wrong, and has been removed. The lesson recorded here is the real one: a null-space claim must be checked against , not against whether the rows are independent.

References

  • Deisenroth, Faisal & Ong, Mathematics for Machine Learning, Section 2.1 (“Systems of Linear Equations”), Example 2.1 and Equations (2.2)–(2.3). See References for the full citation and link.
  • Reproducibility script: scripts/explore_example_2_1.py.