IA idea · Optimisation & linear programming
The cheapest healthy weekly shop: a linear programming diet problem
Research question
Using nutrition labels and supermarket prices for ten foods you actually eat, what is the cheapest weekly basket that meets chosen targets for energy, protein and fibre without exceeding a salt limit, and how realistic is it?
Adapt it: change the place, the data or the comparison until the question is yours.
Free: the A–E checklist an examiner uses, by email ↓
Why it makes a good exploration
The diet problem is one of the oldest uses of linear programming. Doing it with your own shopping basket produces a strange, cheap answer that is rich material for reflection: why would nobody eat it?
The mathematics you'll need
- Setting up an objective function and several linear constraints
- Linear programming with more than two variables (solver, explained on a two-food version by hand)
- Shadow prices: how much the cost rises if a constraint tightens
- Sensitivity of the solution to price changes
Course labels show where a technique sits; using maths from outside your course is fine if you explain it clearly and say it is new to you.
Where the data comes from
Read prices and nutrition labels for ten foods from a supermarket website or the shelf; record the date. Take nutrient targets from a public health source in your country and cite it.
- Desmos graphing calculator — Free graphing and regression (y₁ ~ ax₁ + b) — fit models to your data and show residuals.
Cite every source in a footnote where you use it and in your bibliography. Check the licence of any dataset you download.
A possible outline
- Choose foods and targets and justify them.
- Solve a two-food version graphically to show how the method works.
- Solve the full problem with a spreadsheet solver and explain what it is doing.
- Add realistic constraints (variety, maximum portions) and compare costs.
- Test how sensitive the basket is to price changes and reflect on what cost does not capture.
Pitfalls that cost marks
- Letting a solver produce an answer you can't explain.
- Using nutrient targets without a source.
- Presenting an absurd basket without discussing why it is absurd.
Showing personal engagement
- Use your own family's usual foods.
- Compare the optimal basket with what you actually buy.
- Explore how much a vegetarian constraint adds to the cost.
See Criterion C: personal engagement for what examiners look for.
Which course is it for?
| Course | Fit | Maths to lean on |
|---|---|---|
| AA SL | Good fit | Setting up an objective function and several linear constraints; Linear programming with more than two variables (solver, explained on a two-food version by hand) |
| AA HL | Not a natural fit | The mathematics is mainly from the AI course; at AA HL the exploration would need an AA-level approach (calculus, proof or probability theory) to reach the top of Criterion E. |
| AI SL | Good fit | Setting up an objective function and several linear constraints; Linear programming with more than two variables (solver, explained on a two-food version by hand) |
| AI HL | Good fit | Setting up an objective function and several linear constraints; Linear programming with more than two variables (solver, explained on a two-food version by hand) |
Level: Solid. Needs some independent work beyond class examples. See how the IA differs between AA and AI, SL and HL.
How this idea reaches the top bands
Personal engagement (C)
Optimise a decision that is really yours or your school's (a timetable, a budget, a delivery), gather the real constraints yourself, and say which ones you chose to ignore and why.
Reflection (D)
Compare the mathematical optimum with what people actually do, and test how sensitive the optimum is: which constraint, if relaxed a little, would change the answer most? For this idea, start with: letting a solver produce an answer you can't explain — say how it affects your answer.
Use of mathematics (E)
SL: An objective function and constraints set up from the context, solved correctly (graphically for two variables, or with differentiation), the optimum checked and interpreted, and any new method such as linear programming explained in your own words.
HL: Optimisation with two or more variables, a justified numerical search, a proof that the optimum lies at a vertex, or a sensitivity analysis with calculus, used because the problem needs it.
Criteria A and B (presentation and communication) work the same way for every idea: see the guides to Criterion A and Criterion B.
Taking it further
Compare the cost of meeting the same targets in two countries or two supermarkets, or add a taste-preference score as a second objective.
Extending it for HL
Add a second variable or a non-linear constraint, use a numerical search where calculus alone is not enough, and analyse how the optimum moves as a parameter changes.
See a complete IA, marked
Our annotated exemplar Is it cheaper to leave the heating on low overnight? A two-temperature model of my bedroom (AI HL) asks a different question, but shows how a complete optimisation exploration is structured and marked, with an examiner's comment on every criterion. Free excerpts and the full marking table are on its page.
Before you start: the checklist an examiner uses
Every check for Criteria A–E in a 4-page PDF, the mistakes that cost the most marks and a self-assessment grid. We'll email it with a short IA tip every few days, timed to your deadline if you give it. Free — no account, no payment.
While you wait for the email: read the free excerpt of a complete, annotated IA (Coupled cooling model (AI HL)) →
Turn this idea into your IA
Similar ideas
- How few staff can a café roster? An integer programming rotaAI SLAI HLAA SLSolid
- What speed minimises the total cost of a long drive?AA SLAI SLAA HLAI HLSolid
- What price maximises profit at our school bake sale?AA SLAI SLAA HLAI HLSolid
- What is the cheapest way to hire coaches for a school trip?AA SLAI SLAA HLAI HLAccessible
All optimisation ideas · AI SL ideas · AI HL ideas · AA SL ideas · All 239 IA ideas