Simple Budget Constraint/Demand Curve Demonstrator

Neoclassical consumer theory is based on the assumption that, in making a comparison between different items of consumption, individuals have preferences which they use to rank the possible alternatives. Preferences are assumed not to be affected by the variables that are considered in the theory, such as prices and incomes.

Assume, for example, that a schoolboy who likes both crisps and chocolate is deciding how to allocate his pocket money between two possible combinations. In one shopping basket there are three packets of crisps and three bars of chocolate – this can be referred to as bundle A. In the other shopping basket there are just two packets of crisps and two bars of chocolate, referred to as bundle B. In choosing between these two bundles the individual, in this case the schoolboy, has to decide "Do I prefer bundle A to bundle B?"

If the schoolboy prefers bundle A to bundle B (we would expect that he would since he likes both crisps and chocolate), it follows that he ranks bundle A more highly than bundle B. In his mind, the bundles are arranged in a particular order, in which bundle A is ranked higher than bundle B.

The assumption that individuals use preferences to rank alternatives, and that these preferences are exogenous, provides the starting point for the neoclassical theory of consumption.

Below is a simple simulation that lets you test out these ideas. Use the sliders on the right to alter the prices of Crisps (Chocolate is assumed £1 per bar throughout) and the boy's spending money.

Indifference Map/Budget Constraint
Crisps Bought
Demand Curves
Crisps Bought
Advanced: Utility Function Settings
Start Again

With thanks to:

Here's the source code. Please note: this was written really fast and badly needs restructured (and commented)..