Tuesday, April 6, 2010

A princess story


Once upon a time, a princess was sequentially presented with N suitors. She had the option to reject each one as he came, but she didn't know the quality of the successive suitors. Once a suitor was rejected, she could not change her mind and return to one she had previously scorned. Thank goodness these rules weren't in effect for Princess Jasmine, or else there would have been no happily ever after for poor Prince Ali.

Wikipedia, as usual, has a very thorough discussion of this problem (listed as the secretary problem, if you want to look it up). However, as I fancy myself a princess, and this has to do with me (of course), I will retain the princess language.

So, here's the deal. It would be extremely beneficial to both me and one man(space) friend to know if we have sampled the pool enough (hehe) to be out of the training data stage. So, we are going to use the princess game to decide what to do when he leaves for the summer and I leave for...ever. But, because we are both huge nerds both would know the answer under the traditional assumptions (and what fun is that?!), let's make this a little more exciting...

The princess game assumes the suitors arrive in a random order / are randomly selected / the king gets to pick who you date. I'm pretty sure that's not how it works-- if it had been up to my dad, my pool would have been a random selection of "nice Asian boys from Berkeley." OK, so let's move forward to a time/place when women get to pick their own boyfriends, and assume that we pick who we date based upon each candidate boyfriend's attributes and how important those attributes are to us at the time. (We can see the whole pool's attributes, but we only know how useful each person was to us after we date them.)

But ahhh! In high school, back when this whole game started, Lance Bass was pretty much my ideal man. (Don't judge! My bff had already called JT.) We all know how well that would have worked out for me if I'd gotten my wish. Thank goodness I've gotten to update my understanding of which man-attributes I like since then. Turns out shy and effeminate isn't quite as appealing to me as I once thought... Strange.

The original framing of the problem assumes that the princess is able to determine the actual quality of the suitors as they come. I want to allow for learning over time about which qualities the princess finds appealing. She'll be picking her next boyfriend based upon her current beliefs about which qualities she likes. (For fellow nerds, she'll rate the remaining princes in the pool based on their posterior expected value to her given all of the princes she's already sampled.)

Lastly, let's ground ourselves in reality. As much as I'd like to keep playing until I find the perfect person, there is only finite time in which to play this game. While long-term relationships use up a lot of your allotted game time, they also allow you to learn a lot more about the attributes you appreciate in a person.

More formally,
Soooooo, because dissertations don't write themselves, I'm just going to run a simulation rather than do what it seems like everyone else has done (yes! gah! I did a mini lit review..) and derive things.

Feel free to skip to the bottom now; you won't hurt my feelings. But, for the brave...

I will include parameters that dictate:

  • The noise with which the princess observes her utility for a prince after knowing him for only one day.
  • The average duration of a relationship. (This will be modeled with the exponential distribution, though really a think a mixture distribution with a point mass at 1 day would be pretty appropriate for most of my friends. Not me, of course. I'm a lady.)
  • The number of attributes that go into a princess's weighting of how much she likes a guy. According to the partner in crime in this project, there should only be two attributes... jerk! jk
  • Your time limit for picking a mate. I'm setting this to 12 years.
  • How sure you are about your initial guess at the importance of different attributes, and how far away this is from the truth.
  • What percentile of awesome does the guy you end up with have to be in to make you happy. If you get someone who is top 10 out of 100, is that good enough? (I'm setting this to be top 5%. No soulmates here!! Why 5%? Ask whomever made it the magic number in hypothesis testing, I don't know)

But, before we get to my decision re: the manfriend, let's look at how one's strategy should change over different values of one of the parameters just to get some intuition about how this simulation is working...

On the left there you see the best strategy for the number of boyfriends you sample and automatically reject before starting to try to find the best one. The blue lines are strategies that came within 80% of the best one. This ranges over the average duration (in days) of the relationship down on the x-axis. The moral of the story: people with lots of short relati
onships should wait longer to start looking seriously than those with a few long term ones. However, the difference between the best strategies isn't that big. (15ish versus 5ish). That being said, ignore the actual numbers... This all depends on the other parameters of the simulation, which I haven't told you for this example.

And now, ta-daaaa!! The results! To get my final sample of best strategies, I averaged over my
beliefs about what all of the parameters of this simulation would be for me. I'll post this code to my website, so if you're interested in how I did this averaging, you can look for yourself. The histogram here shows the optimal strategy over 1000 simulations. It looks like my best bet on average is to wait about 10 princes and then take the best one that comes after that.

Uh oh... there have already been ten... better start running, you know who you are... ;)









Disclaimer: this doesn't take into account the fact that the good ones might get taken . And it assumes that you can't go back to an old one. Both of those aren't quite right, but this was about as much work as I am willing to put in on a procrastination project!





9 comments:

  1. I award you 10 Awesome Points for actually carrying out this simulation(!). Unfortunately I then have to subtract 9 points for you using the word "manfriend."

    You should modify the utility to be something like
    p_i = x_i \beta [ 1 - (\sum_{previous princes} t_i) / (\sum t_i) ]
    to take into account that as time goes by, the quality of the pool degrades due to marriage/baldness/what have you, until you're stuck with whatever Asian Berkeley grad your relatives can set you up with. So by the time you're sure what you want, you can no longer have it... somewhat depressing, but I love the symmetry.

    ReplyDelete
  2. No, this goes against everything I stand for!! Haha. I'm banking on the fact that all the good ones will, in fact, be left by the time I exit my training data stage. I figure the lazy, boring ones are settling down right now, and the really, truly awesome ones, worthy of this princess :) are off doing bigger and better things. At least let me believe *that* fairy tale! :D

    ReplyDelete
  3. p.s. Since this project was super on the fly, I am totally open to any and all constructive criticism. The next iteration of this will include time between boyfriends, due to some helpful comments. :) Keep 'em coming!!

    ReplyDelete
  4. Uh oh, what about the probability that the man of your choice doesn't select you because he's an idiot? What factors does that probability depend on?

    ReplyDelete
  5. I agree that the good ones take longer to settle down. This makes sense because the good ones have more options and will in general be less likely to exit the market early. Also, for me anyway, "good ones" tend to be interesting, adventurous, and all that, and usually want to experience lots of things in life. They like freedom and so forth, and are reluctant to settle down early. So I don't think it is a bad assumption that the pool of "good ones" doesn't deplete that much over time. I hope so anyway, for my sake.

    ReplyDelete
  6. Please, Rajan. Don't be ridiculous.

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. This comment has been removed by a blog administrator.

    ReplyDelete
  9. I've tried to explain this to people!

    most are resistant to the idea, saying that math has no place in such matters.
    http://xkcd.com/55/

    I try to tell them they're doing this calculation whether or not they're willing to admit it.

    I'm glad to see I'm not the only one who thinks this way.

    ReplyDelete