Wu haopin game core algorithm round 18 -- Wu haopin teaches you how to play the sexiness of the sister paper in Facemash. PK Algorithm

Source: Internet
Author: User

 

Zuckerberg in social networks is domineering, but many people are still designing a "stone player" for his friends.Algorithm", That is, the Facemash website is impressed by the sexiness algorithms of the two sister papers! Therefore, I thought of writing "Wu Hao teaches you to copy sister paper" and its external Biography "Wu Hao teaches you to copy sister paper (special post-palace article)". These two articles are also the companion articles about Bill Gates in Round 11. Today they describe Zuckerberg.

In fact, in software enterprises all over the world (including mobile Internet), the CEOs of some American giants are not necessarily geek, for example, Google's two amazing boys, one is a math enthusiast who loves righteousness, and the other is a toy enthusiast who is obsessed with Lego block games. These two geeks have created a well-known Google company. In addition, I don't want to talk more about Steve Jobs's apple. Instead of saying that he is an entrepreneur, he is more like an artist. He made his apple series a work of art, not just a smartphone.

However, more people worship that kind of entrepreneur itself is also a cool geek! For example, Zuckerberg's Facebook and Bill Gates's Microsoft, the charm of geeks is not only that they can complete problems that ordinary people have to think about for a long time to solve, but simply look at their domineering eyes, we can see the shock he has brought us.

The so-called Facemash, according to the movie social network, is actually implemented like this. Coincidentally, Zuckerberg broke up with his girlfriend because his girlfriend thought Zuckerberg was too objective to be emotional (of course, as a programmer, there was nothing ), later, Zuckerberg posted many things about her on his blog in retaliation for her. Finally, he simply created a website named Facemash, which steals the photo of the entire Harvard nvwa dormitory, to create data resources for its website, and then use the photos of the two beautiful women each time as the PK interface ., This is Facemash imitated by students of huake. When selecting a viewer, consider the sister paper on the left and the right, which is more sexy. Then, select a sister paper that he/she thinks is the sexiest and enter the name, the system will analyze and then obtain an updated value for each sister paper based on the corresponding algorithm (Here we use the stone feed algorithm provided by Zuckerberg's economics roommate. Through continuous iteration, we finally get the best description of the sexiness degree of sister paper (of course, there is a small premise here, that is, every man must be objective during his evaluation, rational without evil ideas. If he was bought by the sister-in-law, the consequence would be the magic horse. You can imagine it. ^_^)

Algorithms used to calculate the sexiness of two sisters

This algorithm has paralyzed the entire Harvard Internet!

First, correct an error. As shown in the first figure, the algorithm written by the roommate should be a power of 10 instead of a product. Because, if it is understood as a product, then some things will not be able to get through, because if the level difference between the two is too big, it will lead to negative denominator, and thus expected to be negative, then, isn't that sister paper always capable of turning over? (Not sexiest)
According to wiki, this ranking system originated from the Hungarian American physicist Arpad ELO. It was originally used in chess rankings and is now widely used in football, basketball and other sports. The Chinese name is the rank.
Elo hypothesis:
1. contestants showed a normal distribution in each competition. Later, it was generally believed that the logistic distribution was more reasonable.
2. In a single game, the winning party is considered to be a good player, and the losing party is considered to be a poor player. In a draw, the two sides are roughly equivalent. Although this assumption seems quite common

Algorithm

EA is the expected performance of Player A, and Ra is the current rank of Player.
When contestants a and B compete, the expected performance of the two players can be calculated based on the formula.
EA + EB = 1
The winner scored 1 point and the negative scored 0 points. (In movies, there will be no draw)

If a contestant performs better than expected, the contestant's ranking should rise. On the contrary, if the performance is not as good as expected, the ranking will drop.

Sa is the score (1 or 0) of Contestant A, and EA is the expected performance of Contestant. K is a constant and usually takes 16 (this is an empirical parameter) in a master chess match ). The obtained Ra is the rank of contestants after the competition.

In the beginning, we can think that the rank of each person is 0.

The first game is a and B. In this case, Ra = RB = 0, EA = EB = 0.5.

Assume that Council a wins B, then a's score is 1 and B's score is 0.
Ra' = 0 + 16 * (1-0.5) = 8
RB '= 0 + 16 * (0-0.5) =-8
Therefore, each time a game is held, a new rank is generated. The huge number of participants and clicks within four hours made the game exceptionally evil. After all, it is my sister-in-law XD.

Here is a specific example, False RB = 1200, Ra = 1600 to see what will happen. Here, a is better than B, so when B loses, a wins the right thing, and even has nothing to do with it, just win a person who is 400 points less experienced than himself! Therefore, the empirical value of both parties will only change by 2.9. However, if a loses to B, it will be understood as unacceptable by many people-this is also normal. How can you lose it if you are so strong? So we use a how pathetic! To describe this event, the experience value of a will decrease at a rate directly proportional to experience K. The absolute value of the change is about 10 times the absolute value of the experience that a wins B! Cannot afford to lose.

Here, let's look at Song Yao's younger brother. This is the Shanghai election page of the 2013 Smart Transport Conference. The principle of finding sister paper can be traced back here. There is no error. In 2013, the national network smart transport association will first conduct the audition. To avoid the traditional round robin competition, the knockout competition is very rigid, here, we use an algorithm that selects any competitor for PK. That is, the stone player algorithm we described above. When comparing the two players, we can use the current winning rate as a reference. In addition, we can adjust the winning rate to a certain extent.

In other words, when I was at the E-Science and Technology University, I used the "big score + small score" algorithm to complete the field competition at the Chengdu chess Institute. I scored 2 points for each winner, but I failed to score, when you score a big score, you can also score a small score. The score is accumulated continuously. If you fail, the score is reduced, so far as 0) in my seven games, it was a pity that I had not completed the competition. Now I am working hard with a private go coach, the sister-in-law may be surprised. It's just a little bit worse.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.