Price Elasticity of Demand (PED) measures how much the quantity demanded of a good responds to a change in the price of that good. It is a fundamental concept in economics used to understand consumer behavior and optimize pricing strategies.
The Midpoint Formula
This calculator uses the Midpoint Method (arc elasticity), which provides the same elasticity value regardless of whether the price increases or decreases. The formula is:
Since the absolute value (1.57) is greater than 1, the demand for lattes in this scenario is elastic.
function calculatePED() {
var p1 = parseFloat(document.getElementById('price1').value);
var p2 = parseFloat(document.getElementById('price2').value);
var q1 = parseFloat(document.getElementById('qty1').value);
var q2 = parseFloat(document.getElementById('qty2').value);
var resultDiv = document.getElementById('ped-result');
var valSpan = document.getElementById('ped-value');
var typeSpan = document.getElementById('ped-type');
var expSpan = document.getElementById('ped-explanation');
if (isNaN(p1) || isNaN(p2) || isNaN(q1) || isNaN(q2) || p1 <= 0 || q1 1) {
type = "Elastic";
explanation = "The demand is elastic. This means consumers are sensitive to price changes. A price increase will likely lead to a decrease in total revenue, while a price decrease may increase total revenue.";
} else if (absPed 0) {
type = "Inelastic";
explanation = "The demand is inelastic. Consumers are not very sensitive to price changes. Raising prices will likely increase total revenue because the drop in quantity sold is proportionally smaller than the price increase.";
} else if (absPed === 1) {
type = "Unitary Elastic";
explanation = "The demand is unitary elastic. Any change in price is offset by an exactly proportional change in quantity demanded, leaving total revenue unchanged.";
} else if (absPed === 0) {
type = "Perfectly Inelastic";
explanation = "Demand is perfectly inelastic. Changes in price have no effect on the quantity demanded.";
} else if (!isFinite(absPed)) {
type = "Perfectly Elastic";
explanation = "Demand is perfectly elastic. At a specific price, consumers will buy any amount, but if the price rises slightly, demand drops to zero.";
}
typeSpan.innerHTML = type;
expSpan.innerHTML = explanation;
}