# How Science is Taking the Luck out of Gambling - with Adam Kucharski

Feb 27, 2020Thank you all for coming now, as Tom mentioned. I'm a researcher at the London School of Hygiene and Tropical Medicine, where I specialized in mathematical modeling of infectious diseases, so, at first glance, my work couldn't be further away. from the world of casinos, playing cards and plastic chips, but in reality

### science

and### gambling

have an incredibly intertwined relationship, a very ancient history and that is what I want to talk about tonight and, since I am Speaking of### gambling

, I thought I would. Start with an example of how not to bet, so this is a story from a few years ago and as you can probably tell, there are two big flaws in this lady's strategy.The first is that it's completely illegal and the second is that she clearly doesn't do it. It doesn't work and the reason I wanted to show you this is that I think when we talk about people mastering chance and beating the system, usually these are two themes that come up quite often: either you have them doing something a little bit dodgy or you have them . present a system that is clearly not going to be very successful and what I want to do tonight is take a look at a third approach, that is, take a look at some of the ways that mathematicians and scientists have approached gambling . and they used their techniques to get an advantage over the house, but I also want to see how ideas have flowed in the opposite direction, how games and betting have actually inspired many ideas that are now fundamental to modern mathematics and

### science

and, Actually, I think lotteries are a good place to start because for me it was a story about lotteries that first got me interested in the mathematics of gambling.I'm sure any of you who have played the lottery or thought about playing the lottery will know that it is incredibly difficult. win, but actually even the way we measure how hard it is to win is a fairly recent development, although mathematics has been around for millennia, the idea of how we quantify

#### luck

, how we quantify a random event, is relatively recent. one that developed in the 16th century, it was actually in Renaissance Italy, there was an Italian named Jolo Cardano, he was a doctor as a doctor, he was the first to describe the clinical symptoms of typhoid fever, he was also a gambler and, like player, was the first to describe these games mathematically and he described what is known as the sample space, so it's all the combinations of events that could occur and obviously if you're only interested in one of those, that gives you a idea of how It's hard to win now in the UK National Lottery, as it stands you have to choose six numbers from a possible set of 59, so this results in just over 45 million possible combinations of numbers that you could choose if you bought a card.Clearly this makes your life very difficult, winning the jackpot, but there is a way to guarantee that you will win the lottery this weekend and that is to simply buy every combination of numbers now, that may sound a bit loud. absurd, but let's stick with this for a moment, like I said, there are 45 million combinations of UK lottery tickets, so if you bought all the possible combinations and lined them up end to end, it would actually extend from De London to Dubai, plus each ticket costs 22, so if you really want to hit the jackpot this weekend, it will cost you around 90 million to achieve it.

Clearly that is not a viable strategy, but not all lotteries are created equal in the 1990s. For example, the Irish National Lottery had a much smaller sample space. Much smaller possible combinations of numbers that could appear. In fact, there were about 1.94 million combinations. Each ticket costs 50p, so it would cost you less than a million pounds to buy each. unique combination and actually a union headed by an accountant. I got to thinking about this and clearly, on most weeks, this is a pretty poor investment because the jackpot would be maybe a few hundred, and if you're spending almost a million to win a few hundred, you don't know.

It takes a lot to spot it, it's a pretty bad investment, but if a rollup were to occur, yeah, maybe this could be plausible and in fact, instead of stretching all the way to Dubai, if you line up all these tickets and the combinations end up in the end , it would actually stretch from London to Plymouth, so you know you've got something that's a little bit more feasible and what they started doing is collecting these tickets and filling them out by hand to get each of these combinations and then they waited, they waited for about 6 months, until the May bank holiday of 1992, when the reinvestment reached 2.2 million and they put their plan into action, they took all these tickets that they had filled out, they started

## taking

them to the stores and buying them, um and in many In In some cases, this caught attention, so stores that normally sold maybe a thousand tickets in a week suddenly sold 15,000 uh, the lottery, yeah, maybe unsurprisingly, they noticed this a little bit and tried to stop them, and as a result, when the lottery drawing came.They only bought 80% of the possible ticket combinations, there is still an element of

#### luck

as to whether they will win the jackpot, fortunately for them, that set of jackpot winning numbers was within the combinations they mentioned, so they won. eh, that. Unfortunately, there were two other winners that week, so they had to split the jackpot, but when you added up all those lower level prizes, they matched five numbers, four numbers, and walked away with a 300,000 um win now for me, years ago, When I heard the story it was just a fantastic illustration of how you can take simple mathematical PR knowledge, a good dose of audacity and hard work and turn it into something that is profitable and, yes, this is not the only case to which people have been addressed.These types of games, for the UK lottery, the draw is random, so really the only way to guarantee a win is to use this Brute Force approach by simply buying all the combinations, but not all lotteries are the same. Take scratch cards as an example. At first glance, scratch cards are completely random. If you think about it, they can't be completely random because if you're producing scratch cards and you just randomly generate which cards will be winners, there's a chance. that by pure chance you will produce too many winning cards if you are a company that makes scratch cards, you want some way to control and limit the prizes that are awarded, um, as statisticians would call it, you need controlled randomness, you want the prizes to be fairly uniform distributed evenly between locations, but you don't want the generation of them to be completely random and in fact in 2003 a sassis named moan Sansa was thinking about Strat, she had been given some as a gag gift and was wondering about this idea of control Randomness and you realized there must be some way for the lottery to identify which cards were winners without having to scratch them off.

On each card there was a series of digits and some of these appeared twice three times, but some numbers and symbols only. appeared once on the card and in fact if these unique numbers appeared in a row that card was always a winner and he went and bought more cards and tested his strategy and every time the cards that had these numbers in a row had winners guaranteed. Now, what would you do in this situation? Basically, you've cracked scratch cards and have a system that can identify winning and non-winning ones just by looking at them. Would you go out and buy tons?

