Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Tuesday, February 09, 2010

I'm in the money - Second Place in the Playoff Fantasy Football Pool

My roster (RDK 1) came in second in the the RKB Playoff Fantasy Football pool!

I predicted a significant chance (18%) that roster RDK 1 would be in the money! And it happened. I just want to take some time to gloat. My acceptance speech:
"I want to thank the Drew and the Saints for winning the Superbowl, especially their defense for that critical touchdown and Garrett Hartley - kick away Garrett. I also want to thank Joseph Addai for getting that touchdown that helped put me over the top, even though his team lost. And Adrian Peterson, you didn't even make it to the big game, but getting those touchdowns with no credit for Brett Favre really helped. Thanks to Yahoo for your player stats, and Sagarin for your ratings. And finally, I couldn't have done it without math and statistics, you guys rock!"


Here are the final results with all of the roster's points separated by position. It pays to have a good QB on the roster, but WR, RB and K's also contribute almost the same amount of points for the roster which are towards the top. Remember that there are 3 RW's and 2 RB's so the K has more point generating power as a single player. Even the defense can be significant. Probably the TE is the least useful point generating player on a roster.

The final results separated according to the game in which the points were generated reveals a truism that has been a guiding principle all along. Rosters with players that play more games generate more points. The light blue "dusting" of Superbowl points is what determined the winner this year.

A chart with the order of the roster based on the points before the Superbowl shows a little more clearly that the Superbowl points are what changed the order around. The top contenders had many or all NO and IND players left on their sheets, especially the big point positions like QB and K.

The rosters are shown above for the top twenty finishers, with just the players in the Superbowl on them. Realize that in the above some roster (like mine, RDK1) had players that did not play in the Superbowl and so are not listed above, however the correct total points are in the grand total at bottom.

The final contenders strategies were the three fold obvious ones, all NO, all IND or a mix. Give the way the game went it didn't pay to be all IND. I was able to thread my way to second place because I was a mostly NO roster, K, QB, DEF, but with enough IND to differentiate myself from others. Those that split the K and QB between IND and NO ended up not faring so well.

Finally, I simulated this outcome. Bruschi Drink 3 in first place and RDK1 in second, was the second most likely outcome in my simulations at 10% after the one with Tim G 5 in second.
The simulations above are from the prediction before the Superbowl. What happened to Tim G 5? That roster started 2 points behind RDK1 before the Superbowl. It had IND K instead of NO K for who were 5 to 11 in the Superbowl for 6 more points of deficit. RDK 1 beats Tim G 5 entirely due to the choice of kickers. Even if Matt Stover (IND) had made the field goal he missed that would only have added 3.

The simulations also picked out particular aspects of the game. About 40% of the time when New Orleans defense forces a turnover they get a touchdown. I included that in my model and lo and behold it happened during the game. Having Joseph Addai finally get a touchdown this playoff season pushed me over some of the NO rosters, but having NO do so well pushed me over the IND rosters. It also helped when Jeremy Shockey got a touchdown because no one of the top contenders had him for points. Sometimes it is just as good when no one gets the points as when your roster gets the points.

Next up, March Madness simulations. I have to go get started.

Monday, November 10, 2008

Math Jokes - Holliday edition

From this collection of math jokes (I will not repeat the ones that denigrate enginneers.)

Q: What do you get if you divide the circumference of a jack-o-lantern by its diameter?
A: Pumpkin Pi!
(the above is a little late for Halloween)

Q: Why do you rarely find mathematicians spending time at the beach?
A: Because they use sine and cosine to get a tan and don't need the sun!

Q: Why do mathematicians often confuse Christmas and Halloween?
A: Because Oct 31 = Dec 25.
(this year they can confuse Halloween, Thanksgiving and Christmas because Oct 31 = Nov 27 = Dec 25, somebody check my math)

Thursday, July 17, 2008

Mathmatical Rice Krispie Treats

