Updated · By Pete Bromfield, IB examiner

IA idea · Optimisation & linear programming

The cheapest healthy weekly shop: a linear programming diet problem

AI SLAI HLAA SL Solid Also in: Health & biology, Finance

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.

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

  1. Choose foods and targets and justify them.
  2. Solve a two-food version graphically to show how the method works.
  3. Solve the full problem with a spreadsheet solver and explain what it is doing.
  4. Add realistic constraints (variety, maximum portions) and compare costs.
  5. 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?

CourseFitMaths to lean on
AA SLGood fitSetting 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 HLNot a natural fitThe 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 SLGood fitSetting 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 HLGood fitSetting 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.

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.

Turn this idea into your IA

Similar ideas

All optimisation ideas · AI SL ideas · AI HL ideas · AA SL ideas · All 239 IA ideas