Okay, so now we're going to try to to create an algorithm based on the model that we've created, and what we'll do is basically look at the diagram that we came up with. Think about the different classes or agents that we have and the different events that can happen. And then see if we can actually come up with some rules. Of how we would put this into a computer. So recall we have a model where we're going to have three classes of individuals susceptible they can get infected, they're currently infected and can pass the virus and recovers they've cleared the infection. Now, they're pretty much out of the game. And two things can happen transmission and I infects in this, then the S will become an I and recovery and I can recover and become an R. So that's kind of summarize in diagram and now we're going to try to think about it each of the different processes that can happen and how we can actually make some rules to put those into a computer. For that, we need to think a little more about how we want to model this. And we've been talking about the who, the what, and we're going to talk about the how. How are we going to incorporate these processes? And I think just to make things easier, I think these, the Is becoming Rs or the infected's recovering, it's an easy process to think about. So let's start with that one, with the right side of the diagram and we think about that. So we're going to come up with some rough justification of how we could actually model though. So let's start with some rules. So we're going to think that anyone who's currently infected can move or recover and jump into the R compartment or box. The more people that are in the I class then, the more transitions we should see, right? If no one is in the class, we should not see people moving from my two R because there isn't anyone in the class on the other side. If there's lots of people in the I class, then maybe we should see a lot of people recovering at any given day and we're going to use day as our unit of time. So, just to give you some intuition, let's assume that the recovery rate is about 10% per day. So 10% of the people who are infected at any given day will recover on that day. So we're going to make the parameter 10% and think about that something to help us. So a question is, okay on average how many people should then recover on any given day? Right? So maybe we can just quickly argue about that with the screen. And so we say, if today, at the beginning of the day there are I numbers of infected let's say that that's 1,000 And we say that r is 10%, right? So 10% of those 1,000 individuals should recover that's the amount of people that we should see recovering on that given day. Well, then how many people should recover? Well, it should be I the number that I have times r, which is the 10%. And then, 10% of 1,000 in this particular case, the answer would be 100, okay? So on a given day when I have 1,000 people infected, the recovery rate is about 10% per day. Then I should see about 100 people recovering on that given day. So, that's written there in the bullet, right? The main point, the main thing that we should think about is, well, then that tells me that the number of people I should be seeing getting recovered every day should be my rate in this case times the number of people that I have or R times I. So, if I go back to the dependent really this is the key feature I want to see, right? That the another people who are getting recovered every day. Or should be the product, in this case, of the rate times the amount of people that actually have infected and who can get recovered. Now, for the next side of things, the people getting infected, that's a little bit trickier. We'll try just to articulate how we're going to actually do it. And because then it's not only a function of how many people we have in there, right? Because it should also depend on how many people we have in the I compartment. If no one is infected, if no one has infections, then no one should go from the S to the I, right? There is no virus, there is no people who can transmit, all right? So the amount of people who go from S to I should be a function of both, how many people are having S and also how many people are having I? And that's where we actually get to make some assumptions and do what we call math modeling, right? We need to come up with some rules of how these things are going to occur. So the slides you can see that some things that we need to care about for infection to occur, an S must meet an I, and once they meet, then the transmission can occur. But not everyone not all the time that you meet someone with flu, you're going to get the flu right? It has to be some conditions and person has his sneeze are actually expel some virus out of their bodies and then to actually go and you have to breathe it in or touches and put it inside your mouth or some ways. So not every time that you meet an I, you're going to get sick, right so let's say that every time you meet an I the provisions, you're going to get infected, it's p, right? And we're going to use that parameter. Now, unless we model explicit context and we do something more sophisticated for people are moving around, then we need to come up with a way to count all the possible ways that assets can meet with I. So we'll do that next. So what we're going to do is just that, in the end, all the possible connections that can happen well, it's going to be a function of how many S people I have how many I people I have. And in the end what I can think about is that the thought of possible number of connections or contacts that could happen well, it should be the amount of people I have in S times the amount of people that have in I, right? The more I have I, the more I have in S the more potential contacts I'm going to have. But of course not everyone is going to meet everybody, right? You didn't see everyone who has the flu, you don't see everyone in your town just see a small proportion of them. So maybe then we can have another parameter that we're going to call c, which is the rate at which people meet each other, all right? So we're going to then multiply those all potential number of contacts S times I times a rate of contact that we call c, right? And once a contact occurs then with certain probability we're going to actually have a transmission, right? So how many infections should we see every given day that starts with S susceptibles and l infecteds? So, if there c times S times I contacts then we can say but the probability that there is an infection when there is a contact is p, then on average we should see, as we see here in the slide c times p times S times I infections a day. So, going back to our model if that is how many infections we're going to see per day, then we see that for our b that we have in our diagram is actually in this case, the product of those two parameters. The rate at which people meet each other times the probability that even asked me to an I, actually an infection happens, right? And although I'm going really fast through this, and I encourage you to go back and look at the slides, review the things that we're saying. In the end, we've already come up with all the ingredients that we need to build a computational algorithm to simulate through transmission using this model. So let's articulate how the algorithm is going to look at and actually summarize it. So, of course, for us to be able to pull in a computer, we need to tell it, the computer what the values of my parameters are going to be. So we're going to need to pick valleys for my parameter b and my parameter r, understanding that b is red of infections per S times I potential pairs that are in the model. And that r is the recovery per individual, we also need to start somewhere, so we're going to have to come up with, okay? If I have a population of 100,000 or 10,000 or a 1,000,000, then I need to decide how many of those are going to be susceptible to begin with? How many infected so I'm going to start with? And how many people who are already recovered? So it makes sense that for instance we would make the susceptible maybe N, or N-1, that maybe I start with one infected, one person that comes with the infection, and 0 recovered. And then once, say, I have my initial conditions, then I can go and say, okay, what are the things that can happen every day? While people can get infected and then infectants can get recovered. So, how many people can get infected? Well, there are S susceptibles and I infectants we said b times S times I is the new people that I should have infected everyday on average. So, what I can do is, well, start with my S and I at the beginning of the day. And at the end of the day, I can update my number of infectants by having whatever I have plus b time S times I, which is the number of new infected that I'm going to get. Now, if Ss become infected, they're not Ss anymore. So I also need to update the number of Ss that I have and then reduce what I've started with at the beginning of the day. By the number of people who got infected, so these number of new people who get infected, then I can just go ahead and add it to the Is and subtracted from the essence it's a zero sum game. So if you gain infectants you're losing susceptible. What is the other thing that can happen? Well, people can recover, the infected can recover. So we said how many people do I expect to recover every day? Well if R is the rate of recovery, well, it should be R times I. So then the number of Rs that I should have at the end of the day should be what I started with plus the new recovers ups that I have. And then again, it's a zero sum game. If someone recovers from the R to the I then the I should decrease by that same amount. So if I clean this now, this is now the algorithm that we can actually enter into our computer, right? Everyday update the number of new Ss, Is and Rs given these rules. So this is an example of a computation algorithm to them that we can use to simulate the model that we have created to simulate the propagating of the flu in the population. The web tool that I showed you earlier, it uses pretty much a similar algorithm with some differences. Here, we're modeling things are we talked about maybe doing algorithm jumping one day at a time. The one is actually in the tools, that continuous time algorithm. So it uses something that's called differential equations. So it's a little more detailed but not by much. And if you don't know what differential equations are, you will learn that at some point. And then you'll be able to actually called a model such like that and actually write those equations that govern how the dynamics happen. You're curious about it, you could actually, in the tool, just go to the developer tools in your browser. And you can actually see the equations and the algorithm that is running behind the scenes. That's one of the cool things. These tools allow you to make explicit and see exactly what's behind to sense running those are producing those outputs and those curves. We'll now move to trying to expand that model. And maybe yet, one more comparative, which is the one that we're missing, which is vaccination.