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
If you're going to a social event with lots of people, what is your risk of coming into contact with someone who has been infected by the coronavirus?
Alex Tabarrok posted the math that can provide insight into the answer to that question, which we'll convert into a tool you can use to run your own scenarios. Here's how he describes the math:
The mathematics for calculating the probability of exposure given the number of carriers in a population and group size aren’t difficult but they can be surprising. Even a low number of carriers can generate a relatively high probability for reasonably sized groups. For example, assume you run a firm of 1000 people in the San Francisco Bay Area (population 8 million.) Let’s suppose that there are just 500 carriers in the area. In this case, assuming random draws, the probability that at least one of your employees is a carrier is 6%. You can run your own calculations at Wolfram Alpha following this format:
p=8000000, c=500, g=1000, 1-1(1-c/p)^g //N
where p is the population size, c is the number of carriers, g is the group size and the //N at the end isn’t a division but a command to Wolfram Alpha to give you a numerical answer.
We're huge fans of Wolfram Alpha, but since the data entry is a bit cumbersome, you'll hopefully find the user interface in the following tool to be a bit more friendly. If you're accessing this article on a site that republishes our RSS news feed, please click through to our site to access a working version.
One important thing to note is that the probability the tool calculates assumes that carriers are randomly distributed among the whole population. In practice, many will be concentrated within smaller groups of the population, where effective quarantine practices, or what the kids are calling "social distancing" these days, will reduce the probability of exposure.
Alex makes the key point for what we can learn from the math if you're thinking of going to a public event while the risk of viral infection remains high:
Now here is the most important point. It’s the size of the group, not the number of carriers that most drives the result. For example, suppose our estimate of the number of carriers if off by a factor of 10–that is instead of 20,000 there are just 2000 carriers in the United States. In this case, the probability of at least one carrier at a big event of 100,000 drops not by a factor of ten but just to 45%. In other words, large events are a bad idea even in scenarios with just a small number of carriers.
You can confirm that insight using the tool above, or if you prefer, here is Joshua Weitz' COVID-19 Event Risk Assessment Planner that presents the data visually:
Numbers like these are why the NBA has suspended its season.
Labels: coronavirus, health, probability, tool
Now that we've quantified all of the streaks of two-or-more consecutive days in which the S&P 500 was either up or down for every trading day since 3 January 1950, it's time to do something with the results of our deep data dive.
So we've taken the math we generated and built the following tool, in which you only need to enter the duration of a particular streak. We'll calculate the odds of a streak that long occurring, the odds of it being either a winning streak (multiple consecutive up days) or a losing streak (multiple consecutive down days), and also the odds of the streak lasting just one more day!
It all begins below. If you're accessing this tool on a site that republishes our RSS news feed, just click through to our site to access a working version....
So, if a streak in the S&P 500 is underway and you're a speculator, the question is: do you feel lucky?
Well, do you?
Labels: investing, probability, SP 500, stock market, tool
What are the odds that IRS employees deliberately targeted President Barack Obama's political opposition and have attempted to cover it up?
On 31 May 2013, the U.S. Internal Revenue Service (IRS) told Congressional investigators that they had identified at least 88 IRS employees and supervisors who were involved in targeting groups opposed to various aspects of President Barack Obama's political agenda. At that time, the IRS ordered these employees to preserve all the "responsive documents" related to the scandal on their personal computers, which would apply to documents going back as far as 2010.
On 21 July 2014, in written testimony before the U.S. Congress, IRS Deputy Associate Chief Counsel Thomas Kane indicated that the hard drives of up to as many as 20 of these IRS employees had experienced crashes, making e-mails and other documents stored on them inaccessible in explaining why the agency would not deliver the information that it had been ordered to provide to Congressional investigators.
What are the odds of that happening?
Fortunately, we have an app for that! You just need to enter the relevant data, which we have below, or adjust it as you might like, and we'll figure out the odds of so many members of such a small group of IRS employees and supervisors going through the experience of their hard drive crashing so bad that no information related to potentially unlawful activities would ever be retrieved from them.
In the tool above, we're using the findings of a 2007 study found that the odds of a single hard drive independently failing in a given year is about 3%. If you want to be precise however, the average rate of replacement for a failed hard drive in a single year is 2.88%.
Our tool's results indicate the probability of the events in question occurring by purely random chance. If you want to find the odds that IRS employees deliberately targeted President Barack Obama's political opposition and have since attempted to cover up evidence of their unlawful conduct, just subtract the percentage odds above from 100% to find the odds of that....
We've previously found two really cool tools for doing this kind of math elsewhere on the web:
Richard Lowry presents the detailed calculations and an online calculator for finding binomial probabilities that gets around our tool's limitation of 170 opportunities!
Texas A&M offers a Java application for doing this kind of math that includes graphical output, so you can see where various outcomes might fall on a normal bell curve distribution!
Update 3:35 PM EDT: One of our readers points us to the perfect country tune to describe the IRS' "problem" with hard drives:
Labels: crime, politics, probability, tool
Wouldn't it be nice to win the lottery? And since the multi-state Powerball lottery game has just changed to offer higher jackpots, including one that recently went over $330 million, could it be a good idea to buy a Powerball ticket today?
The answer is "it depends". Specifically, it depends upon the following factors:
Together, these three things, combined with the kind of math that an economist might do to calculate the environmental costs of a spill from an oil pipeline, will tell us how big the lottery jackpot needs to be to be worth the cost of the ticket to play!
And that's the math our tool today is here to do for you! Just enter the indicated data for the lottery game of your choice, and we'll calculate just how be the jackpot has to get to be worth the amount of money you might be willing to plunk down on a ticket.
Our default data is that for the new Powerball game, which was revised back on 15 January 2012 to double the price of a single ticket from $1 to $2, and which was also tweaked to increase the odds of winning.
Doing the math, we find that in order to fully justify the cost of a $2 lottery ticket, and to also compensate for the negative effect of having the jackpot get taxed at just the current top federal income tax rate of 35%, the Powerball lottery would have to exceed $539,149,262.
Will the Powerball jackpot ever exceed the more than half billion dollars it at least needs to be to be worth the price of its $2 ticket to play? It's possible, but the odds are such that the average jackpot paid out will be around the $175 million level, which means there's probably something else a lot better you can do with your $2 than play the new Powerball game!
Labels: probability, tool
Suppose you were in the business of predicting the outcome of a coin toss, where with each flip of the coin, you have a 50% chance of being correct. What are the odds that out of 20 coin tosses, you would correctly call heads or tails exactly 18 times during all those tosses?
Our newest tool is designed to answer the question of just how likely or unlikely it would be for such a thing to happen. Just enter the indicated data in the tool below and we'll work out the probability of such a thing happening by pure chance for a given number of opportunities!
We find that the percentage odds of correctly calling the outcome of 20 coin tosses exactly 18 times by chance is 0.0181%, or rather, the odds are that this exact situation will occur by chance just once in 5518.8 opportunities.
Now for some food for thought. Since January 1871, the percentage probability that the average monthly price of stocks in the S&P 500 will be higher than in the previous month is 56.1%. What is the likelihood that an individual could correctly anticipate that stock prices would either be higher or lower than the average price level recorded in the previous month on 17 out of 19 occasions by chance?
[Answer: It's very unlikely that chance alone explains that happening, but it's also not as improbable as you might think.... ]
We found two really cool tools for doing this kind of math elsewhere on the web:
Richard Lowry presents the detailed calculations and an online calculator for finding binomial probabilities that gets around our tool's limitation of 170 opportunities!
Texas A&M offers a Java application for doing this kind of math that includes graphical output, so you can see where various outcomes might fall on a normal bell curve distribution!
Labels: probability, tool
Have you ever seen those television shows with the Masked Magician? The ones where he reveals the secrets of how magicians saw people in half, levitate or make elephants appear in the middle of an empty parking lot?
We have to count those shows as one of our guilty pleasures. In fact, it's such a guilty pleasure that we're going to feature the Masked Magician performing, then explaining, how to do a trick he's never done on TV!
We'll begin with the Masked Magician's audience, a thousand people, who each choose a colored marble. All of the marbles are the same size and weight and texture - the only difference between them is their color. There are ten different colors from which the audience members can each choose: red, blue, green, yellow, white, black, orange, violet, tan and pink. They inspect them all, then each choose their favorite color.
Next, they line up to place their marbles in the Masked Magician's magic marble bag, while the Masked Magician's able assistants keep a tally as other audience members look on to make sure there's no funny business. When the last audience member drops their marble into the Masked Magician's magical marble bag, his assistants reveal that of the 1000 marbles the audience has placed into the bag, 420 are red, 419 are blue, 152 are green 5 are yellow, 3 are orange and 1 is violet.
It's sad that the audience members have rejected the white, black, tan or pink marbles. Perhaps they believe those colors just aren't very exciting.
The Masked Magician's assistants then shake the bag, jumbling up all the colored marbles inside. They show the bag's contents to the audience members. And then the Masked Magician arrives.
His assistants blindfold him. The Masked Magician rolls up his sleeve and shows his bare arm to everyone in the audience.
He then reaches into the magical marble bag with his bare hand and removes a single blue marble.
The audience is unimpressed. Surely there's something more to this trick.
He reaches in again, and pulls another blue marble from the bag. And then another. The audience begins to shift uncomfortably in their seats. Where's the magic?
But the Masked Magician continues. One at a time, he reaches in and pulls out a blue marble. After 10, some in the audience are yawning, but some are just getting interested. How is that possible, they wonder? He should have pulled at least one other-than-blue colored marble out of his magical marble bag by now.
The Masked Magician continues only removing blue marbles from the bag. 15. 20. 25. Then 30.
Most of the audience now understands why this trick never made it onto one of his television specials. But some in the audience are truly amazed - there's just no way that someone could pull that many blue marbles in a row out of that bag at random! There's an almost equal number of red ones, and almost one out of seven in the bag are green! Sure, you can understand maybe not seeing the yellow, orange or violet marbles, but shouldn't you have seen a lot of red marbles or at least one green one by now?
What are the odds of that?
How amazing is the Masked Magician's ability to only pull blue marbles from his magical marble bag filled with hundreds of marbles of different colors? You can calculate the odds yourself with our tool below:
If you play with the numbers, the more he only pulls marbles of the same color from the bag, the ever more unlikely it is that he should be able to do it! Clearly, you should never let the Masked Magician near the ballot box during a recount!
It's time for the Masked Magician to reveal how the trick was done. How could the Masked Magician defy the laws of probability and pull so many marbles of just one color from a bag holding a thousand marbles of different colors?
The secret is in the bag. Literally.
Hidden within the bag are hidden pockets, sewn into its padded lining. Fans of the show will know he has his suits made with similar features.
But here, long before the first audience member has even begun inspecting the different colored marbles, the Masked Magician has stashed blue marbles into the concealed pockets that are sewn into the bag's lining. Lots of them.
And then it's just a simple matter of appearing defying the odds to keep pulling marbles of the same color out of the bag.
But the odds would only matter if the selection of marbles from the bag were truly random and fair. And as we all know, the Masked Magician is neither random nor fair when it comes to producing an ever more unlikely outcome. The fix was in from the beginning.
There's something potentially just as unlikely happening now in Minnesota, where a U.S. Senate seat is on the line. The table below shows the original tally of that race (as best as we could find in news articles from 5 November 2008), along with the current tally of the mandatory recount that is now underway, as of Sunday, 9 November 2008.
| 2008 Minnesota U.S. Senate Race Vote Tallies |
|---|
| Candidate | Original Tally (5 November 2008) | Current Tally (9 November 2008) | Difference |
|---|---|---|---|
| Coleman | 1,211,629 | 1,211,556 | -73 |
| Franken | 1,211,167 | 1,211,335 | +168 |
| Barkley | 437,377 | 437,385 | +8 |
| Aldrich | * | 13,916 | 0 |
| Niemackl | * | 8,906 | 0 |
| Write-In | * | 2,340 | 0 |
| Cavlan | * | 1 | 0 |
| Evan | * | 0 | 0 |
| Price | * | 12 | 0 |
| Shepard | * | 0 | 0 |
| Total | 2,885,348 | 2,885,451 | +103 |
As we were unable to find the correct vote tallies for the minor candidates in the original tally (indicated in the table above with an asterisk "*"), we've assumed that the current vote tally is the same in calculating the total number of ballots cast in that election.
But to really get good use out of our tool above, it would be best to know the vote counts recorded at the polling place or precinct level. If say 32 uncounted ballots were to turn up in the trunk of the car of a poll worker, you could find out just how unlikely it would be that all of those ballots would be for just one candidate out of all the votes recorded for their polling place.
If so, in the worst case of vote fraud, an extremely unlikely probability would suggest that these ballots favoring one candidate were either pre-positioned before election day to be used in case of a close election or are the remaining evidence of vote suppression, where 32 real ballots are all that remain of a group of roughly 76 ballots, where some 44 legitimately cast for other candidates have been destroyed and never added to their totals (assuming the same proportion of ballots cast per candidate as tallied statewide.) An alternative explanation is that it could be evidence of extreme incompetence on the part of the individual poll worker, their co-workers and those to whom they report.
Finally, here is our table presenting the odds of unlikely events, which have been extracted from Gregory Baer's Life: The Odds and How to Improve Them, so you can judge for yourself how likely it is that the U.S. Senate race recount totals are changing as they would appear to be changing in Minnesota:
| The Relative Odds of Unlikely Events | |
|---|---|
| Possible Event | Probability of Occurring |
| Being Audited by the IRS | 175 to 1 |
| Writing a New York Times Bestseller | 220 to 1 |
| Dating a Supermodel | 88,000 to 1 |
| Being Struck by Lightning | 576,000 to 1 |
| Getting a Royal Flush on the First Five Cards Dealt | 649,740 to 1 |
| Winning the California Lottery | 13,000,000 to 1 |
| Dying from a Shark Attack | 300,000,000 to 1 |
| Having a Meteor Land on Your House | 182,138,880,000,000 to 1 |
How likely is it that votes previously counted for one candidate are now being counted for another?
Labels: election, probability, tool
Earlier this year, the mainstream media added anywhere from 10 to 20% to the public's heightened perception that the United States would find itself in recession in 2008.
Really! And we can thank prediction markets for helping to answer the question of how much does subjective economic reporting and commentary influence the public's perception of the U.S.' economic health.
Here's how we know. Because the probabilities generated by prediction markets rely primarily upon the information available to those who participate in the markets, which really are a kind of betting pool organized around the likelihood of certain events coming to pass, what they really measure is the degree to which those participants expect a certain event will occur based upon the most current and prevailing information available to them.
In the case of the likelihood of an economic recession, we can safely assume that virtually all of the information available to prediction market participants is that compiled, disseminated and echoed by the various organs and members of the mainstream media.
As a result, we can measure the impact that those who deliver the information have upon the perceptions of the market participants that a given event will occur. We can do this by comparing the probability of the event occurring that is determined by the prediction market against other predictive methods that are not similarly influenced by the mass media's subjective reporting and commentary.
In essence, it all boils down to a subtraction problem. The measure of the media's influence is the difference between the prediction market's media bias-influenced probability and an objectively-determined probability that the given event will take place.
For objectively determining the probability of recession in the United States, one method we might use for comparison is a predictive method developed by economist Jonathan Wright of the Federal Reserve Board. Known as Wright Model B, this method uses the impartial data of the calculated spread in the bond yield curve for the 10 Year and 3 Month U.S. Treasuries along with the Federal Funds Rate to anticipate the likelihood of a U.S. recession some twelve months in advance.
Here's our side by side comparison of the data. First, here's the lifetime history of Intrade.com's 2008 Recession Prediction Market (HT: Mark Perry):
Now, here's the history of the probability of a U.S. recession as determined by Wright's Model B method:
Update 4 September 2008: The next chart shows the difference between the probability of recession as determined by each approach:
We see that the probabilities for each start out close to the same, around 30%, but then as negative economic reporting and commentary in the mass media began to kick into gear in September 2007, we see that the prediction market's participants reacted by sharply increasing their expectation of recession by roughly a 20% margin over the objectively determined probability.
That increase in the prediction market probability level was followed by a brief dip in October 2007 as positive news related to corporate earnings in the third quarter of 2007 was released that also indicated that U.S. companies would do well through the end of 2007. The prediction market shortly resumed tracking along with the increasing objective probability of recession, which was building to the mid-to-upper 40% range at the time.
Those levels continued until January 2008 when U.S. companies, especially banks, mortgage lenders and other financial companies, began warning that their future earnings would be distressed. Negative media reports and commentaries on U.S. economic conditions grew exponentially, sending Intrade's 2008 U.S. recession prediction market soaring to the 70% level, even as the impartial and objectively determined probability of recession was flattening out just under the 50% level.
From January through April 2008, we can see that the media's continuously negative economic reporting and commentary throughout this period contributed anywhere from 10-20% to the prediction market participants' heightened perception that a recession was likely.
Toward the end of April, the failure of the economy to drastically worsen (driven by better than anticipated economic and financial news), led the prediction market's participants to sharply deflate their expectations of recession. Here, the probability of recession anticipated by both prediction market and impartial forecasting method declined rapidly from 50% through the 40% level and back to the 30% level.
In fact, we see that the probability of recession communicated by Intrade's prediction market now is well below that determined using the objective method. That decline below the objectively determined level of probability is likely due to how the prediction market is set up, in that it requires two consecutive quarters of negative GDP growth in 2008 for a positive affirmation, which is now highly unlikely to occur.
And so we find a new way, other than their designed purpose, in which prediction markets might provide useful insights!
Investor's Business Daily featured a series of articles in 2007 examining how biased reporting by the media, when combined with incompetence in explaining how markets and the economy work, seriously skews the public's perception of both.
Labels: economics, math, probability
Although we don't go there often, we're not ones to shy away from personal topics here at Political Calculations. We are, after all, the only blog out there that gets into your paycheck, goes into your house to see if you should switch to compact fluorescents and helps you figure out how much diet soda your system can safely handle.
But now we're getting really personal with our latest tool, adapted from math posted by Geek Logik author Garth Sundem at his blog, asking the question "What are the chances your marriage will last?"
While the Geek Logik blog post contains three separate equations for helping decide various marital topics (the other two answer the questions "should we get married" and "how many kids should we have"), we were intrigued by the statistics that underlie the question of marital sustainability. Here's what Garth wrote about the data:
... the first is based on solid statistics -- an 11,000-person study by the CDC that expolored factors that help and hurt a marriage's chances of working (for example, they found that if a woman is married before age 24, her chances of staying married for 15 years decreased by 30%). These statistics were easy to write in math terms, and the equation does fairly accurately predict your chances of being married at time "T". Granted there are other factors that might help or hurt your specific marriage, but the CDC study found that, for most people, these are the biggest factors. Remember that the average for all marriages is only about 50% and if you get a low number, please accept my very best wishes in bucking the odds.
There's not much more than to go straight to the math, captured in our tool below (please click here for a working version if you're accessing this article on a site that republishes our RSS news feed):
Having coded the math, let's reassure you that the result isn't processed through any sort of normal probability distribution. It is, at best, an approximation. Just change the default "religiousness" value to 10 (aka "the pope") and you'll get a better than 100% probability level! Aside from these quirks of math however, you'll still be able get a somewhat realistic approximation of the odds that you'll be married for your "Xth" anniversary over a pretty wide range of the distribution curve.
Now that you've seen the generic probability that you'll still be married to your current spouse at the anniversary of your marriage that you entered, you may have more questions than answers. If the probability is really low, that might be a good place to begin a conversation with your spouse. If the probability is high, you may already have a strong foundation for a successful marriage. Just remember that it never hurts to make it stronger.
Labels: geek logik, probability, 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.