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
You know how it is when you're out shopping. You're looking for the perfect thing, but you're not finding it. In that situation, how long should you keep at it?
Notice that we didn't mention what it is that you might be shopping for.
The truth is that it doesn't matter - we could be talking about anything from apartments for rent to engagement rings made from the finest cubic zirconium, and possibly even your future spouse, and unless you're fortunate enough to recognize perfect when you've somehow accidentally stumbled across it, what you're really shopping for is something that's just good enough to meet your needs.
And to find it, it turns out that you just need to know how much shopping you're willing to commit to do before you've seen enough and can simply buy the next best thing you see.
Emily Oster recently addressed this problem in taking on a question from a young couple seeking a new place to live, but not as yet having much luck in finding suitable accommodations. She writes:
You have, perhaps inadvertently, happened upon an extremely famous area of statistics: optimal stopping theory. The classic example is the secretary problem: you want to hire a secretary, and you have many applicants you interview in order. How do you know when to stop interviewing and hire someone? In your case, how do you know when to stop viewing apartments and just rent one?
Part of what attracts statisticians to this problem is it turns out to have an extremely elegant solution. First, figure out how many apartments you expect to see. Let’s say you think you’ll see 50. The solution says that you should reject the first 50/2.71 apartments (or, about the first 20 of them) and then rent the first one you see after that which is better than any you’ve seen before. (For those of you following the math, the precise number you reject is 50/e, the base of the natural log.)
This is pretty easy to follow and statisticians have proved it will get you the best apartment about 40% of the time, which definitely isn’t 100% but is better than any other strategy!
Well, with that kind of statistical endorsement, how could we possibly pass up the opportunity to build a tool to do the math for you? Just enter the total number of possibilities that you're willing to consider in your search to find what's just good enough for you, and we'll determine the minimum number of possibilities you need to consider to make a decent decision!
For our default example, in a search for where you would be willing to consider up to 50 possible options in your pursuit of the best choice for you, by the time you've considered at least 18 of them, you will have seen enough and can jump at the first opportunity you have that is better than all that you have previously seen.
And, for what it's worth, there's even a 40% chance that you'll be right. Happy shopping!
Labels: geek logik, personal finance, 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.