Box Relatives

Thoughts about puzzles, math, coding, and miscellaneous

February 15, 2012
by Alex
10 Comments

Life changes

This past Wednesday my two year-old son was diagnosed with leukemia. At this age the chances of a cure are surprisingly high and the doctors have been extremely pleased with his progress so far. Still, it is an incredibly scary process which is draining in so many ways.

I have been hesitant to write about this, but I now think it is necessary to do so. It doesn’t hurt to raise a little awareness about cancer. And writing this now will allow me to write more about it in the coming weeks, months and years as his treatment progresses. I’m sure I will have lots to say on the subject.

Many people have asked how they can help. I would ask you to consider giving blood or (especially) platelets. A timely transfusion of platelets early on in the process may have saved my son’s life. If you are eligible and can find the time, please consider donating.

Also: I don’t know what this will do to my schedule quite yet, but I am guessing that a lot of non-essential activities will fall by the wayside. Don’t expect much from me on Twitter or here for a little while. I also expect @FakeWillShortz to slow down his rate of tweeting, though he’ll be taking on some new writers soon.

Thanks for reading.

January 23, 2012
by Alex
1 Comment

Crossword Butler

I am pleased to announce the launch of Crossword Butler v. 2.0 (let’s call it beta 1). Those of you who remember the original Crossword Butler will notice some differences from the old version, namely:

1. It is now an online interface, accessible at http://crosswordbutler.com
2. It doesn’t blindly get all available crosswords; only the ones from providers who have given their permission
3. Most interestingly (I think), it gives independent crossword constructors a site to host their puzzles and distribute them easily for free or for profit.

Right now the site is essentially a souped-up puzzle pointers page, that in addition to most of the standard links, also links to puzzles like Matt Gaffney’s weekly contest and Andrew Ries’s weekly Rows Garden puzzle. But the fun part will begin when independent constructors start using the site to host their puzzles. Right now there isn’t a one-stop shopping destination for independent puzzlemakers, so constructors have to set up Paypal accounts, websites, e-mail lists, etc. to be able to distribute their work. Crossword Butler will take care of all of that; all a constructor has to do is upload the puzzles to the site (through a simple interface). If the puzzle is paid, I would take a (small) cut; if the puzzle is free I’ll happily host it free of charge.

Feel free to become a member of the site and poke around. If you have suggestions, comments, questions, leave a comment below!

Thanks for reading. This is my grand experiment this year — hope it works.

January 20, 2012
by Alex
0 comments

Ben Sheets vs. Barry Zito

When I read Moneyball a while back, it was already a few years old, and already seemed it (a whole chapter devoted to Scott Hatteberg?!) I don’t remember all of it, but one part in particular stood out for me at the time:

The hardest thing,” says Billy [Beane], “is there is a certain pride, or lack of pride, required to do this right. You take a guy high no one else likes and it makes you uncomfortable. But I mean, really, who gives a f**k where guys are taken? Remember Zito? Everyone said we were nuts to take Zito with the ninth pick of the draft. And we knew everyone was going to say that. One f**king month later it’s clear we kicked everyone’s ass.

A lot of people in the room have forgotten that the scouting department hadn’t wanted to take Barry Zito because Barry Zito threw an 88-mph fastball. They preferred a flamethrower named Ben Sheets. “Billy [Beane] made us take Zito,” Bogie [a scout] later confesses.

Well, now that both guys’ careers are essentially over, we can ask the question: who had the better career, Zito or Sheets? Did Billy really kick everyone’s ass with that pick? Or were the scouts right?

I have chosen to measure the careers by fWAR (Fangraphs Wins Above Replacement) because I think that’s probably the best way. (If you want to do it some other way, be my guest, but bear with me for this part.) Now, before I reveal who has accumulated more WAR over his career, what do you think the answer will be, based on what you know about both careers?

Personally, my guess was Zito. I didn’t follow either guy especially closely during their careers, but I recall that while Sheets probably had the higher peak, Zito was much, much more durable, and he wasn’t so bad himself, even winning a Cy Young award along the way. Sure, he’s been awful since joining the Giants, but he’s still been above replacement level. So I would have guessed Zito would have accumulated more WAR, maybe about 15% more.

Well, here’s what Fangraphs says — Zito: 30.8 WAR. Sheets: 31.7.

So, yeah. Sheets’ peak was WAY higher than Zito’s. And it actually gets better — the FANS prediction for Zito this year is 0.9 WAR, which means he and Sheets would be exactly even in WAR at year’s end.

“But wait,” you might say. “It’s not fair to compare their entire careers. The A’s would only have had control over their pick for six years, before he hit free agency. Who accumulated more WAR over those first six years?” Good point, theoretical reader. Let’s take a look: during Zito’s time with the A’s, he accumulated 24.2 WAR. Meanwhile, in Sheets’s first six years with the Brewers* he accumulated 24.5 WAR.

* I’m not sure when he would have first hit free agency — the Brewers bought out at least one year of it with a contract extension. This number might actually be higher.

