Building, Searching and the Algorithm for Finding the Best Spouse

Let me tell you about my favorite mathematical proof.

It’s for a puzzle called the marriage problem (alternatively called the secretary problem or the sultan’s dowry). It’s my favorite for belonging to a rare category of “mathematical proofs which also have to do with sex.”

The problem is very simple:

Suppose you are looking to get hitched. You have many people you could potentially marry. How do you find the best spouse?

Well, as a mathematical puzzle, rather than a human one, we need to define the process for finding and evaluating suitors a bit more rigidly to answer that question.

The rules of this particular puzzle are defined as follows:

  1. Each potential suitor you meet, you can go on a date (or a few) with them. During this time, you’re able to evaluate their suitability.
  2. After each dating period, assuming the person is willing to propose to you, you can either accept or reject the suitor.
  3. If you accept the person, great, you’re now hitched.
  4. If you reject the person, move onto the next.
  5. In either case, accept or reject, you’re not allowed to go back and change your mind later. Once you reject someone, you can’t go back to them if you realize they were the one for you. Once you accept someone, you can’t change your mind if you meet someone else.
  6. You aren’t allowed to date more than one person at a time.

This puzzle has a more formal, mathematical definition, that can work as an analogy for a lot more than just spouses. You could, for example, also think of this as an employer looking for the best employee, but is required to either hire or reject each applicant, one at a time.

Interestingly enough, this puzzle has a solution. As in, there is a mathematically provable optimal algorithm for deciding the best spouse.

The Algorithm for the Best Spouse

The algorithm has two parts: what I’ll call a “rejection” phase and a “choosing” phase.

During the initial rejection phase, you reject every single applicant who proposes to you. It doesn’t matter how good they are, you just reject them. (In the formal definition you do this for the first n/e candidates, or roughly the first 40% of people.)

Then, after the rejection phase, you enter a new, choosing phase. Now you agree to marry the first candidate who is better than every other suitor you dated who also agreed to marry you.

With this algorithm, you can demonstrate that you will, in fact, select the best possible spouse a whopping 37% of the time, regardless of whether there are ten billion applicants or only ten.

No, You Can’t Actually Use This Algorithm to Find a Spouse

Obviously the mathematical solution to this puzzle won’t work strictly in real life. Many of the assumptions of the model are violated: you don’t know how many people you might potentially date, you don’t know whether the suitability of the suitors is time-dependent, you have access to information about people you aren’t currently dating which can inform you of the relative merits of those you are, etc.

It also goes without saying that basing your love life on an algorithm is a pretty poor way to live.

However, there is something I like about this algorithm, and I believe it can offer an analogy, if not a solution, for thinking about many areas of life.

Searching and Building

In short, the algorithm does two things. First, it has a searching capability. It spends a certain amount of time not making a decision at all, but simply gathering information about the overall range of suitability of the different options.

Second, it has a deciding capability. This is where you have gathered enough information and now need to make a choice.

While the algorithm only deals with the decision phase, most areas of life also have a follow-up part. They have not only a part where you must choose the best option, but also a point when you have to build on that choice you’ve made. A good marriage isn’t just selecting the right spouse, after all, but years of investment into building a relationship with that person.

Therefore, in a real context, I’d describe the split as being between searching and building. Searching, when you lack enough experience to know what to choose, and building, when you have enough data and now need to just make a choice and run with it.

What interests me about the ideal algorithm is that it divides itself neatly into these two phases. Search for awhile and then, abruptly, switch to deciding (or in our real world case, building).

Should You Search or Build?

Unfortunately, real life doesn’t offer a precise point to switch from one phase to the other, like in our idealized mathematical problem. But I do think the puzzle does illustrate the need for both searching and building in different areas of life.

Consider many decisions: which city to live in, what career to go into, what friends to associate with or habits to create. In many ways, they suffer from the same problems as the original puzzle I outlined: you have many options and you don’t know which to pick. Yet, at the same time, you know that once you do pick you’ll have to put in a lot of effort to make them work anyways.

Ask yourself whether your problem is a lack of information? If so, entering a searching phase where you don’t choose anything but explore options might be best. Spend some time living in different cities before picking a home. Spend some time in different jobs before picking a career. Spend some time with different groups of people before finding a tribe.

Do you have information, but can’t make a choice? If so, maybe you need to stop shuffling around, pick something and start building on it. Fretting over what is the right business idea? Maybe you already have enough information and just need to make a choice and commit to it.

What interests me about the algorithm is that the ideal solution may have two distinct phases, depending on where you sit. Which is better depends crucially on how much information you already possess, hence the seemingly endless contradictory advice between gathering more information and taking action.

Please note the “reject the first 40% of all applicants” really only applies in this formal puzzle. If you got married early or late, live in your hometown or haven’t settled into one by middle age, that shouldn’t imply you made an incorrect choice. Changing any of the assumptions can lead to very different outcomes for the algorithm.

