Last active
August 29, 2015 14:18
-
-
Save bondarewicz/fd6864c18397874aa219 to your computer and use it in GitHub Desktop.
price elasticity of demand
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://en.wikipedia.org/wiki/Price_elasticity_of_demand | |
//In general, the demand for a good is said to be inelastic (or relatively inelastic) when the PED is less than one (in absolute value): | |
//that is, changes in price have a relatively small effect on the quantity of the good demanded. | |
//The demand for a good is said to be elastic (or relatively elastic) when its PED is greater than one (in absolute value): | |
//that is, changes in price have a relatively large effect on the quantity of a good demanded. | |
//Revenue is maximized when price is set so that the PED is exactly one. | |
<?php | |
//original_quantity | |
$oq = 50; | |
//new quantity | |
$nq = 30; | |
//original price | |
$op = 20; | |
//new price | |
$np = 25; | |
//Change in Quantity = ((New Quantity - Original Quantity) / Original Quantity) | |
$chiq = ($nq - $oq) / $oq; | |
//Change in Price = ((New Price - Original Price) / Original Price) | |
$chip = ($np - $op) / $op; | |
//Price Elasticity (PED or Ed) = Change in Quantity / Change in Price Where, | |
$ped = $chiq / $chip; | |
print abs($ped); // 1.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment