FaceMash algorithm from Social network movie.

Hi All,

I saw social network movie and next day when I was discussing this movie with few of my colleagues we were thinking about the algorithm which Mark had taken from one of his friend who use it for Chess game. If you have seen that movie you will surely remember that scene. No body among us was sure what was that algorithm and how does it help in matching girls! 

I thought I must search that and found some good points about that. Facemash is an algorithm which is actually based on another algorithm called Elo Rating System.

Wiki says:

The Elo rating system is a method for calculating the relative skill levels of players in two-player games such as chess. It is named after its creator Arpad Elo, a Hungarian-born American physics professor

Now according to this algorithm following repersents the expected score of Player A

E<em>A = \frac 1 {1 + 10^{(R</em>B - R_A)/400}}.
Similarly the expected score for Player B is

E<em>B = \frac 1 {1 + 10^{(R</em>A - R<em>B)/400}}.
Where _RA _is current rating of Player A and _R_B _is current rating of player B.

When player A will play the match what ever score he will have will be compared with the expected score and that will give a new rating for player A. This will be done using the below formula;

R<em>A^\prime = R</em>A + K(S<em>A - E</em>A).

Where S_A _is the actual score of player A. K is a constant that has two values for Master players K=16 and for weaker players K will be 32.

Now let us take an ecample of rating girls as done in the Social Network movie. For example we have the following table:

Girl Current Rating Result Score
A 80
B 90 Lost 0
C 30 Won 1
D 50 Draw 0.5
E 40 Won 1

Now as you can clearly see that A was comapred with 4 girls and she has scored 2.5 points. If you calculate the Expected score using the above formula it will be

Now using the second formula given above we will calculate the new Rating for player A  using K = 16  will be
R'_A _= 80 + 16(2.5-2.157) = 85.2
So this was all about that algorithm. This is widely used in games like football etc.

I hope you guys will like it I will be waiting for your comments :)

Share on : Twitter, Facebook or Google+