 Hey guys, it's MJ the student's act tree and in this video we're gonna be looking at artificial intelligence and American football and The reason being is that sports involves a certain element of chance But it's not like gambling, you know, you pull that slot machine and you just hope for the best When it comes to sport your choices can influence your chances and Whenever there's chances They're gonna be act trees So we've really I mean made like a little model on cricket and my friends done a model on soccer results So I thought why not make a model on American football? And there's two main reasons why you'd want to make a model The first is so that you can win at betting You don't make lots of money or the more interesting and the more enjoyable Reason is to make games and that's what we're gonna be doing with this American football model We're gonna use it to make a game So what we're gonna do is we're gonna start off very simply and we're then gonna Build on complexity as time goes by so we're gonna start simple And I mean what is more simple than rock paper scissors? So think of rock paper scissors American football and you get run throw kick We do add like on another layer, you know, so when you run or whether you throw You know, you can either do it safe normal or risky Just to add another just a little bit of complexity But remember this is still a vice simplification of American football because it is much more complicated, but remember We want to start with a simple model and then build on as we learn or at a later stage So let me show you The game mechanics what will happen is you'll make a choice your opponent will make a choice This will then go to a distribution matrix and the outcome will have various probability weightings So let me give you a quick little example Let's say for instance, I chose to run wide and my chosen my opponent chose to pass defend long what this means is as You can see it's highlighted in yellow the probability of me making a big loss or a small loss or nothing is zero I've got a high probability of making a small gain a big gain and a very small chance of making a mega gain If you go back to that previous distribution, you'll see that by going long You know, you had a much greater chance of making a mega gain, but then you could also fumble type of thing So what we're basically making is the yards gained is the random variable so and it basically comes down to this if You choose to throw that's kind of risky. There's a little bit of volatility in it It's more of a fat tail distribution. Whereas whether you choose to run. It's more of a thin tail It's a safer, but you're not going to make as many yards. So this is just an assumption I am making with regards to American football This is how the app is going to look we've actually got a Current version out. It's not on any of the app stores Just that I've been playing around with my friend who I've been making it with and we can play against each other And it goes to all of this and it's really cool But in order for us to play against each other we have to connect to the Google Play Store and We've realized that both of us have to be on at the same time in order to play the game So I thought why not make an artificial intelligence? You know for the computer to to play against us And I thought let's bring in some of the actual science that I've learned So we're going to be using a Bayesian principle Which means that the probability weightings are going to evolve and the computer is going to learn So if we have a quick little look at the mathematics For those of you familiar with Bayesian statistics We will have a posterior and we'll have a prior and we'll have the evidence. So what will happen is? I'll take real American football statistics and this will become the prior depending on how I play the computer will use that as the evidence and Along with the prior it will then create the posterior distribution Which will it will then use to make its choices against me So what is going to be doing? It's basically going to be counting The decisions I make creating a bit of a frequency Diagram on what I'm doing at various states on the field So if I'm very close to my opponents end zone and I always seem to run at that stage The computer is going to learn that and factor that in when it makes this decision Whereas if I'm throwing when I'm in the middle of the field, it's also going to take that into account So the idea is that if I keep playing the exact same way the computer is going to learn my strategy and I'm going to lose Now when it comes to artificial intelligence or machine learning or whatever you want to call it There's three key ideas the first is the learning rate and this is how quickly does the system learn so What emphasis does it put on the posterior data compared to the prior data? The more emphasis on the posterior data that means, you know, the more it's learning You know the more it's taking in the evidence and rejecting the prior information then we have the discount factor that is Not to be confused like with the time value of money discount factor. This is something else This is is your system focused on short-term goals, you know Like making as many yards as possible within that down or is it focused on more long-term goals? You know like scoring points and actually winning the game and then there are the initial conditions which is what you set the prior data as and This kind of gives the artificial intelligence its own personality and we're gonna see later We can you know, maybe mix this up and create different personalities to take on each other But let's say you you play against my system and somebody else plays against the system Each time Somebody plays with the system It's gonna learn that player's behaviors and so it's gonna become a little bit unique towards that player You know, it's gonna learn your style Whereas somebody else plays it's gonna learn that style. So we're gonna be creating Yeah, you'll have your own unique artificial intelligence that you'll be taking on and What will be cool is if we can gather all that data So you'll be playing online we capturing that data and we'll create this massive library of various player strategies and Then what we do is we take all this big data and We look for patterns and we use all the various actuarial and statistical techniques that we've learned To predict a new player strategy just from the first few players So if somebody let's say the the data identifies two types of strategy a player Who runs a lot compared to a player who throws a lot just as a very simple explanation or simple example And you come up and you're first two downs you decide to run it then the system might say wow this person is Incorporating this strategy. This is how we're gonna play against them So in effect our AR won't have to learn anymore It would become mature and it'll be able to predict your every move Otherwise, this is known as reaching the Nash equilibrium for those of you interested in game theory But that is the general idea of artificial intelligence and of the system we want to make The more people play it the smarter it becomes and Then like I said, it would be a lot of fun To you know get the AI's to take on each other You know have an AI with the various learning rates and different discount factors to play against other AI's with the different configuration and to see you know, which one is the best and Then once we have optimized our artificial intelligence We might be able to step it up make the system a little bit more complicated and the ultimate goal would be Possibly to replace an NFL coach So I know that's a big dream, but it would be pretty cool if in the American Football League You have all these coaches and then one team is run by an artificial intelligence And it will be really cool to see how it competes against the rest of them So yeah, if you guys are studying actuarial science, you will know that from subject CT6 You'll be learning a whole bunch of stuff Around this so that you can apply for artificial intelligence. You learn it for insurance But the same maths can be used in machine learning. I mean as you can see this decision theory There's Bayesian statistics. There's credibility theory There's time series Monte Carlo simulations all that stuff is for machine learning as well And job, that's basically the aim of this project is to take rock-paper-scissors American football thrown a little bit of actuarial magic and yet artificial intelligence Now I know this is a video a little bit off what I normally do But if you are interested in this, I will be making another video later on Just with regards to rock-paper-scissors. I've made it a slightly different version of the game We have scissors ones you get three points if paper ones you get two points and if rock wins you get one point And what I'm going to be doing is I want to make a video Explaining how I go through the mathematics of creating an artificial intelligence for this simple game And this is important for me because once I can do it for this simple game I can then step it up for this American football game Which we're gonna make and it's gonna be really cool So if you're watching this a little bit later You should be able to see a link if you click rock-paper-scissors But if you're watching this video straight away as it's just come out Then that video will only come on like maybe a few days later. So Subscribe then to get a notification Or otherwise just yuck come check on the channel a little bit later, but otherwise, that's all I want to say Thanks so much for watching and I will see you guys soon. Hope you have a merry Christmas as it's almost your Christmas season now. Cheers