So to recap: the A’s didn’t exactly “kick everyone’s ass” with this pick. If anything, it was a wash. But there is an amusing postscript to the story — the A’s did end up signing Ben Sheets to a one-year contract for $10 million at the end of his career. He gave them 0.6 WAR for their efforts. Guess they just picked him up at the wrong time.

January 13, 2012
by Alex
0 comments

“Improved” Rock-paper,-scissors

I don’t know about you, but growing up I always played rock-paper-scissors with just three weapons … you know, the three in the title. But my wife is French, and as Wikipedia explains:

Similarly, the French game “pierre, papier, ciseaux, puits” (stone, paper, scissors, well) is unbalanced; both the rock and scissors fall in the well and lose to it, while paper covers both rock and well. This means two “weapons”, well and paper, can defeat two moves, while the last two weapons can only defeat one of the other three choices.

So I have questions for you.

1. There is a weapon in the French version that should never be used (in an optimal strategy). Which one is it and why?

2. Is it possible to add one weapon to rock-paper-scissors without rendering one weapon inferior to all the others? If so, give an example; if not, show why not. (Fans of The Big Bang Theory know it’s possible to add two.)

December 26, 2011
by Alex
2 Comments

Christmas Trivia 2011

Every year I write a ten-question trivia quiz for my office’s holiday party. And this year I’m sharing it on the blog! Enjoy.

1. In reaction to Fox News (and others) calling for people to “put the Christ back in Christmas”, some on Facebook have started calling for people to put who back in Thursday?

2. Which astronomical object which passes by Earth approximately every 76 years was visible in 12 BC, leading some to believe it may have been the Star of Bethlehem?

3. The tallest snowman ever was built in 2008 and named “Olympia SnowWoman.” In which U.S. state was it made? Hint: not Washington state.

4. North American reindeer are usually called by what other name?

5. Which man, Duke of Bohemia from 921 to 935, was eventually elevated to Sainthood and even posthumously declared king as a result of his legendary goodness?

6. What comedian portrayed the fictional character “Hanukkah Harry” on Saturday Night Live from 1989 to 1990?

7. Which territory of Australia was named by Captain William Mynors as he sailed past it in December of 1643?

8. What phrase ends the Charles Dickens novella “A Christmas Carol”?

9. Which country music megastar sang about the War on Christmas in his
song “Have I Got a Present for You” on the 2008 special A Colbert Christmas: The
Greatest Gift of All!
?

10. What 1996 movie inspired one reviewer to quip that
Arnold Schwarzenegger shows “the comic timing of a dead moose”?

Want the answers? You can google them … or discuss in the comments.

November 29, 2011
by Alex
2 Comments

Solving the overtime dilemma

The NFL has an overtime problem, or so everyone seems to think. Every year we get long screeds from columnists lamenting the unfairness of sudden death overtime. Why? Some people think it’s unfair that one team can get the ball and score, without the other team’s offense ever taking the field. Others point to the fact that the team that wins the toss wins the game 25% more often than the team that loses the toss. And recently, the NFL has taken some action, changing the rules for overtime in the postseason:

Under new NFL overtime rules, a coin toss still determines which team gets possession of the ball first in the overtime period. However, if a team scores only a field goal on the ensuing possession, the opposing team has the opportunity to possess the ball. Thus “sudden death” applies only to touchdowns, not field goals. If the score is still tied after 15 minutes, play continues until a score is made and a winner is determined.

Okay, a few things here. First: the new overtime rule for the playoffs seems overly complicated and doesn’t completely solve the problem of only one team touching the ball. Second, in the regular season, what’s so bad about ending a game in a tie? Why not eliminate overtime completely in the regular season? Well … that’s not going to happen. We hate ties here in America. So with that in mind, here are my two cents about “fixing” overtime.

Consider this: why do teams take the ball first in overtime? Is it because they think they are going to score on their first possession? Well, not necessarily, though that does happen a healthy chunk of the time (30+%). No, they want the ball first because they feel that will put them in the best position to score at some point during overtime. (Mathematically, we can say that this move has a positive expectation.)

But why do they feel this way? Two words: field position. I can’t find what the average starting field position is for teams after a kickoff (little help?) but let’s say it’s the 27 yard line*. Football teams intuitively feel they are more likely to score if they start on the 27 than their opponent, and this intuitive view matches up well with the numbers. According to the famous Berkeley paper on the topic, starting with the ball on the 27 yard line is worth 0.71 points (on average) to the team with possession. That doesn’t sound like a lot, but it’s a positive number, meaning that team is more likely to score than their opponents.

* It’s probably lower than that now with the new kickoff rule, but again, I don’t have any numbers here.

So how do we fix this? Easy: just eliminate the opening kickoff in overtime and give the ball to one of the teams on a pre-determined yard line. Now what should that be? The ideal place to start the ball is one that is worth 0 points to the team with possession; this means that the team that starts on defense is as likely to score as the team on offense. If we go back to the Berkeley paper, we find that the 15 yard line is the place to start. Intuitively, this again makes sense — a coach would have to think pretty hard before simply taking the ball to start overtime if he knew he would start from his own 15. I suspect it would happen more often than not, but certainly a lot less often than it happens now. And if the math is right, you would see the team that started with the ball in overtime win a lot less often than they do now.

