Stats in Sociology – Not Boring Version

By Rathan Haran, December 30, 2009 11:23 am

Hans Rosling shows you how to to make stats cool again.  Visualization of data is a great learning tool, and creating ways to do this will be of great value to those with less mathematical sophistication than others.

The insights that Hans Rosling was able to illustrate in this presentation were pretty amazing as well, and definitely surprising to see how much the world has leveled in the past 40 years.  Check it out:

The Perfect Fantasy Football Play

By Rathan Haran, November 30, 2009 4:09 pm

I’ve been playing in a fantasy football league with the same group of guys for about ten years now, and like many others of you out there, I just can’t win.  It seems like everything that can go wrong, will go wrong, from a missed extra point to the NFL reviewing game tape to change the marking of a fumble which causes enough yardage difference to drop you 1 point loss in a game against the other team going for the last playoff spot (didn’t happen to me, but did to another manager whose opponent called up the NFL offices posing as a reporter to question a Jonathan Stewart fumble last year … priceless).

Now if you are an astute fantasy football player, you know exactly what it takes for you to win a game.  Even in the waning seconds of a game, I can come up with the most ridiculous real life football play that would pull my team out from the jaws of defeat and on to capturing an elusive Small Show* championship and the prestigious Portis Belt (and eventually making it rain like Pacman Jones).

My White Elephant

My White Elephant

After years of perfecting this ability, I started to think about what would be the most desperate of desperation plays that would be needed by a single player on your team to overcome a seemingly insurmountable lead.  At first I thought it was obvious, the 99 yard rushing/receiving touchdown from a running back/wide receiver/tight end.  The field is only 100 yards and a touchdown is the most amount of points you can score on a single play.  It’s the max on yardage and points on a single possible offensive play.  Defenses usually aren’t rewarded for return yards, so the best you can hope for there is a sack, fumble recovery, touchdown.

Actually there is a way to top the 99 yard, 1 TD effort, and this play is one of the rarest you’ll ever see.  It is a legitimate football play for the quarterback to throw a pass, have it deflected by a defender,  and then catch the deflection and run with it (Brett Farve’s first completion was to himself).  This counts as both passing AND receiving stats making it possible for a quarterback to throw and receive a 99 yard touchdown pass on the same play for 26.2 points of fantasy legacy.  Here’s a breakdown of the most possible points by position for a typical points-per-reception fantasy football league:

Fantasy Football Max Points Chart

Theoretically, any offensive player can do this (i.e., Ronnie Brown Ricky Williams in the Wildcat), but for practical purposes, we’ll expect the quarterback to be handling the ball at the end of the game.  So if your QB is backed up to his 1-yard line with 4 seconds left in the game and you are down 26, keep the faith, you still have a shot!

Here’s that Brett Favre completion to himself:

*The Small Show is the fantasy league that I play in.  I’m currently 4 and 7 and up by 5 points this week with Pierre Thomas (my guy) going against Tom Brady and John Carney (his guys) tonight.  If I win this week and next week I have an outside chance of getting into the play-offs provided another team loses and I can outscore him in Total Points.  What do you think my chances are in both tonight’s game and the playoffs?

Bill Belichick + Statistics = Usually Good Outcomes

By Rathan Haran, November 16, 2009 3:48 pm

I’ve been a die hard Giants fan for as long as I can remember, and although I was technically alive and barely remember parts of the 86 season (and nothing from that Super Bowl), the 90 Super Bowl team made me love the G-Men .  They had me at Mark Ingram’s 3rd and 13 conversion.

Bill Belichick was the Giants’ defensive coordinator in that Super Bowl and designed a genius defensive game plan, predicated on the statistics of his defensive unit.  Knowing that Jim Kelly and the Buffalo Bills could rip apart the Giants’ secondary, he had his defensive linemen and linebackers give up yards on 1st and 2nd down.  He believed that this would dictate that Buffalo would run the ball, rather than pass in longer 3rd down situations, a place where the Giants were statistically strong in all season.

