Lunch Order Problem: Solving a System of Linear Equations

Systems of Equations 9th-10th Grade
PROBLEM
You have just started a full time summer job in an office. It's your first day on the job and the boss has sent you out to buy lunch for the 23 people who work in the office. Everyone wants either one hotdog or one hamburger for lunch. You see that hamburgers cost $1.50 each and hot dogs cost $1.10 each tax included. You also know that your boss gave you $32.10. Assume $32.10 is the exact amount needed for your purchase. Figure out, in any way you can, how many hot dogs and how many hamburgers you should order. Is your combination the only combination possible? Why or why not?

What This Problem Teaches

  • System of equations setup: Translating real-world constraints into mathematical equations
  • Linear algebra fundamentals: Understanding how two independent constraints create exactly one solution
  • Elimination method: Strategic manipulation to remove variables systematically
  • Solution uniqueness: Recognizing when a system has exactly one answer versus infinitely many
  • Real-world validation: Checking that mathematical answers make practical sense

Visualizing the Constraints

you have just started a full time summer job in an office. its your first day on the job and the boss has sent you...

This table shows our constraints clearly: we need exactly 23 items total, and they must cost exactly $32.10. With two constraints and two unknowns, we have a system that should yield exactly one solution.

Solution: Method 1 — The Elimination Approach

Step 1 — Set up the system of equations

Let's define our variables clearly: b = number of hamburgers, h = number of hot dogs. Our constraints give us two equations:

Equation (1): b + h = 23   (total people)
Equation (2): 1.50b + 1.10h = 32.10   (total cost)

Step 2 — Eliminate one variable using multiplication

To eliminate h, I'll multiply equation (1) by 1.10 so that both equations have 1.10h:

1.10 × (b + h) = 1.10 × 23
Equation (1a): 1.10b + 1.10h = 25.30

Step 3 — Subtract to eliminate h

Now I'll subtract equation (1a) from equation (2):

(1.50b + 1.10h) - (1.10b + 1.10h) = 32.10 - 25.30
0.40b = 6.80

Step 4 — Solve for b

Dividing both sides by 0.40:

b = 6.80 ÷ 0.40 = 17

Step 5 — Find h using substitution

Substituting b = 17 back into equation (1):

17 + h = 23
h = 6
Answer: Order 17 hamburgers and 6 hot dogs

Solution: Method 2 — The Substitution Strategy

Step 1 — Express one variable in terms of the other

From equation (1), b + h = 23, I can solve for h:

h = 23 - b

Step 2 — Substitute into the cost equation

Replace h in equation (2) with (23 - b):

1.50b + 1.10(23 - b) = 32.10

Step 3 — Distribute and simplify

1.50b + 25.30 - 1.10b = 32.10
0.40b + 25.30 = 32.10
0.40b = 6.80

Step 4 — Solve for both variables

b = 17
h = 23 - 17 = 6

Both methods arrive at the same answer, confirming our solution.

Verification

Let's check both constraints with our answer: 17 hamburgers and 6 hot dogs.

Check the total count

17 + 6 = 23 people ✓

Check the total cost

17 × $1.50 + 6 × $1.10 = $25.50 + $6.60 = $32.10 ✓

Both constraints are satisfied perfectly. The mathematical solution matches the real-world requirements.

Is This the Only Solution?

Yes, this combination is unique. Here's why:

Mathematical principle: Two non-parallel lines in a plane intersect at exactly one point. Our system represents two lines—one for the people constraint and one for the cost constraint. Since they have different slopes, they intersect at exactly one point: (17, 6).

To see this graphically, imagine plotting all possible combinations:

  • The line b + h = 23 contains all combinations that feed exactly 23 people
  • The line 1.50b + 1.10h = 32.10 contains all combinations that cost exactly $32.10
  • Only one point lies on both lines simultaneously

Why uniqueness matters: In real-world problems like this, having exactly one solution is ideal—it means there's no ambiguity about what to order. If there were multiple solutions, you'd need additional criteria to choose between them.

Common Pitfalls

Mistake 1: Setting up equations incorrectly

✗ Wrong: Writing 1.50 + 1.10 = 32.10 for the cost equation

Why it's wrong: This just adds the unit prices, ignoring the quantities. You need to multiply each price by its quantity: 1.50b + 1.10h = 32.10.

Mistake 2: Decimal arithmetic errors

✗ Wrong: Calculating 6.80 ÷ 0.40 = 1.7 instead of 17

Why it's wrong: When dividing decimals, be extra careful with place values. 6.80 ÷ 0.40 = 680 ÷ 40 = 17.

Mistake 3: Forgetting to answer the uniqueness question

✗ Incomplete: Finding the numbers but not explaining why the solution is unique

Why it matters: The problem specifically asks about uniqueness. Understanding that two independent linear constraints create exactly one solution is a key mathematical insight.

The Math Beneath the Surface

This problem demonstrates a fundamental principle: n independent linear equations in n unknowns typically have exactly one solution.

General form:
a₁x + b₁y = c₁
a₂x + b₂y = c₂

Solution exists and is unique when: a₁b₂ - a₂b₁ ≠ 0
(The coefficient matrix has non-zero determinant)

In our problem:

  • Equation 1: 1·b + 1·h = 23 (coefficients: 1, 1)
  • Equation 2: 1.50·b + 1.10·h = 32.10 (coefficients: 1.50, 1.10)
  • Determinant: (1)(1.10) - (1)(1.50) = -0.40 ≠ 0 ✓

Since the determinant is non-zero, we're guaranteed exactly one solution. This mathematical check confirms what we found algebraically.

Why This Matters Beyond School

