Elastcal: Simple Cross-Platform App for Econ Students to Calculate Elasticity Coefficients

This BASIC code could be modified for pretty much any repetitive formula that crunches four numbers together. The only real pain is keeping track of parenthesis.

I’m sure similar code has been written thousands of times to do the exact same task, but I thought I’d share mine. As it stands, this calculates the “Elasticity Coefficient” of a good or service from one price/quantity point to another price/quantity point. Google can help one find websites that do these calculations, but Google is generally not allowed to be used on tests. The formula used here is the ‘midpoint formula’ of supply or demand elasticity.

Platforms this works on:

  • Your web browser.
  • TI-83 and perhaps other TI- calculators that use BASIC.
  • Android phones.
  • Probably a bunch of other things, too. If you port it to something else and it works, please let me know!

Microeconomics Formulas this works for:

  • Elasticity Coefficient of Demand
  • Elasticity Coefficient of Supply
  • Cross-Elasticity of Demand
  • Income-Elasticity of Demand

I just added a few lines so that it also spits out the slope of the line at that segment.

It just spits out the numbers, it is up to you to interpret it.


Click here to run elastcal in your web browser. Requires Java. I have not done extensive testing on this version, and it looks like crap. It should still work, though. If you run into errors, please inform me and include as many details as possible.

Once it pops up, click “run” to start.

Point your smartphone’s barcode scanner at the below image to be directed to the website if you wish to attempt to use it on your smartphone.



TI-83s are very crummy computers and BASIC itself is a very crummy language, but that’s the most advanced thing I’m allowed to use on tests in my Economics class.

elastcal asking for input on TI-83.

elastcal showing results on TI-83.

On your TI-83 press “PRGM” and arrow over to “NEW”. Give it a name, and you should then be faced with a screen containing a “:” in the upper left corner under “Program:”.

Enter these lines of code. For “Disp” or “Input”, you enter that by pressing “PRGM”, arrowing over to “I/O”, selecting either “Disp” or “Input” and hitting enter. Make sure you keep track of parenthesis!

Disp "ELASTCAL V1.0"
Disp "BY C.T. MASON"
Disp " "
Input "OLD QUANT-",A
Input "NEW QUANT-",B
Input "OLD PRICE-",C
Input "NEW PRICE-",D
Disp " "
Disp ((A-B)/((A+B)/2)/((C-D)/((C+D)/2))
Disp (D-C)/(B-A)


I did a simple port to BASIC as implemented on the $0 Android app called “BASIC! + SQL” that you can find in the Android Marketplace. All three methods below work equally well at installing elastcal, pick the one that seems easiest to you.
elastcal asking for old quantity.

elastcal asking for new price.

elastcal returning the elasticity coefficient.

Method 1 to install:

Install “BASIC! + SQL” on your Android phone from the Android Marketplace, plug your Android phone into your computer click here to download elastcal, and save it to “rfo-basic -> source” on your Android’s MicroSD chip.

Method 2 to install:

If you don’t want to do all that, point your Android phone’s barcode scanner at this, and install it, to get the BASIC interpreter app:
QR Code that refers Android Phones to the BASIC! + SQL app in the Android Marketplace
Point your barcode scanner at this for the app I wrote, and download it to the rfo-basic/source folder on your phone’s SD card:
QR Code that refers Android Phones to elastcal.bas

Method 3 to install:

Install the “BASIC! + SQL” app, and enter the source code manually:

print "elastcal v1.0"
print "by C.T. Mason"
print "Released to Public Domain"
input "old quant",a
input "new quant",b
input "old price",c
input "new price",d
print " "
print "elasticity coefficient:"
print ((a-b)/((a+b)/2)/((c-d)/((c+d)/2))
print "slope of that segment:"
print (d-c)/(b-a)

Putting the Icon on your Home Screen:

Long-tap on the home screen to bring up the “Add to Home Screen” dialog.

Select “Shortcuts”.

Select “Launcher Shortcuts” with the telescope icon.

For “Program File Name”, enter “elastcal.bas”.

Leave “Icon File Name” blank.

For “Shortcut Name” enter “elastcal”

Hit “OK”. Hit “OK” again.



Elastcal for cellular phones relies on a piece of Free and Open Source Software covered under the very ethical and reasonable terms of the GNU General Public License, and as such it is not compatible and will never be compatible with the Terms of Service of the Apple App Store unless Apple’s ToS are altered significantly.

The copyright license of the software that makes elastcal work is the GNU GPL v3, and it says this:

You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License.

The App Store’s various terms and conditions place significant restrictions on recipients’ rights that are not compatible with the section in bold above. If you would like to see elastcal and “BASIC! + SQL” available natively on Apple devices, please e-mail Steve Jobs ( sjobs@apple.com ) and ask him to modify the Terms of Service of the App Store to be more inclusive and open to people with different ethical codes than his own.

If iPhone and iPad web browsers are standards-compliant, then the web based version above should work for you. If not, there isn’t much I can do about the situation.

Elastcal: Simple Cross-Platform App for Econ Students to Calculate Elasticity Coefficients

One thought on “Elastcal: Simple Cross-Platform App for Econ Students to Calculate Elasticity Coefficients

  1. It doesn’t matter if you’re trying to save your
    relationship after cheating, stop a divorce, or you
    just want to get your ex back. If I knew how to
    bake cookies, I would do that and send over a care
    package but Im much better at telling jokes
    so I go there and entertain, shake hands and thank the men and women
    who serve our country. Well, it can easily be because the
    audience has been watching her in the TV for the past 6 years, but nevertheless, her FACTS are easy to remember and apply to everyone.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s