What would you do well? Going back to the slide I showed you at the beginning, winning scratch cards is remarkably rare and actually what Mohan did instead of just going on a big SC scratch card purchase was calculate how long it would take him to buy enough cards and be guaranteed. win it, he was a statistician working on geological problems and making pretty decent money and he realized that actually, even though he had a lottery winning strategy, it was better to stay at his current job, so what he did was call to the lottery and He told Les that there was a hidden code on his scratch cards and he had deciphered it and knew how to win the lottery, of course he didn't take it seriously so what he did was collect the scratch cards and identified some. the winners, some use them, divide them into two piles and courier them to the Lottery that night.

He got a phone call from the Lottery saying we need to talk and really this story is representative in many areas of the game, it often isn't. professional players who come up with these strategies that beat the system and often the people who beat the system don't become professional players for many of these people the game is almost a playground for ideas, it's a way to test the resolution of problems and skills that will actually work. applies to many other industries, the people who focused on these problems moved on to academia, finance and business and as I mentioned with Cardano, this is not a new phenomenon throughout history, many of the greats thinkers and mathematicians have used gambling as a way to refine their ideas around 1900 a French mathematician named HRI prano was a particularly interesting game of chance now prano was one of those known as the last universalists as a mathematician was one of the last people to specializing in almost all subject areas as they existed at the time had not expanded to the point where it is big today and one of the things he was interested in was predictability and for him, unexpected events, unexpected results were the result of ignorance, he thought that if something is unexpected it is because we ignore the causes and he classified these problems according to what he called the three levels of ignorance.

The higher level was a situation where we know what the rules are, we have the information, we just have to do some basic calculations, so if you have to say a school physics exam. You know what the physical laws are. You are given the information so you know that, in theory, you should be able to get the correct answer. If the answer is surprising, then you have done something wrong at work. but it is not a type of level of ignorance that is difficult to escape in theory, the second level of ignorance according to Prare was one where you know what the rules are but you lack the information necessary to perform the calculations accurately and he used roulette as method.

For example, on a roulette table you start spinning and spinning and he observed that a very small change in the initial speed of the ball could have a very dramatic effect on where it ends up because it will circulate around this table over time and today mathematicians They refer to this as sensitive dependence on initial conditions and it is popularly known as The Butterfly Effect. There is a talk in the '70s where a physicist pointed out that a butterfly flapping its wings in Brazil could cause or perhaps prevent a tornado in Texas. The very small changes that Prim first observed could have a very large effect later and then we will say that the results are random, it is due to chance but in reality it is an information problem, then comes the third degree of ignorance and here it is where we don't know the rules or maybe they are so complex that we will never be able to unravel them and in this situation all we can do is observe the weather and try to understand some of what we are observing and it was really this level of ignorance when the players began to focus on the roulette they focus on, they didn't try to unravel all these physical laws, they just said, well, let's look at a bunch of roulette spins on a table and see if there's a bias, let's see if something strange is happening with this table, but this begs the question: what do we really mean by strange?

What do we mean by biased? And while he was joking, I was thinking about roulette in France, across the Channel uh, a mathematician called Carl. Pearson was also thinking about roulette, uh, and Pearson was fascinated by random events, since he said that we can't have a true sense of what nature does, we can only observe and try to make inferences about those observations, and he was really interested in collecting. random data to test these types of ideas on one occasion he spent his summer vacation flipping a coin 25,000 times to generate a data set to analyze and he was also interested in rette now, fortunately for him at that time, the newspaper L Monaco would . he publishes the results of all roulette spins in Monte Carlo casinos now for Pon, this is a fantastic data set.

He wants to test his ideas about randomness. You have all these previous roulette spins to prove it and it started. looking for ways to understand if they were random or not and retracing the table, of course, you have these black and red numbers and then you have a zero and if you eliminate the zero over time, you would expect the ratio of For the black and the red to be even , HEyou would expect it to be 50/50 over time and when Pearson looked at the data he found that red appeared 50.1 15% of the time, this was over about 16,000 spins so by his calculation this wasn't that unlikely, so actually that kind of deviation from the expected value is reasonable given the kind of data set you had, but then you went ahead and looked at, for example, how often pairs of numbers now appear if you have a randomly processed roulette table, sometimes you'd expect a string of the same color to appear by pure chance, you might have some reds and some blacks, eh, but what Pearson discovered was that the numbers changed too frequently, they didn't actually.

Not getting these strings of the same color to appear as frequently as expected, they were changing and to him this was pretty definitive evidence that the tables were corrupt, that they were biased and, as he says, if he had been looking at these tables since the beginning of geological time on Earth, I wouldn't have expected to see such an extreme result and in fact suggested that they close the casinos and donate the profits to science, uh, it just so happened that there was something a little more realistic. going on, it turned out that those journalists in Monaco, instead of sitting by the tables and recording the numbers, instead of sitting at the bar and making them up, but this idea, think back, think about how he put it, which was the probability of observing an event as extreme as the one I have observed.

This was the first type of way in what is known as hypothesis testing. Today, you know, whether we're working on clinical trials or particle physics experiments, we use the principles that um Pearson perfected. in these relet tables and quotes to understand if we have enough evidence to reject or accept a certain hypothesis, so in this case your hypothesis was on the tables and it was random and you had enough evidence to say that this was not the case and in reality the players have also used these ideas during the Victorian era and until the late 1940s, for example, two medical students used these types of methods to go and, unlike the lazy journalist, this time they looked at the tables, collected all the data and discovered that there were biases.

