
Lahari Sengupta
Nov 17, 2026
A. Introduction
We make hundreds of decisions every day. We never imagine turning those everyday decisions into Greek letters, incomprehensible symbols, and unnecessarily scary equations. In fact, we rarely think of these decision-making processes as mathematical problems at all. And perhaps that is exactly what keeps our lives spontaneous. But believe me, sometimes, math can be fun too if you use it properly. Mathematics can make those everyday decision-making processes more interesting.
Once you learn how to mathematically model real-life problems, you may be surprised to find that almost any daily situation can be modeled in some way.
Mathematically does not necessarily mean Greek letters and scary equations. It means structure. It means clarity. It means identifying what matters and setting clear priorities. It reminds me of a beautiful psychological puzzle that exists in many forms. One version goes like this:
“All of these things are happening at once.
Your baby is crying and needs you
Your phone is ringing, you are expecting an important phone call, and you have no
voicemail available
The doorbell is ringing
There are dry clothes on the line outside and rain starts
The water faucet in the kitchen is running
You are alone in the home with the baby. You are not a superhuman, you have to do things sequentially. What will you do first? Or what will you do next?”
The amusing thing is there is no single correct answer to this puzzle. It depends on how you prioritize things: what bothers you the most, what matters the most, and what you are willing to postpone. Every time I get confused by this kind of trade-off, I find it useful to think mathematically. Not necessarily by writing equations, but by creating some structure and asking: What matters the most?
Mathematically, here optimization problems step into our lives. What matters most becomes the basis of our objective function — a mathematical way of expressing what we want to maximize or minimize. And how do we optimize it? By choosing our decisions while respecting the limitations imposed on us. I will come back to mathematics later. Let’s first imagine a situation.
B. An Everyday Situation -> An Optimization Problem
Suppose, after work, you have a list of groceries to buy. But you have a limited budget and you can carry only a limited weight. You also know how urgent each item is. Like, you don’t even have enough coffee for one cup, and you definitely need it tomorrow morning. So coffee is one of the most urgent items on your list. But you prefer your coffee with milk, and you don’t have any milk either. That means you need to buy milk as well. However, to respect your budget and carrying capacity, you cannot necessarily buy everything on your list. How do you choose what to buy? Usually, our brain uses intuition in such a case. It grabs the most"urgent" thing first, then the next, then the next, until the capacity is full or the wallet is empty.
And that sounds reasonable. But is it actually the best way to make the decision? Let’s make up some numbers and guess what our brain does in this case:

Limitations:
Total money you can spend: €18
Maximum weight you can carry: 3kg
Maximum one unit of each item is allowed to buy: buying an item means buying exactly one unit of it, in the size listed in the table. For example, buying coffee means buying one 0.5 kg pack, not more.
If buy coffee, need to buy milk.
Objective: maximize the total urgency score of the items you buy
1. Solution using intuition/guess:
Strategy: Most urgency = fill-up first
Detergent (9) + (Coffee (8) + Milk (2))
Urgency score = 9+8+2 = 19
Cost = 7+6+1 = €14
Weight = 2+0.5+0.5 = 3kg
Maximum weight reached, so, no more item can be bought. So, you end up with detergent, coffee, and milk. You still have €4 in hand but not usable.
2. A Better Solution:
After coming back home, you might start thinking mathematically and do a what-if analysis of other combinations. And quite easily, you can find a combination that uses the available money and carrying capacity more effectively while giving you a higher cumulative urgency score.
(Coffee (8) + Milk (2)) + Chicken (7) + Bread (6)
Urgency = 8+2+7+6 = 23
Cost = 6+1+5+2 = €14
Weight = 0.5+0.5+1+0.2 = 2.2kg
The first strategy is called Greedy approach in the optimization domain.
Building a combination of items step by step by picking the most urgent item first. It doesn’t give the best result in this case. But does this mean greedy is always a bad idea? Not at all.
Some well-known optimization problems have a structure that makes greedy provably optimal. In our grocery case, greedy can also work if the numbers change, for example if the detergent were a small 0.5 kg pack for €2.
Detergent (9) + (coffee (8) + milk (2)) + chicken (7) + bread (6)
Cost = 2+6+1+5+2 = €16 = 18
Weight = 0.5+0.5+0.5+1+0.2 = 2.7kg < 3
Urgency = 9+ 8+2+7+6= 32 (hugely improved)
In this example, greedy happens to find the optimal solution, that is not a guarantee of the greedy approach. That is the key point: we can't trust a strategy just because it looks intuitive.
We need to know something about the mathematical structure of the problem that makes the greedy choice safe.
So, what should we do to solve such a problem? Try out all possible combinations?
That is also another approach called Brute-force search.
C. Combinatorial Structure
We assume every item is a binary decision here: yes or no; whether to buy or not. We have 6 items with two possibilities of each item: buy it or do not buy it. We are not choosing items one by one. We are choosing a combination of items. So, for 6 items, total number of combinations should be = 26 = 64.
The brute-force technique asks us to check all 64 combinations and find the one with the highest urgency score among the feasible combinations — the combinations that satisfy all our constraints. For six items, that is easy. But now imagine 20, 50, or 100 items. The number of possible combinations grows exponentially: 220 250 2100
Figure 1 shows 64 possible combinations of items. Each row represents one possible combination of items. A coloured cell means that the item is selected, while a white cell means that the item is not selected. Also, it is important to notice that not all 64 rows are feasible - satisfy our budget, weight, and coffee–milk constraints.
The red rows are infeasible combinations, meaning they violate at least one of our constraints. The green rows are feasible combinations. Among the feasible combinations (green ones), we are looking for the one with the highest total urgency score. Our greedy choice is one of these feasible points, but the optimal solution is another point with a higher urgency score.

