Introduction to Computational Social Science · an explorable
What is the best strategy for finding a partner?
Mathematics has a famous answer: look at the first 37%, then leap. Here you will see where that answer comes from and why it is right for the question it answers. Then we change the question, step by step, until it looks more like life. Along the way you will build, run and take apart a model of human behaviour, which is what computational social scientists do.
A teaching model. It finds the best strategy inside a simplified world. It is not the best strategy for your life, and it is not dating advice.
A rule for dating keeps going viral: spend the first part of your search only looking, then commit to the first person who beats everyone before. Behind it is a real theorem. We will derive it, and then question it.
Say the caveat in the status line out loud at the start and again at the end; the page is built so that students discover why the in-model answer and the real-world answer differ. Every section has a stable anchor (#part-1, #derivation, …) for linking from slides.
Part 1
The classical answer: 37%
The question, stripped down
Imagine you will meet a known number of people, N, one at a time and in random order. You can see how each one compares with the people you have already met, but you have no absolute scale. Once you pass someone, they are gone. You choose only once, and you "win" only if you choose the single best of all N. Which strategy gives you the best chance of winning? This is the classic secretary problem (Ferguson, 1989). Its premises:
One choice. You choose exactly one person.
Known number. You know in advance how many people you will meet.
Random order. People arrive in random order.
Ranks only. You can only compare people with those already met; you have no idea what is out there.
No going back. A person you pass is gone.
Only the best counts. Second best is as bad as no one.
They always say yes. The premise nobody states. We return to it in Part 4.
Try it
You will meet 20 people between the ages of 16 and 50, one at a time. Each has a score, and higher is better. Nobody tells you what a typical score is or how high scores go: you learn that only from the people you meet. For each person, keep looking or settle down. If you pass everyone, you stay single.
This interactive needs JavaScript.
Where 37% comes from, step by step
Choose a family of strategies
Consider the rule: look at the first k people without choosing, then leap at the first person who beats everyone so far. Under the premises above, the best possible strategy has exactly this form (Ferguson, 1989). So our only job is to find the best k.
When does the rule win?
Suppose the very best person stands at position i.
If i ≤ k, we skipped them, and we lose.
If i > k, we reach them only if nobody between k and i tempted us first. That happens exactly when the best of the first i − 1 people stood in the looking zone. Because the order is random, that person is equally likely to be anywhere among the i − 1, so the chance is k/(i − 1).
Add up over every position
The best person stands at each position with probability 1/N, so the chance of winning is
P(win) = (k/N) · (1/k + 1/(k+1) + … + 1/(N−1))
Best at position i
Chance
Term
Running total
Let N grow
Write x = k/N for the share you look at. The sum in brackets is close to ln(N/k) = ln(1/x), so
P(win) ≈ x · ln(1/x)
Find the peak
Differentiate and set to zero: ln(1/x) − 1 = 0, so x = 1/e ≈ 0.368. The chance of winning there is also 1/e ≈ 0.368.
The price
The same logic shows that you choose nobody exactly when the best person was in the looking zone, which happens with probability k/N = x. At the optimum, 37% of people who follow the rule end up alone.
Exact chances for "skip the first k of N, then take the next person who beats everyone so far", with the large-N approximation x·ln(1/x) dashed.
What the answer does and does not say
The 37% rule is the right answer to one question: how to maximise the chance of the single best, under all seven premises. Change the question and the answer changes:
If what matters is how good your partner is, the best look phase shrinks to about √N, about 10 out of 100 (Bearden, 2006). In simulations, "try a dozen" works well (Todd & Miller, 1999).
If you can see how good people are and know what is out there, there is no look phase at all: start with a high bar and lower it as time runs out (Gilbert & Mosteller, 1966; Guttman, 1960).
Part 2
Rethink the premises
A theorem is only as true as its premises. For each one, decide whether it is true of dating, then see what our model will do with it.
P1
You choose exactly one person.
Kept. You choose one long-term partner.
P2
You know how many people you will meet.
Loosened. How many people you meet is random, and you may meet more people at some ages than at others (Natsal-3; Bhattacharya et al., 2016).
P3
People arrive in random order.
Kept, to keep the model simple.
P4
You can only rank people; you have no idea what is out there.
Loosened. You see how good each person is. You start with an expectation of what people are like, and you learn from everyone you meet.
P5
No going back to someone you passed.
Kept. In real life people do go back (see Part 5).
P6
Only the very best counts.
Loosened. What counts is how good your partner is; staying single is counted separately.
P7, the hidden one
Whoever you choose says yes.
Loosened in Part 4. Others can say no, and you do not know exactly how desirable you are.
Loosened in our modelsKept as in the theorem
Loosening P2 already breaks the popular version
People meet new partners most often in their late teens and early twenties, and less often with each decade after (Natsal-3, Table 30). When meeting peaks early, "37% of your years" (age 28.6) comes after about 61% of your candidates have passed. That version leaves 61% single. "37% of your candidates" switches at 22.6 and leaves 37% single. The probability literature points the same way: when arrivals are spread out in time, set the cutoff by the expected share of arrivals, not by the calendar (Bruss, 1984).
Simulated lives with an early-peaking meeting rate. The share of lives that settle at each age, under the two readings of "37%".
Once premises are loosened there is no tidy formula left. So we do what computational social scientists do: write down the rules for one simulated person, an agent, and let a computer live thousands of lives.
Part 3
A one-sided model: loosening P2, P4 and P6
A model is a deliberately simplified world in which every assumption is written down. That makes it possible to check and argue with (Epstein, 2008). An agent-based model describes individuals by rules and lets patterns emerge from many simulated lives.
The agent
Who you meet. Each person has a rating. The agent does not know how ratings are spread in the population; it has to learn that. We describe a partner by their percentile: a partner at the 90th percentile is better than 90 in 100 people.
When you meet them. Ages 16–50. The number of people met each year is random, around a rate that is either constant or peaks early, as in the survey data.
What you expect. The agent starts with an expectation of what people are like: high, medium or low, held weakly or strongly. After each person it meets, it updates that expectation with Bayes' rule. The chart below lets you watch this happen.
What you do. Look for a while, or until you feel sure what is out there. Then say yes to the first person who clears your bar:
better than everyone met so far;
in the top 50%, 25% or 10% of what you believe is out there;
or a bar that falls with age.
Ratings are measured in standard deviations (SD) from the average person. 0 is average; +1 SD is better than about 84 in 100 people; +2 SD, better than about 98 in 100; −1 SD, better than only about 16 in 100.
Expected people met per year of age, at about 102 in a lifetime. The two shapes differ only in timing.
How an expectation meets experience.
One hundred lives
Each square is one simulated life. The board shows 100 lives; the numbers summarise 10,000. Click a square to replay that life.
Click a square to replay that life.
What the lives say: is there a best strategy in this world?
The benchmark is an oracle: an imaginary person who knows everything, both what people are like and exactly how many are still to come. The oracle settles in every life, with an average partner at the 98th percentile (Guttman, 1960). Among strategies a person could actually follow:
1 Looking less is better for almost every goal.
Take the rule from Part 1: look first, then say yes to the first person who beats everyone you have met. The only question is how long to look. Compare two ways, for people who meet about 102 people in a life:
Look at the first 37% (the classic rule). 38% stay single. Those who settle get an excellent partner, around the 98th percentile, and 36% of all people get the very best person they ever meet.
Look at only the first 10%. Only 10% stay single. Partners are only a little worse, around the 95th percentile, but only 23% get the very best.
So the short look wins on almost everything people care about. The classic rule wins only if your goal is "the very best or nobody". Notice the top panel: the share who stay single is about the same as the share of people you spend looking, just as step 6 of the derivation said.
Rule: look first, then say yes to the first person who beats everyone met. About 102 people in a life, met at a steady rate; 10,000 lives per point. The marked points are the 10% look and the classic 37%.
2 A bar that comes down with age comes close to the oracle.
Instead of "beat everyone", use a bar that starts high and comes down as you get older. After the same 37% look, say yes only to someone better than 95% of the people you have met. Then lower that bar a little every year, so that at 50 you would say yes to anyone better than half of them.
Everyone who uses this rule settles, with partners around the 93rd percentile. To compare strategies with one number, we use a score: the partner's percentile written from 0 to 1 (the 93rd percentile is 0.93), and 0 for staying single. The falling bar scores 0.929 and the oracle 0.982. The classic rule scores only 0.613, because the people who stay single score 0.
3 Expectations matter only when you meet few people.
Imagine someone who meets only about 17 people in a whole life, one every two years. They look at the first 20%, then say yes to the first person in the top 10% of what they believe is out there. Before they start, they firmly believe that people are mostly great (high expectation), average (medium) or mostly poor (low).
With high expectations, almost nobody they meet looks like "top 10%", and 70% stay single. With low expectations, only 6% do. With about 100 people or more, almost nobody stays single, whatever they expected: there is enough experience to correct a wrong belief.
Share who stay single, by expectation (held strongly), for three numbers of people met in a life. Strategy: look at the first 20%, then say yes to the top 10% by your belief. The lines for 102 and 340 people lie on top of each other, near 0%.
4 Waiting until you are sure means waiting most of a life.
Another way to decide when to stop looking: keep looking until you are sure where the "top 10%" begins. It is like guessing the height above which the tallest 10% of people stand. After 5 people your guess can be far off; after 70 it is close. How sure you want to be changes everything (about 102 people in a life, three a year):
Roughly sure: you start choosing at about 21.3, and 100% settle.
Quite sure: you start choosing only at about 40.4, after meeting about 70 people, and 17% never settle.
Very sure: 102 people are not enough. Nobody ever starts choosing.
5 A mistake that helps: optimism that experience slowly corrects.
Ana and Ben use the same plan: look at the first 5 people, then say yes to anyone in the top 10% of what they believe is out there. The only difference is what they believe before they start.
Ben's expectation is right. His "top 10%" is close to the real top 10% from the start: the top 13% at first, the top 10% after 80 people.
Ana is an optimist. She firmly believes people are better than they really are, so what she calls "the top 10%" is really the top 1.5%: she is very choosy. Each person she meets is a little worse than she expected. She slowly corrects her belief, and her bar comes down: the top 4% after 20 people, the top 8% after 80.
Ana's mistake helps her. Being very choosy early, while many people are still to come, and less choosy as time runs out is what the oracle does: the top 1.9% at first, the top 8% after 80 people. Ana's score is 0.970, Ben's 0.925, the oracle's 0.982.
This explains a mechanism; it is not advice. With only about 17 people in a life, the same optimism leaves 67% of people like Ana single (finding 3).
How choosy each one is after meeting m people: the share of the whole population their bar lets through. About 102 people in a life; average over 1,000 simulated lives.
So, inside the one-sided model, the best strategy is a bar that starts high and falls as you learn and as time runs out. The 37% look phase is best only for a goal almost nobody has.
Your turn: the one-sided model
Change one thing at a time, and write down your prediction first. Your strategy is compared with the classic rule on the same lives.
Press Run.
Part 4
Two-sided: they can say no (loosening P7)
Trick's proposal was refused. In online dating, people write to partners about 25% more desirable than themselves, and replies fall steeply as that gap grows (Bruch & Newman, 2018). A one-sided model also hides a second unknown: you do not know how desirable you are.
The two-sided agent
You have a desirability of your own, drawn from the same population as everyone else. Every simulated life gets a different one.
When you propose, the other person says yes more often the less they outrank you. Equals say yes half the time; someone 1 SD above you, about 1 time in 20. This steepness is an illustrative choice.
A refusal costs time. For a blank period after each refusal you meet nobody, as after a courtship that failed. People you would have met then are never seen.
You start with a self-image (overconfident, accurate or underconfident) and learn your own desirability from every refusal, with Bayes' rule again, this time about yourself.
Two ways to aim:
Aim by the market: use the bar learned from the people you met, as in Part 3.
Aim by yourself: propose to anyone at least as desirable as you think you are, plus a little ambition. Each refusal lowers your self-estimate, and your aim with it (Todd & Miller, 1999).
This is a model of one searcher: the people you meet do not search themselves.
One hundred lives, two-sided
The same 100 lives as in Part 3 (with a constant meeting rate), but now each person also has a desirability of their own, and others can refuse. Every agent looks at the first 10% of the people they expect to meet.
Click a square to replay that life, with every refusal.
What the lives say
All figures below use a constant meeting rate, about 102 people in a lifetime, and a 1-year blank period.
6 When others can say no, Part 3's strategies collapse.
Take the strategies from Part 3 and let other people refuse, with a 1-year blank period after each refusal. Every one of them settles fewer lives. The classic rule falls furthest: from 62% of lives to 3%. A bar that falls with age keeps 56%, down from 100%.
Why does "beat everyone" fail so badly? A toy example with the scores from Part 1, where a typical person scores about 10. You are typical. You have met people scoring 12, 9 and 15, so you propose to the next person who beats them all: a 22. Someone that desirable will almost certainly say no. But they still count as someone you have met, so now you need someone above 22, who is even more likely to refuse. And after each refusal you spend a year meeting nobody.
Share who ever settle when everyone says yes (Part 3) and when others can refuse (1-year blank period). Same strategies, same lives.
7 Aiming by yourself works, and similar people end up together.
Now a different rule. Forget the market and aim by yourself: "I propose to anyone a little more desirable than I think I am." With an accurate self-image, 93% settle, at a median age of 26.4.
Look at who ends up with whom (green line). Nobody in the model looks for a partner like themselves. Yet people in the bottom third end up with partners around the 26th percentile, the middle third around the 53rd, and the top third around the 81st. Similar people end up together (correlation 0.88), only because of who says yes to whom (Kalick & Hamilton, 1986).
Compare the other lines. In Part 3 (blue), everyone got a partner around the 95th percentile, whoever they were. Aiming by the market (orange) gives partners from the 68th to the 84th percentile, but only 56% settle (finding 6).
The average partner's percentile for people in the bottom, middle and top third of desirability (those who settle; 1-year blank period).
8 Self-image matters most, and refusals cost the overconfident years.
Three people aim by themselves, a little above where they think they are (+0.25 SD). They differ only in their self-image. With a 1-year blank period after each refusal:
Accurate:93% settle, at a median age of 26.4.
Overconfident (thinks they are 1 SD better than they are, like an average person who believes they beat 84 in 100): only 63% settle, at a median age of 36.7. They propose too high, are refused, and lose a year each time.
Underconfident:97% settle, early (median age 21.8), but with partners below what they could have had: around the 44th percentile, against the 53rd.
The longer the blank period, the more overconfidence costs: with a 2-year blank, only 43% of overconfident people settle.
Share who ever settle, by the blank period after each refusal and by self-image. Everyone aims by themselves, a little above their self-estimate (+0.25 SD).
So, in a two-sided world, the best strategy is to know yourself, aim a little above it, and let refusals teach you, rather than optimise against everyone you have met.
Your turn: the two-sided model
Change one thing at a time, and write down your prediction first. Your strategy is compared with the classic rule in the same two-sided world, on the same lives.
Press Run.
Part 5
So, what is the best strategy?
Inside the models, "best" depends on what you want, how many people you will meet, what you know about them and about yourself, and whether they choose you back. Each loosened premise changed the answer:
The classical answer (look 37%, then leap) is best only for "the single best or nothing".
One-sided: a bar that starts high and falls with time.
Two-sided: know yourself, aim a little above it, and learn from refusals.
Even inside a toy world there is no single answer.
Outside the models, every result is conditional on assumptions that research on real people contradicts:
The models' assumptions and the evidence about real people
The models assume…
What research finds
Why it matters
Everyone agrees on how desirable a person is
Romantic evaluations are mostly specific to the pair, and agreement falls as people get to know someone (Eastwick & Hunt, 2014). Over a hundred traits could not predict who would desire whom (Joel et al., 2017).
There may be no single scale to learn, about others or about yourself.
A model can explain, predict or illustrate, and these are different jobs (Hofman et al., 2021). These models illustrate. Even large teams with rich data struggle to predict individual life outcomes (Salganik et al., 2020).
Matching a pattern is not proof. Search rules can reproduce the age-at-marriage curve (Todd, Billari & Simão, 2005). So can social pressure spreading through a cohort (Hernes, 1972). Many mechanisms can grow the same pattern (Epstein, 1999).
The value is in the disciplined argument. Writing the viral rule down exposed seven premises and a goal. Simulating it showed which ones matter: the goal, how many people you meet, how you learn, and whether they choose you back.
The best strategy in these models is a falling bar set by what you have learned, about others and about yourself. The best strategy in life is not something a model like this can tell you. Seeing exactly why is the point of the exercise.
Discussion
Goals. The 37% rule maximises the chance of "the best". What objective would you write down instead? Try the "value of staying single" slider.
Premises. Which premise did you vote "false" that our models still keep? How would you loosen it, and what would you predict?
Measurement. Our models need the number of "candidates" a person meets. How would you measure it for real, and what would that measurement miss?
Self-knowledge. In Part 4, self-image mattered more than strategy. Where do people learn how desirable they are, and how could that learning go wrong?
Validation. In the US, the median age at first marriage in 2025 was 30.8 for men and 28.4 for women (U.S. Census Bureau, 2025), and 25% of 40-year-olds had never married in 2021 (Pew Research Center, 2023). Should a toy model try to match these? What would it prove if it did?
Ethics. Dating apps run algorithms on millions of real searches. What changes when a model of human choice is used to steer choices rather than to understand them?
Further reading
Every reference was checked against its DOI registry or source page.
The puzzle and its mathematics
Ferguson, T. S. (1989). Who solved the secretary problem? Statistical Science, 4(3), 282–289. doi:10.1214/ss/1177012493
Gilbert, J. P., & Mosteller, F. (1966). Recognizing the maximum of a sequence. Journal of the American Statistical Association, 61(313), 35–73. doi:10.1080/01621459.1966.10502008
Guttman, I. (1960). On a problem of L. Moser. Canadian Mathematical Bulletin, 3(1), 35–39. doi:10.4153/cmb-1960-008-8
Bearden, J. N. (2006). A new secretary problem with rank-based selection and cardinal payoffs. Journal of Mathematical Psychology, 50(1), 58–59. doi:10.1016/j.jmp.2005.11.003
Bruss, F. T. (1984). A unified approach to a class of best choice problems with an unknown number of options. The Annals of Probability, 12(3), 882–889. doi:10.1214/aop/1176993237
Trick, M. (2011, February 27). Finding love optimally [blog post]. mat.tepper.cmu.edu
Mate search as a model of behaviour
Todd, P. M., & Miller, G. F. (1999). From pride and prejudice to persuasion: Satisficing in mate search. In G. Gigerenzer, P. M. Todd, & the ABC Research Group, Simple heuristics that make us smart (pp. 287–308). Oxford University Press.
Kalick, S. M., & Hamilton, T. E. (1986). The matching hypothesis reexamined. Journal of Personality and Social Psychology, 51(4), 673–682. doi:10.1037/0022-3514.51.4.673
Todd, P. M., Billari, F. C., & Simão, J. (2005). Aggregate age-at-marriage patterns from individual mate-search heuristics. Demography, 42(3), 559–574. doi:10.1353/dem.2005.0027
Hernes, G. (1972). The process of entry into first marriage. American Sociological Review, 37(2), 173. doi:10.2307/2094025
Baumann, C., Singmann, H., Gershman, S. J., & von Helversen, B. (2020). A linear threshold model for optimal stopping behavior. PNAS, 117(23), 12750–12755. doi:10.1073/pnas.2002312117
Goldstein, D. G., McAfee, R. P., Suri, S., & Wright, J. R. (2020). Learning when to stop searching. Management Science, 66(3), 1375–1394. doi:10.1287/mnsc.2018.3245
Evidence about real people
NatCen Social Research et al. (2013). Natsal-3 reference tables (Table 30). natsal.ac.uk
Bhattacharya, K., Ghosh, A., Monsivais, D., Dunbar, R. I. M., & Kaski, K. (2016). Sex differences in social focus across the life cycle in humans. Royal Society Open Science, 3(4), 160097. doi:10.1098/rsos.160097
Bruch, E. E., & Newman, M. E. J. (2018). Aspirational pursuit of mates in online dating markets. Science Advances, 4(8), eaap9815. doi:10.1126/sciadv.aap9815
Eastwick, P. W., & Hunt, L. L. (2014). Relational mate value: Consensus and uniqueness in romantic evaluations. Journal of Personality and Social Psychology, 106(5), 728–751. doi:10.1037/a0035884
Eastwick, P. W., & Finkel, E. J. (2008). Sex differences in mate preferences revisited: Do people know what they initially desire in a romantic partner? Journal of Personality and Social Psychology, 94(2), 245–264. doi:10.1037/0022-3514.94.2.245
Eastwick, P. W., Luchies, L. B., Finkel, E. J., & Hunt, L. L. (2014). The predictive validity of ideal partner preferences: A review and meta-analysis. Psychological Bulletin, 140(3), 623–665. doi:10.1037/a0032432
Eastwick, P. W., Joel, S., Carswell, K. L., Molden, D. C., Finkel, E. J., & Blozis, S. A. (2023). Predicting romantic interest during early relationship development: A preregistered investigation using machine learning. European Journal of Personality, 37(3), 276–312. doi:10.1177/08902070221085877
Joel, S., Eastwick, P. W., & Finkel, E. J. (2017). Is romantic desire predictable? Machine learning applied to initial romantic attraction. Psychological Science, 28(10), 1478–1489. doi:10.1177/0956797617714580
Joel, S., et al. (2020). Machine learning uncovers the most robust self-report predictors of relationship quality across 43 longitudinal couples studies. PNAS, 117(32), 19061–19071. doi:10.1073/pnas.1917036117
Bhargava, S., & Fisman, R. (2014). Contrast effects in sequential decisions: Evidence from speed dating. Review of Economics and Statistics, 96(3), 444–457. doi:10.1162/rest_a_00416
Spielmann, S. S., MacDonald, G., Joel, S., & Impett, E. A. (2016). Longing for ex-partners out of fear of being single. Journal of Personality, 84(6), 799–808. doi:10.1111/jopy.12222
U.S. Census Bureau (2025). Families and living arrangements, press release CB25-TPS.78. census.gov
Pew Research Center (2023, June 8). A record-high share of 40-year-olds in the U.S. have never been married. pewresearch.org
Why model? Computational social science
Epstein, J. M. (2008). Why model? Journal of Artificial Societies and Social Simulation, 11(4), 12. jasss.org
Hofman, J. M., et al. (2021). Integrating explanation and prediction in computational social science. Nature, 595, 181–188. doi:10.1038/s41586-021-03659-0
Salganik, M. J., et al. (2020). Measuring the predictability of life outcomes with a scientific mass collaboration. PNAS, 117(15), 8398–8403. doi:10.1073/pnas.1915006117
Methods and reproducibility
One-sided model
One agent per life, ages 16–50. Yearly counts of people met are Poisson around a rate that is constant or peaks early (shaped on Natsal-3 Table 30), normalised to the same expected total. Ratings are standard normal. Beliefs use a Normal–Inverse-Gamma prior (α₀ = 2, β₀ = 1; expectation −1, 0 or +1 SD; strength 1 or 10 pseudo-observations). "Until sure" means the 90% credible width of the agent's estimated top-10% line, in rating units, falls below the set value. The falling bar relaxes from 95% to 50% of people met between the switch and age 50.
Two-sided model
Own desirability d is drawn from the same population. A person rated r says yes with probability σ(3(d − r)). The self-image is N(d + bias, 1), updated on a 201-point grid after every refusal. After each refusal the agent meets nobody for the blank period, and people it would have met then are not observed. "Aim by yourself" proposes to anyone rated at least self-estimate + ambition.
Runs
Every setting on this page was simulated for 10,000 lives, and the same lives are reused across settings and across both models. Seed 20261010.
Verification
25 of 25 engine tests pass. They include exact results, a replication of Todd & Miller (1999), the optimal benchmarks, a brute-force re-implementation of the two-sided logic, and independent Python re-implementations of both models with different random numbers. The boards on this page are recomputed live by the same engine and match the precomputed results exactly.