These tables became worn over time and certain numbers or areas appeared more frequently. In fact, they toured Nevada and bet a lot on these tables. The exact number was never known, but they bought a yacht and sailed the Caribbean for a year. However, the problem for players is that the casinos realized what they were doing and made sure that the tables were incredibly well maintained and these biases did not occur, but in the 60s and 70s some physics students They realized that this actually leaves you in the second level of ignorance because if you have an impeccable and well-maintained roulette table it is not a statistics problem, it is a physics problem, as one of them said, it is like having a planet orbiting a point at which you have this ball.

In the '70s, a group of students at the University of California at Santa Cruz actually started doing these calculations and looked at a rette spin and said well, for starters, the Couer will spin the ball and it will spin. That is, the edge of the track around the edge of the table and often he will circle a couple of times before the creaia indicates that there are no more bets. In other words, you have a window in which you can gather information about what the Bull is doing and acting. You can place bets on it during this period, over time it will fall on the track and spin freely.

Eventually they will hit one of these deflectors and land in one of the pockets and what they actually did was test their strategy on different tables in their lab. They realized that if you could calibrate your model, then if you could write the equations for the physical system. , you have the ball spinning, slowing down, and then falling if you write down these equations and calibrate them to a specific table. then in that initial period of time you could gather enough information to improve your predictions of where the broad zone would be located, you would never get it exactly, but you wouldn't need it, you just need to have an idea of what region the board would land on. in enough to get an advantage over the casino, it's all very well, of course, to do it in a classroom and work for all the occasions, uh, all the equations, but in a casino you have to do it in real time, you have to do it in the casino floor as the ball spins, so what these teams actually did was devise hidden computers to do these calculations in person.

Now, portable technology is of course all around us today, but the first laptop was designed for this purpose. and because it was a new technology, of course, there were some drawbacks with this, often electric shocks were applied, for example, uh, and on top of this, as I mentioned, things are very sensitive to initial conditions, so that if the weather changes, they must recalibrate the chosen table on one occasion they were actually losing a good amount of money and couldn't understand why until they realized there was an overrated tourist further down leaning on the table and ruining all their predictions, so really this type of methods were somewhat imperfect in theory, they worked very well, but these types of stories have been a bit sporadic, but it wasn't just roulette during this period that players started targeting, they also started targeting other games and in fact one of the most successful players in the world is a man named Bill Benter um and when he was a student in the '70s he came across this sign in an Atlantic City casino now for him this sign meant one thing: card counting clearly works um and the whole idea of card counting, if you have games like blackjack, you're trying to reach a certain total, playing with the dealer, and you know in blackjack you're trying to get close to 21, but not pass, so you have to draw cards and try to get close to this total and at first glance this is a random game, the draw is completely random, what will come out, but of course not It's for a deck of cards because if certain cards have already come up, it can't respawn until you shuffle the deck, so if you can gather information about what's already come up, this can potentially give you an advantage over the casino, it can give you an advantage. against them now again, the casinos began to realize what the players were doing. track what was in the deck, so they started using more decks of cards instead of one, they used a whole part and this made it much more difficult to count the cards because if there are several of the same cards in the deck, it is much more difficult. difficult to maintain them.

Keep track of what came out and what didn't, but the casinos were inadvertently giving players a very significant advantage because at the time casinos generally used what was known as dovetail shuffling, so splitting the deck in two is probably familiar to you. you shuffle the cards together, um now, a dovetail shuffle, if you do it once, it retains a tremendous amount of information about the cards, so just to give you an example, let's say we have a sequence of cards in order of Ace to the King if we make a dove. ta tail Shuffle, we split them.

I've colored them just to make life a little easier and then we put them together now they may not fall exactly on the fabric. You can see it here in two different colors. You've got two pretty clear, what's known as increasing sequences of numbers, so the cars have been shuffled, but really, if you know where they started at each point as you go from left to right, you know there's only one of them. two cards that could appear and actually there are several magic tricks that depend on This is a fact, if you get a deck of cards, move one and then shuffle it randomly, you can detect the moved card because it will not fit into one of these Rising sequences.

In fact, mathematicians have shown that for this type of shuffling you need to shuffle a deck at least half a dozen or so times to get something that is as good as random and in the casinos in that period people really only shuffled them once, so that if you can trace what happened, you will have a lot of information about what happened. In many cases, they would actually introduce computers back into another computer application in the casinos to track cards that have previously arrived and, whereas before, card counters would measure what came and then get some sort of approximation of what is left. now.

In fact, at each moment we know that it is only one of the two cards that could appear. This is a great advantage that they had, but this poses a challenge because how do you capitalize on that at every moment? Let's say there is a card that is advantageous. and uh, less beneficial, how do you make that decision about how much to risk in that situation? And what I want to do is just talk through a simple example. Let's assume we have coins and I'm going to offer you a bias bet here. so I'm going to offer you two to one odds on tails, in other words, you name an amount of money, if it comes up heads, you pay me that amount, if it comes up tails, I'll pay you double the amount. you named it so clearly it's a pretty stupid bet on my part.

I'm giving you an advantage, but how much would you be willing to risk? After all, it is a TO coin and you would still have a chance to lose money. Can I get a quick sample F who here would be willing to risk a pound on that hand share bet okay so I think most of you keep your hand up if you were willing to risk1 well how about1 well and 500 , how many times we get to Once, okay, there are a few people left. I'm not sure if they're playing with Monopoly money, but okay, so if you put your hands down, that wasn't legally binding, I don't know why, but I wanted to give you. an opportunity to have that feeling of measuring the risk, how much you are willing to risk in that situation and I don't know if you were able to see it, but actually the hands went down a lot between 10 and 1, but this is a great opportunity. important question for gamblers, and in fact, in the 1950s, a physicist named John Kelly began thinking about this idea of bias betting.

Let's say you have inside information and have a certain advantage over a bookmaker or a casino, how do you exploit that in this situation? although I gave you all exactly the same bet mathematically it is the same, um, offer your perception of the value of that was very different, some of you valued it at a pound, some at 10, others at 500, um, what is it? optimal to do that? It's actually this concept known as utility in economics, it's the value of something that changes depending on how much money is in your wallet, for example, and how much you're willing to lose, and what Kelly did was he looked at these two guys.