That being said, look over the areas of your life. Could they benefit from more searching or do they need commitment? Share your thoughts in the comments.

  • William Tarbush

    One must be careful trying to build the perfect spouse. During the infatuation period, people are simply too much of emotional wrecks to be changed. Once you are married you don’t have the social capital to change the person. It is best to keep searching if you cannot live with one. Changing should be considered hazardous.

  • William Tarbush

    One must be careful trying to build the perfect spouse. During the infatuation period, people are simply too much of emotional wrecks to be changed. Once you are married you don’t have the social capital to change the person. It is best to keep searching if you cannot live with one. Changing should be considered hazardous.

  • Scott Young

    I don’t mean to imply you should “build” or change your spouse. Rather, you should build a relationship between them. That doesn’t come from trying to change them, but rather building trust, learning about each other and learning how to interact with each other. In many ways, what you’re changing is not the other person, but yourself.

    You can’t build a perfect spouse, but I do believe you can build better relationships.

  • Scott Young

    I don’t mean to imply you should “build” or change your spouse. Rather, you should build a relationship between them. That doesn’t come from trying to change them, but rather building trust, learning about each other and learning how to interact with each other. In many ways, what you’re changing is not the other person, but yourself.

    You can’t build a perfect spouse, but I do believe you can build better relationships.

  • Josh

    Hi, Scott! A question, are you married?

  • Josh

    Hi, Scott! A question, are you married?

  • Dave

    Hi Scott, apologies to ask at wrong forum but can you please tell us when is your Learning on Steroids course is going to start? How to access materials because me and my friend both are registered for it and we have a big exam in September 🙂
    Thank you tons in advance!

  • Dave

    Hi Scott, apologies to ask at wrong forum but can you please tell us when is your Learning on Steroids course is going to start? How to access materials because me and my friend both are registered for it and we have a big exam in September 🙂
    Thank you tons in advance!

  • I prefer the terms “exploration” and “exploitation” to describe that classic trade-off. If you want a less misogynist title for the problem, you could call it “the best choice problem”.

  • Neil Traft

    I prefer the terms “exploration” and “exploitation” to describe that classic trade-off. If you want a less misogynist title for the problem, you could call it “the best choice problem”.

  • Scott Young

    The classic term for the problem is actually the “secretary” problem, but that seems a bit anachronistic, so I went with marriage.

    Not sure where the misogyny lies, though, care to explain? I was very careful in my choice of words (spouse, being gender neutral) to imply that this algorithm would work equally for both men and women. As in a woman could potentially use this algorithm to find a husband (or wife, should she prefer) and a man could use it to find a wife (or husband).

    Perhaps it’s a bit distasteful to think of marriage in terms of an algorithm, but the problem and my description of it was genderless.

    Also not sure what “exploitation” means in this context?

  • Scott Young

    The classic term for the problem is actually the “secretary” problem, but that seems a bit anachronistic, so I went with marriage.

    Not sure where the misogyny lies, though, care to explain? I was very careful in my choice of words (spouse, being gender neutral) to imply that this algorithm would work equally for both men and women. As in a woman could potentially use this algorithm to find a husband (or wife, should she prefer) and a man could use it to find a wife (or husband).

    Perhaps it’s a bit distasteful to think of marriage in terms of an algorithm, but the problem and my description of it was genderless.

    Also not sure what “exploitation” means in this context?

  • Scott Young

    You should have gotten access immediately. If you didn’t, there was a technical error. Email me: personal@scotthyoung.com and I’ll get it sorted.

  • Scott Young

    You should have gotten access immediately. If you didn’t, there was a technical error. Email me: personal@scotthyoung.com and I’ll get it sorted.

  • I seem to remember watching a TED talk by Hannah Fry that discussed something like this. In that case instead of counting how many people you might date you merely use time as a proxy. So you might say that you’d like to be married by 38 and let’s assume you start dating at 18. (She actually says it’s 37% vs. 40). This means that once your turn 25.5 you should accept the next best person who is better than everyone else. If you enjoy these types of math problems (that meet your rare category) you should check out her book called: : The Mathematics of Love. It’s a fun, light read with lots of good (and funny) advice. Nice article Scott!

  • Nathan Biller

    I seem to remember watching a TED talk by Hannah Fry that discussed something like this. In that case instead of counting how many people you might date you merely use time as a proxy. So you might say that you’d like to be married by 38 and let’s assume you start dating at 18. (She actually says it’s 37% vs. 40). This means that once your turn 25.5 you should accept the next best person who is better than everyone else. If you enjoy these types of math problems (that meet your rare category) you should check out her book called: : The Mathematics of Love. It’s a fun, light read with lots of good (and funny) advice. Nice article Scott!

  • Marija Nachevska

    Great point,I guess sometimes you can get lost in exploring the options and choosing the right thing,and somehow forget the journey after the decision is made.Building is an important stage.Great analogy,thank you for opening my eyes! 🙂

  • Marija Nachevska

    Great point,I guess sometimes you can get lost in exploring the options and choosing the right thing,and somehow forget the journey after the decision is made.Building is an important stage.Great analogy,thank you for opening my eyes! 🙂

  • Veena

    Interesting article. I am dating now and feeling somewhat frustrated with the process. I like that the article states you need to make a choice or move on. The hard part is choosing to move on because you don’t know if you will find someone better./the unknown I wonder how this can actually be applied to the dating process in a practical way. I think online dating has added greater complexity to dating and newer frustrations too. I also think people are looking to date and marry people they have a connection with whereas years ago people would settle with someone they met in high school or even had an arranged marriage.

  • Veena

    Interesting article. I am dating now and feeling somewhat frustrated with the process. I like that the article states you need to make a choice or move on. The hard part is choosing to move on because you don’t know if you will find someone better./the unknown I wonder how this can actually be applied to the dating process in a practical way. I think online dating has added greater complexity to dating and newer frustrations too. I also think people are looking to date and marry people they have a connection with whereas years ago people would settle with someone they met in high school or even had an arranged marriage.

  • Scott Young

    Yes 1/e = ~37%. The algorithm we’re discussing is the same.

  • Scott Young

    Yes 1/e = ~37%. The algorithm we’re discussing is the same.

  • Scott Young

    Not currently, no. But I am in a relationship.

  • Scott Young

    Not currently, no. But I am in a relationship.

  • Hey Scott,

    Awesome article, it was really impressive how you were able to explain such a high level concept in an easy to understand and interesting way!

    I always think it’s better to make a decision and move on than it is to dwell on things because a lot of the time the information we’re using to decide is incomplete or inaccurate anyway.

    I’m gonna post this on Google +

  • Jon Lee

    Hey Scott,

    Awesome article, it was really impressive how you were able to explain such a high level concept in an easy to understand and interesting way!

    I always think it’s better to make a decision and move on than it is to dwell on things because a lot of the time the information we’re using to decide is incomplete or inaccurate anyway.

    I’m gonna post this on Google +

  • Jay

    Great article. Gotta hand it to you – this is the first new concept, or truly fresh take on a concept, that I’ve seen in a while in the self-improvement blogosphere.

    This resonates with me as I was relatively dragging my heels – big time – over the course of my relationship with my now-wife. I met her soon after a long-distance relationship ended. While I thought she was great, initially I had a lot of resistance to our gradually deepening relationship because I didn’t feel the same level of initial head-over-heels infatuation I felt for the other person during summer travels in a foreign country (pre-long distance). Fast-forward nearly a decade and…we’re married and have two beautiful children. Things are by no means perfect (they never are) but it’s…great! The tortoise (building a deeper relationship, evolving love and partnership) beat the hare (head-over-heels love). Lapped the hare.

    I’m no relationship expert, but if you’re in a situation like I was and feel that resistance* even when something is great (or at least good and getting better), it may be that same resistance you get when you’re about to start something…great. Don’t discount the trend.

    And – people – Scott isn’t talking about “building a wife”; he’s talking about building a life. Marriage isn’t for everyone, but if that’s an interest of yours – especially if you can forsee children in your future – remember that being “in love” may be a component of being in a serious, committed relationship, but it’s just part of the puzzle. To keep building, it’s not just being “in love”, but being…partners and friends with each other. How do you play and work together? If the answer is “quite well”, maybe that fear you feel doesn’t mean you should abandon the mission, so to speak. Maybe that fear indicates that you care a lot about the situation, that you’re excited about taking the next step, but a little nervous at the same time as you won’t REALLY know what it’ll really be like when you take that step. Yet that’s exactly when you need to take that step and build.

    Again, nice post.

    (*Resistance: see War of Art by Steven Pressfield for more details)

  • Jay

    Great article. Gotta hand it to you – this is the first new concept, or truly fresh take on a concept, that I’ve seen in a while in the self-improvement blogosphere.

    This resonates with me as I was relatively dragging my heels – big time – over the course of my relationship with my now-wife. I met her soon after a long-distance relationship ended. While I thought she was great, initially I had a lot of resistance to our gradually deepening relationship because I didn’t feel the same level of initial head-over-heels infatuation I felt for the other person during summer travels in a foreign country (pre-long distance). Fast-forward nearly a decade and…we’re married and have two beautiful children. Things are by no means perfect (they never are) but it’s…great! The tortoise (building a deeper relationship, evolving love and partnership) beat the hare (head-over-heels love). Lapped the hare.

    I’m no relationship expert, but if you’re in a situation like I was and feel that resistance* even when something is great (or at least good and getting better), it may be that same resistance you get when you’re about to start something…great. Don’t discount the trend.

    And – people – Scott isn’t talking about “building a wife”; he’s talking about building a life. Marriage isn’t for everyone, but if that’s an interest of yours – especially if you can forsee children in your future – remember that being “in love” may be a component of being in a serious, committed relationship, but it’s just part of the puzzle. To keep building, it’s not just being “in love”, but being…partners and friends with each other. How do you play and work together? If the answer is “quite well”, maybe that fear you feel doesn’t mean you should abandon the mission, so to speak. Maybe that fear indicates that you care a lot about the situation, that you’re excited about taking the next step, but a little nervous at the same time as you won’t REALLY know what it’ll really be like when you take that step. Yet that’s exactly when you need to take that step and build.

    Again, nice post.

    (*Resistance: see War of Art by Steven Pressfield for more details)

AS SEEN IN