A square plate and a coincidental cutting and stacking of (approximately) square Rice Krispie treats produced a tasty square pyramid with some interesting mathematical qualities. The layers of the pyramid are each a square, 1, 4, 9, 16 (Integer sequence A000290), they form a pyramid and summing each subsequent layer yields the (obviously called) square pyramid numbers, 1, 5, 14, 30 (Integer sequence A000330).

Two other interesting properties of the square pyramid numbers:
  • The sequence contains exactly one square greater than 1, namely 4900.
  • Gives number of squares formed from an n X n square. In a 1 X 1 square, one is formed. In a 2 X 2 square, five squares are formed. In a 3 X 3 square, 14 squares are formed, and so on.
Compare the suare pyramid number sequence with the triangular numbers, 1, 3, 6, 10 (sequence A000217). These are like the bowling pin two dimensional pyramid, but each level has fewer treats than the square pyramid stacking above. I think I like the quantity from the square pyramid better.

The On-Line Encyclopedia of Integer Sequences is fun for looking for interesting sequences of integers, if you like that kind of thing. They even have the Lost numbers (4, 8, 15, 16, 23, 42, sequence A104101). The encyclopedia generates lists and graphs of number sequences, but even more interestingly, though less useful, it will generate a sound file of the sequence as played on an instrument of your choice.

Monday, January 07, 2008

Are you a Nerd? Of course you are, you're reading this.

You always knew you were a nerd, but just what kind are you? As always the Internet comes to the rescue with a fun quiz.

My results may not be typical, use with caution.

NerdTests.com says I'm an Uber Cool Nerd God.  What are you?  Click here!


(via Marc A. Murison)

Friday, May 25, 2007

"Dynamic" baseball Payroll vs. Performance chart

Ben Fry, who can program, has created a dynamic salary vs. performance chart for this baseball season. His chart connects the current standings of each team to its 2007 salary.



We don't learn much more than I realized when I plotted the salaries vs. performance for last year - there is no correlation. You can also delight in the fact that the Yankees are paying a lot of money for a very mediocre team this year.

On his chart you learn these facts with more flash and javascript. I agree his chart dynamically changes the team performance as the teams win and lose games through the season, but I think if he has gone to all this trouble it would be great to see the payroll change as teams add and drop players over the season. Paul would point out that this is still a useless chart since we have beaten to death the idea that performance does not correlate to payroll in baseball (and in many other things). He suggests you read Moneyball.