You have contrasting goals if you want to give a good return in the long term, so the first thing you're trying to do is make money because you have a skewed bet, but you're also trying to avoid going bankrupt, essentially. You're still flipping a coin, it's a chance you're going to lose, you know, if I don't think anyone here would have bet their house on this, maybe you would have, you might have an angry family, but in this case you want to do it somehow manner. exploit it but also limit your losses and what kley did was come up with this formula, so excuse my handwriting, basically you have the odds, which in this case are two, you have the probability of winning this P wins minus the probability. you will lose and this is the optimal fraction of your money to bet for a certain advantage over someone in a difficult situation, so in the bet that I just showed you, the odds were two, the probability of you winning is half because it is about TOS coins.

The probability that you will lose is also half, so if we put these numbers in, you will get the following type of equation, a little bit of arithmetic, you may end up with a quarter, so in this situation, if you want to maximize your growth in the long run term. of money, it is optimal to risk about a quarter of your income, just think about the moment you raise your hand, whether it is a quarter of you, you know where you are

## taking

advantage or not, now some of you might think which is fine, everything is fine and Okay, you have shown me a formula, let's try it now.I could, of course, take Pearson's approach to the automobile and spend the next half hour or so flipping coins to convince you that it's a bit boring, so what I thought I'd do instead is I'll show you some simulations of if we adopted different strategies, what kind of results we would get, so here in the vertical is your bank. I'm going to assume you start with 100 and at the bottom are the coin tosses, so there we are. I'm going to play this bet over and over again and see what you'd end up with over time. Now you could have thought about a quarter of my money.

You know, that's not taking risks. I want to go big. You might say, well. I want to bet 80% of my money and in this case, if we just do a random simulation, what could happen is thatYou'll make a couple of big wins at the beginning, you know you're getting close to 000 and you'll lose a lot of money. Winning a lot of money is exciting and then losing all your money and going broke. um less exciting if you take this optimal Kelly strategy and bet 25%, what will happen is it will take longer and it will grow a little bit slower. time, but you won't go bankrupt and in fact in the long run you'll get something that takes off, you could say that's actually still too much for me.

I'm going to bet 10% of my income on each of these salaries. uh, and in this case, if you do it randomly, it will take a long time to grow, so you won't go bankrupt, um, but it will take a lot longer to bet your money and you will notice these kinds of pretty steep increases in the end and that it's because you're reinvesting your money, it's this kind of compound interest effect over time, again, this is just a simulation, it's a currency. There's a little bit of randomness, so what we could do is simulate it, let's say 10 times instead of kind of an example here, do each of these 10 times and in the case where you bet 80% you'll end up with something, nine Of these you go bankrupt and one of them wins a little money, but in most of these cases, you will run out of income pretty quickly if you bet 25% of this optimal amount.

On the other hand, it grows a little slower, but you don't go bankrupt at any point and you will eventually increase your income and on the other hand, this 10% is just a much slower growth, so it takes a lot more time to accumulate this over time. throughout the betting series and this is the strategy that people used to manage Blackjack in many of these games. uh your banky actually the concept of utility in money management is obviously important in finance, but it underpins the entire insurance industry because whether we insure something or not depends on how we value it, you know if we're willing to risk the fact that that we could lose it and it costs us a lot of money or if we accept those small bonuses that will depend on the value of the item, but implementing the strategy of course for card counters can still be a problem, as one card counter I spoke to said , learn to count cards.

It's easy to learn how to get your way, it's very difficult and many of these people who are successful like Bill Benser soon became quite well known in the casino world and found themselves excluded from everyone, so they turned their attention. in a bigger game, a much bigger place to bet now, this is the Happy Valley Racecourse in Hong Kong, if you've ever been on a Wednesday night, this is where all the action takes place on a typical race day , about $150 million is spent. betting is a huge part of what's going on here and all the attractions of this for the players is that it's quite small, well, first of all, they're pretty convinced that you know it's an honest operation and it's a small group of horses of around a thousand running horses. over and over again so you can generate a lot of data, uh, to look at and try to interpret which horse might have a good chance, but to do that, of course, you need some way to convert the data into a performance measure, which horse is the better. which horse is going to win and how to use this equipment turns an idea that was first conjured up by this man this is Francis goon um a Victorian scientist um and cousin actually of Charles Darwin um and as you can see you know they shared some passions particularly by the creations and the sideburns, but there were some differences.

Darwin was actually meticulous in shaping his research, so even in the theory of evolution you can see a lot of his fingerprints on this. Now, a bully liked to think of himself more as an explorer. He dabbled in anthropology, psychology, biology and economics and then he started a little and then he left it and dedicated himself to something else and one of the things that interested him was inheritance and, in fact, on some occasions he sent his seeds from friends and having them grow them for him, it's kind of an early approach of crowdsourcing and having them report back and one of the things he had noticed is that if you grew the season and you had the next generation, if those were, for example , higher.

The Next Generation would not be expected to become taller and taller, that over time they would gain a characteristic that was referred to as regression to mediocrity, that over time these types of characteristics would somehow converge, and the influence of older lineages could appear. of gentle variation, he wanted to understand this in a a little more rigorous way and it was actually a horse trainer who presented him with a figure that allowed him to frame this type of idea and it was the following, it was a diagram, it was a square that represented the characteristics of a horse and this trainer had proposed that about half of the characteristics be explained by the dam and the sire, so you have a couple of squares for those and then of the remaining characteristics, maybe a quarter is explained by the four grandparents and then, um, another part is explained by the great-grandparents and so on and this idea was one of the founders of what is known as regression theory in statistics, this idea that we can take a series of factors and find out how they influence the characteristics of a certain object or system and we could have a similar approach uh in horse racing we could say well, suppose this chart is the performance of The Horse and we have many different bits of past data and we could Well, maybe each of these B of data explains a certain amount of the horse's performance, of course, this is a bit simplistic, isn't it?

