
Gresham College Lectures
Gresham College Lectures
Lottery-Winning Maths
The field of probability started when a French nobleman asked the mathematician Blaise Pascal to solve a dispute for him about a game consisting of throwing a pair of dice 24 times. Pascal discussed this and other problems with fellow mathematician Pierre de Fermat, in a series of letters in which they arrived at the basic principles of probability theory.
This lecture looks at dice, cards, lotteries, and other games of chance. Can mathematics help us win?
A lecture by Sarah Hart recorded on 31 January 2023 at David Game College, London.
The transcript and downloadable versions of the lecture are available from the Gresham College website: https://www.gresham.ac.uk/watch-now/lottery-maths
Gresham College has offered free public lectures for over 400 years, thanks to the generosity of our supporters. There are currently over 2,500 lectures free to access. We believe that everyone should have the opportunity to learn from some of the greatest minds. To support Gresham's mission, please consider making a donation: https://gresham.ac.uk/support/
Website: https://gresham.ac.uk
Twitter: https://twitter.com/greshamcollege
Facebook: https://facebook.com/greshamcollege
Instagram: https://instagram.com/greshamcollege
(electronic swishing)- This lecture looks at games of chance like lotteries, dice, even tossing coins. Can mathematics help us win? We'll see how a Frenchman's gambling problem instigated the whole field of probability. We'll find out why you should never buy a British lottery ticket on a Monday. And we'll learn how Voltaire got rich on a lottery using a simple bit of mathematics. But let's start with one of the oldest games of chance, and that's dice. So dice have many advantages. They're inexpensive, cheap to make, easy to carry. You can put them in your pocket, you can take them with you wherever you go. And people have been playing games with dice for a long, long time. I want to tell you about a game that was quite popular in France a few centuries ago, and I'll just say the dice I'm going to be talking about today are always the standard dice. So each die is a cube. It's got the numbers one to six on its faces, and we'll assume that they are fair, they're unbiased. Chance of throwing any one of the numbers is 1/6th. Okay, so your mate, Antoine, comes up to you and says,"I bet you five francs that I can throw a six"if you give me four goes," should you take that bet? What do we think? So let me tell you a little bit more about Antoine. Full name, Antoine Gombaud Chevalier de Mere, Nobleman. Well, sort of; he actually gave himself that nickname,(laughs) but everyone just started to call him that anyway. And he was very interested in gambling and in calculating mathematical odds. He got a bit stuck on some of his calculations, and one of them was related to this game, or a version of it. So let's see what we can find out about this game. So you've got four goes to throw a six, and that means there are actually five possible ways the game can turn out; here they are. So you throw a six straight away possibly, or you fail, but then you manage on your second attempt or your third attempt, or your fourth attempt. And the only way to lose in this game is to fail consecutively four times. So, of course, we're not going to say,"Well, that means you have an 80% chance of winning,"(laughs) 'cause four of the five outcomes leads to you winning. We won't say that. And the reason we don't say that is because we have no reason to think that these outcomes are all equally likely. So we need to understand what are the probabilities of each of these possible outcomes. Okay, well, the first one, maybe you just throw a six; you're lucky straightaway, you throw a six. The chance of that happening is one in six. There are six numbers on the die, and six is one of them. There's a one in six chance of that happening. Fine; what about the next one? Well, in that outcome, we failed on our first attempt, and then we are lucky and we do throw a six. Now, the probability of throwing a six is one in six. So the probability of throwing a not-six, one of the other five numbers, will be 5/6. So I claim that the chance of throwing non-six followed by six will be 5/6 times 1/6, which is five out of 36. Now, why am I saying that? Well, it's an example of a general rule of probability that says if you're looking at independent events, ones which do not affect each other, the outcome of one does not affect the outcome of the next, then there's a rule that says this, that if the probability of event A is P, say, and the probability of event B is Q, say, then if they are independent of each other, they don't affect each other, like consecutive rolls of a dice, then the probability of both of those things happening, you just multiply together P times Q. Now, I must stress they have to be independent events. They cannot be events that influence each other in any way. For example, here is a false conclusion, one that you should not apply this rule. If we know, say, that about 1/10th of adults have a beard, and we know that about one-half of adults are women, we cannot multiply those together and conclude that one adult in 20 is a woman with a beard. Not true, however glorious that would look. So however, luckily for us, throws of a die are independent of each other. So the outcome of one roll does not affect the outcome of the next. So we really can multiply those probabilities together and get, as we've seen, five out of 36, a probability of five in 36 of the second outcome there. And you can repeat that idea and work out the chance of having non-six followed by non-six, followed by six, and non-non-non-six, and then finally, a six on your fourth attempt. And you can get all of these written down, there they are, those are all those probabilities. You can do the calculations. So what's the chance of winning in this game of eventually managing to get a six if you have four goes at it? Well, we can just add up all of those four things, and if you do that, as I'm sure you have all just done in your head, you get 671 out of 1,296, which is about a 52% chance of winning at this game. So we should not take our friend Antoine's bet when he sidled up to us, because over the long-term, he will have a better chance of throwing that six than not. Now, there's actually a better way to do this calculation. We worked out those four things step-by-step and adding them all up. But instead, we could just say,"Well, our chance of winning"is one minus our chance of losing." So if we have a, well, we can work out the chance of losing. The only way to lose is to fail four consecutive times to throw a six. So that's a 5/6 chance, multiplied by itself four times. We're trying it four times, okay? So we get this calculation here, 5/6 the power of four, 625 over 1,296. That is the chance of losing. It's the only way we can lose. So if that's the chance of losing, then the chance of winning is one minus that, and we get that same outcome at the end. So that's a slightly quicker way if we notice to do that. And that's going to be useful to us later. So after awhile, Antoine finds that he's sort of getting a bit bored of this game, or maybe no one wants to play it anymore with him'cause he somehow keeps winning, so he's experimenting with variants of it. And one he comes up with is this. Okay, we've been trying to throw a single die and throw a six, and we're having four attempts at it. How about I make it a little bit more spicy and instead, I throw a pair of dice, two dice, and I try to get a double six. Now, the chances of getting a double six while both of the dice have to be the six, and there's a 1/6th chance for each of them, so 1/6 times 1/6th, one in 36. You've got a one in 36 chance on any given try to throw a double six. So Gombaud said right, one in 36, that's 1/6th as likely as throwing a six with a single die. So there's this old gambling rule that says that what I can do is I can say, well, this thing, this alternative, is 1/6th as likely as throwing a six with a single die. I know that that has a 52% success rate with four attempts. So with this thing that's 1/6th as likely what I should do is have not four attempts but four times six, so you sort of make up for the less likeliness, you should have 24 attempts, and that will give you the same 52% likelihood of success. This is Gombaud's idea, and right, so he thinks this is what it should be, but unfortunately doesn't seem to be working out that way. So he had a friend, and he asked his friend for advice. And luckily for Gombaud, his friend was one of the best mathematicians in France, Blaise Pascal, and Pascal, he had a friend as well. And he asked his friend about this question and a couple of others, and his friend was one of the other best mathematicians in France, Pierre de Fermat. Right, there we are, Pascal on the left. He's looking at cycloids in that statue, it's a good statue; and Fermat is on the right. So they have a series of letters that go between them. And in that series of letters, they pretty much establish the field of probability and mathematical study of probability. They get a lot of the basics right, and established and worked-through. So we can solve this question, was Gombaud right? Was this intuition right? And if not, what's the right answer? So we're interested in throwing a double six, and we're going to have 24 goes at it. And Gombaud says this should give you a 52% success rate, so it should be a good bet in the long run. Now, we don't want to add up 24 different potential outcomes. We'd be crying by the time we did that. So let's instead say how could we lose? And the only way we can lose is by failing 24 consecutive times to throw a double six. Now, the chance of throwing a double six in any one attempt, as we've seen, one in 36. So the chance of failing to do that will be 35/36, okay? So if we're going to fail 24 consecutive times, then the chance of that will be 35/36 raised to the power of 24. And then that's the probability of failure, so the probability of success is one minus that. Brilliant, so we just put that in our calculator and work it out. Only Pascal and Fermat do not have our calculator, or any calculator, right? So what are they going to do? Well, how can they work, this would be, I don't want to be doing that by hand. Nobody wants to do that by hand. Luckily, luckily, there is a mathematical result that can help us do precisely this kind of calculation. It's really, really useful. And it's called the binomial theorem. And if you've heard or used a binomial theorem, you'll be thinking, hang on a minute, that's got something to do with multiplying out brackets, and indeed it does. It tells us how to work out expressions like A plus B, all to the power N, right? So bi for two things that you've got two terms in your bracket. So you want to multiply out a bracket by itself N times, a great big algebraic calculation. And the theorem tells you how to do that, what the coefficients are of all those terms. Now, a special example of this, which is relevant to us, is something like this. If you wanted to work out one minus X to the power of 24, then the theorem will tell you it's an expression that looks a bit like that, some X's, X squared, X cubed, and so on, higher powers of X. And those coefficients that I haven't explicitly stated what I've called U, V and W, the theorem tells you exactly how to find those. And we call them binomial coefficients. Now, the useful thing for us here is that if your X in that expression, if X is a small number and X is already small, X squared is very small, X cubed is tiny, and every higher power of X is increasing, well, it is very, very, very small. And after awhile it's kind of negligible. If you just want an approximate answer, you can ignore those higher terms in X'cause they're very, very small. So what's our X going to be? Well, if we want to work out 35/36 to the power of 24, that's one minus one over 36. So our X is one over 36, which is small. And so we can just calculate the first few terms of this long expression. We don't care about the higher powers. We just have two or three terms, and it will give us a good enough approximation. And the approximation we get is about 0.51. So that's a 51% chance of failing to throw a double six. The odds are kind of switched over. Gombaud is more likely, so his chance of succeeding to throw a double six in 24 attempts is less than half. It's a 49% chance. So actually we should take that bet, (laughs) if he asked us to do this, because he has a 49% chance only of winning, and we would have a 51% chance therefore of getting money from him. So it's wrong that that little intuition there, the old gambler's rule, didn't work out, and we can prove why. But we have to use something like the binomial theorem to do so. I will just mention another of the problems that Pascal and Fermat discussed in their letters,'cause it does have applications today in people are thinking about how to bet on sporting events or something like that. It's known as the problem of points. And the idea is that you've started playing some game, you're gambling on something, dice or coins or something, rain stops the play, so the Duckworth-Lewis method, isn't quite that; it's not going to be as bad as that. Something stops the game, or you're at a point in the game, and you want to know actually how have the odds changed based on what's happened so far. So you might go into, say, you and I are tossing a coin, and it's the first of three. So maybe I've chosen heads, you've chosen tails, and we've got, so far, we've thrown heads, heads, tails. So I just need one more head; you need two more tails. So I've clearly got an advantage at this point. I've got a, clearly going to have a more than a 50/50 chance of winning now, but exactly what chance, how should we, if the game is abandoned at this point, how do we divvy up, how do we share the kitty or the pot if we have to stop at this point? So you could reason it like this. You could say, there's only three ways this game can end now, by if the next row is heads, we're done, I've won,'cause I've got three heads. Or the next throw could be tails, but then if after that it's heads, I've won, again,'cause I still have my three heads before you've got your three tails. And so the only way of those three possible end games where you would win is if it's two tails consecutively. So therefore, I should get two-thirds of the kitty. Well, no; no, again, the issue is these things are not all equally likely. And what Pascal and Fermat sort of realized was that you've got to consider all the potential things that could happen, even if they don't actually happen during gameplay. And the reason you do that is so that you can consider all the events with equal likelihood. So if you toss a coin two times, there are actually four possible outcomes. Heads then heads, heads then tails, tails then heads, or tails then tails, right, four equally likely outcomes. So if you can, I'll put those in. Now, the first two of those, you never actually play to the conclusion of those. Because as soon as you've thrown that next head there, the game is over. But you still have to include those sort of shadow ghost potential universes in your calculation, even though no game could list that sequence of throws because you would stop before you get to the end. When you do that, when you list even the sort of potential outcomes, even if they may not happen in gameplay, it's then very easy to see, okay, there are four of these all equally likely. In three of them, I win; I've rigged this, clearly,(laughs) in three of them, I win, so I should get three-quarters of the kitty, if we have to stop at this point. Okay, so that's the kind of deduction that they were making. Now, this kind of reasoning was really one of the very early attempts to properly lay down some foundations of the theory of probability, and it went from strength to strength. But I want to give you a couple of examples of a general principle, really, that human beings as a species, we are poor at probabilistic intuition. We don't seem to have very good intuition when it comes to risk and chance, and these kind of things. And I just wanted, this is not, I'm not saying this to crush our self-esteem, but knowledge is power. And so if we know this about ourselves, we know we're not great interpreting statistics, then it just means we can be a bit more vigilant, right? So to make us feel better about our own imperfection as humans, I want to give you just two examples of really pretty good mathematicians who made what we might call basic errors of probability. And this is not me saying that they're bad mathematicians. They are great mathematicians, and so it's even more surprising to say that they would make some errors. So here are two questions, right, that I'm going to give you some surprisingly incorrect answers to. The first one; if a coin is tossed twice, we've just talked about this actually, what's the probability of getting at least one head? And the second question, throwing two dice, which total is more likely to get, 11 or 12? Okay, so first one on the left, let us hear the answer of extremely good mathematician, Jean Le Rond d'Alembert, who wrote an Encyclopedia article about it, this is after the time of Fermat and Pascal. Here he is; okay, he says, "The possibility is"if you're trying to get at least one head,"well, you could throw a head straightaway"or you carry on trying, and it could be tails,"but then heads, or it could be two tails." So three possibilities. Two-thirds of the time you get a a head, so the probability is two-thirds, right? It's that same incorrect thing that we talked about a moment ago, the real answer, no, is three-quarters. And it's again because he didn't consider outcomes that you would never play to their completion, because you already stop when you get a head. So now this guy is a really amazing mathematician. If you ever have done or will do a math degree, you will hear about some of his mathematics. But he made this silly mistake, you know, even he. And here's another amazingly, right, okay, Leibniz. What a guy, right? Invented calculus with Newton. He has a biscuit named after him. That is how(students laugh) amazing he is as a mathematician. We can only dream of such fame. So Choco Leibniz here says, "It's equally likely"to throw 12 points as 11, because," what does he say?"One or other can be done in only one manner." So what he means here is, okay, to throw a total of 12 with two dice, they both have to be six, eh? To throw an 11, you've got to have one five and one six. There's only one way to do it. But that's not, (laughs) that's not quite right. Temporarily, you have to care that you have two different dice, and you have to care which one is which. Because you could have, the one on the left could be five and the one on the right could be six, or the one on the left could be six and the one on the right could be five, right? Oh, I said that right? Anyway, so you could have five and six or six and five, and those are actually different temporarily from your point of view, right? So there are actually two ways to throw an 11. It's twice as likely to get a total of 11 as it is to get 12. And you know, even the great Leibniz could make a little mistake like that. So just you know, watch out. The biggest, the biggest mistake that we all, it's very tempting to do, it's a beguiling error, is to say something like, you know,"I've thrown four heads in a row,"so I'm overdue to get a tails." And you sort of feel like the universe owes you(laughs) the other outcome. Because you know that they're equally likely in the long run, but, of course, coins don't have a memory, roulette tables do not have a memory. This is the gambler's fallacy of saying, we know what the odds are in the long run, and therefore, you start to think, oh, I'm definitely going to get it this time. This time, it's got to happen. So on a roulette table, you might bet on red and black, those are equally likely to occur. It just feels a slightly less than 50%, because there's actually a sneaky green one in there as well. That's how the casinos make their money. This is a beguiling fallacy; it isn't true. The roulette table, the dice, the coins, they don't remember what's happened. They don't have a sense od moral justice. (laughs) It's randomness. And the point is, any, if you're talking about tossing coins, any sequence of heads and tails that you specify exactly is equally likely as any other. If you have a sequence of six coin tosses, there's a 50/50 chance at each stage of heads or tails. So you multiply those halves together, six of them, you get a one in 64 chance of any particular specified sequence. So it's a one in 64 chance of getting six heads in a row, but there's also a one in 64 chance of getting five heads then a tail. And you don't know which universe you're in when you've had five heads. You don't know if you're in the universe of five heads then another head, or five heads and a tail. At that point, they are equally likely. And so you cannot do this kind of, "Oh, I'm overdue" a head or a black or a white. However, here is my top guaranteed strategy to always win at roulette, right? You ready? This is amazing. Free to you, 'cause I love you so much. Right, what you do is you put, your initial bet is, say, $1, right? I don't know why I decided, dollars felt more gambly.(laughs) Anyway, the initial bet is $1. And so when you're doing this, when you're betting on red or black in roulette, if you bet a dollar and you're correct, then you would get $2 back, so you sort of double your money. You get your bet back and the same amount, right? So my strategy is, you keep going. Every time you lose, you double your stakes and bet again. So let's do a little example. Suppose you're betting that black will come up, and it doesn't come up until the seventh go. So at that point, let's see, what are we betting by the seventh go? So we've got $1, two, then four, then eight, then 16, then 32, 64. So we bet $64 then on the time we finally do win, so our winnings will be $128, double that. How much have we actually spent? Well, it's all that one, two, four, eight, 16, 32 and 64, that's our outlay. And it's a fact about these kind of progressions, if you add up all the powers of two to a certain number, to a certain point, then the sum of all of those is the next power, take away one. So the sum of all of those up to 64 will be the next power 128 minus one, 127. So we actually, our profit, we have made a profit, but it's always just $1. It's the same as our initial bet. Now, you can address this and say, fine, my initial bet will be a million dollars, right? So then I'm going to definitely make a million dollars profit. That's great, except, well, you have to have a million dollars, but you have to have more than a million dollars, right? Because you could go, and this is not by any means unusual enough to not worry about, that you would have to go six or seven steps or even more. And by the time you get to that point, how much money have we laid out if we put a million dollars initially? Well, in $127 million investment to only get a million dollars back. And at any point, you could run out of money, the casino could say you've reached the maximum bet you can place, or they can just say,"We don't like the look of you, go away." So this is perhaps quite a risky strategy, but it does work in theory. And I'm sure they wouldn't mind if you do it with $1. They may not be too happy if you're betting 64 million. If you've got $64 million, you don't need to be wasting your time. Just have a lovely time; don't worry about gambling. So you do sometimes hear of mathematicians or mathematically-minded people winning money at casinos. It's almost always by playing this game, blackjack. Now, in blackjack, what happens is you're playing against the dealer, you each get two cards, and then you can decide whether to take more cards at any point or to stick with what you've got. And the goal is, you want to get to a total of, as near as you can to 21, but not go over, not go bust. So at any point, so here you have a total of 16, right? So you have to think, okay, do I want to take another card and try and get closer to 21? But then the risk is, maybe I take this and it's a nine, and then I've gone bust. And the dealer is doing the same thing. If they go bust, then you win by default however far away you are. But the dealer has to obey the following rule, that if they are on 16 or less, they have to take another card. So it is in your interests for the play to reach the point where lots of small cards have already been played. And so if that happens, and this is what the card counters are doing, they're monitoring the number of small cards that are still left in play. If there are very few, then the chance that the dealer will go bust gets higher. So they can sort of gauge the how good the odds are and change their bets accordingly. This method, it's, I mean yes, it could work. At its best, if you're doing it absolutely perfectly, you get, at best, a 1% advantage over the house casino. Any mistake and you risk losing all that. Also, you can't be winning too ostentatiously because they're not compelled to have you as a customer. So although people have been able to win money at this, it's getting harder. One way it's getting harder is that the casinos are adding more decks of cards into the mix. So you know, a long time ago, you might just have one deck of cards, and then you'd play and play until they were all gone, and then you'd start again from the beginning of the deck. So it was sort of easier for changes to make more of a difference. Now they can use up to eight decks of cards at once, so the variants in that becomes big enough. It's harder to make this pay. But this precisely is working, because it's not random. So what I'm really talking about today is randomness, lotteries, dice and things. This is only possible because there isn't randomness, it's not independent of what comes next, because you've been looking at the cards that have already been dealt. So I'm not going to talk any more about it here, but that is precisely possible because of non-randomness. Okay, but you know, I've promised you lotteries, so let's talk about lotteries. The earliest lottery, I think, in England was a state lottery that Elizabeth the First decreed there'd be a lottery, it was to raise money for the Navy. Tickets were 10 shillings each. That is a lot of money in Elizabethan time. So this is not for everyone. You have to be pretty well-to-do even to buy a ticket. The prize was astronomical, 5,000 pounds, but not all in ready cash. You got some tapestry, you got some plates, and some linen, fine linen, oh, well, it better be fine linen cloth, in the mix, so it's kind of an interesting prize. Cobbled together everything they could find, ergo, this is what you'll get. So this was supposed to raise money. I don't think it actually quite succeeded, but that's the first lottery that I'm aware of in England. It was more what we'd now call a raffle, actually. Modern lotteries, we'll do a sort of little toy example, but modern lotteries all tend to have the form of you choose some numbers from a wider selection of numbers. So in the UK, you choose six numbers that are between one and 59. It used to be 49, then it went up to 59. And then if you match all six numbers, that's how you win the jackpot. So we're going to, we'll work up to that, but we'll do a little toy lottery first. And now toy lottery, we're choosing from numbers between one and 10, and we choose two numbers. And to win the jackpot, we have to match two numbers with what comes out in the exciting draw. So what are our odds of winning this toy lottery? So think about this. How many ways are there of choosing two numbers from a set of 10? That's what we need to know, because that's the number of possible lottery tickets. And there's one winning combination, so out of all the possibilities, we've got a one chance out of all that. So how many possible ways are there of picking a set of two numbers out of 10? Well, you imagine the ball there in front of us. We pick our first number. There's 10 ways to do that,'cause there's 10 numbers in front of us. Then we pick our second number. Now there's only nine ways to do that,'cause we've already used up one of the numbers. So total number of ways to do this is 10 times nine, 90. However, however, that forgets that we're actually going to see each combination twice.'Cause if, say, you had a one and a five, and that's your winning numbers, well, you could have drawn a one first, then a five, or you could have drawn the five first, then the one. Either one of those will result in the same set, one and five. So every actual pair is going to appear twice in this selection process of 90 kind of ordered pairs, sequences of two numbers. So we've got to divide that 90 by two, and we get, really, there are 45 pairs. So it's sort of A, B equals BA in this situation. So our chance of winning then, if we want to pick the one that is the jackpot winner, that's a one in 45 chance. Okay, step two, let's imagine that's too easy to win. Let's now say, okay, for the jackpot, you actually need to match three numbers. So now, what are we going to do? How many ways are there of picking a set of three numbers out of 10? Well, you do the same thing. You pick the first number, there's 10 ways, then the second number, there's nine ways to do that, nine numbers left, and then the third number, there are now eight numbers left. So that's how many choices we've got there. So we get 10 times nine times eight, which is 720 of these sequences, right, of numbers A, B, then C, but you again are going to get copies. Because it doesn't matter. You don't care the order that you drew the numbers out in; you just care what the numbers themselves are. So it turns out, and I've written down the possibilities here, there are six ways of rearranging a collection of three things. So you can have A, the number A could be first, you could draw that out first, or you could draw B out first or C out first. So there's three possibilities for the first number you drew out, because you've got a collection of three that you have to get. So there's three ways to get, to have the first number, and then two ways to get the next number,'cause there are two numbers left in your special selection. And then the final number, you've got no choice. It must be that third one in the set that you're interested in. So three times two times one ways to do it, which is six. And you may notice, I know I get very excitable, but that exclamation mark is not just me going,"Hey, three!" (laughs) That symbol is pronounced in mathematics, "factorial." And that three with a little exclamation mark, that means the product of all the numbers up to three. And in general, N factorial means multiply all the numbers from one up to N, all the whole numbers. So four factorial, for instance, would be one times two times three times four, 24. That would be the number of ways of arranging four numbers or objects.'Cause you could have any of the four in the first place, then any of the three remaining in the next place, then two and then one. Okay, so we have 720 sequences of three numbers that we've drawn out, but every collection, every set of three, arises in six ways. Those are the six ways. So you've got to divide that 720 by six, which I believe is 120. So this lottery, you have a one chance in 120 of happening upon the correct set. All right, so the final little one, now we know how to do this. What about choosing four numbers from 10? So a bit of notation, we call that "10 choose four" that number, and there are different ways of writing it, but my favorite way is you put a 10 and then a four, and then brackets around, so I've done that there. So we know how to do this. Oh, somehow I've got the last little number missing. Looks all right on my screen. That should be 10 times nine times eight times seven divided by four times three times two times one, so we have picked our four numbers. But then each one occurs, each set occurs, in four factorial, four times two times three times two times one, 24 ways. Now, there's a sort of sneaky little trick you can do to write this in a more efficient way with lots of factorials in. So I'll just show you that, there are little bits of missing on the end. It'll all be there in the end. So what I've done, this looks worse, but I promise you, it's better. I wish I had the product of all the numbers from one to 10 on the top. And so I've made that happen. I've forced that to occur by just finishing that list, six, five, four, three, two, one, but then I've put it on the bottom of the fraction as well, so we haven't broken the law. (laughs) These things are equal. And now if you do that, you find that what you've actually got is 10 factorial on the top, and then four factorial and six factorial on the bottom. So it's kind of a neat nifty way of writing it. And you can work it out; it's 210. Now, this is a cute little expression, and it works in general. So we've done 10 choose four, but the same bit of reasoning works to tell you that the number of ways of choosing R, a set of size R, from a set of size N. So R numbers out of N is the same sort of expression with factorials N. But I have to accept that's quite a lot of calculating, and multiplying and dividing. So I want to show you another context that these numbers arise in, because it gives you an alternative way of finding these numbers that has a lot less multiplying and dividing. Okay, so imagine you're in one of those cities that we don't tend to have in Britain, but that actually is kind of well-organized and is laid out on a grid system, a bit like in the middle of New York or something. And if you're trying to get from place to place, if I've got a point O and a point P that I'm trying to get from O to P, you're trying to work out a route, well, there might be lots of valid routes, but everything you do is either going right or going up. So you're moving through the grid. No weird, higgledy-piggledy, curvy lines. And so you're only interested in shortest routes, so you're not going to go down or left, or do anything weird like that. So to get from O to P, you really, I'll just give one example there. Every route will involve going, at some point, right two steps or blocks, and at some point, up three. So the total kind of distance you've traveled is five, two right and three up, but you can do it in any order you like. So there's one route there that's right up, up right up, but there are many others. The question is how many? Well, that's not too difficult to answer, because any route can be specified exactly by saying where, in the five steps that you're going to take, are the two places where you go right? So we're choosing two places, two points out of the five that we're going to make, that's where we go right. And so the number of ways to do this is exactly five choose two, choosing two things from five, which is five times four divided by two, which is 10, okay? Very nice, and this works in general. So if we're going to any old point P, which involves going, at some point, R steps to the right and U steps up, then the total distance traveled will be R plus U, let's call that N. And the number of ways to do it is you just choose which of the places along the route will be where you turn right, where you go a step to the right. So you're choosing R things out of a total of N. So N choose R; nice. So why have I told you this? Because there's a different way of working this out, and it's this. To get to that point P, whatever route you take, you'll either, the kind of penultimate place you stop will either be the place just directly to the left of P, or you'll have come from directly below P.'Cause to get there, you're only ever going right or you're going up. So the last place you have been before P will either be the place directly to the left or the point directly below. So the total number of routes to P will be the total number of routes to that point just to the left, plus the total number of points to that place just below. And that little argument allows you to build up kind of cumulatively these numbers. Anything that is a point directly to the right of O, you get no choice about,'cause there's no up; you just have to go right until you get there. So there's always one route to any of those. If you're going directly up from O, however far, again, you get no choice,'cause you're never going right, so there's only one route to those. But then there's other points you can add your way to. So this number two here, we get it by saying you've either come from below, there's one way to get there, or you've come from the left, there's one way to get there. And then one plus one is two, right? Two plus one is three. And you can build up and up. And by the time you get to that 10 there, you're adding four and six. So you can build these things up just by adding, which feels nicer than doing all that multiplying and dividing. So you can carry on the grid as far as you like. I'm just going to throw away the furniture there and leave that grid. Now I'm going to rotate it now and just show you, because perhaps some of us have seen this triangle before. It's exactly the same thing; I've just rotated it round a bit. And in this triangle on the left now, every number is made by adding the two immediately above it. Or if there isn't something on one side, that's an invisible zero, okay? Right, so we can work out these N choose R things by using a triangle like this. And we can write it on a piece of paper and carry it in our pocket if we want to. Now, to cycle back to something we mentioned before, this helps us with multiplying our brackets as well. If you're doing something like one plus X all to the power of five, that's imprinted in those brackets, what's the coefficient of X squared, say? Well, when you're multiplying this out, how will you get X squared? Well, you're going to have to choose an X from exactly two of the brackets. So there are five choose two ways to do that, which is 10. Okay, so we can, this, this triangle in these coefficients are exactly the binomial coefficients I alluded to earlier but didn't specify. So they are really, really useful not just for lotteries but also in working out these other probabilistic calculations we saw before. And this triangle, Pascal wrote a treatise on it, and he wrote about the binomial coefficients, and it's because of that that we now call this triangle "Pascal's triangle." I have to say it was known to Indian, Chinese, Arabic and Persian mathematicians before Pascal, but this was how kind of, I guess we heard about it in the UK from Pascal, so we call it "Pascal's triangle." Okay, we now can work out lottery odds. In the UK Lotto, you choose six balls from six numbers from 59. And so the number of ways to do that is 59 choose six, which we can work out with a actually pretty big triangle, right, or we can use our calculation for binomial coefficients. And we can work it out that the odds of doing this, so there are 45 million-ish, that's 45 million-ish, 59 choose six is about 45 million. So the odds of us happening upon the actual correct numbers, the jackpot-winning numbers, are one in 45 million. Not great (laughs) odds. Okay, there are other ways you can win some money. So if you match exactly three numbers, you win 30 pounds. Well, that's all right. So we can do the math to see what are the odds of that. If you're matching exactly three numbers, then three of your numbers must be chosen from the six winning numbers. So that's six choose three. But then the other numbers, three numbers, have to be coming from the 53 not-winning numbers. So that's 53 choose three. And if you multiply those together, you get that there are about 468,000 ways of buying a ticket that matches exactly three numbers out of a total of 45 million possible tickets. So if you work that out, it's about a one in 96 chance of winning 30 quid, which again, hmm, (laughs) doesn't seem amazing. Okay, but you know, I've got you in here with a promise that you can win the lottery, right? Well, sort of. (laughs) Okay, so how do you do it? It's easy; it's so easy. What you do is you watch the lottery, you write down the numbers, and then you quickly invent the time machine, and go back and buy a winning, no? (laughs) Okay, so, okay, I jest. I do remember there was a program a few years ago, a science fiction program, where they decided they were going to do this. Somehow, even though they'd invented a time machine, they couldn't get their grant funding renewed, which, (laughs) well, it's difficult out there. So what they did, they got the numbers, then they somehow found that they'd only matched four numbers. But this is a cute little plot twist, and you might like to investigate which sets of six numbers this works for. When they got to the place to buy their ticket, they looked at the bit of paper upside down. And so they found they'd only matched four numbers. I don't know if these were the exact sets, but anyway, you can work out all the possibilities. Okay, this isn't my real advice. You don't have to build a time machine. I'm going to present you with six ideas to finish off with six ways to maximize your lottery winnings, none of which, bonus, none of which require you to break the laws of physics. Okay, so the kind of the game is, you've got some budget, maybe you've got two pounds a week, that's how much a lottery ticket costs at the moment, you've got some budget that you can invest in the lottery. What is the way to end the year with the biggest amount of money? Tip number one, do not play the lottery.(students laugh) Okay, I'm going to have to say this, right? If you don't buy a ticket, instead you put that money in the bank, at the end of the year, you will have 104 pounds, and your lottery-playing alter ego is likely to have less. The amount of ticket revenue that is given out in prizes is higher than I thought, actually; it's just over 50%. So, of course, that includes the jackpot winnings and everything. Your, over the very long-term, the expected winnings are, well, certainly not 100%. Your lottery-playing alter ego will have, on average, at the end of the year, about 50 quid, and you'll have 104 quid. So, you know, this is the way to do it. Of course, if it's fun, that's fine. I think we just have to remember what we're paying for is not the definite likelihood of getting rich. It's that little free sigh of excitement of "maybe I'll do this," or maybe you like that you're giving some money to good causes, or something like this. Never, never bet more than you can cheerfully lose, and be happy and have a smile on your face, okay? So that's our tip number one. If you must play the lottery, you could play a different lottery. So there are lots of lotteries around the world. Famously, the U.S. Powerball lottery tends to have very big prizes. The reason is the chance of jackpot is one in 292 million. That's quite hard to get, so you quite often get rollovers. In 2022, there were 40 draws without a win, and the rollover amount reached $2 billion, (laughs) which is a lot, a lot. The easiest probably one to win is the Polish Mini Lotto, chance of about one in 850,000,'cause you're drawing only five balls, and you're drawing them from only the numbers one to 42. So you can sort of imagine that that's going to be a lower number of possibilities. On the other extreme, Italy's Lotto, one in 622 million chance. So again, that's very hard to do. Now, you might think, right, there are, in the American lottery, 292-ish million possible tickets you could buy. If the winnings reach $2 billion, it's $2 per ticket, should I spend $584 million to get all possible tickets? I can guarantee I will have a winning ticket in there. Okay, this is, no, (laughs) of course I'm going to say no. The reason is, what do you think everyone else is doing when there's a Powerball multiple rollover and the prize is $2 billion? Everyone's buying a ticket. Your chances of having to share the jackpot are really quite high. And even, I mean, also you have to pay tax on this 2 billion, right? So once you've done that, if you have to share it with even one or two other people, you are not making money; you're making a loss. So that's really quite risky. This is why hedge fund managers are not doing this, right?'Cause it's very risky strategy. You're probably going to have to share. There was one instance where a group of people realized, this is in 1992 in the Irish Lotto, which was easier to win, only 1.9 million combinations; tickets were 50 p. There was a rollover, and the amount reached 1.7 million, and to buy one of each ticket was less than a million. And some people tried to do this. They did manage to get a winning ticket. Well, they managed to get an estimated 80% of all possible tickets, which is pretty good, since this was a time when, like, you couldn't just buy things online. You had to physically go to shops and buy tickets one at a time from terminals, right? So they, somehow, they managed to get 80% of the tickets over the course of a week. They did have a winning ticket, but they had to share it. Now, they won some subsidiary prizes as well. So they've never been quite clear about exactly how much they won in the end, it was a group of people, but they may have won a couple of hundred thousand pounds. They were not millionaires for life. But it has been done. Okay, number three, join a syndicate. So about a fifth of the jackpots are won by syndicates. If you're in a syndicate, you're kind of spreading your risk a bit. You each put in the price of one ticket, say, but then you're actually buying a share of 10 tickets. And so the chances, you're making a little bit higher chance for yourself of having a share of a jackpot, but it's a share. It's a share of a jackpot. So you know, that's factored in, right? You're never going to be like the one who wins 10 million pounds; you'll be sharing that. So since it swings, it's a roundabout thing. I did wonder, though, if you're buying a bunch of tickets, maybe there's a way to guarantee at least getting any prize. How many tickets do you have to buy in order to guarantee matching three numbers if you're careful about the combinations? Interestingly, I'll just look up the formula, unsolved form of mathematics, the Lotto design problem. If you can work out this minimum number, then you've got a good math research career ahead of you. Nobody has got a formula for this, in general. I mean, there's some little examples. So this number is called L. If you want to be sure of matching one number, then if you buy 10 tickets, you can do that, because there are 59 numbers, six on each ticket. So 10 tickets will mean you can have one of each number represented. But, of course, you don't get a prize for that. There are some theorems that tell you bounds. So it's known that if you buy, well, you need to buy at least 22 tickets in order to have a hope of matching two numbers guaranteed. But the smallest prize is for three numbers. And even 22 tickets is already 44 pounds, and the prize for three numbers is 30 pounds. So again, (laughs) that's not going to help you. There are some specific cases where maybe it can help in unusual rollover type situations. But usually that's not going to be good. Okay, tick four of six, never buy your ticket on a Monday. This is a UK-specific tip, by the way. And the reason is that in the UK, Lotto draws are on Wednesdays and Saturdays. So a bit macabre, right, but the chance of winning the jackpot is one in 45 million, as we've seen. Unfortunately, anyone's chance of dying in any 24-hour period is higher than one in 45 million, so(students laugh) you have a higher chance of dying before you find that you've won the lottery if you buy your ticket too far ahead of time. And the extreme of this, I looked up some accident statistics, you have a one in 30 million chance, so more likely than winning the jackpot, one in 30 million chance of dying from falling over while trying to put your trousers on. (laughs) So just, okay, be careful out there, right?(students laugh) And if you must gamble, do it at the last minute, right? So point five, don't try and prove a point about randomness. So as we've discussed with coin tossing, any particular set of six numbers is just as likely to come up as any other particular set, whether or not we attach any specific significance to them ourselves as humans. So one, two, three, four, five, six has a one in 45 million chance of coming up. It has exactly the same chance of coming up as this sequence of numbers, or any other specific sequence. They've all got the same chance of coming up. So what we can do, all we can really do is to try and make sure we don't have to share the jackpot if we win. So, you know, people often choose dates or memorable things, anniversaries, birthdays, so days that can be days of the month one to 31 may be coming up more often in people's choices, not as draws in the lottery, but what people do, our sort of human way of assigning significance to things. But don't think, well, I know that one, two, three, four, five, six is just as likely as anything else, or unlikely, so I'm going to show that I know this and I'm a logical human being, by putting the numbers one, two, three, four, five, six. Because 10,000 people do that every week. (laughs) So if you do that, then great; you are rational, except you'll be sharing that happiness of being logical with 10,000 other people, and you really do not want to have to share a million pounds or whatever the jackpot is, 10,000 ways. So don't do that. Final tip, final tip. This may be hard to achieve. Be Voltaire. (laughs)(students laugh) So Voltaire and his chum, Charles Marie de La Condamine, spotted a little loophole in the French lottery. So the French government at that time, they were selling government bonds to raise money, but the interest rate wasn't very attractive. So to sweeten the deal, they had a little lottery attached to it. And you could, if you had one of these bonds, you could, for a little bit extra, so for actually 1,000th of the price of the bond you had, that would entitle you to buy a lottery ticket. So if you had a 10 pound bond, for one extra penny, you could have a lottery ticket. The flaw in the plan was that the prizes you would win in the lottery did not depend on what you paid for your ticket. So Voltaire and La Condamine started buying up thousands of tiny, tiny, cheap, there was no minimum price, tiny little bonds, and each one of those tiny, tiny bonds gave them an equal chance with everybody else in this lottery. And they did this successfully over several months, and they won a lot of money. They made huge profits, about equivalent of 6 million pounds-ish in today's money. And the government got a bit cross, (laughs) and they actually tried to prosecute them, and took 'em to court and said, "You can't do this."This isn't what we meant." But the court ruled in their favor, in Voltaire and La Condamine's favor. They said, "Listen, it's not illegal"to exploit government's stupidity," (laughs) right?(students laugh) Your own fault. So they got to keep their winnings, and Voltaire became a rich man, and was perhaps able to devote more time to writing and philosophy, so it's great. But so yeah, be Voltaire, is a good tip in life in general. Okay, so we've reached the end of my little guided tour of the lottery, and chance and fate. I'll just mention if you would like to come back here on March the seventh, and if you do, you will hear about the mathematical life of Sir Christopher Wren. But I will stop there; thank you very much.(students applaud)- Lovely; thank you very much, Sarah. That was excellent, as always. I shall now have to accuse anyone who's buying a Lotto ticket in front of me to stop and be rational, but not too rational, about the whole process. I don't know if anybody here wants to ask a question. The only online one we've got is about card counters in Las Vegas.- Uh-huh.- And are they mathematicians extraordinaire and do they know the probabilities just like that?- So what is not happening, the card counters, they are not having sort of prodigious feats of memory and actually memorizing every single card, and adding up numbers. What most of the systems that are there assign a value of something like plus-one to every low card, say, between two and six, and then zero to seven, eight and nine, and then minus-one to 10 and upwards. And so you've got a running tally in your head, which you're only adding one at most or taking away one each time. And then there are triggers of like, if it gets above this amount, that means lots of small cards have been played, so it's favorable. So there's sort of trigger points where you then, okay, I'm going to make a bigger bet. They have to learn these things. They are aware, or at least the people who design the systems, are aware of the exact probabilities. You don't have to necessarily know those probabilities yourself to use the system, but what you do have to be, and this is less about actually once you're playing, when you're playing it, it's less about mathematics and more about nerve, I think, and having a very good memory even under pressure.'Cause you've got to keep this tally in your head. If you're up to 17 and then you get distracted by something, you know, where was I? Oh, no, it's all gone wrong. Right, so you don't want to be in that position.'Cause as I've said, the actual advantage you get even playing perfectly is very, very small and marginal. So yeah, it's to design the system, you do need to know the probabilities and the mathematics. And so there was a group of PhD students from MIT a few years ago who, they'd manage to do this and made some money on it. But really, (laughs) you know, it is really, really difficult to do that, and stay cool and not get too excitable so that their people at the casino go,"Hmm, maybe that person, we don't want them"playing in the casino," yeah.- [Student] You mentioned earlier that if you're tossing a coin, say, and you get a long sequence of heads-- Yeah.- [Student] And some people think erroneously that a tail must be due, if you're a statistician, you begin to query the-- Yes.- [Student] Whether the coin is truly balanced. When did that start coming into mathematics, the statistics rather than the probability theory?- Yeah, so I mean, that's a good point. If you did toss a coin and it came up heads 92 times in a row, as actually that happens in the play,"Rosencrantz and Guildenstern are Dead" by Tom Stoppard, that sort of meditation of probability. In that case, they start to suspect something's going on,'cause it's heads 92 times in a row. But in their situation, yeah, what's happening is they aren't the masters of their own fate, because unbeknownst to them, they're trapped as minor characters in someone else's play.(laughs) But hopefully, that's not our situation. If that did happen, as you say, a lot, heads 25 times in a row or lots and lots over a long period of time, you would start to suspect there's something up with this coin. Now, statistics as a subject started to come in, and those kind of analyses over long periods of time, and testing things and hypothesis testing, that sort of thing, statistics as a subject, I mean, it got its name, I guess, in the 19th Century, it comes from the German word "statistic," but that kind of means numbers to do with the state. You know, so measuring things. Initially, it was just measuring things like how many people have we got in our population? What's our production of wheat? And then people started to think, oh, we've got all these numbers, we can actually perhaps spot some trends and do some analysis. And so that statistics comes from, originally, it was just collation of numbers to do with, you know, yeah, a country, a state. But then in the 19th Century, people like Florence Nightingale, you start to get actual analysis of it. So that statistics as a thing comes a lot later than probability, like three, two, three centuries later.- [Student] Hi, there; thanks for the talk. I was thinking about what you said that we seem to understand ourselves to be really poor, what am I trying to say?- We have a poor intuitive-- [Student] A few things we understood to understand probability poorly.- Yeah.- [Student] And we can't rationalize around this, and things like that. But I'm wondering whether, I suspect it's not an accident that we are like we are.'Cause we're talking about the probability of things which relate to technology, and we didn't evolve with any kind of technology before games or before money or anything like that.- Yeah, yeah.- [Student] And do you think it's because of the status of the natural world that maybe we do expect seeing a correlation in things and a lot less randomness? So we are how we are actually supposed to be. It's not our fault that we're like this.- Oh, yeah, okay. (laughs)- [Student] Do you see what I mean?- Yeah, I see what you mean. So it's this sort of actually, yes, our ability to assess risk and things, randomness is perhaps less prevalent in the natural world just because-- [Student] Maybe because we're competitive-- I mean, yeah, I think there's something to that. And I suppose my feeling is, you know, the penalty of underestimating risk if you're just, you know, a hunter-gatherer, is different from the penalty of overestimating risk. If you underestimate risk, go,"Oh, it's probably not a tiger, (laughs) I'm fine," then that, you know, getting that wrong is unfortunate. Or you could say, "It might be a tiger" for everything, okay, you're a bit panicky, but you're less likely to be eaten by a tiger. So I think we're perhaps something about the way we've, as we are animals after all, there's less of a penalty for overestimating risk than there is for underestimating it. I'm not a biologist, but that's my suspicion, for sure, yeah.- Thank you. I would like to ask you all to join me in thanking Sarah very much for being here.(students applaud)