November 10, 2011
by Alex
3 Comments

A fun math problem

When I was sick recently, my boss e-mailed me a math problem he said I might try to solve to pass the time. Now, I had thought that this was a problem he had read somewhere, but no: this is an actual thing that happened to him. It happens to lend itself to a cool problem, and here it is:

You have ten players and five two-player games at a party. There will be five rounds of games, and each round will include all five games played simultaneously. You want every player to play each game once, and never play against the same player more than once. Is there a solution?

Once you’ve worked that out, consider:
(a) Is there a solution if you have N rounds of games and 2N people, where N is an arbitrary odd number?
(b) Is there a solution to (a) if N is even?

I know the answer to (a). I suspect I know it for (b) but I can’t prove it. I’d like to see what you all can come up with.

UPDATE 11/14/2011 This problem has been completely solved in the comments! Check them out.

UPDATE 2: 11/15/2011 I’ve also put the C++ code I used to brute-force a solution in the N=6 case online here, in case anyone’s interested.

November 9, 2011
by Alex
1 Comment

2201 Fascinating “Facts”

When I was a wee trivia buff, I received a book called “2201 Fascinating Facts.” In fact, if I remember correctly, I actually received *two* copies of it within the span of a year or so. And I loved it. I read it several times in my youth and learned lots of wonderful facts. But in the internet age, you actually get to learn what is a fact and what is not, thanks to Snopes and the invaluable List of Common Misconceptions page on Wikipedia. And since that time, I have learned that A LOT of the “facts” in the book are not so. Such things include:

  • The Great Wall of China is the only manmade structure visible from space (debunking)
  • You can see the stars in daytime from the bottom of a well (debunking)
  • The deer botfly can travel more than 800 miles per hour (debunking)

And the one that brought all this back to mind: a duck’s quack doesn’t echo (debunking). So now I’m totally skeptical of anything and everything I’ve read in that book. Here’s what I’m going to do: I’m going to start reading it again to (a) brush up on my trivia knowledge and (b) brush away all the false facts I’ve learned by researching any claims that seem suspect.

A first one that has always seemed suspect to me: there is a claim that some royal figure described St. Paul’s cathedral as “awful and artificial” — meaning it as a compliment! Supposedly, “awful” meant “awe-inspiring” and “artificial” meant “full of great art.” This is actually retold in several places including some that inspire confidence, but no one seems sure of its accuracy and there doesn’t seem to be an official debunking (or, um, bunking). Can anyone find anything about that?

All right, this blog is going to start detailing my journey. There may not be as many mistakes as I think there are, but I have to know. And you’re all coming along for the ride.

October 27, 2011
by Alex
2 Comments

Star Wars Thoughts

  • When Alderaan exploded, did Obi-Wan Kenobi feel it instantaneously or was there a speed-of-light delay?*
  • Yoda says “Always two Sith there are. No more, no less.”
    • So why did the Jedi think the Sith had been extinct for a thousand years?
    • Who are the two Sith after Darth Vader and Darth Sidious both die in the Death Star?
  • Han Solo boasts that the Millenium Falcon made the Kessel Run in under twelve parsecs.
    • People have pointed out that this is a unit of distance, not time, but aren’t they equivalent according to relativity? Since there’s no real way to time a run that long, couldn’t someone have checked the Falcon’s odometer after the run to see how long it took him?
    • Or, more likely … is Solo just lying to con Luke and Obi-Wan?
  • Finally and most importantly … what changes in the prequels if Qui-Gon never finds Anakin? Dooku doesn’t get killed by Anakin so presumably he remains Sidious’s apprentice. The Jedi still get exterminated and Palpatine still takes control of the Senate and becomes emperor. The Death Star is still built with Dooku taking the role of Darth Vader. The main events that never happen are Luke and Leia being born and Naboo being saved. I guess my point is … all the bad things still happen if Anakin is never found, but none of the good things in the original trilogy ever happen. Finding Anakin wasn’t a bad thing for the Jedi; it saved them.

* This joke is lifted from my Twitter feed, and was probably unintentionally stolen from XKCD. Eh, still funny.

September 16, 2011
by Alex
0 comments

Daily Show Oopsie

Oh, Daily Show. You ought to know better.

The Daily Show With Jon Stewart Mon – Thurs 11p / 10c
Uncensored – Big Mouth Billie Vagina
www.thedailyshow.com
Daily Show Full Episodes Political Humor & Satire Blog The Daily Show on Facebook

Cute segment, Kristen Schaal is great, etc. But at the end, they list a phone number, 1-800-555-VAJJ. No problem, right? 555-numbers don’t go anywhere, do they? Well, not exactly. Most 555-numbers are reserved, but 800-555 numbers are not. There is one that is reserved for TV shows and movies — 1-800-555-0199. Look for it; it’s everywhere. However, if you don’t use that number, you risk sending callers to a number that promises “sexy students, housewives, and working girls” … like the one listed by The Daily Show does. Honestly, where did you think dialing 1-800-555-VAJJ was going to get you?