(via Castro's Favorite Color)

Wednesday, May 09, 2007

Just how many prime ribs or prime numbers are there.

Just how many numbers are prime? Something on popurls.com inspired me to got to the Prime pages to figure it out. Experimentalist that I am, I just went and grabbed a list of the first thousand primes and then some points along the way to the first 15 million to see what I could see. I divided the number of primes by the prime number I had reached to get the fraction of numbers below that number that are prime. Plotting this yields a suspiciously smooth decreasing curve if you use a log x-axis, which is necessary because we have numbers from 2 to 275 million.

Since we don't have a straight line yet the next plot is of the inverse of the fraction of prime numbers. Bingo! We have a straight line. A quick check of wikipedia (Distribution of Prime Numbers. Know your search terms!) reveals that I have just empirically rediscovered the Prime Number Theorem. Typical engineer.

That theorem defines pi(n) as the number of numbers that are prime below n. The fraction of numbers that are prime that I was trying to figure out is pi(n)/n.

pi(n) ~ n/ln (n)

pi(n)/n ~ 1/ ln(n)

My plot is the inverse of the fraction on a log which gives me my straight line ln(n). The chance of a randomly selected number being prime is 1/ ln(n).

Sunday, May 06, 2007

Team payrolls, last year's results and who is gonna win the pennant this year

We had discussion at work about baseball payrolls. I wondered just how high the Yankees payroll is and who the next place team was. A plot of the 2006 payrolls and the 2007 payrolls vs their rank shows that the Yankee salary is certainly disproportionate vs. the other teams, but they are not twice the next team anymore. The Florida Marlins and Tampa Bay Devil Rays hold the last two spots.


A high salary does not necessarily get you a good winning percentage. There is little correlation between salary and winning. Take that Yankees. Here is an example from 2006, both with and without the Yankees who skew the chart.

They say that past performance does not guarantee future results. That is also true for at least the last three seasons of baseball. I plotted the year's winning percentage vs. the year before and get an even worse correlation than for salaries.


Perhaps it is the quality of players that determines how many baseball games you will win. Team payroll or past performance doesn't seem to correlate.

Wednesday, March 14, 2007

Some last March Madness NCAA Basketball pool advice.

The NCAA Basketball March Madness pool that I play in encourages upset picks by weighting the points by the seed in the tournament. You get the seed for the win. If #13 Davidson beats #4 Maryland you get 13 points, otherwise you get 4 points. Each round is multiplied by a factor, first round is 1, second is 2, third is 4 and so on to 32 points multiplied by the seed of the overall winner. It is ingenious because being safe doesn't translate into as many points as picking upsets, and that's the key to winning the whole thing.

Last year I did some extensive upset probability analysis of upsets in the round of 64 and round of 32. I also separately analyzed the final four and the winner. This year I am spending my time on my picks so I will just use the analysis from last year, which does neglect the 2006 results, but that is a small effect over the 21 years of data already in the analysis.

My advice:
  • Pick the #1 team in the first round. They have never lost, and you are not going to be the lucky one who finally picks it when they do.
  • For almost the same reason as above, pick the #2 team to win in the first round also.


  • Pick upsets in the first round for the other matchups. #8 vs. #9 seeds are worse than toss ups, more than half of the time the #9 seed wins. Even #12 beats #5 one in three times.
  • Pick more upsets in the second round. Almost half the time, 12 beat 4, 5 beat 4, 6 beat 3, 10 beat 2. A quarter of the time 8 beat 1, 7 beat 2, and 11 beat 4. Some of those matchups are rare, so take the statistics with a grain of salt.


  • The worst seed to win the tournament was #8 and this happened only once. The worst seed to make it to the Final Four was ranked #11, which also only happened once. Since these are highly improbably events your bracket should avoid them.

  • Get some more information about the individual teams, but don't rely too heavily on it (see upsets above). I am using the Sagarin ratings for some extra information on where teams were ranked over the year and as a substitute for my utter lack of knowledge about college basketball. This gives me some way to guess where the upsets that are expected above will happen. My excitement is in the math more than the sport.

Finally, on any given day any team can beat any other team. The key to winning is picking which upsets will happen and that takes some knowledge of the teams. Good luck.

tags: , , ,

Happy Pi Day 2007

Last year I celebrated Pi day (March 14 is 3/14. Get it? 3.14) and provided some fun links to mark the occasion. This year I was just hoping to get this shirt in time to wear it for the day. Maybe it will arrive in today's mail. I promise a picture if it arrives in time.

tags: ,

Friday, February 16, 2007

Don't do what I tell you - a paradox.

The other day I exclaimed, "Don't do what I tell you!" "Don't do what I tell you" is a paradox along the lines of "I am a liar" (Epimenides or Cretan paradox). If you don't do what I tell you then you are doing what I told you (by not doing it), but to not do what I tell you you must do what I tell you and so it goes around.

These types of statements were the inspiration for the title of this blog, "The Honest Hypocrite". Hypocrites say one thing and do another, but if I admit that I say one thing and do another then I really am correcting what I say to what I did so I am not a hypocrite, am I. But I just said I was, and so it goes around and around.

Set theory can produce a similar contradiction, Russell's Paradox: The set of all sets that do not contain themselves as members. Russell discovered this paradox while working on Cantor's theorem which was important in understanding infinity and may have driven Cantor insane. Thus these statements are important to mathematics and can be dangerous in and of themselves.

These types of results led to the celebrated Godel's Incompleteness Theorem which says that you can never create a complete and consistent finite list of axioms, or even an infinite list that can be produced by a computer program. Each time you add a statement as an axiom, there will always be other true statements that still cannot be proved as true, even with the new axiom. Those paradoxes above will still pop into your mathematical theorems or your life, no matter how hard you try to avoid them or fix them.