As with heredity characteristics, where, for example, some of the variations explained by the parents will also be shared with the grandparents, these characteristics will overlap, some of them will explain multiple aspects, so This kind of thing will be a little more confusing, and we may not be able to explain all the horses. performance, there may be some portion that we still can't really explain, the goal from a statistical point of view is to try to minimize this unknown quantity, it was actually in the 80s. Bill Benter, visiting the library in Nevada, came across a paper by two researchers named Ruth Bolton and Rand Chapman, they work in marketing, they still do, and they had essentially outlined this method for horse racing, this approach of converting data into some kind of performance measure that could be used to make predictions, and so as Bill said, it was the idea that stitched together a multi-billion pound industry an incredibly important piece of research and in fact for Ruth Bton it was the only paper she wrote about horse racing during her PhD and actually It was kind of a side project, but this had a huge impact on this industry.

Now, when doing the analysis in the early Hong Kong syndicates, certain things would turn out to be more important, for example, in one of their early investigations, the number of races a horse had run would say a lot about how it was going to do and it is tempting make up a story about it, we say well if you run more races then you will have more experience and that will give you a better performance in the next race, but in reality avoid doing that because you really know that it is a jumble that all these things will overlap and explain one thing and it is not clear that just because something is important it has a direct explanation, this is a fairly common problem in statistics.

It's known as this idea that correlation doesn't always mean causation, I'll just give you an example. Here we have at the bottom the spending on wine per year by Cambridge universities. In the vertical are the results of the exams, as you can see. There's a pretty strong correlation between universities spending more and wine doing better, and that's not the only thing that happens. In fact, it turns out that countries that have higher per capita spending on chocolate generally win more Nobel Prizes. would be that eating chocolate would make you a Nobel Prize winner and to think about why we give you better exams there's clearly something else going on there, some underlying characteristic that explains all these things and really these unions, so don't try to untangle it and actually , one of the notable things is that they do not want to be experts in this type of field.

For them, the question is what horse is going to win, not why that horse is going to win, so it's almost the ignorant idea of going back. They are accepting their ignorance and saying yes. I don't really mind not being able to explain exactly how everything goes. I just want a method that gives me good predictions, now starting by measuring performance in a good way. But in reality, when you have multiple horses running, you can get some slightly unexpected results, so just an example, a very simple one. Suppose we have two horses, we have one that half the time does well and half the time does poorly.

The day you don't know what it's going to be and you have the second horse, which is a bastion of reliability, in every race, exactly the same performance, now, on average, in many, many races, they have the same type of performance. top top one on average that will cancel out and in a race it will essentially be a 50/50 because in a race it depends entirely on whether the number one best horse is having a good day or a bad day so if these two horses compete against each other It's basically a Coos, there's a 50-50 chance because the best horse is having a good day, he's going to win, if he's having a bad day, he's going to lose, that's kind of intuitive, but if you add a third horse into the mix something a little strange happens, so let's say we have a third horse here that some days performs slightly better than the middle horse, other days performs a little worse, so again, on average, all of these horses have the same performance now with the same type of logic.

The best horse here again has a 50% chance of winning because half the time he will come out ahead and half the time he will come out last, so he still has a 50% chance of winning from the two remaining horses if the better the horse does not win, we can apply the same logic as to these two horses below, if horse number three has a good day, it will be victorious and if it has a bad day, it will lose, so if the best horse does not win, you divide the odds between the two remaining horses because you can't decide now just take a look at what is going on here, all these horses on average have identical performance, but it is the variability that is different and actually the best horse, because it is more variable in this type of race, you have a greater chance of winning.

In fact, you can apply the same type of logic to other situations, so let's say we have an election that, with the first pass of the posting system, the person Who gets the most votes wins if you have three people who, on average , you would expect to get the same number of votes, is actually the most polarizing candidate, the All or Nothing type, the one who has the best strategy because he has the highest probability of winning. win in this situation If you want to take the example a little further, you could look at job interviews or maybe even dating if you have a lot of different suitors.

In this situation, it makes more sense to adopt this All or Nothing. Marite type of strategy, if the goal is to come out first against multiple people, this is not a problem if there are only two in the race, but as soon as you have multiple competitors, this kind of strange dynamic arises and really the mathematics of the games and these kinds of features have been of interest to mathematicians for a long time. Actually, the origins of games. The origins of gaming mathematics originated with poker in the 1920s. A researcher named John Von Neyman, a brilliant mathematician, was the youngest professor in history.

The history of the University of Berlin was not so good in poker, although at first glance, poker is a perfect game for mathematicians, right, it is the probability that you will get a certain hand, the probability that your opponent will get a different, but Von Noyman realized that there is more to it than that, as he said, real life is about bluffing with little deception tactics of wondering what the other man supposes I'm going to do and he wanted to study that kind of feedback between what you think, what they think and they think that you think and looked at very simplified forms of poker.

One situation he observed was that two players each receive a single card and then put some money in the pot at the beginning and the first player has the option to choose. They can simply continue with their bets, in which case they simply turn over their cards and compare them, or they can increase the bets and then it is up to the second player to decide whether to honor that bet or not, so two players receive a card of money. In the middle, what Von Noyman discovered is that in these types of games there is almost a tug of war because each player tries to maximize his own profit and at the same time tries to minimize his partner's profit.opponent.

If you think about a game like poker, everything your opponent wins comes. out of your pocket, so you try to maximize what you get and at the same time you try to minimize what they get, which means that there is this kind of equilibrium point, there is a point where the two conflicting forces balance each other and When analyzing this situation for the game, he discovered that this situation where no player would benefit from changing their strategy, this break-even point, for the first player, the strategy was the following: if they got a very high card, then they had to increase the bets intuitively.

