Wednesday, August 19, 2009

the kind of person

I was flipping through one of Michael Pollan's books at the airport bookstore last weekend. It may have been In Defense of Food, but I can't remember. Anyway, I came across this puzzling piece of advice:

Be the kind of person who takes supplements.
That is, you don't really have to take the supplements, as long as you are the kind of person who might. Pollan explains that studies have shown people who take multivitamins are generally healthier, but in controlled studies, multivitamins haven't been shown to actually make anyone healthier. This is reasonable, as it could be that supplement-takers are more health-conscious to begin with, and taking the supplements simply indicates their health-conscious status.

The puzzling part is this: how can someone follow Pollan's advice, other than by taking supplements?

This is related to a few philosophical paradoxes. Here's Kavka's toxin puzzle (from Wikipedia):
An eccentric billionaire places before you a vial of toxin that, if you drink it, will make you painfully ill for a day, but will not threaten your life or have any lasting effects. The billionaire will pay you one million dollars tomorrow morning if, at midnight tonight, you intend to drink the toxin tomorrow afternoon. He emphasizes that you need not drink the toxin to receive the money; in fact, the money will already be in your bank account hours before the time for drinking it arrives, if you succeed. All you have to do is. . . intend at midnight tonight to drink the stuff tomorrow afternoon. You are perfectly free to change your mind after receiving the money and not drink the toxin.
The question being, is it possible to intend to drink the toxin tonight if you know you won't actually have to tomorrow?

Saturday, August 01, 2009

starting tomorrow

It's sad that it took me this long to come to this realization, but starting tomorrow does not work, at all, for anything.

The interesting part is that starting now does not work either. The entire mindset associated with making an abrupt transition from a bad state to a good state is the problem. Typically, the good state is unsustainable and you eventually end up back in the bad state again, where you tell yourself that at time t you will make another abrupt transition to the good state, which is unsustainable, so you end up in the bad state again, and so on.

The only solution that I've found is to try to be in a state that is not so bad that you have to make empty promises to yourself to transition out of it, and not so good that you can't keep it up.

Another reason not to make an abrupt transition from the bad state to the good state at some future time t is that this encourages you to get in all the damage you can before time t. And since you keep reverting back to the bad state, you can end up doing a lot of damage this way.

Monday, June 01, 2009

wordless melodies

This is the second post in my Things I Like in Music series.

Have you noticed that lots of songs have vocal parts with "la la la..." or "na na na..." instead of lyrics? And have you noticed that these parts are almost always extremely catchy? The best example is probably Hey Jude, but there are many such songs: Land of 1000 Dances, Centerfold, Can't Get You out of My Head, and many more. I posted a quiz a while back about guessing these songs given only the rhythm of the "na na na..." part, if you're interested in more examples.

If you agree that these parts are usually catchy, and you do, you may wonder why this is the case. My guess is that removing lyrics doesn't actually make the melody catchier, but that sometimes a melody is so catchy that the songwriter feels no need to embellish it with lyrics.

A related phenomenon that I also like is when a song has an instrumental solo that is just the vocal melody. Some examples are Come as You Are (or Smells Like Teen Spirit for that matter), Buddy Holly, and Paint It Black, in which the vocal melody is both played on guitar and hummed (not simultaneously). You could also count the whistling in Walk Like an Egyptian.

Or you could make an entire song out of weird vocal noises, like this one.

Sunday, May 10, 2009

in between major and minor

This is the first post of many I plan to make about Things I Like in Music.

If you've played around with Songsmith (and if you haven't, you should), you'll notice that instead of a switch between major and minor, we provide a "happy" slider that lets you explore a continuum between strictly major and strictly minor chord progressions. Is this really how music works, you might ask? Can a song be somewhere in between major and minor? Now, certainly a song can be major and minor in different sections, like the chorus and verse (Happy Together is a good example of this). Minor-verse-major-chorus (and its much rarer opposite) is also a Thing I Like in Music, but right now I'm interested in songs that sound both major and minor within a single section.

It turns out that many great songs do this, and wavering between major and minor is part of what makes them great. Here are a few examples (Roman numeral chord names assume the major key):

One Headlight
Listen to the verse, and notice how the first half of each line sounds just a little bit less gloomy than the second half, which helps give the song its poignant feel. The chord progression during the verse is VI -> I -> III -> vi, two chords generally associated with the major key followed by a minor cadence.

Just What I Needed
The same thing happens in the verses here. The first half of each line sounds happier than the second. Even the lyrics seem to follow suit. "I don't mind you coming here." Moderately happy! "And wasting all my time." Umm, not quite so happy. The chord progression in the verse is I -> V -> vi -> III, the two chords most indicative of a major key followed by the two chords most indicative of a minor key.