His gutsy calls are not relegated to just defense.  The 07 Patriots’ offense was a great example of not playing into defenses strengths (case in point, going to five WR sets against the top ranked Minnesota run defense), and taking gratuitous unsportsmanlike advantages of your strengths when the game was well out of hand.  Gratefully honor prevailed and the Giants laid the smack-down on the Patriots to win their 3rd Super Bowl and squash a rather presumptuous book before it made its way onto bookshelves.

Last night’s Patriots Colts game is just another way Bill Belichick makes football analysts (like Mike Francesca) and arm-chair quarterbacks look like idiots.  It was absolutely the right move to go for it on 4th and 2 and the odds were completely in his favor, as described on “Advanced NFL Stats:

“With 2:00 left and the Colts with only one timeout, a successful conversion wins the game for all practical purposes. A 4th and 2 conversion would be successful 60% of the time. Historically, in a situation with 2:00 left and needing a TD to either win or tie, teams get the TD 53% of the time from that field position. The total WP for the 4th down conversion attempt would therefore be:

(0.60 * 1) + (0.40 * (1-0.53)) = 0.79 WP

A punt from the 28 typically nets 38 yards, starting the Colts at their own 34. Teams historically get the TD 30% of the time in that situation. So the punt gives the Pats about a 0.70 WP.

Statistically, the better decision would be to go for it, and by a good amount.”

It didn’t work out for Bill last night, but the decision was sound, and in the long run, he’s going to come out on top more often than not.  It’s why he’s a great NFL coach, and we shouldn’t be convinced that our “conventional” wisdom is better than his statistical prowess.  Just be content knowing that he’s a prick and move on.

Music and Math

By Rathan Haran, November 5, 2009 10:30 pm

This is just unbelievable.  The sync between music and math is undeniable.  It’s shocking to see an audience, a random group of individuals untrained in music, be able to use the power of the pentatonic scale.

Don’t Worry, Be Happy!

Predicting the World Series using Python

By Rathan Haran, October 29, 2009 7:45 am

Last week, I’ve started to learn Python through a peer-to-peer learning session set up through nextNY.  The material that we’ve gone through has made learning programming very easy to wrap our heads around, and the environment of cooperative learning has been awesome.  I’m looking forward to being a Python ninja* pretty soon.

With four and half chapters of Python at my disposal, I wanted to put my skills to the test.  Since I’m a huge baseball fan, I thought I’d try my hand in simulating who would lose the World Series this year, a pillow-fight match-up between the New York Yankees and the Philadelphia Phillies.

The first thing to do was to crunch the numbers.  Crunching the numbers means exactly that, figuring out the probabilities of events occurring over a seven game series.  I incorporated things like Ryan Howard’s immense strike-out rate, Derek Jeter’s incredible lack of range at shortstop, and Brad Lidge’s ninth inning ERA.  I also made sure to incorporate correlations, or how related each variable is to each other.  Funny enough, the highest correlation I found was between having a runner on first base with less that two outs in the seventh inning onwards and Arod weakly grounding into a double-play.  Numbers never lie.

Now this got me a pretty good picture of who would lose the World Series, but I hadn’t taken into consideration the qualitative variables, the intangibles, the “Cole Hamels’ is a play-off pitcher” and the “Mariano is unhittable in the World Series” bullshit bullshit.  These are usually the ’statistics’ that overzealous fans throw out (with no meaningful data except their distorted memories) as their defense to a player’s immortality.

The classic intangible lies on the shoulders’ of the Yankee captain, Derek Jeter, a ball player that seems to find himself at the right place at the right time in the postseason.  Yankee fans have constantly spouted his ‘greatness’, and refuse to admit that he was horribly out of position on the Jeremy Giambi play at the plate, and doesn’t even register as having the highest batting average in a World Series (that designation goes to Billy Hatcher who hit a sickening .750 for the Reds in 1990 in 12 ABs).  Heck, Jeter doesn’t even deserve the nickname “Mr. November” for his play in the 2001 World Series.  He had 1 HR, 1 RBI, and 2 runs scored in November, numbers that were almost matched by a pitcher for the Arizona Diamondbacks (1 RBI and 2 runs scored).  Oh, and that pitcher also won two potentially series ending games in two days that November with a 2.22 ERA, .96 WHIP, 8Ks in 8.1 innings.  Derek Jeter, I’d like you to meet the real “Mr. November,” Randy Johnson.

