Skip to playerSkip to main content
  • 2 days ago
Transcript
00:00How many times do you need to shuffle a deck of cards to make them truly random?
00:05How much uranium does it take to build a nuclear bomb?
00:10How can you predict the next word in a sentence?
00:13And how does Google know which page you're actually searching for?
00:16Well, the reason we know the answer to all of these questions is because of a strange
00:21math feud in Russia that took place over a hundred years ago.
00:26In 1905, socialist groups all across Russia rose up against the Tsar, the ruler of the
00:32empire.
00:33They demanded a complete political reform, or failing that, that he stepped down from
00:37power entirely.
00:39This divided the nation into two.
00:41So on one side, you got the Tsarists, right?
00:44They wanted to defend the status quo and keep the Tsar in power.
00:48But then on the other side, you had the socialists, who wanted this complete political reform.
00:53And this division was so bad that it crept into every part of society, to the point where
00:58even mathematicians started picking sides.
01:01On the side of the Tsar was Pavel Nikrasov, unofficially called the Tsar of Probability.
01:07Nikrasov was a deeply religious and powerful man, and he used his status to argue that math
01:12could be used to explain free will and the will of God.
01:17His intellectual nemesis on the socialist side was Andrei Markov, also known as Andrei
01:22the Furious.
01:24Markov was an atheist, and he had no patience for people who were being unrigorous, something
01:29he considered Nikrasov to be.
01:31Because in his eyes, math had nothing to do with free will or religion.
01:35So he publicly criticized Nikrasov's work, listing it among the abuses of mathematics.
01:41Their feud centered on the main idea people had used to do probability for the last 200
01:46years.
01:47And we can illustrate this with a simple coin flip.
01:50When I flip the coin 10 times, I get 6x heads and 4x tails.
01:54Which is obviously not the 50-50 you'd expect.
01:57But if I keep flipping the coin, then at first the ratio jumps all over the place.
02:02But after a large number of flips, we see that it slowly settles down and approaches 50-50.
02:08And in this case, after 100 flips, we end up on 51 heads and 49 tails.
02:14Which is almost exactly what you would expect.
02:17This behavior, that the average outcome gets closer and closer to the expected value as you
02:22run more and more independent trials, is known as the law of large numbers.
02:27It was first proven by Jacob Bernoulli in 1713, and it was the key concept at the heart of probability
02:33theory, right up until Markov and Nikrasov.
02:36But Bernoulli only proved that it worked for independent events, like a fair coin flip,
02:42or when you ask people to guess how much they think an item is worth, where one event doesn't
02:47influence the others.
02:49But now imagine that instead of asking each person to submit their guess individually,
02:54you ask people to shout out their answer in public.
02:58In this case, the first person might think it's an extraordinarily valuable item and say
03:02it's worth around 2000 dollars.
03:05But now all the other people in the room are influenced by this value, and so their guesses
03:11have become dependent.
03:13And now the average doesn't converge to the true value, but instead it clusters around a
03:18higher amount.
03:19And so for 200 years, probability had relied on this key assumption, that you need independence
03:25to observe the law of large numbers.
03:28And this was the idea that sparked Nikrasov and Markov's feud.
03:32See, Nikrasov agreed with Bernoulli that you need independence to get the law of large numbers.
03:37But he took it one step further.
03:39He said, if you see the law of large numbers, you can infer that the underlying events must
03:45be independent.
03:47Take this table of Belgian marriages from 1841 to 1845.
03:52Now you see that every year the average is about 29,000.
03:55And so it seems like the values converge and therefore that they follow the law of large numbers.
04:01And when Nikrasov looked at other social statistics like crime rates and birth rates, he noticed a
04:06similar pattern.
04:08But now think about where all this data is coming from.
04:10It's coming from decisions to get married, decisions to commit crimes, and decisions to
04:15have babies, at least for the most part.
04:18So Nikrasov reasoned that because these statistics follow the law of large numbers, the decisions
04:22causing them must be independent.
04:25In other words, he argued that they must be acts of free will.
04:29So to him, free will wasn't just something philosophical.
04:32It was something you could measure.
04:34It was scientific.
04:37But to Markov, Nikrasov was delusional.
04:40He thought it was absurd to link mathematical independence to free will.
04:46So Markov set out to prove that dependent events could also follow the law of large numbers,
04:51and that you can still do probability with dependent events.
04:56To do this, he needed something where one event clearly depended on what came before.
05:01And he got the idea that this is what happens in text.
05:04Whether your next letter is a consonant or a vowel depends heavily on what the current
05:09letter is.
05:10So to test this, Markov turned to a poem at the heart of Russian literature, Eugene Onegin
05:16by Alexander Pushkin.
05:17He took the first 20,000 letters of the poem, stripped out all punctuation and spaces, and
05:24pushed them together into one long string of characters.
05:28He counted the letters and found that 43% were vowels and 57% were consonants.
05:33Then Markov broke the string into overlapping pairs.
05:37That gave him four possible combinations, vowel-vowel, consonant-consonant, vowel-consonant, or consonant-vowel.
05:45Now if the letters were independent, the probability of a vowel-vowel pair would just be the probability
05:49of a vowel twice, which is about 0.18, or an 18% chance.
05:56But when Markov actually counted, he found vowel-vowel pairs only show up 6% of the time,
06:03way less than if they were independent.
06:06And when he checked the other pairs, he found that all actual values differed greatly from
06:11what the independent case would predict.
06:14So Markov had shown that the letters were dependent.
06:18And to beat Nikrasov, all he needed to do now was show that these letters still followed
06:22the law of large numbers.
06:24So he created a prediction machine of sorts.
06:28He started by drawing two circles, one for a vowel and one for a consonant.
06:32These were his states.
06:34Now say you're at a vowel, then the next letter could either be a vowel or a consonant.
06:39So he drew two arrows to represent these transitions.
06:43But what are these transition probabilities?
06:45Well, Markov knew that if you pick a random starting point, there is a 43% chance that it'll
06:51be a vowel.
06:52He also knew that vowel-vowel pairs occur about 6% of the time.
06:57So to find the probability of going from a vowel to another vowel, he divided .06 by .43
07:03to find a transition probability of about 13%.
07:07And since there is a 100% chance that another letter comes next, all the arrows going from
07:12the same state need to add up to 1.
07:15So the chance of going to a consonant is 1 minus .13 or 87%.
07:21He repeated this process for the consonants to complete his predictive machine.
07:26So let's see how it works.
07:28We'll start at a vowel.
07:31Next we generate a random number between 0 and 1.
07:34If it's below .13, we get another vowel.
07:37If it's above, we get a consonant.
07:40We got .78, so we get a consonant.
07:42Then we generate another number and check if it's above or below .67 .21, so we get a vowel.
07:50Now we can keep doing this and keep track of the ratio of vowels to consonants.
07:54At first, the ratio jumps all over the place.
07:57But after a while, it converges to a steady value .43% vowels and 57% consonants.
08:04The exact split Markov had counted by hand.
08:09So Markov had built a dependent system, a literal chain of events.
08:14And he showed that it still followed the law of large numbers.
08:17Which meant that observing convergence in social statistics didn't prove that the underlying
08:21decisions were independent.
08:23In other words, those statistics don't prove free will at all.
08:27Markov had shattered Nikrasov's argument and he knew it.
08:31So he ended his paper with one final dig at his rival.
08:35Thus, free will is not necessary to do probability.
08:39In fact, independence isn't even necessary to do probability.
08:43With this Markov chain as it came to be known, he found a way to do probability with dependent
08:48events.
08:49This should have been a huge breakthrough because in the real world almost everything is dependent
08:55on something else.
08:56I mean, the weather tomorrow depends on the conditions today.
09:00How a disease spreads depends on who's infected right now.
09:03And the behavior of particles depends on the behavior of particles around them.
09:09Many of these processes could be modeled using Markov chains.
09:13Do people think it was like a mic drop moment?
09:15Like, oh, Nikrasov is out, like, Markov's a man.
09:19Or people didn't really notice, or it was obscure, or...
09:22I feel like people didn't really notice.
09:24Like, it wasn't a really big thing.
09:29And Markov himself seemingly didn't care much about how it might be applied to practical
09:33events.
09:34He wrote, I am concerned only with questions of pure analysis.
09:38I refer to the question of the applicability with indifference.
09:44Little did he know that this new form of probability theory would soon play a major role in one of
09:49the most important developments of the 20th century.
09:54On the morning of the 16th of July, 1945, the United States detonated the Gatchets, the world's first nuclear bomb.
10:05The six-kilogram plutonium bomb created an explosion that was equivalent to nearly 25,000 tons of TNT.
10:12This was the culmination of the top-secret Manhattan Project.
10:17A three-year-long effort by some of the smartest people alive, including people like J. Robert Oppenheimer,
10:23John von Neumann, and a little-known mathematician named Stanislav Ulam.
10:30Even after the war ended, Ulam continued trying to figure out how neutrons behave inside a nuclear bomb.
10:36Now, a nuclear bomb works something like this.
10:38Say you have a core of uranium-235.
10:41Then, when a neutron hits a U-235 nucleus, the nucleus splits, releasing energy and, crucially, two or three more neutrons.
10:50If, on average, those new neutrons go on to hit and split more than one other U-235 nucleus,
10:56you get a runaway chain reaction.
10:58So you have a nuclear bomb.
11:00But uranium-235, the fissile fuel needed for the bombs, was really hard to get.
11:05So one of the key questions was, just how much of it do you need to build a bomb?
11:10And this is why Ulam wanted to understand how the neutrons behave.
11:15But then, in January of 1946, everything came to a halt.
11:21Ulam was struck by a sudden and severe case of encephalitis, an inflammation of the brain that nearly killed him.
11:28His recovery was long and slow, with Ulam spending most of his time in bed.
11:34To pass the time, he played a simple card game, solitaire.
11:38But as he played countless games, winning some, losing others, one question kept nagging at him.
11:45What are the chances that a randomly shoveled game of solitaire could be won?
11:50It was a deceivingly difficult problem to solve.
11:53Ulam played with all 52 cards, where each arrangement created a unique game.
11:58So the total number of possible games was 52 factorial, or about 8 times 10 to the 67.
12:06So solving this analytically was hopeless.
12:10But then, Ulam had a flash of insight.
12:12What if I just play hundreds of games and count how many could be won?
12:16That would give him some sort of statistical approximation of the answer.
12:21Back at Los Alamos, the remaining scientists grappled with much harder problems than solitaire.
12:26Like figuring out how neutrons behave inside a nuclear core.
12:30In a nuclear core, there are trillions and trillions of neutrons all interacting with their surroundings.
12:36So the number of possible outcomes is immense, and computing it directly seemed impossible.
12:42But when Ulam returned to work, he had a sudden revelation.
12:46What if we could simulate these systems by generating lots of random outcomes, like I did with solitaire?
12:52He shared this idea with von Neumann, who immediately recognized its power, but also spotted a key problem.
12:59See, in solitaire, each game is independent.
13:02How the cards are dealt in one game have no effect on the next.
13:06But neutrons aren't like that.
13:08A neutron's behavior depends on where it is and what it has done before.
13:13So you couldn't just sample random outcomes like in solitaire.
13:17Instead, you needed to model a whole chain of events, where each step influenced the next.
13:24What von Neumann realized is that you needed a Markov chain.
13:28So they made one, and a much simplified version of it works something like this.
13:33Now, the starting state is just a neutron traveling through the core.
13:37And from there, three things can happen.
13:39It can scatter off an atom and keep traveling.
13:42So that gives you an arrow going back to itself.
13:45It can leave the system or get absorbed by a non-visal material, in which case it no longer takes part in the chain reaction, and so it ends its Markov chain.
13:54Or it can strike another uranium-235 atom, triggering a vision event and releasing two or three more neutrons that then start their own chains.
14:04But in this chain, the transition probabilities aren't fixed.
14:08They depend on things like the neutron's position, velocity and energy, as well as the overall configuration and mass of uranium.
14:16So a fast-moving neutron might have a 30% chance to scatter, 50% chance to be absorbed or leave, and a 20% chance to cause fission.
14:24But a slower-moving neutron would have different probabilities.
14:28Next, they ran this chain on the world's first electronic computer, the ENIAC.
14:34The computer started by randomly generating a neutron's starting conditions, and stepped through the chain to keep track of how many neutrons were produced on average per run, known as the multiplication factor K.
14:45So, if on average one neutron produces another two neutrons, then K is equal to 2.
14:52And if on average every two neutrons produce three neutrons, then K is equal to 3 over 2, and so on.
14:59Then, after stepping through the full chain for a specified number of steps, we collect the average K value and record that number in a histogram.
15:07This process was then repeated hundreds of times, and the results tell it up, giving you a statistical distribution of the outcome.
15:14If you find that in most cases K is less than 1, the reaction dies down.
15:19If it's equal to 1, there's a self-sustaining chain reaction, but it doesn't grow.
15:24And if K is larger than 1, the reaction grows exponentially, and you've got a bomb.
15:29With it, von Neumann and Ulam had a statistical way to figure out how many neutrons were produced, without having to do any exact calculations.
15:39In other words, they could approximate differential equations that were too hard to solve analytically.
15:45All that was needed was a name for the new method.
15:48Now, Ulam's uncle was a gambler, and the random sampling and high stakes reminded Ulam of the Monte Carlo Casino in Monaco.
15:56And the name stuck. The Monte Carlo method was born.
16:01The method was so successful that it didn't stay secret for long.
16:05By the end of 1948, scientists at another lab, Argonne in Chicago, used it to study nuclear reactor designs.
16:12And from there, the idea spread quickly.
16:16Ulam later remarked,
16:17it is still an unending source of surprise for me to see how a few scribbles on a blackboard could change the course of human affairs.
16:27And it wouldn't be the last time a Markov chain-based method changed the course of human affairs.
16:35In 1993, the internet was open to the public, and soon it exploded.
16:40By the mid-1990s, thousands of new pages appeared every day, and that number was only growing.
16:47This created a new kind of problem.
16:50I mean, how do you find anything in this ever-expanding sea of information?
16:54In 1994, two Stanford PhD students, Jerry Young and David Filo, founded the search engine Yahoo to address this issue.
17:03But they needed money.
17:06So, a year later, they arranged to meet with Japanese billionaire Masayoshi Sun,
17:11also known as the Bill Gates of Japan.
17:14They were looking to raise $5 million for their new startup.
17:19But Sun has other plans.
17:22He offers to invest a full $100 million instead.
17:26That's 20 times more than what the founders asked for.
17:29So Jerry Yang declines, saying, we don't need that much.
17:33But Sun disagrees.
17:34Jerry, everyone needs $100 million.
17:39Before the founders get a chance to respond, Sun jumps in again and asks,
17:43who are your biggest competitors?
17:45Excite and Lycos, the pair respond.
17:48Sun orders his associate to write those names down,
17:51and then he says, if you don't let me invest in Yahoo,
17:54I will invest in one of them, and I'll kill you.
17:58See, Sun had realized something.
18:01None of the leading search engines at the time had any superior technology.
18:05They didn't have a technological advantage over the others.
18:09They all just ranked pages by how often a search term appears on a given page.
18:14So the battle for the number one search engine would be decided by who could attract the most users,
18:19who could spend the most on marketing.
18:21Lycos?
18:22Go get it.
18:23Get Lycos.
18:24Or get lost.
18:26This is revolution.
18:28Yahoo!
18:33And marketing required a lot of money.
18:35Money that Sun had.
18:37So he could decide who won the war.
18:39Yahoo's founders realized they were left with no real choice but to accept Sun's investment.
18:45So here we are right in the middle of Yahoo.
18:48And within four years, Yahoo became the most popular site on the planet.
18:52In the time it takes to say this sentence, Yahoo will answer 79,000 information requests worldwide.
18:59The two men are now worth $120 million each.
19:03Yahoo!
19:05But Yahoo had a critical weakness.
19:10See, Yahoo's keyword search was easy to trick.
19:13To get your page ranked highly, you could just repeat keywords hundreds of times,
19:17hidden with white text on a white background.
19:20One thing they didn't have in those early days was a notion of quality of the result.
19:28So they had a notion of relevance, saying,
19:31does this document talk about the thing that you're interested in?
19:35But there wasn't really a notion of which ones are better.
19:38What they really needed was a way to rank pages by both relevance and quality.
19:43But how do you measure the quality of a web page?
19:46Well, to understand that, we need to borrow an idea from libraries.
19:50So I'm old enough that library books used to have a paper card in it that was a stamp of all the due dates of when it was due back.
19:57You took a book and if it had a lot of those, you said, oh, this is probably a good book.
20:01And if it didn't have any, you said, well, maybe this isn't the best book.
20:05Stamps acted like endorsements.
20:07The more stamps, the better the book must be.
20:09And the same idea can be applied to the web.
20:12Over at Stanford, two PhD students, Sergey Brin and Larry Page were working on this exact problem.
20:19Brin and Page realized that each link to a page can be thought of as an endorsement.
20:24And the more links a page sends out, the less valuable each vote becomes.
20:29So what they realized is that we can model the web as a Markov chain.
20:34To see how this works, imagine a toy internet with just four web pages.
20:38Call them Amy, Ben, Chris and Dan.
20:41These are our states.
20:43Typically, one web page links to others, allowing you to move between them.
20:47These are our transitions.
20:50In this setup, Amy only links to Ben, so there's a 100% chance of going from Amy to Ben.
20:56Ben links to Amy, Chris and Dan, so there's a 33% chance of going to any of those pages.
21:02And we can fill out the other transition probabilities in the same way.
21:06So now we can run this Markov chain and see what happens.
21:10Imagine you're a surfer on this web.
21:13You start on a random page, say Amy, and you keep running the machine and keep track of
21:18the percentage of time you spend on each page.
21:21Over time, the ratio settles, and the scores give us some measure of the relative importance
21:26of these pages.
21:27You spend the most time on Ben, so Ben is ranked first, followed by Amy, then Dan, and lastly
21:33Chris.
21:34It might seem like there's an easy way to beat the system, just make 100 pages all linking
21:39to your website.
21:40Now you get 100 full votes and you'll always rank on top, but that is not the case.
21:47While during their first few steps they might make your page seem important, none of the
21:51other websites link to them, so over many steps their contributions don't matter.
21:57You might have many links, but they're not quality links, so they don't affect the algorithm.
22:04But there is still one problem though.
22:06Not all pages are connected.
22:07In networks like this one, a random server can get stuck in a loop, never reaching the
22:12rest of the web.
22:13So, to fix this, we can set a rule that 85% of the time, our random server just follows
22:19a link like normal.
22:20But then for about 15% of the time, they just jump to a page at random.
22:25This damping factor makes sure that we explore all possible parts of the web without ever
22:30getting stuck.
22:32By using Mark of Chains, Page and Bryn had built a better search engine, and they called
22:37it PageRank.
22:38Because it's talking about how pages react, web pages react with each other, and also
22:44because the founder's name is Larry Page, so he snuck that in.
22:48With PageRank, they got much better search results, often getting you to the site you were looking
22:53for in one go.
22:55Although, to some, this sounded like a terrible idea.
22:58Others said, oh, well, you're telling me you get a search that will get the right result
23:03on the first answer?
23:04Well, I don't want that, because if it takes them three or four chances searches to get
23:09the right answer, then I have three or four chances to show ads.
23:13And if you get them the answer right away, I'm just going to lose them.
23:16So, you know, I don't see why a better search is better.
23:20But Page and Bryn disagreed.
23:22They were convinced that if their product was far superior, then people would flock to it.
23:26I would say it actually is a democracy that works.
23:30If all pages were equal, anybody can manufacture as many pages as they want.
23:35I can set up a billion pages in my server tomorrow.
23:38But you shouldn't treat them all as equal.
23:40Just looking at the data out of curiosity, we found that we had technology to do a better
23:44job of search, and we realized how impactful having great search can be.
23:49And so, in 1998, they launched their new search engine to take on Yahoo.
23:54Initially, they called it Backrup after the backlinks it analyzed.
23:58But then they realized that maybe that's not the most attractive name.
24:02Now, their ambitions were big, to essentially index all the pages on the internet.
24:07And they needed a name equally as big.
24:09So they thought of the largest number they could think of, 10 to the power 100, a Google.
24:15But then, when trying to register their domain, they accidentally misspelled it.
24:19And so, Google was born.
24:22Over the next four years, Google overthrew Yahoo to become the most used search engine.
24:31Everyone who knows the internet almost certainly knows Google.
24:34Googling is like oxygen to teenagers.
24:37And today, Alphabet, which is Google's parent company, is worth around $2 trillion.
24:43When Google makes even the slightest change in its algorithms, it can have huge effects.
24:48Google. Google. Google. Google. Google. Google.
24:51They're on fire. And the reason why they're on fire is because they're focused.
24:55And they're more focused than Yahoo, who does search.
24:57They're more focused than Microsoft, who does search with Bing.
24:59Yahoo has lots of traffic. They always have.
25:01They have some really great properties.
25:03But I don't think Yahoo is the go-to place, you know?
25:06And at the heart of this trillion-dollar algorithm is a Markov chain,
25:11which only looks at the current state to predict what's going to happen next.
25:16But in the 1940s, Claude Shannon, the father of information theory, started asking a different question.
25:23He went back to Markov's original idea of predicting text,
25:26but instead of just using vowels and consonants, he focused on individual letters.
25:31And he wondered, what if instead of looking at only the last letter as a predictor,
25:36I look at the last two? Well, with that he got texts that looked like this.
25:41Now, it doesn't make much sense, but there are some recognizable words, like way, off, and deep.
25:47But Shannon was convinced he could do better. So next, instead of looking at letters,
25:52he wondered, what if I use entire words as predictors? That gave him sentences like this.
25:57The head and in front to attack on an English writer that the character of this point is
26:02therefore another method for the letters that the time of whoever told the problem for an unexpected.
26:09Now, clearly, this doesn't make any sense.
26:12But Shannon did notice that sequences of four words or so generally did make sense.
26:17For instance, attack on an English writer kind of makes sense.
26:21So, Shannon learned that you can make better and better predictions about what the next word is
26:25going to be by taking into account more and more of the previous words.
26:30It's kind of like what Gmail does when it predicts what you're going to type next.
26:34And this is no coincidence. The algorithms that make these predictions are based on Markov chains.
26:41They're not necessarily using letters. You know, they use what they call tokens.
26:47Some of which are letters, some of which are words, marks of punctuation, whatever.
26:52So it's a bigger set than just the alphabet. The game is simply we have this string of tokens that,
27:00you know, might be 30 long. And we're asking what are the odds that the next token is this or this or this?
27:09But today's large language models don't treat all those tokens equally.
27:13Because unlike simple Markov chains, they also use something called attention,
27:17which tells the model what to pay attention to.
27:20So in the phrase, the structure of the cell, the model can use previous contexts like blood
27:25and mitochondria to know the cell most likely refers to biology rather than a prison cell.
27:30And it uses that to tune its prediction.
27:33But as large language models become more widespread,
27:36one concern is that the text they produce ends up on the internet,
27:39and that becomes training data for future models.
27:42When you start doing that, the game is very soon over. You come, in this case, to a very dull,
27:51stable state. It just says the same thing over and over and over again forever.
27:55The language models are vulnerable to this process.
27:58And any system like this, where we have a feedback loop, will become hard to model using Markov chains.
28:05Take global warming, for instance. As we increase the amount of carbon dioxide in the air,
28:09the average temperature of the Earth increases. But as the temperature increases, the atmosphere
28:14can hold more water vapor, which is an incredibly powerful greenhouse gas. And with more water vapor,
28:19the temperature increases further, allowing for even more water vapor. So you get this positive feedback
28:25loop, which makes it hard to predict what's going to happen next. So there are some systems where
28:29Markov chains don't work. But for many other dependent systems, they offer a way of doing probability.
28:36But what's fascinating is that all these systems have extremely long histories. I mean,
28:41you could trace back all the letters in a text, trace back all the interactions of what a neutron did,
28:46or trace back the weather for weeks. But the beautiful thing Markov and others found is that for
28:52many of these systems, you can ignore almost all of that. You can just look at the current state and
28:58forget about the rest. That makes these systems memoryless. And it's this memoryless property
29:05that makes Markov chains so powerful. Because it's what allows you to take these extremely complex
29:10systems and simplify them a lot to still make meaningful predictions. As one paper put it,
29:17problem solving is often a matter of cooking up an appropriate Markov chain.
29:21It's kind of ridiculous to me that this basic fact of mathematics would come out of a fight like
29:28that, which, you know, really had nothing to do with it. But all the evidence suggests that it really
29:34was this determination to show up in the cross-off that led Markov to do the work.
29:40But there's one question we still haven't answered. When playing Solitaire, how did Ulam know his cards were
29:48perfectly shuffled? I mean, how many shuffles does it take to get a completely random arrangement of cards?
29:56If you have a deck of cards, you need to shuffle it, right? Okay. How often, if you're shuffling,
30:01like, you know, you split it in half and then you do the... How often do you have to shuffle it to make it
30:08completely random? Two. Two? Yeah, I'm going with 26. Yeah, four times. Four times. I don't know.
30:1452 times. Okay, okay. It's not a bad guess. Seven? It is seven. Really? Yeah. So you can think of
30:22card shoveling as a Markov chain, where each deck arrangement is a state and then each shovel is a
30:28step. And so for a deck of 52 cards, if you riffle shovel it seven times, then every arrangement of the
30:34deck is about equally likely. So it's basically random. But I can shuffle like that. So for me,
30:41what I do is I do it like this. How many times do you think you have to shuffle like this to get it
30:46random? What do you think? And perhaps more importantly, how would you go about working it
30:53out? Well, that's where today's sponsor Brilliant comes in. Brilliant is a learning app that gets you
30:58hands-on with problems just like this. Whether it's math, physics, programming, or even AI, Brilliant's
31:05interactive lessons and challenges let you play your way to a sharper mind. You can discover how large
31:11language models actually work, from basic Markov chains to complex neural networks, or dig into the
31:17math behind this shuffling question. It's a fun way to build knowledge and skills that help you solve
31:22all kinds of problems, which brings us back to our shuffle. So, Casper, what actually is the answer?
31:29It's actually over 2,000. Oh, it's crazy, right? Yeah. So the next time someone offers to shuffle before a
31:35game, make sure they're doing it right. Seven riffles or it doesn't count. But the interesting part
31:41isn't just knowing that, it's understanding why and seeing how a simple question can lead you to
31:46some surprisingly complex mathematics. And that's what Brilliant is all about. So to try everything
31:53Brilliant has to offer for free for a full 30 days, visit brilliant.org slash veritasium. Click
31:59that link in the description or scan this handy QR code. And if you sign up, you'll also get 20% off
32:05their annual premium subscription. So I want to thank Brilliant for sponsoring this video, and I want to
32:09thank you for watching. Easy.
Be the first to comment
Add your comment

Recommended