This makes sense if you have a good card, you know you might as well bet on it, if they had a mediocre card it didn't make sense for them to raise the bets, they didn't have a big chance of winning but they still did. some chance, in other words, they should stick with their current bet, but when Von Neyman looked at what happened when you got the lowest type of cards, he discovered that there is no point in holding back because if you turn over the cards you will probably you're going to lose, instead you should raise the bets, so in other words you should bluff and in fact up to this point players had often pushed players had often bluffed in games, but it was always seen as a peculiarity of human psychology. of innate deception that humans came up with, but here was Von Norman proving it was a mathematical necessity; in other words, it showed that bluffing is a necessary part of life and you know this idea was kind of a fundamental game theory that you can have these strategies put together in this very simple version of Poker, although there is almost a list of fixed rules which we can follow, in other words, if you get a high or low card, you increase the bets, if you get a medium card, you keep what you have. and in any game where you have all the information in front of you, other games for example things like NS Chess and Crosses Checkers, all these games have a fixed set of rules, it's known as pure strategy, so Follow these exact rules and you will get the optimal result, so something n and crosses.

I think most people can figure it out when they are younger and realize that there are a series of moves and if you always do it, you always get the result. uh that's the best possible, of course, not all games are like that. A good example is rock, paper, scissors, so it may be admirably consistent on your part to always choose the same one, but if your opponent sees what you're doing, he can take advantage of it. It's not the type of operation strategy if you're trying to make your opponent's decisions as difficult as possible in these types of games, that's what you're trying to do, you're trying to make your opponent indifferent to change. because you have that tug of war goes on, so if they can win more by adopting a different strategy, you don't have the optimal approach and in what role or scissors, if you want to make your opponent's decisions as difficult as possible, which you can do simply is to choose. randomly, if you choose completely random options among them, in the long run your opponent will not be able to make money on you, so this is optimal and, paper or scissors, there are three options that are not too difficult to do.

Keep in mind that choosing at random will make your opponent's decisions more difficult, but games like poker are much more complex, you have a wide variety of choices you can make throughout the game, so it's not something you can write with a pencil and paper and fortunately we can turn to a technique that was devised by one of John vom's colleagues and this was a mathematician called stanislav amp um and unlike many mathematicians he was not a big fan of working with a bunch of equations in One time he was working on a whiteboard trying to solve a quadratic and he got to the end and he was so frustrated and upset that he went home for the day, so it wasn't really his thing to solve all this algebra and one time he was playing Can Canfield, which It is a version of solitaire. and he wondered what the probability would be if he simply spread the cards what is the probability that he would have a situation where he could win that game the cards would fall favorably he started looking at the calculations and realized that it was just a bunch of effort, so he thought well, what if I just lay out the cards a few times and see what happens?

In other words, what would happen if I simulated this process a few times and got an idea of how likely it is at that time and for the person working? in the US nuclear program at Los Alamos, working on neutron collisions, part of the project towards the hydrogen bomb and again, these were random processes where you couldn't clearly write down the formulas and solve them and they realized that this method would be incredibly powerful for that, being a government program, they needed a code name, so they called it the Monte Carlo method because ulam had a very gambling uncle at the time and the Monte method has become a fundamental part of science, I mean, in my line of work where we try to observe disease outbreaks, you have something like Eola or Zika, which is an incredibly complex set of interactions, it's not something that you can write clearly with pencil and paper, for example. so we use these simulation-based approaches that simulate these random processes to understand these systems.

Um, it also shows up in areas of sports hitting when you're trying to understand how these kinds of complex team interactions work and it also applies to poker. Teams have used this type of approach for poker games where you can't. Carefully solve the equations, you can use a simulation-based approach to make computers learn. Actually, Alan refers to one of the fathers of computer science and when he first thought of this idea of machine learning he said that, actually, if he's trying to build intelligent systems. machine, there is no point in building an adult mind, you don't want to try to build the finished product with all the knowledge and rules.

There it makes much more sense to build the child's mind and let him learn, let him figure out how. to play these types of games and this is what these poker teams do, they create these algorithms that they can learn and in fact the way that they learn is maybe a little surprising because what they do is they get these algorithms to be used with time. what's known as regret minimization, so as they play these games billions of times against each other, at every point, when they make a decision, they look back and say, could I do that better if I had done something different?

They have an artificial measure of regret for every decision they make and in fact there is a lot of evidence from some neurological neuroscience studies that the ability to regret is quite important in learning to gamble. There have been studies of people who have damaged the part. of the brain that is responsible for regretting this ability to write look back and ask how I would feel if I had done something differently and there are people who are often perfectly capable of playing logic games if they have to sort the cards absolutely right if there are any element of risk in the game and they have to learn how to play the optimal strategy, that is something that they really struggle with and in fact a lot of economic theories were developed not around looking back but around what is known as expectation maximizations, in other words, You look ahead and say: if I did this, could I make money?

If I did this, could I earn more? But actually, from these kinds of AI approaches, it seems like it's much more powerful to look back and employ that power of regret than you're going to look back on your decisions as you take these risks and, in fact, these teams They have employed these algorithms and gotten these computer Bots to play against each other so many times that last year they announced that the poker is resolved well to be specific to two player poker where the states have a limit. These Bots have played each other so many times that they have come up with a strategy that they are not expected to lose money in the long run, so even if you are playing. a perfect opponent, this robot would not lose money over the course of a very long game, interestingly enough, actually, many of the players who came up with this system, many of the computer scientists are not very good at poker themselves.