Okay, so I wrote my little Python program to capture all of this.  The stats, the pseudo-stats, the Phillie Phanatic’s rants, and the countless times we’ll hear “26 World Series rings.”  With so many probabilities and interactions, this program chugged along for two days, and finally, yesterday before the first pitch, I got the result:  Value Error: Let’s Go Mets.

*Looking forward to the day when ninja is not used in start-up world employment searches and reverts back to its original awesomeness of stealthy nighttime assassin.

Google Wave Applications

By Rathan Haran, October 20, 2009 10:54 am

As Jeff and I were thinking about ways to integrate Google Wave on Wixity, we really couldn’t think of a totally awesome way to use it within our platform.  Everything that we came up seemed like a feeble attempt to integrate the next best thing, without really knowing whether it was the next best thing.

Luckily, our distraction only lasted a few hours, and we didn’t get down the path of playing in the Wave Sandbox without a decent plastic shovel or florescent colored pale.  Sometimes, trying to be early and ride the hype wave really doesn’t make sense when you think about the overall concept of what you are building.  Maybe somewhere down the road we’ll find a cool way to use it, but for now we’ll stick with developing things we know people want, not things we think people may want to play with for the novelty factor.

One place where I saw a fun use of Google Wave came from Tim Kane’s blog, daily dares.  It’s one of the more interesting mash-ups I’ve seen, but not as good as Chinese Backstreet Boys – That Way.

It’s Me. Wario!

By Rathan Haran, September 30, 2009 10:46 am

Wario

Wario Land: Shake it has done a brilliant job in creating this masterpiece of online advertising.  Absolutely love the creativity these guys had to build this.   Check it out here

The Pay-Off Matrix to Icing the Kicker

By Rathan Haran, September 24, 2009 3:00 pm

First off, Eli Manning is a great quarterback whose number will probably never reflect how good he really is.  I’m not interested in the big arm of Jay Cutler, and the accuracy of Drew Brees, or the double threat QB nightmare in Philadelphia (McNabb and Vick).  Eli Manning flat out just knows how to win games (without the ego and attitude), and he’s getting better at it.

Aside from this, there were two things I took away from the Giants Cowboys game on Sunday night, played at the eighth and ninth modern wonders of the world (Jerry Jones words, not mine), the new Cowboys Stadium.  The first thing is that the Giant receivers are pretty good and I’ll specifically note the circus TD catch by Super Mario Manningham and the incredible juke Steve Smith put on before scoring.  In basketball,  the term is “broken ankles” and in competitive urban street dance, I believe it’s “you got served Orlando Scandrick.”

The second thing was how ridiculously popular it’s become to attempt to freeze the kicker by calling a time-out at the last possible half second so that the first attempt at a field goal doesn’t count.  My buddy Jeff brought up how silly the pay-off matrix looks like when coaches try to do this.  Essentially if the kicker makes the first attempt, then there’s no reason for the kicker to believe that he can’t make it again, since kicking FGs is a highly repeatable and high probability of success event (NFL average FGs made percentage was 84.5% last year).  If he misses, then he essentially has taken a practice shot, and now can adjust to better his outcome since the physical conditions of the kick hasn’t change.  Your hoping that the best case scenario happens twice, which if kicking FGs were independent, it would be something like a 2% probability of missing twice.

There is a mental element to missing a field goal, much like their is one to making one, but I don’t think that there is a strong relationship between kicking events.  In math world, it’s call the autocorrelation, which is the cross-correlation of a signal with itself.  In field goal kicking/inane time-out  world, the signal is the made/miss on a FG attempt.  It’s saying that if a kicker produces higher than average  success rate (made FG = 100% which is greater than NFL average 84.5%), then if the autocorrelation is high he’s more likely to make the next, and if he misses (made FG = 0%), then he’s more likely to miss the next attempt.  While I can see the autocorrelation being high on made FG attempts, I just don’t think it’s true on missed attempts (how many times have you seen a kicker miss even two in a row in the NFL from the exact same spot?)

If you really want to play a mental game with an opposing kicker, giving him a practice kick is hardly the answer.  I’d call time-out once the kicker got comfortable, but not where he could complete his routine by taking the kick.  Or try something like this legendary inbound play in a high-school basketball game, because it’s all about the element of surprise, and the last-second freeze play isn’t a surprise anymore.


