Sox Win, As Formula Predicted
So in 2004 I predicted the Red Sox would win in 2006, using a mathematical formula. I was wrong. So I realized that my formula was off. Because the length of difference between last year won and the pivotal year of beating St. Louis crossed millennia, we had to add an extra year.
#!/usr/bin/perlThis formula correctly "predicts" the next championship of each team:
use warnings;
use strict;
# script to predict when the next Boston team championship
# will occur after either:
#
# * winning first championship in team history, against St. Louis
#
# OR
#
# * winning first championship since St. Louis existed as a team
my %boston_team = (
# team last year won, year beat St. Louis
Celtics => [1957, 1957],
Bruins => [1941, 1970],
Patriots => [2002, 2002],
'Red Sox' => [1918, 2004],
);
for my $team (sort { $boston_team{$a}[1] <=> $boston_team{$b}[1] } keys %boston_team) {
printf "%s: %d\n", $team,
predict_year(@{$boston_team{$team}});
}
sub predict_year {
my($last_won, $beat_stl) = @_;
my $base_year = $beat_stl + 2;
$base_year += int($beat_stl/1000) - int($last_won/1000); # adjust for difference
return $base_year;
}
__END__
Celtics: 1959I CALLED IT!!!!!</colbert>
Bruins: 1972
Patriots: 2004
Red Sox: 2007
Leave a comment