How was Pizza Mercato?
- Good (46%, 6 Votes)
- Average (31%, 4 Votes)
- Never Again (15%, 2 Votes)
- Poor (8%, 1 Votes)
- Excellent (0%, 0 Votes)
Total Voters: 13
How was Pizza Mercato?
Total Voters: 13
Wes McKinney and I are hosting our first ever Open Statistical Programming meetup tomorrow night after taking over for Drew Conway. Please attend, have some pizza, enjoy the talk then come out for some beer.
This month’s pizza will be from Pizza Mercato in the Village.
Couldn’t resist showing off this article in Wired Magazine that quotes me. It’s a good take on the new, semi-corporate hacking culture, but then again, I may be a bit biased.
With tonight’s Mega Millions jackpot estimated to be over $640 million there are long lines of people waiting to buy tickets. Of course you always hear about the probability of winning which is easy enough to calculate: Five numbers ranging from 1 through 56 are drawn (without replacement) then a sixth ball is pulled from a set of 1 through 46. That means there are choose(56, 5) * 46 = 175,711,536 possible different combinations. That is why people are constantly reminded of how unlikely they are to win.
As of this afternoon it was reported (sorry no source) that two tickets were sold for every American. So let’s assume that each of these tickets is an independent Bernoulli trial with probability of success of 1/175,711,536.
Running 1,000 simulations we see the distribution of the number of winners in the histogram above.
So we shouldn’t be surprised if there are multiple winners tonight.
The R code:
winners <- rbinom(n=1000, size=600000000, prob=1/175000000) qplot(winners, geom="histogram", binwidth=1, xlab="Number of Winners")
Shortly after the Giants fantastic defeat of the Patriots in Super Bowl XLVI (I was a little disappointed that Eli, Coughlin and the Vince Lombardi Trophy all got off the parade route early and the views of City Hall were obstructed by construction trailers, but Steve Weatherford was awesome as always) a friend asked me to settle a debate amongst some people in a Super Bowl pool.
We have 10 participants in a superbowl pool. The pool is a “pick the player who scores first” type pool. In a hat, there are 10 Giants players. Each participant picks 1 player out of the hat (in no particular order) until the hat is emptied. Then 10 Patriots players go in the hat and each participant picks again.
In the end, each of the 10 participants has 1 Giants player and 1 Patriots player. No one has any duplicate players as 10 different players from each team were selected. Pool looks as follows:
|Participant 1||Giant A||Patriot Q|
|Participant 2||Giant B||Patriot R|
|Participant 3||Giant C||Patriot S|
|Participant 4||Giant D||Patriot T|
|Participant 5||Giant E||Patriot U|
|Participant 6||Giant F||Patriot V|
|Participant 7||Giant G||Patriot W|
|Participant 8||Giant H||Patriot X|
|Participant 9||Giant I||Patriot Y|
|Participant 10||Giant J||Patriot Z|
Winners = First Player to score wins half the pot. First player to score in 2nd half wins the remaining half of the pot.
The question is, what are the odds that someone wins Both the 1st and 2nd half. Remember, the picks were random.
Before anyone asks about the safety, one of the slots was for Special Teams/Defense.
There are two probabilistic ways of thinking about this. Both hinge on the fact that whoever scores first in each half is both independent and not mutually exclusive.
First, let’s look at the two halves individually. In a given half any of 20 players can score first (10 from the Giants and 10 from the Patriots) and an individual participant can win with two of those. So a participant has a 2/20 = 1/10 chance of winning a half. Thus that participant has a (1/10) * (1/10) = 1/100 chance of winning both halves. Since there are 10 participants there is an overall probability of 10 * (1/100) = 1/10 of any single participant winning both halves.
The other way is to think a little more combinatorically. There are 20 * 20 = 400 different combinations of players scoring first in each half. A participant has two players which are each valid for each half giving them four of the possible combinations leading to a 4 / 400 = 1/100 probability that a single participant will win both halves. Again, there are 10 participants giving an overall 10% chance of any one participant winning both halves.
Since both methods agreed I am pretty confidant in the results, but just in case I ran some simulations in R which you can find after the break.
With the Super Bowl only hours away now is your last chance to buy your boxes. Assuming the last digits are not assigned randomly you can maximize your chances with a little analysis. While I’ve seen plenty of sites giving the raw numbers, I thought a little visualization was in order.
In the graph above (made using ggplot2 in R, of course) the bigger squares represent greater frequency. The axes are labelled “Home” and “Away” for orientation, but in the Super Bowl that probably doesn’t matter too much, especially considering that Indianapolis is (Peyton) Manning territory so the locals will most likely be rooting for the Giants. Further, I believe Super Bowl XLII, featuring the same two teams, had a disproportionate number of Giants fans. Bias disclaimer: GO BIG BLUE!!!
As always, send any questions my way.
My sink was clogged, not with anything specific, but just years worth of gunk. So after scraping out what I could with my hands and a wire hanger–and wanting to avoid caustic chemicals like Drano–I searched the Internet to see if Listerene or Coca-Cola might do the trick. But extensive searching led me to baking soda and vinegar.
It’s very simple: Stuff a half cup of baking soda into the train then pour a half cup of vinegar down it, return the sink stopper and wait 15 minutes. Then pour down another half cup of vinegar, close the stopper and wait another 15 minutes. After that pour a gallon (a tea kettle’s worth) of boiling water down the drain and you’re done! Not only will it unclog your drain, it leaves all the chrome shining like new!
For those of us who never got to make a model volcano in science class it was really awesome watching the baking soda and vinegar react
A new study, reported in the New York Times, tracked population movements in post-earthquake Haiti using cell phone data. The article grabbed my attention because one of the authors, Richard Garfield (whom I have done numerous projects with and who has his own Wikipedia entry!), had told me about this very study just a few months ago.
Over dinner in New York’s Little India he explained how the largest cell phone company in Haiti provided him with anonymized cell tower records. As many people are aware, cell phones–even those without GPS–report their locations back to cell towers at regular intervals. By tracking the daily position of the phones before and after the earthquake they were able to determine that 20% of Port-Au-Prince’s population had left the capitol within 19 days of the disaster.
They used plenty of solid math in the analysis and amazingly did it all without resorting to spatial statistics. They have some nice map-based visualizations but I’ve been meaning to get the data from Dr. Garfield so I can attempt something similar to the amazing work done by the NYC Data Mafia on the WikiLeaks Afghanistan data. Though I don’t promise anything nearly as good.
It is also worth noting that they did this at a fraction of the cost and time of an extensive UN survey. That survey only had about 2,500 respondents whereas the cell phone project incorporated around 1.9 million people without them spending valuable time with an interviewer.
While playing Words with Friends my randomly chosen opponent played “radiale” as her first word. Since that used up all of her tiles, she received a bonus on top of all the points the word itself got, resulting in a one-move score of 53 points! Rather than being impressed I was upset at the large deficit I would have to overcome.
To combat this I did what comes naturally: Write an R script to find the perfect word!
Needing to combine my seven letters with one of her letters there were two routes I could take. The first would be for each combination of my seven letters and one of hers, find all 40,320 (8!) permutations then hit dictionary.com to see if it is a real word for a total of 282,240 (8!*7) http calls. That seemed a bit excessive and impractical so I moved on to the next idea.
So, first thing I did was pull a list of common eight-letter words. Then for each combination of my letters and one of hers (only 7 iterations) I checked if those letters (in any order) matched the letters in any of the possible words. Once a match was found there was a check for the counts of the letters and if that passed then the word was recorded as a true match.
The algorithm took about 17 seconds to run and found me one possible word for my letters combined with one of hers: ”headrace”, for 63 points! Perhaps I should have been able to figure that out on my own, but where would be the fun in that. Find the code after the break.