# The algorithm from The Social Network

## Метаданные

- **Канал:** Zach Star
- **YouTube:** https://www.youtube.com/watch?v=BkWEhMWbPVs
- **Дата:** 30.04.2026
- **Длительность:** 9:44
- **Просмотры:** 9,578

## Описание

►To try Brilliant free for a full 30 days, go to https://brilliant.org/zachstar. You’ll also get 20% off an annual Premium subscription, which gives you unlimited access to everything on Brilliant.
►STEMerch Store: https://stemerch.com/
►Follow me
Odysee: https://odysee.com/@ZachStar:0
Instagram: https://www.instagram.com/zachstar/
Twitter: https://twitter.com/ImZachStar

Support the Channel: https://www.patreon.com/zachstar
PayPal(one time donation): https://www.paypal.me/ZachStarYT
Join this channel to get access to perks:
https://www.youtube.com/channel/UCpCSAcbqs-sjEVfk_hMfY9w/join

2D Graphing Software: https://www.desmos.com/calculator

Animations: Arkam Khan (For contact info go to https://www.arqum333.com/)

Check out my Spanish channel here: https://www.youtube.com/channel/UCnkNu2xQBLASpj6cKC8vtpA

►My Setup:
Camera: https://amzn.to/2RivYu5
Mic: https://amzn.to/35bKiri
Tripod: https://amzn.to/2RgMTNL

►Check out my Amazon Store: https://www.amazon.com/shop/zachstar

## Содержание

### [0:00](https://www.youtube.com/watch?v=BkWEhMWbPVs) Segment 1 (00:00 - 05:00)

This video is sponsored by Brilliant. You guys remember the algorithm on the window at Kirkland? Well, it's wrong or just really badly written because these are exponents in the actual equations. But excusing that, these two equations are half of the algorithm for ranking chess players. I'll get to the other half later. And notice these are basically identical. Just the RA and RB are flipped. So, when we get to the math, I'm just going to stick to using one of these because that's all we need. But this algorithm can really be used to rank anything that involves one-v-one comparisons. Your favorite movies, favorite food, who's the most attractive, and so on. So, here's the idea behind the algorithm and I will stick to chess. Every player has a score, an ELO rating. And after two players have a match, the winner's score goes up, the loser's score goes down. That's the algorithm. That's all it does. We're going to ignore draws this entire but it builds your rating one game at a time. And it's these two equations plus two others — that tell us how big that jump or drop should be. Now, let's build this intuitively before just plugging in the numbers. Think about what you want this algorithm to do for each of the three scenarios that can happen. Scenario one, two equally ranked players have a match. Rare but possible. Scenario two, two unequally ranked players have a match and the higher ranked player wins. — Scenario three is the upset where the lower ranked player wins. Now, for this top one where both players have the same score and someone wins, we said the winner's score should go up and the loser's score should go down. That makes sense but by how much? This is totally arbitrary right now. There's no right answer here. There's really no intuition. We're just going to pick. So, let's say the change for each player is 100 points. Now, let's look at scenario two where the better ranked player wins. How much should their scores change here? Because this is expected, I made the difference huge to just highlight what we want because this is like if Magnus Carlsen faced me. And because I still put the computer on easy mode, if Magnus wins, our scores probably shouldn't change by much. So, maybe the delta is five. Still kind of arbitrary but we at least know it should be less than the 100 from above. That's actually our baseline. Now, if the two players were much closer in score, like 1,500 versus 2,000, and still the better player wins, then we would have a bigger jump. Less than the 100 from above cuz this is still expected but it should be more than five. So, in our algorithm, the jump also depends on how big the difference in their scores is. Now, take scenario three, the upset. This is like if I beat Magnus Carlsen. Well, if that happens, first, I should get a holiday named after me. That's non-negotiable. But also, my ELO score should skyrocket, at least somewhat. Maybe by infinity but I'll do like 1,000 as the delta for each of us. That's actually too high but I'm highlighting for the upset, the delta should be large cuz this is not an expected result. So, that's it. We know what our algorithm needs to do. Raise and lower each player's score by something based on their difference in scores and who won. Now, we need an equation or two to do all of that. Oh, look, we found them. The left equation is one from the window and the right equation is the other half of the algorithm that was not on the window. Now, on the left, EB is the probability that player B wins, which is based on the difference in scores, just like we wanted. On the right, RB' prime is player B's new score, which equals their old score plus some delta. K is just a constant and EB comes from the first equation. So, that's it. Get a probability, plug it into the second equation. So, now let's run the math for each of the three scenarios. If we have two equally ranked opponents, first step, plug the ratings in for RA and RB. Their difference is zero. So, E sub B becomes 1/2. Since their scores are the same and we know nothing else, makes sense that each has a 50% chance of winning. Now, we plug that into the second equation and player B's new score will be their old score plus 1/2 K.

### [5:00](https://www.youtube.com/watch?v=BkWEhMWbPVs&t=300s) Segment 2 (05:00 - 09:00)

K is a constant. So, let's give it a value of 200. Thus, the delta becomes 100 and the new score for player B is, look at that, 1,100, what we saw before. Then, since the math is essentially symmetric here, player A's score will become 900. Their delta is going to be -100. Now, let's say player A and B are not equal in rating and the better player wins. — Now, the difference RA minus RB is -200. Plug that in and EB comes out to 0. 76, meaning this algorithm gives player B a 76% chance of winning. Plug that into the second equation and the new delta is 48. So, player B's score goes up to 1,248 and player one goes down by the same amount to 952. Notice we have a smaller jump in score than before because the ratings now are further apart and the better player won. In fact, here's a table of a bunch of other probabilities and deltas based on the difference between player A and player B's rating assuming the higher ranked player wins. That's what this whole table assumes. If you play someone close in skill to you, the scores change by more. If you play someone way worse or way better, well, the change will be minimal, just like we wanted. Then the last scenario is the lower rated player wins. Now, I'm switching who is the higher rated player just so I don't have to change the equation to the RB minus RA version. Totally symmetric, really doesn't matter. Now, the difference is positive 200. Thus, EB is now 0. 24, just one minus what we got earlier. And that makes the delta value 152. Then notice this delta and our other one with the reverse situation add to 200, our K value. That is true everywhere. — We can make a table for this scenario where the lower ranked player wins and notice the probabilities in the reverse situations add to one and the deltas add to K. So, one property of this algorithm is that the change in score is bound by K. — You can never go up or down by more than that amount. Notice the deltas are all between zero and 200. And that's the idea. Chess players are ranked basically by this algorithm, just different variations. The biggest difference between this video and actual chess ranking systems that matters a lot is K. Instead of being constant, K typically decreases based on how many games you've already played. As you can see in this example here for the US Chess Federation ranking system, as you play more, the nominator goes up and K goes down. Thus, experienced players with lots of games won't have as big of a change in score after any given match. So, your score becomes a little more locked in place the more and more you play. But it's not even just chess. They have ranking algorithms even over at Brilliant, a learning app meant to help you excel in math and computer science with visual, interactive problem-solving and personalized practice, which is what I love most about this platform. See, I am a visual learner, especially with math. So, I need to see examples and ideally real-world applications. And Brilliant offers exactly that. And this method has been proven to be more beneficial than just watching lectures and videos. And with Brilliant, you'll have the perfect mix of interactive problems, motivating challenges, and encouragement to move forward so you can build a genuine understanding of even the most complex topics you'll encounter. Now, they have an algorithmic thinking course that covers optimization and scheduling but it's in their how technology works course that you'll find ranking algorithms, recommendation engines, and encryption among other topics. Brilliant is meant for kids and adults ages 10 to 110. So, get started with Brilliant for free for a full 30 days. Just go to brilliant. org/zackstar, scan the QR code on the screen now, or click the link in the description below. Brilliant's also giving our viewers 20% off an annual premium subscription, which gives you unlimited daily access to everything on Brilliant. With that, going to end that video there. Thanks as always to my supporters on Patreon. Social media links to follow me are down below and I will see you all in the next video.

---
*Источник: https://ekstraktznaniy.ru/video/51479*