I admit they're not po players, so it's kind of a remarkable illustration of the power of these algorithms. You can have people who aren't particularly good at poker creating Poker Bots that can beat any human. um, you could say, but there you go, this is a remarkable achievement. but of course there is a downside to this and that is that you are assuming that your opponent is perfect if you go for this optimal strategy which is inherently defensive because you are assuming that your opponent is perfect and you are almost giving him too much credit because if you have a flawed opponent and you come up with a strategy that assumes it's perfect, you're potentially not exploiting it as much as you could and it's just giving one example of this type of failure. that could happen, um, let's go back to rock, paper, scissors, which I would like you all to do, just turn to the person next to you and play a couple of games of rock, paper, scissors with them, please , okay, thank you ladies and gentlemen, um, okay.

I can see there's a couple of people in the back trying to play best of seven or something, but okay, what I'd like to do is just quickly show the hands of who opened with rock, okay, a few who opened with scissors. and who opened with paper well, actually not so many for paper um, usually, in these types of big competitions people play many times um, it's the rookies who open the stone, often the men sorry, um, scissors tend to be the most popular type of people who Play a lot of these games and the role is not always chosen as often and also think about what happened between the first game and the second one you played because, in a type of study big enough on rock, paper, scissors, what happened was that the people won. the first round usually follows the same move for the second, so it's an old military saying, isn't it that generals always fought last, they always fight the last war, especially if they won it, so this one idea that if you won, just stick with what's safe, the people who lost, however, will often switch to the move that would have beaten the one they lost, so if they lost to rock, they will often switch to the role in the next I try, so it's not always like that.

This happens, but in these types of large competitions these types of patterns emerge, so although the optimal thing to do in rock, paper, scissors is to behave in a completely random way, people do not fall into these predictable patterns and in reality There was a story a few years ago. A while ago in Japan, an electronics company wanted to auction off its art collection and they approached Christies and sbes to hold the auction that they both obviously wanted, so the director of the electronics company decided that the fairest way to solving it would be with a game of rock, paper, scissors, now soube thought that's perfectly random, okay, okay, um Christies, however, he, the CEO in Japan, had a young daughter, a girl of seven years, he played tirelessly on the playground, so he asked his daughter to teach him a little rock. paper-or-scissors strategy and, sure enough, they entered the meeting room.

Christie's treats it as a random game with a strategy. Christie's came out on top, so in these kinds of cases, exploiting those patterns and that kind of predictability and knowledge of what's happened before can be extremely valuable, but there are some challenges to doing that and, in particular, if you're playing with computers , one of the challenges from a human point of view is the limitation of our memory, so just illustrate this point with what I would like. What I have to do now is have all of you try to memorize that number for me, so I'll give you a couple of moments to take a quick look at it, okay?

Who would like to try to find out? yes sir 26 1 very very close does anyone want to try again what was what was your name sorry gav Gavin so Gavin got really close does anyone want to try to take advantage of that yes 610 26191 so what's your name Steve Steve Steve Round of applause To Steve, ladies and gentlemen, Steve did something pretty smart there. I don't know if they saw it. I explained to them what he did, so I asked them to memorize 10 digits. And that was actually a little torturous for me because in many psychological ways. studies um people who are presented with numbers can usually memorize about seven and recite them um sorry 12 digits yeah on which oh sorry yeah okay I have a mass PhD I assure you okay , so I actually made it even harder.

He was cooler than he thought. I apologize? um and usually people can remember likea local phone number that they can remember, um that they struggle with, but what Steve actually did when he recited the numbers, he didn't recite that type of individual, he said like 610 260 in 1091, so what he actually did was grouping the numbers together, I wasn't reciting 10 bits of information, I was breaking them down into a smaller amount, which put them below that threshold that you can memorize and, in fact, other countries, so you know, France. For example, if you go there, the phone numbers tend to be paired together, which actually makes it easier to remember the numbers because it's much easier for you to remember these kinds of chunks of numbers instead of just a single sequence, but I can guarantee that all of you will remember this number when you go home tonight and that's actually if you break it down and add some punctuation to it and then turn it around, that's just the time and date of this talk so everyone You now know that number and be able to repeat it and the reason is that you have gone from 10 bits of seemingly arbitrary information to one that clearly has some meaning to you and this ability to chunk is something that card counters employ because clearly memorizing a full deck of cards is incredibly difficult, so what they do is they use what's known as grouping, they group them into, for example, low cards, medium cards, high cards and then, instead of having to memorize a whole deck, They only have these three cubes to remember, and what's more, it is a kind of memory. property so that they don't have to remember everything, they can simply keep track of these three values, of course, there are some people who can memorize a large number of cards, you know, the best memory champions, they can memorize about 1,000 cards in an hour, a thousand playing cards in an hour, that's extraordinary, and the way they do it is they actually attach characters to the cards, turn them into people and objects, and attach a story to that, and Similarly, while everyone will remember this because you're not remembering a number, you're remembering an event, you remember a single thing that is much more memorable and that's what you really know how humans can get around this idea of memory limitation, but There are some disadvantages to learning about your opponent and remembering things and trying to take advantage of them and that is, if your opponent is incredibly smart, they might teach you the wrong image of themselves, so that's what's known as the problem of being taught and exploited if you are playing poker for example, your opponent could pretend to be very passive and very shy and then once you learned that notion of how they play they could change their behavior and exploit the fact that you have learned the wrong perception of they. poker this happened a couple of months ago, you may have seen it Microsoft released a bot for Twitter to learn, you can see where this is going, try to learn the language, the idea, have conversations and improve your ability, uh, learn, uh, T Twitter users. unfortunately I decided to teach him some unfortunate tricks.

What really happened was that within 24 hours they had to take it down because it had so many horrendous reviews, I think it's an example that you can have a pretty smart algorithm, but if you give it the wrong picture of what it should be doing, in reality can go off track very quickly and at this point you talked about they push Bots that play billions of games to refine their strategy. I have talked about these language Bots um, but in many situations these Bots are not very complicated in finance, for example, the programs are designed to be fast if you are trading if you want to get compensation, you need to do it quickly, so have that huge amount of complexity, nuance and rationality in your algorithm won't get the job done.