Figure 1: 64 combinatons of our grocery problem
Clearly, we cannot expect a human to simply list and check every possible combination.
This is the combinatorial structure hiding underneath our grocery list. The challenge is not just deciding whether to buy an item. It is deciding which combination of decisions works best together.
This is where optimization solvers come in. We need to structure the problem mathematically, yes, with some equations and use computers to solve them. Let’s make the equations for this problem.
D. Mathematical Formulation
Here our decisions are simple; should we buy item x or not. We can represent each of these decisions using a binary decision variable: a variable that can take only two values, 0 or 1:
a. If coffee to buy or not → 𝑥 = 0 𝑜𝑟 1; when 𝑥 is the coffee buying decision variable
b. If chicken to buy or not → 𝑥 = 0 𝑜𝑟 1; when 𝑥 is the chicken buying decision variable
… and so on
Hence, in general terms,
Decision variables: xᵢ ∈ {0,1}; ∀ i = 1, …, all items
where xᵢ = 1 means we buy item i, and xᵢ = 0 means we don’t buy item i
Objective function: z = ∑ᵢ uᵢ · xᵢ; where uᵢ = urgency score of item i
Problem:
maximize z
subject to:
Limited budget:
∑ᵢ cᵢ · xᵢ ≤ Total allowed cost; where cᵢ = cost of item iLimited carrying capacity:
∑ᵢ wᵢ · xᵢ ≤ Total allowed weight; where wᵢ = weight of item iMust buy milk if buy coffee:
xᵢ ≤ xⱼ; where i = coffee, j = milkMaximum one unit of each item is allowed to buy:
It is already guaranteed by our binary decision variables xᵢ ∈ {0,1}; ∀ i
We have now transformed a very ordinary shopping decision into a mathematical optimization problem. There are several algorithms or solvers to solve this mathematical model for a large dataset. Solvers such as the open-source Highs, CBC (Coin-OR branch and cut), or commercial ones like Gurobi, FICO Xpress, and CPLEX, can solve such models even for very large lists.
They use methods such as branch-and-bound to explore the search space intelligently, often eliminating large groups of combinations without checking each one individually.
E. Conclusion
Our grocery trip taught us simple things. Definitely intuition is a good start, but it doesn’t guarantee the best solution always. Grabbing the most urgent item first feels natural, and it even worked in our tweaked example. But for the original example, greedy strategy gave us a total urgency score of 19, when a combination worth 23 urgency score was available.
The difficulty is hidden in the combinations. With 6 items there are 64 possible combinations, which is a manageable number to check. With even 12 items there are immensely large number of combinations to check manually.
Structure makes the problem solvable. Once we wrote down what matters (urgency), what limits us (money and weight) and what depends on what (coffee needs milk), the problem became something a computer can solve for us, even for a very large list.
Optimization isn't about replacing common sense with mathematics. It's about knowing when common sense stops being enough. So next time your cart feels "obviously right", ask yourself: is it optimal, or just familiar?
I have made a simple puzzle in a webapp here to test your understanding.
More Articles For You

The difference between academia and industry?
Dr. Andreas Emil Feldmann
(Academia vs Industry)


What's on the Menu? Solving the Product Mix Problem for Hydra's Pastry Pop-Up
Chahira Mourad
(Applied Scientist)


From Flour to Fortune: The Dual Role of Resources in Optimization
Chahira Mourad
(Mathematics in Real Life)


Pastries with a Plan: Where Will Hydra Open Her Bakery?
Chahira Mourad
(Mathematics in Real Life)
