Inside OKCupid: The math of online dating - Christian Rudder
-
0:18 - 0:20Hello, my name is Christian Rudder,
-
0:20 - 0:22and I was one of the founders of OkCupid.
-
0:22 - 0:25It's now one of the biggest
dating sites in the United States. -
0:25 - 0:27Like most everyone at the site,
I was a math major, -
0:27 - 0:31As you may expect, we're known
for the analytic approach we take to love. -
0:31 - 0:32We call it our matching algorithm.
-
0:32 - 0:35Basically, OkCupid's matching
algorithm helps us decide -
0:35 - 0:37whether two people should go on a date.
-
0:37 - 0:39We built our entire business around it.
-
0:39 - 0:41Now, algorithm is a fancy word,
-
0:41 - 0:43and people like to drop it
like it's this big thing. -
0:43 - 0:46But really, an algorithm
is just a systematic, -
0:46 - 0:48step-by-step way to solve a problem.
-
0:48 - 0:50It doesn't have to be fancy at all.
-
0:50 - 0:51Here in this lesson,
-
0:51 - 0:54I'm going to explain how we arrived
at our particular algorithm, -
0:54 - 0:56so you can see how it's done.
-
0:56 - 0:58Now, why are algorithms even important?
-
0:58 - 0:59Why does this lesson even exist?
-
0:59 - 1:03Well, notice one very significant
phrase I used above: -
1:03 - 1:05they are a step-by-step
way to solve a problem, -
1:05 - 1:08and as you probably know, computers
excel at step-by-step processes. -
1:08 - 1:10A computer without an algorithm
-
1:10 - 1:13is basically an expensive paperweight.
-
1:13 - 1:16And since computers are such
a pervasive part of everyday life, -
1:16 - 1:17algorithms are everywhere.
-
1:19 - 1:22The math behind OkCupid's matching
algorithm is surprisingly simple. -
1:22 - 1:26It's just some addition, multiplication,
a little bit of square roots. -
1:26 - 1:28The tricky part in designing it
-
1:28 - 1:30was figuring out how to take
something mysterious, -
1:30 - 1:31human attraction,
-
1:31 - 1:34and break it into components
that a computer can work with. -
1:34 - 1:37The first thing we needed
to match people up was data, -
1:37 - 1:39something for the algorithm to work with.
-
1:39 - 1:42The best way to get data quickly
from people is to just ask for it. -
1:42 - 1:45So we decided that OkCupid
should ask users questions, -
1:45 - 1:47stuff like, "Do you want
to have kids one day?" -
1:47 - 1:49"How often do you brush your teeth?"
-
1:49 - 1:50"Do you like scary movies?"
-
1:51 - 1:53And big stuff like,
"Do you believe in God?" -
1:54 - 1:57Now, a lot of the questions
are good for matching like with like, -
1:57 - 1:59that is, when both people
answer the same way. -
1:59 - 2:02For example, two people
who are both into scary movies -
2:02 - 2:05are probably a better match
than one person who is and one who isn't. -
2:05 - 2:07But what about a question like,
-
2:07 - 2:09"Do you like to be
the center of attention?" -
2:09 - 2:11If both people in a relationship
are saying yes to this, -
2:11 - 2:13they're going to have massive problems.
-
2:13 - 2:15We realized this early on,
-
2:15 - 2:18and so we decided we needed
a bit more data from each question. -
2:18 - 2:21We had to ask people to specify
not only their own answer, -
2:21 - 2:23but the answer they wanted
from someone else. -
2:23 - 2:25That worked really well.
-
2:25 - 2:26But we needed one more dimension.
-
2:26 - 2:29Some questions tell you more
about a person than others. -
2:29 - 2:32For example, a question
about politics, something like, -
2:32 - 2:35"Which is worse:
book burning or flag burning?" -
2:35 - 2:37might reveal more about someone
than their taste in movies. -
2:37 - 2:40And it doesn't make sense
to weigh all things equally, -
2:40 - 2:42so we added one final data point.
-
2:42 - 2:44For everything that OkCupid asks you,
-
2:44 - 2:47you have a chance to tell us
the role it plays in your life. -
2:47 - 2:49And this ranges
from irrelevant to mandatory. -
2:49 - 2:53So now, for every question,
we have three things for our algorithm: -
2:53 - 2:54first, your answer;
-
2:55 - 2:59second, how you want someone else --
your potential match -- to answer; -
2:59 - 3:02and third, how important
the question is to you at all. -
3:03 - 3:04With all this information,
-
3:04 - 3:07OkCupid can figure out
how well two people will get along. -
3:07 - 3:10The algorithm crunches the numbers
and gives us a result. -
3:10 - 3:11As a practical example,
-
3:11 - 3:14let's look at how we'd match you
with another person. -
3:14 - 3:15Let's call him "B."
-
3:16 - 3:20Your match percentage with B is based
on questions you've both answered. -
3:20 - 3:22Let's call that set
of common questions "s." -
3:23 - 3:25As a very simple example,
we use a small set "s" -
3:25 - 3:27with just two questions in common,
-
3:27 - 3:28and compute a match from that.
-
3:28 - 3:30Here are our two example questions.
-
3:30 - 3:33The first one, let's say, is,
"How messy are you?" -
3:33 - 3:35And the answer possibilities are:
-
3:35 - 3:38very messy, average and very organized.
-
3:38 - 3:40And let's say you answered
"very organized," -
3:40 - 3:43and you'd like someone else
to answer "very organized," -
3:43 - 3:45and the question is very important to you.
-
3:45 - 3:47Basically, you're a neat freak.
-
3:47 - 3:50You're neat, you want someone else
to be neat, and that's it. -
3:50 - 3:52And let's say B is a little bit different.
-
3:52 - 3:54He answered "very organized" for himself,
-
3:54 - 3:57but "average" is OK with him
as an answer from someone else, -
3:57 - 3:59and the question is only
a little important to him. -
3:59 - 4:02Let's look at the second question,
from our previous example: -
4:02 - 4:04"Do you like to be
the center of attention?" -
4:04 - 4:06The answers are "yes" and "no."
-
4:06 - 4:09You've answered "no," you want
someone else to answer "no," -
4:09 - 4:11and the question is only
a little important to you. -
4:11 - 4:13Now B, he's answered "yes."
-
4:13 - 4:15He wants someone else to answer "no,"
-
4:15 - 4:17because he wants the spotlight on him,
-
4:17 - 4:19and the question is somewhat
important to him. -
4:19 - 4:21So, let's try to compute all of this.
-
4:22 - 4:24Our first step is, since we use
computers to do this, -
4:24 - 4:26we need to assign numerical values
-
4:26 - 4:29to ideas like "somewhat
important" and "very important," -
4:29 - 4:31because computers need
everything in numbers. -
4:31 - 4:34We at OkCupid decided
on the following scale: -
4:34 - 4:36"Irrelevant" is worth 0.
-
4:36 - 4:38"A little important" is worth 1.
-
4:39 - 4:40"Somewhat important" is worth 10.
-
4:41 - 4:43"Very important" is 50.
-
4:43 - 4:46And "absolutely mandatory" is 250.
-
4:46 - 4:49Next, the algorithm makes
two simple calculations. -
4:49 - 4:52The first is: How much did
B's answers satisfy you? -
4:52 - 4:56That is, how many possible points
did B score on your scale? -
4:56 - 4:59Well, you indicated that B's answer
to the first question, -
4:59 - 5:00about messiness,
-
5:00 - 5:02was very important to you.
-
5:02 - 5:04It's worth 50 points and B got that right.
-
5:04 - 5:06The second question is worth only 1,
-
5:06 - 5:08because you said
it was only a little important. -
5:08 - 5:10B got that wrong,
-
5:10 - 5:12so B's answers were 50
out of 51 possible points. -
5:12 - 5:15That's 98% satisfactory. Pretty good.
-
5:15 - 5:19The second question the algorithm
looks at is: How much did you satisfy B? -
5:19 - 5:22Well, B placed 1 point on your answer
to the messiness question -
5:22 - 5:24and 10 on your answer to the second.
-
5:25 - 5:28Of those 11, that's 1 plus 10,
you earned 10 -- -
5:28 - 5:31you guys satisfied each other
on the second question. -
5:31 - 5:35So your answers were 10 out of 11
equals 91 percent satisfactory to B. -
5:35 - 5:36That's not bad.
-
5:36 - 5:39The final step is to take
these two match percentages -
5:39 - 5:41and get one number for the both of you.
-
5:41 - 5:43To do this, the algorithm
multiplies your scores, -
5:43 - 5:45then takes the nth root,
-
5:45 - 5:47where "n" is the number of questions.
-
5:47 - 5:50Because s, which is the number
of questions in this sample, -
5:50 - 5:52is only 2,
-
5:52 - 5:56we have: match percentage
equals the square root -
5:56 - 5:58of 98 percent times 91 percent.
-
5:58 - 6:00That equals 94 percent.
-
6:00 - 6:04That 94 percent is your match
percentage with B. -
6:04 - 6:07It's a mathematical expression
of how happy you'd be with each other, -
6:07 - 6:08based on what we know.
-
6:08 - 6:10Now, why does the algorithm multiply,
-
6:10 - 6:13as opposed to, say, average
the two match scores together, -
6:13 - 6:14and do the square-root business?
-
6:14 - 6:17In general, this formula
is called the geometric mean. -
6:17 - 6:19It's a great way to combine
values that have wide ranges -
6:20 - 6:21and represent very different properties.
-
6:21 - 6:24In other words, it's perfect
for romantic matching. -
6:24 - 6:27You've got wide ranges and you've got
tons of different data points, -
6:27 - 6:31like I said, about movies, politics,
religion -- everything. -
6:31 - 6:32Intuitively, too, this makes sense.
-
6:32 - 6:35Two people satisfying
each other 50 percent -
6:35 - 6:39should be a better match
than two others who satisfy 0 and 100, -
6:39 - 6:41because affection needs to be mutual.
-
6:41 - 6:44After adding a little correction
for margin of error, -
6:44 - 6:46in the case where we have
a small number of questions, -
6:46 - 6:48like we do in this example,
-
6:48 - 6:49we're good to go.
-
6:49 - 6:51Any time OkCupid matches two people,
-
6:51 - 6:53it goes through the steps
we just outlined. -
6:53 - 6:55First it collects data about your answers,
-
6:55 - 6:58then it compares your choices
and preferences to other people's -
6:58 - 7:00in simple, mathematical ways.
-
7:00 - 7:03This, the ability to take
real-world phenomena -
7:03 - 7:05and make them something
a microchip can understand, -
7:05 - 7:09is, I think, the most important skill
anyone can have these days. -
7:09 - 7:11Like you use sentences
to tell a story to a person, -
7:11 - 7:14you use algorithms
to tell a story to a computer. -
7:14 - 7:17If you learn the language,
you can go out and tell your stories. -
7:17 - 7:19I hope this will help you do that.
- Title:
- Inside OKCupid: The math of online dating - Christian Rudder
- Speaker:
- Christian Rudder
- Description:
-
View full lesson: http://ed.ted.com/lessons/inside-okcupid-the-math-of-online-dating-christian-rudder
When two people join a dating website, they are matched according to shared interests and how they answer a number of personal questions. But how do sites calculate the likelihood of a successful relationship? Christian Rudder, one of the founders of popular dating site OKCupid, details the algorithm behind 'hitting it off.'
Lesson by Christian Rudder, animation by TED-Ed.
- Video Language:
- English
- Team:
closed TED
- Project:
- TED-Ed
- Duration:
- 07:31
![]() |
Krystian Aparta commented on English subtitles for Inside OKCupid: The math of online dating | |
![]() |
Krystian Aparta edited English subtitles for Inside OKCupid: The math of online dating | |
![]() |
Bedirhan Cinar approved English subtitles for Inside OKCupid: The math of online dating | |
![]() |
Bedirhan Cinar accepted English subtitles for Inside OKCupid: The math of online dating | |
![]() |
Bedirhan Cinar edited English subtitles for Inside OKCupid: The math of online dating | |
![]() |
Andrea McDonough edited English subtitles for Inside OKCupid: The math of online dating | |
![]() |
Andrea McDonough added a translation |
Krystian Aparta
The English transcript was updated on 5/5/2016.