You know you really want to keep it as simple as possible in many cases. In these cases, these high speed algorithms, you may only have a few lines of code, uh, and there is an economic researcher, um, I talk, you put it when you have 10 lines of code, you are not even at the level of intelligence of an insect, you know you have. There is no rationality or nuance there, you are just trying to execute trades as quickly as possible in some situations, this means you may run into problems. Recently there was a case in Norway where two traders realized that an American stockbroker had an algorithm that was feeding trades into the market and the algorithm would always react to a trade the same way, in other words if you traded with it , it would change its price by the same amount no matter how big that trade was, and what These people, what they didn't do was teach the algorithm what to do so that it would make a lot of small transactions so that its price would go up and then make one big transaction and it would be benefit from the difference.

Now this ended up in court. These two traders were accused of market man manipulation and they received suspended sentences, um, but then there's a sort of Robin Hood reputation in the media for them in Norway and they went to appeal and their appeals law noted whether They had been trading against a stupid human who was doing this, that wouldn't be a problem, the problem is that they were trading a stupid algorithm presumably created by a human who hadn't been thinking about what they were doing and how it should be different, how it should be the notion of skill and responsibility. different because there's that kind of step, um, away from the argument and, in fact, this argument was held in court and in this situation, um, they were actually, you know, this kind of sentence was overturned and this one was not It is the first instance, it is very simple. algorithms have problems, um, uh, at a similar point, actually a US stockbroker was introducing a new algorithm for entering orders into the market, so there are a lot of client orders coming to the broker bag and would like to feed them at the time they had.

Eight servers doing this. What they actually had is a counter to keep track of because obviously if you get a lot of orders and you send them out to the marketplace, you're going to want to keep track of how many you've completed. you don't want to accidentally create too many and they had one of these counting on each server and then they updated their software but by all accounts they didn't add the counter to the eighth server so they had seven servers that they knew about. what they were doing, the eighth one, who was doing his thing and when this thing got going, what happened was all seven of them were behaving as they should, the ethics just peppered the market with high speed trading and in fact, by the time they figured out what's going on and shut it down in 45 minutes, it had lost about $450 million, so that's $170,000 a second for this runaway algorithm because it was acting so fast and way beyond what the guy of humans could control and that could be called bad luck.

You could call it a kind of error in skill and I think those cases involving these types of games and events of chance are developing in the US in recent years there has been a huge crackdown on poker, particularly online and also in In 2012 there was a crackdown in New York and poker rooms and the gentleman who runs a poker room was taken to court and for operating a gambling operation, now many casino games under federal law are defined like games of chance, but poker is not one of them. So really, whether it was gambling or not was kind of a debate in federal law.

Gambling is defined as anything that is predominantly due to chance, so any game that is predominantly the result of chance is defined as gambling. So what happened is this whole legal case. It was based on poker being a game of chance or a game of skill and they got economists to come in, mathematicians, um, and they pointed out that in a single game of poker, of course, there's an element of luck because you got this deal, but Also you already know. In baseball, someone throws a single ball, there will be an element of chance involved, but over the course of a poker game, the most skilled players generally win and this is the first time a US court has ruled whether the poker is a game of uh. chance or a game of skill and they ruled it was a game of skill, there's a footnote to the story, the next year when it went to the state appeals court, now in New York state law, the game It is defined as anything that has a material element of chance, so if you think about this, it is a much narrower definition of gambling, it is not predominantly chance as something with a material element that clearly poker has and under this condition it is defined as a game of chance and the debate continues if you look at Kind of fancy sports in the US and a lot of these systems Where do we have something that is luck?

Do we have something that is skill? Do you know where we do it? We actually define these things with gambling. I think there's often a temptation, actually, with the situation. to put things in boxes, you know, we like to say there's a lucky box and a skilled box. I think normally, if we're good at something, it goes in the box on the right, if we're bad at something, it goes in the box on the left, um, and that's really tempting, but I don't think it's a realistic notion, necessarily. um, I think, in particular, through the history of how people have approached games like roulette and lotteries, it's much more of a spectrum and, in fact, games that we might think of as being the archetype of luck, things like roulette, actually, if you have a skillful approach, you can master that opportunity and turn it into some element of a game of skill and even games that we might think of as being Incredibly, or almost solely, the RO of games of skill like chess. can have surprising results of chance in the 90s, the famous IBM Deep Blue chess computer played against Gary Kaspro and during the match, in one of the first games, there was a situation where Deep Blue made a move that was so unexpected and almost kind, so subtle that it deviated slightly and convinced him that he was playing something simply beyond anything he had ever seen before, something completely beyond his ability, um, it became.

Actually, I found out that what happened there is that Deep Blue had run into a situation where it couldn't identify the best move and in that situation it had been programmed to choose randomly, so this set of games is one of the milestones of artificial intelligence in the world. Humans in a game that is thought to be purely one of skill was actually shaped by this chance event and I think these types of illustrations show why games of chance and why these types of winnings of chance are so important because they really are whatever your points of view are. of casinos and betting houses um gambling is an inherent part of life betting is an inherent part of what we do whether in health in a type of prediction on this side whether in business whether in finance we have We have to make decisions with hidden information we have.

To deal with uncertainty we have to balance risks with rewards. I think that's why historically so many researchers have invested in gambling and continue to do so because really, if you want to understand luck, decision making and risk, then there's arguably no way. uh it's better to start than with a bet so thanks for what your point of view is or where investing in the stock market might fall between luck and skill. Should I pay someone a 2% fee for their ability to invest my money or should I just rely on buying the market

If you have any copyright issue, please Contact