Minimum Squared Loss

by Tom Temple

26 January 2010, 09:46

I think I’ve got Netflix pretty well trained to give me good movies. Of course this is largely a good job on their part; but I think that I had something to do with it.

I only rate 5s and 1s. Everything in between I don’t rate.

I’m pretty sure that Netflix still uses quadratic loss when predicting your ratings. I think this is really holding them back since it puts an artificial central pressure on ratings. I’m also suspicious that there is a thresholding effect at 4 stars. Specifically, for clustering purposes, I think considers 4 and 5 stars to be the same thing, “movies you liked”. It finds other people who have a high intersection of 4—5 movies and uses them as predictors.

Early on, I rated X-men 3 at the 4 level which led to systematic over-prediction of franchise action movies. That was a mistake. I fixed that by downgrading it to 3 but then putting a 5 on X-Men 1.

Every time I see a bad movie, I make sure to tell Netflix, especially if everyone else rated it highly, e.g., Million Dollar Baby.

Rollover Gotcha

by Tom Temple

7 January 2010, 14:03

If your wireless usage is between 550 and 2100 min/mo and you’re on AT&T, it might strike you as a good idea to get the the 2100 min/mo plan to take advantage of rollover minutes. That is because you don’t have to worry about going negative and paying the ridiculous premium, while at the same time taking advantage on the price non-linearity.

Continue...

Fahklift Certification

by Tom Temple

21 November 2009, 17:48

Dahndest thing happened to me today. I gave my usual class 4,5 class to a bunch of kids at MIT. Not only that, it was in that crazy fahking Statar Center up in this fancy-pants conference room.

They were all like 25-30 yeah olds so I assume theya all PhD students oha post-docs. So I ask them, “Whya you all wantin’ to drive fahklifts.” They look at me funny and one says, “because we’ve got one.” Fahkin’ MIT kids!

Continue...

Ricci and affirmative action

by Tom Temple

21 November 2009, 11:16

Looking at the Michigan case again through the lense of Ricci I think I’ve decided how to do affirmative action.

Continue...

An unexpected surprise hanging

by Tom Temple

11 November 2009, 09:34

This riddle is called The Unexpected Hanging Paradox

A judge tells a condemned prisoner that he will be hanged at noon on one weekday in the following week but that the execution will be a surprise to the prisoner. He will not know the day of the hanging until the executioner knocks on his cell door at noon that day. Having reflected on his sentence, the prisoner draws the conclusion that he will escape from the hanging. His reasoning is in several parts. He begins by concluding that the “surprise hanging” can’t be on a Friday, as if he hasn’t been hanged by Thursday, there is only one day left – and so it won’t be a surprise if he’s hanged on a Friday. Since the judge’s sentence stipulated that the hanging would be a surprise to him, he concludes it cannot occur on Friday. He then reasons that the surprise hanging cannot be on Thursday either, because Friday has already been eliminated and if he hasn’t been hanged by Wednesday night, the hanging must occur on Thursday, making a Thursday hanging not a surprise either. By similar reasoning he concludes that the hanging can also not occur on Wednesday, Tuesday or Monday. Joyfully he retires to his cell confident that the hanging will not occur at all. The next week, the executioner knocks on the prisoner’s door at noon on Wednesday — which, despite all the above, will still be an utter surprise to him. Everything the judge said has come true.

What is wrong? Is anybody abusing logic here? If so, who?

Suppose that he was told the execution would be either Monday or Tuesday (equivalently, the week only has two days) and he was executed on Monday. Is this case different?

But he was already winning

by Tom Temple

26 October 2009, 18:09

A while back Christopher Hitchens issues an open invitation to debate atheism with anybody. One of these debates turned into a movie that comes out (straight to DVD!) tomorrow. Honestly, I’m pretty confident that the movie is going to be consummately boring not least because Wilson concedes a lot and seems primarily interested in the “Without religion, i.e., if life is meaningless, how do you establish morality?” question. That should be a pretty easy one.

Anyway, I’m just posting to tell people to listen to the last little bit of this Laura Ingraham appearance where, on the buzzer, Hitch nails a three-pointer from half-court.

Cosmo's Anger, While Entertaining, Is Often Misdirected

by Joran Elias

21 October 2009, 14:06

Cosmo apparently doesn’t know much about credit/debit cards. Namely that everything he purchases from a merchant that accepts credit/debit cards costs as much as 3% more than it should.

(Yes, you read that right. Merchants often raise all their prices by 1-3% to cover the fees they pay to provide the optional convenience of credit/debit purchases. If you buy everything in cash, you’re still subsidizing other people’s use of credit/debit cards.)

Your government is trying to save you money, Cosmo.

Thank them.

The Perpetual Overhyping of US Men's Soccer

by Joran Elias

11 October 2009, 17:52

I didn’t get to watch the game, but the US men’s soccer team beat Honduras over the weekend by a score of 3-2, which assures their participation in the 2010 World Cup in South Africa.

