to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ var stIsIE = /*@cc_on!@*/false; sorttable = { init: function() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); if (!document.createElement || !document.getElementsByTagName) return; sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); }, makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and // put the first table row in it. the = document.createElement('thead'); the.appendChild(table.rows[0]); table.insertBefore(the,table.firstChild); } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; if (table.tHead.rows.length != 1) return; // can't cope with two header rows // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, // for backwards compatibility, move them to tfoot (creating it if needed). sortbottomrows = []; for (var i=0; i
Arnold Kling has been doing arithmetic in looking at the cost of risk versus it's benefit as it affects health care decisions, and when there's math to be done, we here at Political Calculations(TM) believe that there ought to be a tool to do it!
The tool below is based on the math described in Arnold's look at Costs, Benefits and Health Care, excerpted below:
Suppose that a medical test costs $1000, and 98 percent of the time it fails to turn up anything that would affect treatment. The other 2 percent of the time, it results in a treatment choice that extends life by 5 years. How much does a year of life have to be worth in order for the test to have an expected value that exceeds its cost?
The answer is that the "expected number of life-years saved" is .02 times 5, or one-tenth of one year. If one year is worth more than $10,000, then one-tenth of one year is worth more than $1000, so that the test is worthwhile.
And now, here's the tool for performing the math, which I've tried to make more generally applicable for more decisions than just the health care problem above that provides its default values:
Users of this calculator should pay close attention to the limitations inherent in the assumptions behind the math. For instance, can you really know how much a year of life is worth? Or have you fully accounted for the costs of the test - labor, materials, overhead, etc.? There's a lot of stuff that goes into the numbers you enter, and the usefulness of the tool will be proportionate to their quality....
It does seem to me though that this tool is ideal for figuring out whether or not you should play the lottery. With that in mind, here is a table of odds for the Powerball lottery:
Powerball Lottery Odds | ||
---|---|---|
Matching Balls | Prize Amount | Odds |
5 + Powerball | Grand Prize | 1 in 120,526,770.00 |
5 | $100,000 | 1 in 2,939,677.32 |
4 + Powerball | $5,000 | 1 in 502,194.88 |
4 | $100 | 1 in 12,248.66 |
3 + Powerball | $100 | 1 in 10,685.00 |
3 | $7 | 1 in 260.61 |
2 + Powerball | $7 | 1 in 696.85 |
1 + Powerball | $4 | 1 in 123.88 |
1 + Powerball | $3 | 1 in 70.39 |
The overall odds of winning a prize are 1 in 36.06. |
For reference, here's an example of how to enter these odds in the tool above:
"1 in 12,248.66" should be entered as: "100/12248.66" |
This simple formula will convert the odds entered this way into the percentage format used by the calculator. For prizes other than the grand prize, enter "1" for the time that the benefit will be enjoyed, and the amount of the prize for the value of the benefit per year. For the grand prize, enter the number of years that the prize will be paid out for time, along with the amount that will be paid out each year to add up to the grand prize. Good luck!
Labels: tool
Welcome to the blogosphere's toolchest! Here, unlike other blogs dedicated to analyzing current events, we create easy-to-use, simple tools to do the math related to them so you can get in on the action too! If you would like to learn more about these tools, or if you would like to contribute ideas to develop for this blog, please e-mail us at:
ironman at politicalcalculations
Thanks in advance!
Closing values for previous trading day.
This site is primarily powered by:
The tools on this site are built using JavaScript. If you would like to learn more, one of the best free resources on the web is available at W3Schools.com.