Monday, October 15, 2012

A Mathematical Approach in Finding Love

Inspired by @rofiqlung’s and @muftiabidin’s life stories, I decide to write this post. Given that life is short and finite, and how parents usually complain(!) if we haven’t find after all these years that “special one” to settle and make family with, surely optimizing this love journey so that we won’t waste our time is one of the biggest problem for humankind (string theory and optimal currency areas are, too. But let’s forget those aside). Strangely, albeit love and mathematic don’t usually mix, we may find the answer to that “optimal love journey” in… math.

However, you have to find n number of your love candidates before doing this algorithm. These candidates might be your childhood friends, your friends, your neighbors, your coworkers, those chicks/dudes whom you picked up at the night clubs, your ex- and current boy/girlfriend(s). It doesn’t matter. You just have to know how many candidates you have, and let’s call the number as n.

The rule:
1. There is a single wife/husband position to fill.
2. There are n candidates for the position, and you know the value of n.
3. The candidates can be ranked from best to worst unambiguously.
4. The candidates are interviewed sequentially in random order, with equal probability (none is more prioritized than the others).
5. Immediately after a date/dinner/watching movie together/being in relationship/whatever, the candidate you have dated is either accepted or rejected, and the decision is irrevocable. You have to move on to the next candidate, or if you have found one, stop.
6. The decision to accept or reject a candidate can be based only on the relative ranks of the candidates dated so far, i.e. it doesn’t matter if Dian Sastro is better than Laura Basuki (I know, they both are married), as long as they both are worse than Yoona, then you have to choose Yoona.

The calculations:

It’s only a matter of optimal stopping rule. You reject the first k − 1 candidates (let’s say Dian Sastro is the best candidate among these k − 1 candidates), and then selects the first subsequent candidate that is better than Dian Sastro, then marry her. For an arbitrary cutoff k, and using Bayesian theorem, the probability that the best candidate is selected is:


If we partition the interval [(k − 1)/n, 1] into (nk) + 1 subintervals of length 1/n each: [(k − 1)/n, kn, …, (n − 1)/n, 1]. It follows that (using Riemannian sum):


If k/n → x ∈ (0,1) as n → ∞ then the expression above converges to –x ln (x) as n (the number of candidates) approaches infinity. Taking the derivative of Pn(k/n) with respect to k/n, setting it to 0, and solving for k/n, we find that the optimal k/n is equal to 1/e, with e being Euler number (2,71828183...). Thus, the optimal cutoff (k) tends to be near n/e as n increases, and the best candidate is selected with probability 1/e (= 0,367879441…). That means there is approximately 37% chance of finding your best soul mate, without bother “trying” all the candidates.

Confused? Let me simplify. The algorithm is as follows:

1. Get n candidates.
2. Date n/e or 37% of them (if you have 10 candidates, date 3 or 4 of them. If you have 100 candidates, date 37 of them., etc., etc.).
3. Don’t forget to compare the previous candidate to the next. Let’s say the best from the first 37% is Dian Sastro. Carry on.
4. Continue dating the rest, but the first candidate you meet who’s better than all of the first 37% candidate (Dian Sastro), you marry.
5. Stop dating the candidates left, and love her for the rest of your life. This is without doubts the most important step.

#Protip: should you find no better candidate than Dian Sastro, well, bad luck for you. That's why it's important to employ the "PHP technique."

 


Bonus!

After finding out how to optimally find the best lover, then when is the best time to marry? You think math doesn’t have the answer? Duh. I find your lack of faith disturbing. Here’s how:


Note that the n, r, and k above are completely unrelated to the previous equations (I am lazy). To save you from reading more tiresome equations and math-y explanations, the answer is 0,368. “What is this 0,368, dude?”, you may ask. Fine, here’s the guide:

1. Choose the oldest age by which you want to get married, for example 30. Call this number “a”.
2. When is your earliest age that you start to consider searching for wife/husband? Let’s say, from age 20 onwards. Call this as “b”.
3. Do this math: ((a – b) x 0,368) + a. This gives you 3,68 to be added to 20.
4. The result of 24 (more or less) is your Optimal Marriage Age. Hooray!


Happy searching for you (and also me, goddammit)!


7 comments:

  1. hahaha... certainly radical but strangely brilliant;) maybe you'll get a nobel prize if you obliged yourself to be more diligent.

    but do remember to execute as well as theorize for your supporting proof, in other words: find your soulmate;p

    good luck strolling down the path of love, bro;)

    cool post, as always;)

    ReplyDelete
  2. "but do remember to execute as well as theorize for your supporting proof, in other words: find your soulmate;p"

    This is way way more difficult than to calculate the statistical chance, Mbak Nay! :D

    Thanks for the comment. And good luck strolling down the path of love for you, too! :D

    ReplyDelete
  3. Marry me, mas Andre! Rumus brilianmu ini mempertemukan kita. Sepertinya kita jodoh nih.. (ʃ⌣ƪ)

    ReplyDelete
  4. sweet.. this is why I love game theory. :)

    ReplyDelete
  5. anjrit berat banget omongannya :|

    ReplyDelete