Color me unimpressed. Honduras, media outlets are quick to point out, has been tough to beat at home. Of course, they really only play CONCACAF opponents, particularly at home.

And judging by the highlights, the US only barely edged out a win. Honduras should have tied the game in the 87th minute, but instead sent a PK over the cross bar. Not to mention the fact that Casey’s first goal looked, well, pathetic. For Honduras, that is.

It is stunning to me how much denial exists regarding the quality of soccer among CONCACAF nations relative to the rest of the world, Europe in particular. One really needs to keep in mind that Honduras (indeed, even Mexico these days) is just not a very strong force in international soccer.

This is perhaps an unfair comparison, but the Honduras men’s Olympic team lost all three of its games in 2008 (3-0 to Italy, 1-0 to Cameroon and 1-0 to South Korea). And this is the country we are excited about barely beating on the road?

Perhaps the most distressing fact about the team? Their midfield is so shitty, a player who has logged zero minutes with the US team, indeed hasn’t (to my knowledge) even practiced with the US squad, or any squad because he’s still rehabing from surgery is generally considered a likely starter as soon as he’s available, and has effectively been penciled into the lineup for the World Cup.

And this fact is referred to as a positive sign for the US squad going forward. Good grief.

Don’t get me wrong; if Jones is what people say he is (I’ve never seen him play) then he will surely help. But doesn’t this suggest something about the level of player we have right now? That some guy we’ve never seen play on our squad and is currently injured is considered a potentially massive upgrade in player quality?!

If I were Ricardo Clark, or Michael Bradley, or Benny Feilhaber or Sacha Kljestan, I’d find this situation fairly embarrassing.

Browsing for Images in OS X

by Joran Elias

9 October 2009, 14:03

This from Cosmo has me a little confused, because I generally consider him to be way more knowledgeable on the intricacies of OS X than myself.

And picking on Cosmo when I think he’s whining excessively is a sort of pastime of mine. So I would suggest to him scrolling down in the left pane of the open file dialog box. If he did, he ought to see a Media menu that expands to include a subset of Music, Photos and Movies.

It’s in every app that I’ve tried on my computer. I didn’t look carefully, but I’m guessing Cosmo was trying to upload an image from Chrome? If Google hasn’t implemented this feature, that’s their fault, not Apple’s.

Residency Matching

by Tom Temple

29 September 2009, 10:51

A few of my friends are going through residency matching with hospitals right now and by coincidence we ended up discussing that very problem in an optimization class.

The problem, as posed, is to find a perfect stable matching. The simple explanation is they are trying to find any matching such that there is no pair of assignments in which the two hospitals and two students would (all four) prefer to switch. This has little to do with optimality, except for that if anything were changed, at least one player would be worse off. It is notable that the classic version of the algorithm would produce a matching that favored one group or the other. In the residency problem, I wonder which is given the preference?...

The main point of this post is just to point interested people to that Wikipedia article. Beyond that, more recent scholarship has identified a number of nice properties of the problem (e.g. there exists a self-dual linear relaxation), which make it easier than it looks to find feasible assignments. As a result, I’m suddenly quite suspicious that DOC trips could effectively use commercial optimization software for trip assignments. That would be fun—perhaps even more fun than doing it by hand. Remember that, guys?

Gender selection

by Tom Temple

15 September 2009, 13:44

Saletan just posted an article about gender selection that reminded me a lot one I wrote.

In retrospect, my position was insufficiently nuanced to completely answer Bill’s question, so I’d like to clarify it.

I think that all the stated techniques are “okay” which should be interpreted as “should be left legally permisable.” From the context it should be clear that there is an ordering of preference going increasing from later abortions up to special condom. I guess you could say that this preference is “moral”. I like to think though that my system of ethics is more straightforward than that though.

So let me briefly write out Tom’s system of Ethics, (TSE).
Assume there is some global function (subject to restrictions that are beyond the scope of this article) that assigns values to various outcomes. An action’s “goodness” would simply the expected change of this global function. However, we cannot globally agree on this function.

Assume that we can somehow establish “robust consensus” on some convex family of functions. Any action with expectation greater or equal to zero for some function in the interior of this family is “permisable.” We can define a partial order such that an action is “better” if and only if there does not exist a function in the family which contradicts this preference. But this is not a full order, and certain preferences will be left to personal measurement.

We could try to define universal goodness in terms of measures over this family, but that’s what I would call “hide the potato”—agreeing on measures will be no easier than agreeing on a global objective.

Logarithmic Parlor Trick

by Tom Temple

11 September 2009, 01:16

Seeing how it is fast becoming job interview season, I thought I’d share a parlor trick with you guys. Business-type people are very easily impressed if you can do compounding interest in your head.
It boils down to being able to estimate natural logarithms. Here’s how:

Continue...

Obama speaks to students

by Tom Temple

3 September 2009, 19:42

President Obama wants to give a speech to the nations school students next Tuesday at noon. The country is so polarized that, apearantly, this is a big controversy. Georgetown, (MA), for instance will not be showing it.

Suppose that the President were Republican and the angry parents were Democrats, how do you think this would play out?

