Finding the Optimal Girlfriend with Math

The Secretary Problem, Applied

Yeo Shen Yong
8 min readJun 22, 2021

I remember that time many years back during sexuality education class, where the girls are separated from the guys just for this special session. A week before the class started, the teachers sent out an online form asking for questions for this class, where male teachers will attempt to answer the anonymous male students’ questions. I thought that it would be interesting to contribute a question myself, so sent mine in.

And so, a week later, as the lesson started, a cohort of male students got seated in the large theatrette, excited to listen to the teachers’ answers to some of the questions. Soon after, my question came up. It went something like this: Is it okay to rate a girl’s appearance from 0 to 10. Some students laughed, as a very funny math teacher took the stage to answer the question. He said, “Well, if you rated every girl’s appearance from 0 to 10, there is a method for you to have the highest chance of finding the prettiest girl during your lifetime and that is…” I didn’t really understand what he said at the time, and hence cannot remember it exactly, but now, curiosity got the better of me and I decided to search for an answer on the internet.

The Problem

This optimisation problem is formerly known as the secretary problem, and it involves formulating a strategy to maximise your chances of choosing the best person in a pool of people (based on whatever matrix you want) by examining them one by one.

For the context of finding the perfect girlfriend, let’s assume that John will only meet 3 girls in his entire lifetime. Each of these girls have a different rank, one of them being the best, one being the worst, and one in the middle. However, these 3 girls enter John’s life at different points of time, and the order in which they meet John is uniformly random, which means that the first girl that John meets has a 1/3 chance of being girl A, B or C. For simplicity, we will let girl A be the highest rank, followed by B, then C.

Here are all the possible permutations of the order in which they meet John:

All permutations of the order in which girls A, B and C meet John. Ranking: A>B>C

If John chooses to marry the first girl, there is a 1/3 chance of him marrying the best girl, and the probability is the same if he chooses to marry the second girl, or the third girl. However, if he skips the first girl, and accepts the first better girl which comes up, rejecting all other girls worst than the first one, he has a 1/2 chance of marring the best girl, as can be seen from the table below:

All permutations of the order in which girls A, B and C meet John. The strategy of skipping the first girl, and accepting the first girl which is better than the first one is employed. All worse girls are rejected. Ranking: A>B>C

Employing the strategy of first using an initial pool of people (in this case only one person) as a benchmark for accepting girls that come up in the future actually increases one’s chances of accepting the best girl in the pool.

However, as the number of people in the pool increase, the problem becomes more complicated. To maximise the probability of finding the best girl in the pool, how many girls should we use as the initial benchmark? Here is a more generalised secretary problem:

Instead of a total of 3 girls, now we have a number n instead, and instead of using the first girl as a benchmark, we will use the first (r-1) girls as a benchmark, rejecting them immediately, and accepting the first girl after the (r-1)th girl which is better than all the girls from 1 to (r-1). This will make the rth girl to be the first girl to be considered. The question is, what is the proportion of girls that we use as a benchmark initially which maximises one’s chances of finding the best girl in the entire pool? In a more mathematical sense, we want to find (r-1)/n where P(r), the probability of finding the best girl given that we reject the first (r-1), is maximised.

The Solution

Let girl i be the girl being considered. In order to choose the highest ranking girl out of the entire pool of n girls, two things must happen. Firstly, girl i has to be picked and secondly, girl i has to be the best girl in the pool. The probability of this happening for some girl i can be expressed as such:

Using the idea of conditional probability, we can expand this to be:

On the right side of the expression, the probability of girl i being the best is expectedly 1/n. On the left hand side, the expression represents the conditional probability of ‘given that girl i is the best, what is the probability that girl i is selected’. It might seem like quite a lot to digest, but it is actually quite logical. Let’s go back to the diagram earlier:

However, in this case, the last girl is not the nth girl, but the ith girl, because once girl i is selected, the selection stops and every girl after that is rejected. Since we already know that the ith girl is the best in the pool (from the conditional probability expression), we will always pick her , because she is better than all the girls in the benchmark, right? Well, not really, because there might be a girl from the rth girl onwards which is better than all the benchmarked girls, which causes her to be picked before the ith girl. To cater to that, we have to make sure that the best girl before the ith girl is in the first (r-1) girls, which are the benchmarked girls. That value is simply (r-1)/(i-1)The expression is as follows:

Combining with the earlier equation, we have:

However, if we just consider girl i, we are only considering 1 girl out of all the n girls. To fully calculate the probability of choosing the best girl, we have to consider every girl in the pool from girl 1 to girl n, and sum up their individual probabilities of choosing them and them being the best girls. The expression is as follows:

Note that by using this strategy, we already rejected the first (r-1) girls by using them as a benchmark. Hence, their probability of being picked is 0. With this, along with some rearrangement, we can further simplify the equation:

Next, to further generalise the equation, let’s assume that n is large. The equation can then be further simplified:

To analyse our new equation, we let r/n be x, P(r) be y, and plot a graph of y= -x ln x:

y = -xlnx

We are only interested in the highest point of this graph, because it has the greatest P(r), which is the probability of finding the best girl in the pool. More specifically, we are looking for the specific x-coordinate, because it will give us the ideal value of r/n which we can adopt in our strategy. To find that value, you can use a graphing app, or do it yourself and find the turning point in the graph. To do that, we solve for dy/dx = 0:

There, we finally have our solution! That solution tells us that to maximise our chances of finding the best girl we have to take the first 37% of girls as a benchmark, rejecting all of them and choosing the first girl which is better than every girl in the benchmark.

In the case of dating, you will not know how many girls you will date in your lifetime, but a method to tweak the strategy is perhaps to use it in terms of time instead. Say, you will be dating for 20 years. According to the 37% strategy, you should reject every girl you meet for the first 7 years, and pick the next girl which is better than everyone you have dated before. This admittedly sounds extremely stupid and illogical, and here are some reasons why.


There are some limitations to this strategy which restricts its use in everyday life. For one, this strategy is based on the assumption that the person choosing has literally zero prior knowledge about anything inside the pool of n things. An example would be a monk who has lived in the mountains for all his life, and who hasn’t had any interactions with girls whatsoever, until he decides to assimilate into society when he enters adulthood (sounds like something which came out of a manga).

Also, although this strategy optimally increases your chances of finding the best item in the pool of n items, it also leaves you with a relatively high chance of not picking anything. If, on the 37% chance where the best item in the entire pool is located inside the benchmark pool (the first r-1 items), you will end up rejecting every item, and be left with none. In the case of partners in your life, it will be quite a sad story to tell.

Lastly, if you think about this strategy in the first place, you might end up being labelled as a nerd and partner-less, just like me.