Skip to content
Tutorials Center
My learning

Topics

Lesson 20 of 37 ยท Consumers and Producers

The Budget Line and Optimal Choice

Draw a budget constraint from income and prices, see how it shifts, and find the bundle that maximizes utility, with runnable examples.

Every shopper faces the same fact: wants are large, money is not. The budget line (or budget constraint) shows every combination of two goods a consumer can afford when spending all income. Together with a description of the consumer's tastes, it tells us what bundle she will choose.

This lesson builds the budget line from income and prices, shows how changes in income or prices move it, and finds the best affordable bundle both by reasoning and by a brute-force search you can run.

Building the budget line

Suppose Kofi has an income of $60 for the week. He spends it on pizza at $6 each and movie tickets at $10 each. If x is the number of pizzas and y the number of tickets, he can afford any bundle where

6x + 10y โ‰ค 60

On the line itself, he spends exactly $60: 6x + 10y = 60.

  • All pizza: x = 60 / 6 = 10, y = 0.
  • All tickets: y = 60 / 10 = 6, x = 0.
  • The line joins these two points. Bundles inside the line are affordable but leave money unspent; bundles outside are unaffordable.

The slope of the budget line is -Px / Py = -6 / 10 = -0.6 if you put tickets on the vertical axis and pizzas on the horizontal: for each extra pizza, Kofi must give up 0.6 tickets. That is the opportunity cost of a pizza, measured in tickets.

Python List the affordable bundles

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that some points on the line have fractional tickets; in a real week Kofi must buy whole tickets, but economists often draw the line as smooth for convenience.

Shifts and pivots

  • Income rises to $90: both intercepts move out (15 pizzas or 9 tickets) and the line shifts parallel to the old one. The slope is unchanged because prices did not change.
  • Income falls: the line shifts inward in parallel.
  • The price of pizza doubles to $12: the pizza intercept falls from 10 to 5, but the ticket intercept stays at 6. The line pivots around the ticket axis and becomes steeper.
  • Both prices and income double: nothing changes; the line is exactly where it was. Only real purchasing power matters.

Preferences: indifference curves

An indifference curve joins all bundles that give the same total utility. Kofi is equally happy at every point on one curve. Curves further from the origin mean higher utility. They slope downward (to keep utility the same, more of one good must offset less of the other) and are bowed toward the origin, because of diminishing marginal utility.

The slope of an indifference curve is the marginal rate of substitution (MRS): how many tickets Kofi would swap for one more pizza and stay equally happy. It equals the ratio of marginal utilities: MRS = MUx / MUy.

The best bundle

Kofi wants the highest indifference curve he can reach with his budget. That is the curve that just touches the budget line without crossing it. At that tangent point the two slopes match:

MRS = Px / Py, which is the same as MUx / Px = MUy / Py

Last lesson's equal-marginal-utility-per-dollar rule is this same condition. The market's trade-off (price ratio) equals Kofi's own trade-off (MRS), so he cannot gain by rearranging.

Let's use a specific utility function as an example: U = โˆš(x ยท y) (the square root of pizzas times tickets). For this function, the optimal bundle spends half of income on each good. With $60, that is $30 on pizza and $30 on tickets, so x = 30 / 6 = 5 pizzas and y = 30 / 10 = 3 tickets. Utility is โˆš15 โ‰ˆ 3.87.

Let's confirm with a search over every whole-number bundle that is affordable.

Python Brute-force search for the best bundle

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Real utility functions are not known. The point of the model is the logic: at the optimum, the marginal benefit per dollar is the same everywhere, and the budget is used up.

What happens when income or prices change

Change one parameter and run the optimizer again. This is how economists derive demand curves: hold income and the other price fixed, vary one price, and record the chosen quantity.

Python Derive demand for pizza from the model

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

As the price rises, pizzas bought fall: the demand curve slopes down. The program rounds down to whole goods, so with this utility function the pattern is only roughly smooth.

Income and substitution effects

When the price of pizza falls, two things happen. Pizza is relatively cheaper than tickets, so Kofi substitutes toward pizza (the substitution effect). Also, he can afford more overall, as if his income had risen (the income effect). For a normal good both push the quantity up. For an inferior good (for example instant noodles for a student), the income effect works the other way, but the substitution effect almost always wins.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Income is $80, a book costs $20 and a meal costs $10. What is the maximum number of books affordable?

    All income on books: 80 / 20 = 4 books.
  2. 2. The price of one good rises while income and the other price stay the same. The budget line

    One intercept moves and the other stays fixed, so the line pivots and its slope (the price ratio) changes.
  3. 3. At the utility-maximizing bundle, which condition holds?

    The last dollar spent must give equal extra utility on both goods, equivalently MRS = Px / Py.
  4. 4. What happens to the budget line if all prices and income double?

    Both intercepts and the slope are unchanged: income / price stays the same, and the price ratio stays the same.

Summary

  • The budget line shows affordable bundles; its slope is -Px / Py, the opportunity cost of one good in terms of the other.
  • Income changes shift the line in parallel; a price change pivots it.
  • Indifference curves show equal-utility bundles; their slope is the MRS.
  • The optimum is where an indifference curve touches the budget line: MRS = Px / Py.
  • Repeating the optimization at different prices traces out a demand curve.

Next: Production and Diminishing Returns