This type of constraint satisfaction appears constantly in real situations:

  • Resource allocation: Hospitals determining staffing levels with budget and patient care constraints
  • Manufacturing: Factories optimizing production schedules with material and time limitations
  • Project management: Balancing team size, budget, and timeline requirements
  • Nutrition planning: Dietitians creating meal plans that meet caloric and nutritional targets

The systematic approach you've learned—identify constraints, set up equations, solve, and verify—applies directly to these professional contexts.

What-If Problems

1
Budget Shortfall
What if the boss only gave you $30.00, but you still need to feed all 23 people with the same menu and prices? Find a combination that gets as close to $30.00 as possible without going over. How much money would be left?
Step 1 — Set up the modified constraint system

We still need b + h = 23, but now we want to maximize cost without exceeding $30.00.

Step 2 — Express cost in terms of one variable

Since h = 23 - b, the cost becomes: 1.50b + 1.10(23 - b) = 1.50b + 25.30 - 1.10b = 0.40b + 25.30

Step 3 — Find maximum hamburgers within budget

We need: 0.40b + 25.30 ≤ 30.00
0.40b ≤ 4.70
b ≤ 11.75
Since we need whole hamburgers: b = 11

Step 4 — Calculate hot dogs and verify cost

h = 23 - 11 = 12
Cost: 11 × $1.50 + 12 × $1.10 = $16.50 + $13.20 = $29.70

Step 5 — Final answer

Order 11 hamburgers and 12 hot dogs for $29.70, leaving $0.30 unused.

2
Price Reversal
Now hamburgers cost $1.10 and hot dogs cost $1.50 (the prices are swapped). You still have 23 people and $32.10. How many of each should you order now? Is the solution unique?
Step 1 — Set up the new system

b + h = 23 (people constraint)
1.10b + 1.50h = 32.10 (cost constraint with swapped prices)

Step 2 — Use elimination method

Multiply equation 1 by 1.10: 1.10b + 1.10h = 25.30
Subtract from equation 2: (1.10b + 1.50h) - (1.10b + 1.10h) = 32.10 - 25.30
0.40h = 6.80

Step 3 — Solve for both variables

h = 6.80 ÷ 0.40 = 17
b = 23 - 17 = 6

Step 4 — Verify the solution

Count: 6 + 17 = 23 ✓
Cost: 6 × $1.10 + 17 × $1.50 = $6.60 + $25.50 = $32.10 ✓

Step 5 — Answer uniqueness question

Order 6 hamburgers and 17 hot dogs. Yes, the solution is still unique—we have the same mathematical structure (2 independent equations, 2 unknowns), just with swapped coefficients.

3
The Boss Joins In
As you're about to order, your boss says, "Wait, I'm eating too!" So now there are 24 people. The total money is still $32.10. Is it possible to buy 24 items (each person gets one item) with the exact money? Why or why not?
Step 1 — Set up the new system

b + h = 24 (people constraint)
1.50b + 1.10h = 32.10 (same budget)

Step 2 — Use elimination to solve

Multiply equation 1 by 1.10: 1.10b + 1.10h = 26.40
Subtract from equation 2: 0.40b = 32.10 - 26.40 = 5.70
b = 5.70 ÷ 0.40 = 14.25

Step 3 — Analyze the result

We get b = 14.25 hamburgers, which means h = 24 - 14.25 = 9.75 hot dogs.

Step 4 — Check if this makes sense

You can't order 14.25 hamburgers or 9.75 hot dogs—you need whole numbers of items!

Step 5 — Conclusion

No, it's impossible to feed exactly 24 people with exactly $32.10 using these prices. The system has a solution mathematically, but it requires fractional food items, which isn't realistic.

4
Working Backwards
You need 23 items total. You know hamburgers cost $0.40 more than hot dogs. The total cost is $32.10, and you bought 17 hamburgers and 6 hot dogs. What was the price of each item? (This reverses the original problem—given the quantities, find the prices.)
Step 1 — Define variables for prices

Let p = price of hot dogs, then hamburgers cost p + 0.40

Step 2 — Set up the cost equation

Using the given quantities (17 hamburgers, 6 hot dogs):
17(p + 0.40) + 6p = 32.10

Step 3 — Solve for hot dog price

17p + 6.80 + 6p = 32.10
23p = 32.10 - 6.80 = 25.30
p = 25.30 ÷ 23 = 1.10

Step 4 — Find hamburger price

Hamburger price = 1.10 + 0.40 = 1.50

Step 5 — Verify

Cost check: 17 × $1.50 + 6 × $1.10 = $25.50 + $6.60 = $32.10 ✓
Hot dogs cost $1.10, hamburgers cost $1.50—exactly the original prices!

Frequently Asked Questions

Set up one equation for the total quantity and another for the total cost. In this example, b + h = 23 people and 1.50b + 1.10h = 32.10 dollars. Use elimination or substitution to solve for both variables.
Two non-parallel lines in a plane intersect at exactly one point. In this problem, the quantity constraint (b + h = 23) and cost constraint (1.50b + 1.10h = 32.10) are independent linear equations that intersect at the unique solution: 17 hamburgers and 6 hot dogs.
The number of independent constraints determines uniqueness. Here we have exactly two constraints (total people and exact budget) for two unknowns (hamburgers and hot dogs), creating a unique solution. If we had only one constraint, there would be multiple valid combinations.
NJ
Neven Jurkovic, PhD

Professor of Computer Science, Palo Alto College, Alamo Colleges District, San Antonio, TX

Developer of Algebrator

Contact

This solution was prepared with AI assistance and reviewed by Dr. Jurkovic for mathematical accuracy and pedagogical clarity.

2026-10-26