1) It wouldn’t. Democrats would suck it up as “civic duty.”
2) It wouldn’t. Democrats don’t have a good enough network (mainly radio shows) to rally enough angry phone calls to schools.
3) They’d do the same, but then get hung out to dry for a “lack of respect.”
4) It would play out just the same.

I’m thinking (1), because I really, truly, hated Bush, but if he were going to give the kids a pep-talk on the first day of school, I’d think that was fine, good in fact. The president is important; they might listen.

Everybody who is hand-wringing about how “political” the speech might be is not thinking about it very hard. When Obama speaks, he is nothing if not cautious. If he said anything even remotely political, even remotely assailable, he would (deservedly?) suffer for it. Those kids are guaranteed some of the A-grade flowery bullshit. But maybe it will inspire a kid or two to work harder, stay in school or become better citizens. Whether or not it’s worth the time is another argument, but I think it probably is.

Regarding the other complaint regarding “indoctrination”, let’s be honest, it’s there and it’s pervasive, but it’s not coming from Obama.

US vs. Spain

by Joran Elias

25 June 2009, 15:25

The United States men’s soccer team upset Spain yesterday and unsurprisingly it has caused quite a stir. They played pretty well and certainly deserved the win. However, it is my nature to be both contrary and pessimistic, I thought I’d offer some thoughts on the game.

I haven’t actually watched Spain play all that much so my observations on their performance are largely speculative. But to me, they seemed rather disorganized in back, at least early on. I’m not sure if that was a result of their back four not communicating well, or if it was some defensive midfielders not doing their job.

The US played pretty well for about 35 minutes. There were about 4-5 players who ran around like freakin maniacs in midfield pressuring the ball, scooping up errant passes etc. They were (to my eyes): Bradley, Dempsey, Clark, Davies and Spector. Davies and Spector are actually a forward and defender, but they were dropping back and pushing forward (respectively) quite a bit. During these early minutes, the US did what it does best: run around like crazy and be physical.

Spain started pretty flat and continued to be out hustled by the US for much of the first half. Altidore’s goal was legit, though he had a significant piece of help from the Spanish defender marking him who decided to try to climb over Altidore’s back rather than simply trying to keep him from turning.

For me, the second half was essentially a complete disaster for the US, despite Dempsey’s goal. I’m really curious why the US retreated into their defensive third for the rest of the game. Did Coach Bradley tell them to do that? Or was 35 minutes all they could muster physically at that intensity level?

Either way, hunkering down behind a 1-0 lead for 55 minutes against a team like Spain is, generally, not a recipe for success. Every now and then it’ll work, but it takes luck and your opponent has to have a bit of an off day.

I would have preferred to see the US at least try to maintain the intensity level they started with in the second half. It might have been riskier, and might even have cost them the game. But it would have been a good opportunity to see just how long they could keep it up.

As for individual performances, I was most impressed with Bradley and Spector. Mostly that’s based solely on the effort and intensity they put in during the first half. Bradley should be sent to bed without supper by his Dad for the red card. Unthinkably stupid foul. Which, sadly, has become a trend with this US team.

Altidore continues to fail to impress me. He does only a few things, and not particularly well. He sits up front and waits for the ball to be served through the defense. He gives chase and either is unmarked (rare) and shoots (meh) or he automatically falls to draw a foul. I was much happier with Davies, who at least displayed a wider toolkit, coming back to help develop plays in midfield.

Howard did well, as usual. Dempsey I can live with, if he is used properly. He should really just be a defensive midfielder and not push forward much.

Donovan? Meh. He’s been billed as the Savior of American Soccer for so long now, I always am disappointed when I watch him. He’s no Claudio Reyna, that’s for sure.

It was nice not to see Beasely out there and Jay DeMerit needs to go. Maybe Heyduk will be back soon.

All in all, it’s nice to see the US get a good result like this. But it doesn’t erase from my memory the travesty that was the Costa Rica game, or their uninspired win against Honduras, or their lopsided losses to Italy and Brazil.

Another scale problem

by Tom Temple

22 June 2009, 09:05

Somebody at work asked about the chicken scratchings I used in the snack room and in response to my solution said something fawning about how neat it was that I could just change my number representation however it suited me.

As Jon would guess, that led to a conversation about balanced tertiary, and the following problem arose.

You have a balance with two pans and an object with integer mass, N, that you would like to determine. You have the following known masses:
let k be an odd, positive integer. You have (_k_ – 1)/2 of each mass of weight kn for n in the non-negative integers. With this set of masses, each integer will have a unique representation.

You would like to determine N in a minimum number of weighings. Any time you add or remove a single mass from the scale counts as a weighing.

For instance let k=3, and I wanted to put 128g (=243-81-27-9+3-1) on the scale when 256g (=243+9+3+1) was on their previously. To do so counts as 6 weighings.

I’m looking for the big-Oh (in terms of N,k) of your strategy. From the above example I think it would be easy to argue that binary search is O(log 2 (N)). Can anyone do better?