How to Choose a Wife

This is sort of a response to our friend Kelsey's post about marrying a good husband. It's also a fun math problem, so I can't resist writing about it. Here it is: how does one choose a wife?

We'll begin with some rules:
  1. You'll meet N eligible partners, in random order, over your dating lifetime.
  2. You don't know beforehand, during, or even directly after the date, who your best partner is, but you can judge each date relative to previous dates.
  3. You can date from the total population of N partners until choosing one to marry, or exhausting the population -- at which point you're stuck with the last one.
  4. After each date, you have to decide whether that person is the one. If so, you marry. If not, you resume dating from the rest of the population, but cannot date that person again.
So, it's kind of like barbering: the trick lies in knowing where to stop. It should be pretty obvious that you don't want to marry the very first person you date, because the odds are that she'll be, on average, average. Similarly, you don't want to run through the whole population, because, in addition to the reputation you'll develop, the last date will be on average, just average.

The strategy then, goes like this:
  1. Go on some number, R, of trial dates to sample the population, and remember which of those R dates was the best. You can't date her again, but you can use her as a reference for comparison with the rest of the population.
  2. After the R dates, there are N-R eligible partners left in the population. In the subsequent N-R dates, marry the first one better than the best of the R trial dates.
Now the problem becomes this: what is the optimum R for some given N? Make R too small, and you won't have a good sample of the population. On the other hand, if R is too large, you stand a good chance of discarding your best partner. It turns out -- and although it isn't difficult to show, I won't do the math here -- that if your goal is to maximize the odds of winding up with the very best partner, then the R you should choose is R=N/e. Yes, it's that 'e', the base of natural logarithms, 2.71828...

However, if your goal is to maximize your chances of happiness, and let's say, for the sake of argument, that you could be happy with perhaps any partner in the top ten percent of your eligible population, then R is quite a bit smaller, approximately 0.1 times N. This one is more difficult to calculate, but the rules and strategy are simple enough to make it an easy problem to model, which is what I've done here. The code below is for Matlab, Octave, or your favorite Matlabish computational program and performs a Monte Carlo simulation of our situation 20000 times for each R from 0 to 99, with N=100. If you know me, then surely you're thinking that for me personally, N=100 is a seriously overly optimistic number, but firstly, it's an easy number to calculate with, and secondly (and more importantly) I am irresistibly charming, in a geeky sort of way, so get over it. At any rate, here's the code, uncommented because I'm lazy:
tic
n=100;
tr=20000;
a=zeros(1,n);
a2=zeros(1,n);
pb=zeros(1,n);
h=waitbar(0,'Calculating');
for t=0:n-1
z=0; p1=0; z2=0;
for i=1:tr
mx=n;
m=[1:n];
for k=1:t
b=1+floor(length(m)*rand);
x=m(b);
m(b)=[];
mx=min(mx,x);
end
x=100;
while (x >= mx) && (~isempty(m))
b=1+floor(length(m)*rand);
x=m(b);
m(b)=[];
end
z=z+x;
z2=z2+x^2;
if x==1
p1=p1+1;
end
end
a(t+1)=z/tr;
a2(t+1)=z2/tr;
pb(t+1)=p1/tr;
waitbar(t/(n-1),h,'Still calculating')
end
close(h)
toc
eb=sqrt(a2-a.^2);
figure
plot([0:n-1],a)
figure
plot([0:n-1],pb)

If we rank the best partner as 1 and the worst as 100, the average value of the selected partner's rank as a function of R (still with N=100) looks like this:

You can see how it bottoms out around R=0.1N. Now, for those of you who are more difficult to please, here is a graph showing the probability of winding up with the very best (rank=1) candidate as a function of R.

In this case, when R=36 or so (100/e), the odds for selecting the best partner are maximized. At this point, I'm probably supposed to say something about winding up with my optimum partner. I'm sure that's true because she's probably the only person capable of putting up with me for these past 10+ years. N=1 is, as we like to say, trivial.

Comments

TamiJ said…
You math people make my head hurt. I got lost early on and stopped reading. Sorry :-(

Popular posts from this blog

Happy Fall