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
Today is Black Friday, 2015 - the proverbial day that, if you believe U.S. retailers, enough Americans turn out to the nation's brick and mortar stores to finally lift them into profitability for the year. Which retailers try to ensure by slashing their prices, thereby reducing their marked up profits, in order to lure as many Americans who also have the Friday after Thanksgiving as a holiday into their stores, where they hope to somehow eke out a profit for the year by selling mass quantities of things instead of simply way overpriced things.
But Black Friday has a dark downside. The name really originates in Chicago, where on previous days after Thanksgiving, so many consumers swarmed the city's streets and stores to shop that large numbers of traffic accidents and outbreaks of violence became inevitable, including fatalities, prompting the city's police department to begin calling the day "Black Friday" so they could discourage those activities.
Black Friday brings an inherent conflict of interest for American consumers, who both want to find the ideal Christmas gifts for the people in their lives, and who also don't want to die because of all the other people out shopping at the same time they are.
We have a solution - we've built a tool that you can use to put a limit on how much shopping you need to do to find the perfect gift, which in turn will limit the amount of time that you're exposed to the mayhem that U.S. retailers wrought, increasing your probability of survival. And all you meed to know is how much shopping you're willing to commit to do while shopping for the "perfect gift" 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! If you're reading this article on a site that republishes our RSS news feed, click here to access a working version of this tool!
For our default example, in a search for where you would be willing to consider up to 20 possible options in your pursuit of the best choice for you, by the time you've considered at least 7 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, 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.