Wed.It.Up

By Rathan Haran, September 16, 2009 11:46 am

This past weekend was one of the most outrageously fun times I’ve ever had, and it showed how really unbelievable it is to have great friends.  I think everyone there was looking forward to this wedding for months and it 100%, without a doubt, did not disappoint.

Here’s the video montage of the wedding festivities.  With the massive cooperation of everyone at the wedding, Mohs and Laura had no idea that this was going on (you’ll see them at the end, Mohs in his sweat drenched shirt and orange tie, and the lovely lady in red Laura dancing up a storm). What started off as a cutesy gag gift for the bride and groom eventually turned into a “what could we possibly get away with without them knowing” full on puppet wedding production, all entirely made up on the fly.

Even the near fatal miscue moments turned into some fantastic shots, like the entire family picture, the wine glass clinking kiss with Amy (sitting right next to Laura), and my personal favorites, the party barn shots with Mohs at the bar and Laura on the dance floor (brilliant work by Gabs on those two). No risk, no reward.

The couple’s first look at this video had them, as Mohs put it, simultaneously laughing and crying.  I glad to see the art of puppetry hasn’t lost its magical touch on our souls.  And if this whole web application thing doesn’t work out, maybe my next career path can be puppet wedding videos.  I’d love to hear company names and tag-lines for that.

Reblog this post [with Zemanta]

Casual Gaming, Fierce Competition

By Rathan Haran, September 3, 2009 12:36 pm

Every Sunday night, my friend Jimmy (www.jimmycahill.com) organizes a small, local Sunday Night Poker game.  And every week he tempts me to get my visa and make it out to Brooklyn to play with his buddies.  With our without me, the game goes on, and every Sunday night there is someone who gets to walk home with a little more cash in their pocket.

I think this is a fairly common thing to do amongst groups of friends.  I mean, I think we’ve seen this make it into every RoCo (Romantic Comedy) ever made, and boy do those movies know how to parody every day life.  But an interesting problem was brought up when we were looking over how to rank each player.

Now, as typical (fill in day of the week) Poker Nights go, there are some people that are there every game, and then there are some who can rarely be bothered to visit Brooklyn that frequently.  That leaves us with a bit of problem since games tend to vary in size, as well as vary in who is playing on a given night.  We couldn’t simply tally up how many first to last place finishes everyone has to accurately rank a players skill.

Also, since the number of players can vary, this means that the difficulty of winning a particular game changes as well (the more players there are, the more you have to defeat to be the winner).  This throws another wrinkle in the ranking systems since winning an eight player game is harder to do than winning a three player game.  And then, how do you rank the random friend who came once and ended up winning?  Should he live forever as the best poker player your game has ever seen?

I did a little research and I found a pretty good way to rank players based on the size of the game, how rich the buy-in is, and where people finish in the game.  This equation came from Tourney.com, and it does a pretty job of creating separation between who finishes first and who wears the asshole hat (college reference anyone?):

equation2In this equation, B represents the buy-in, so the higher the stakes, the more points you can accumulate.  Also, since E, which is the number of entrants, is also in the numerator, a player gets more points for winning larger games.  P represents what place you finish in, so the further down you place, the larger the denominator, and the less points you can get.  Pretty cool.

The only problem I have with this system is that it rewards players who play a lot, and doesn’t penalize players that lose a lot.  With the scoring system, a player that plays a whole lot games and finishes in last place in all of them can outrank a player who plays a few games and actually wins them.

A better system would be to figure out relative points given the size of the game, and its a fairly simple adjustment to the equation.  We simply subtract out the points for what the average finish would be.  Those that finish above average, get positive points, and those that finish below get negative points.  Since losing games does not penalize you to the same magnitude as winning games reward you, a player can actually make up ground very quickly by winning games.

Now if you still find yourself at the bottom of your rankings, you may just have to suck it up and admit to yourself that you are not very good at poker.  And if you really still want to keep playing, we play every Sunday night so just give me a call.  I can even sell you a pass to the pool on the roof.

Panorama theme by Themocracy