Say It Ain't So
The previous two songs (or at least their verses, which we were focusing on) probably sounded closer to minor than major. This song, to me, sounds closer to major. The chord progression is vi -> III -> VI -> I, this time ending each phrase with a major sound. Perhaps ends of phrases have a stronger influence on the overall feel.

Yesterday
Both sections of this song live in the mysterious land between major and minor, and it's generally considered one of the best songs ever (citation needed). Coincidence?

Sunday, April 26, 2009

silly headline

Robbery suspect attacks clerk with machete

Whether or not the guy is the attempted robber is uncertain, but he's definitely the guy who attacked the clerk with a machete during the attempted robbery. Of course the article itself is not this confused, only the headline.

Monday, March 16, 2009

Sudoku and nothing

Dan has given me an excellent way to look at research or other ideas, adapted from a David Letterman bit: is this something, or is it just nothing?

Here's one that seems to be nothing: a computer scientist has come up with an algorithm for Sudoku. And (surprise!) the algorithm is exactly how everyone already solves Sudoku puzzles. Nor is this strategy very interesting algorithmically, as it ends up being a regular old constraint satisfaction search.

Friday, January 16, 2009

Songsmith is blowing up

Microsoft Research Songsmith, which grew out of the MySong project I worked on last year, has gone viral, largely because of the (intentional) over-the-top silliness of the promo video. The fact that so many people are experiencing the results of our research is blowing my mind a little bit, especially with the wide variety of responses we're seeing. There's been some praise, some good-natured poking fun, and a fair amount of irrational hatred. Many people seem to appreciate the research while mocking the promo video, which I guess is okay, though the vast majority of them would never have heard about the research if not for the exceptionally silly video.

The most pathetic response I've seen is here. Yes, Michael Arrington, world's most famous tech blogger, decided to call a researcher at MSR gay. If you're going to call us gay, at least do it like this (warning: extremely offensive). And there are many other ways to diss Songsmith that I'm totally cool with.

Tuesday, December 30, 2008

automatic rebalancing through automatic exchange

When investing, you often want to maintain your asset allocation, which can depart from your initial allocation as specific assets increase or decrease in value. One option is to periodically check your allocation and manually transfer funds between assets (rebalance) if necessary. An added convenience is automatic rebalancing, where your investment company rebalances for you at some frequency.

However, Vanguard, one of the most popular investment companies, does not seem to support automatic rebalancing of an arbitrary asset allocation. Here's a trick you can use to achieve the same effect through automatic exchange:

Suppose you have three assets A, B, and C that you'd like to hold in the percentages a, b, and c respectively, where a + b + c = 100. All you need to do is set up 6 automatic exchanges, where A gives b percent of its value to B and c percent of its value to C, B gives a percent to A and c percent to C, and C gives a percent to A and b percent to B. In general, each asset receives a fixed percentage of each other asset, equal to the percentage of the receiving asset in the desired allocation.

The above technique rebalances exactly, but it has some problems. First, you definitely do not want to do this if there are taxes or fees associated with the transactions, since the transactions will be pretty large. (Performing the exchanges within a Roth IRA at Vanguard should still be okay.) Second, it can be a pain to set up an automatic exchange for each pair of assets you own.

Let's address both problems, though really, if you're faced with taxes or fees, you probably just want to do your rebalancing manually. However, you can decrease both the number and the size of the transactions by doing something I might call "soft rebalancing". The trick is that instead of exchanging between every pair of assets, we create a cycle of exchanges. In the above example, we could have A give to B, B give to C, and C give to A. (I'll get to the exchange amounts in a bit.) In general, if you have n assets, you only have to set up n exchanges. With soft rebalancing, you lose the ability to rebalance exactly, as we'll see.

So what are the exchange amounts? There's a slight complication, in that we can now change the rate at which rebalancing occurs, so the exchange amounts can be scaled. In the above example, A would give B proportional to 1/a, B would give C proportional to 1/b, and C would give A proportional to 1/c. In general, each asset gives up value proportional to the inverse of its percentage in the desired allocation. Again, these amounts should be scaled based on how fast you want the rebalancing to happen. At the maximum allowable rate, one of the assets will be giving up all of its value at each rebalance.

There are some problems with the cycle of exchanges scheme. Most importantly, it may take many rebalancing steps to transfer between an asset with excess value and an asset with insufficient value if the asset with insufficient value is far "downstream" from the asset with excess value. There are other schemes that address this issue, like setting up one "hub" asset and having all exchanges take place between the hub and one of the other assets (in both directions), though this scheme requires setting up about twice as many automatic exchanges.

An important point is that these exchanges must be in terms of the percent of the holdings of an asset. If the only supported exchanges are in fixed dollar amounts, automatic rebalancing is impossible. Also, I'm not sure how practical any of this is, since I have to assume that at some point Vanguard and other investment companies will offer automatic rebalancing. In the meantime though, you can use my trick if you're desperate.