So, today we are going to look at interesting phenomena related with Markov chain and that is you know time reversible Markov chains. So, let us just first start looking at what we mean by all this. So, suppose you are given this transition matrix P i j and you are given the stationary state probabilities. So, this is let us assume that the pi i's are all positive because if this if a pi i is 0 then surely we can drop that state from the process because it is not of any interest. So, this is a ergodic process and pi i's are all there stationary probabilities and the system has gone on for some time. So, we are looking at the stationary part of these things. So, now consider a sequence in the reverse order. So, this is x n x n minus 1 x n minus 2 and so on. So, at this point of time you are looking backwards at the process. Now, we will show that this is also a Markov process. So, this is the interesting part that is when you Markov process is going on and you at some point you want to look backwards and then you see the transitions and so on. So, there also the sequence will follow the Markov will have the Markov property and so it will also be a Markov chain or a Markov process. So, now how do we show this? To show this I have to show that you know if suppose the current time is m plus 1 then you are occupying state i or the system is occupying state i and then you want to look at the probability that in the time period just before that means today and yesterday. So, it was x m is equal to j. So, you want to look at the probability conditional probability. So, therefore, for if you are looking at like you are today and you are looking at yesterday's situation then all these days ahead that means x m plus 2 x m plus 3 and so on all these. So, the conditional probability of you know having the history future history and then x m plus 1 is i and you are wanting to know the probability of x m equal to j. So, this would be when you are at time m plus 1 and you are looking backwards. So, if you are looking at this thing then this is all fast for when you are looking backwards. So, therefore, this conditional probability should be equal to x m equal to j given x m plus 1 equal to i. That means it would just depend on the current situation or the current state being occupied by the process and then so this probability should be you know here all the states occupied in the past because now we are looking backwards. So, all the states occupied in the past do not matter it is only the current state that is occupied by the system and then. So, this is what you want to prove if I show this then it would imply that the backward process at any time the backward process will also be a Markov process. So, present time is m plus 1 and we know that we are given that x naught x 1 x 2 this is a Markov chain as I said and the corresponding transition probabilities are p i j's and the pi i's are the stationary probabilities. Now, the conditional distribution of x m plus 2 x m plus 3 and so on given the present state that is given the present state x m plus 1 then we the Markov property tells us that the conditional probabilities of x m plus 2 x m plus 3 and so on do not depend on x m right because the conditional probability of the whatever state is being occupied at time m plus 2 is dependent on this right and then of course x m plus 2 will be x m plus 3 will be dependent on x plus x m plus 2 and so on. So, because this is a Markov process we know that the present state x m plus 1 is independent of no no. So, this is conditional distribution of x m plus 2 x m plus 3 and so on given the present state x m plus 1 is independent of x m the past right and all things beforehand x m minus 1 x m minus 2 right. So, the conditional distribution of x m plus 2 or x m plus 3 and so on. So, conditional distribution of x m plus 2 would depend on the present state which is x m plus 1 and will be independent of x m. Similarly, conditional distribution of x m plus 3 will depend on the state being occupied at time m plus 2 and so it will be independent of m plus 1 and x m and so on right. Now, we know that independence is a symmetric relation you say that x i and x j are independent that means x j and x i are also independent. So, it is a symmetric relationship right. So, therefore, given that x m plus 1 x m given.  So, then I can say the reverse also right. See we just now said that given x m plus 1 x m is independent of x m plus 2 x m plus 3 and so on. This is what I want to say because x m plus 2 is independent of x m x m plus 3 is independent of x m. So, therefore, the reverse because this is a symmetric relationship. So, I can say that x m given x m plus 1 x m is independent of x m plus 2 x m plus 3 and so on and therefore, this probability can be written as probability x m equal to j and x m plus 1 equal to i. And so, we immediately conclude that the backward process is also a Markov process and now we want to look at another special case of this. So, therefore, forward or backward a Markov process have this property right. Now, let us define these backward or the reverse probabilities right. So, I will say that let q i j be equal to probability of x m is equal to j given that x m plus 1 is equal to i right. So, I am defining the backward or the reverse probability reverse transition probability. So, this is present currently you are in i and so, we are occupying state position j just one period before. And so, this conditional probability I can write as by the conditional probability formula I can write this as x m equal to j comma x m plus 1 equal to i divided by the probability of x m plus 1 equal to i right. And then again this product probability I can write conditional as a conditional probability x m plus 1 equal to i given x m equal to j into probability x m equal to j divided by probability x m plus 1 equal to i. And this because we already have the transition probabilities for our forward process and this and the stationary probabilities pi i. So, this can be written as p j i because j i right. So, p j i into pi j probability x m equal to j and divided by probability i that is being in state i at time n plus 1 is a stationary probability. So, that means given the transition probabilities and the stationary probabilities I can always compute the q i j which are the reverse transition probabilities. So, we can compute the q i j's right. And so therefore, now I can say that this is a the backward process is also a Markov process and the conditional the transition probabilities the reverse transition probabilities are also available given the regular Markov process. Then the backward process I can and once you specify the transition matrix the reverse transition probabilities the process is completely determined right. Now, the special case and the special case is in case q i j is p i j in case the reverse probabilities are the same as the forward probabilities transition probabilities. So, if q i j is p i j then you see this equation q i j equal to p j i into pi j upon pi i this reduces to see you write here p i j it will be p i j. So, p i j into pi i p i j into pi i is equal to pi j into p j i. Now, if you look at the left hand side this says. So, you this is the probability of being state i and then this is the probability of transitioning from i to j. So, this is the rate at which the process transitions from i to j right. And in our case this is you know because I am assuming that currently I am in i state i and have transitioning backwards to state j. So, this is your probability the rate at which you are transitioning from i to j in the backward way and this pi j p j i. So, this is the probability of being in state j and then you are transitioning from j to i right. So, therefore, this is your x m equal to j and then you are transitioning to i. So, forward probability. So, this is the rate at which the process transitions from j to i. So, therefore, now you say that this Markov chain is said to be time reversible Markov chain with respect to time because the forward transition rate and the backward transition rate are exactly the same. And so now you can see that you know it is something like saying that if you play a tape then you will not be able to differentiate whether it is playing backwards or forwards this is the idea right. If the tape is the you know has captured the process of a Markov chain which is which has the time reversible property then whether you play the tape forward or backward it will exactly look like this it will look exactly the same you will not be able to make a difference because the rate of transitioning backwards and forwards is the same right. And this is the necessary condition for time reversibility. So, once you have that means if you have a set of transition probabilities and a set of and a set of probability state probabilities which we will show our stationary probabilities then and they satisfy this equation for all i j then you see this system the Markov process has the property of time reversibility. So, this is what we are trying to say right. So, and again just may be it is a matter of again repeating that you are saying that you are see here this is i or this we are saying is j and this is i. So, then you are going backwards or you are coming this way right when you are here you are looking backwards. So, then the transition the rate at which you transition is exactly the same as you were here and then you transition to i right. So, this is what essentially pictorially also this is what this equation says. So, this is a necessary condition and therefore, now we will show that the converse of this is also true. And then you know look at some examples of time or how exactly and of course, the other advantage that we will show that reversible Markov chain time reversible Markov chains possess. So, now suppose p i j s are given and s is a vector of probabilities such that this condition is satisfied which is your necessary condition for. So, we are looking at the converse what we are saying is that suppose you have a transition matrix and you have a vector of probabilities such that this condition the time reversibility condition is satisfied. That means the process that we are given the Markov process is the time reversible Markov process then. So, the process is reversible Markov chain then s is the vector of stationary probabilities. So, therefore, what we are saying is that in case you have a probability vector which satisfies the reversibility equations with corresponding to the p i j s which are your transition probabilities then the s i s can be nothing else, but the stationary probabilities stationary state probabilities. So, this is a convenient way of because. So, now we know that because we said that the condition that means we said that if s i s were stationary probabilities and these were the transition probabilities and these conditions were satisfied then we defined a reversible Markov process. So, now we are saying talking about the converse that if any probability vector along with this given transition probabilities for a Markov process satisfy these time reversibility equations then s the s has to be nothing, but the state probability vector this is what you want to say. So, suppose I start from here and then I sum up these equations with respect to i. So, this is sigma on sigma with respect to i s i p i j is equal to summation or summation with respect to i s j p j i. Now, since s j is independent of i. So, I take s j outside and this would be summation p j i over i, but then these being transition probabilities you are summing up the probabilities of rho j p j i with respect to i. So, you are summing up the elements of a rho and that must add up to 1 because these are elements of a transition matrix and therefore, this is equal to s j and so when you write down for all j this is satisfied. So, this gives you the matrix equation that s s is equal to s p and therefore, s is the because remember we said that when you do this and you have the condition that components of s add up to 1 then you have a unique solution and that unique solution is the vector of state stationary probabilities. So, therefore, we now know that any system if we can find a vector s and we have the transition probabilities for a Markov process satisfying this then s must be the s must represent the stationary probability vector. So, knowing this now the of course, the question is we will certainly want to look at some examples of reversible Markov chains and then we will show you that through this examples that you know computing the state probabilities becomes very easy and so you do not have to work out you know apply matrix methods iterative methods to solve for s because given this you want to know the state probabilities then you have to remember we solved system of linear equations, but when the process when the number of states is very large then it will be very tedious to have to solve these equations. So, now through examples we want to show you that computing these state probabilities is very simple and of course, in the process we also look at these examples. So, the idea is that now here let us look at an undirected graph with four five nodes and the links connecting them the arcs connecting them. Now, what I am doing is that I am writing probabilities that means transitioning from 1 to 2 to or 1 to 3 these are the two edges. So, I am giving them equal probabilities and that is why it is called random walk because you can wander around this graph and what we are saying is that if for example, 2 has 4 edges incident on it then it can you can traverse any of the edges with equal likely probably I mean traversing any or picking up an edge to go along is equally likely and therefore, I am giving probabilities like p 2 1, p 2 3, p 2 4 and p 2 5 equal to 1 by 4. So, it is when you are at node 2 traversing the h 2 1, 2 3 or 2 4 or 2 5 is equally likely. So, therefore, these are the probabilities and then similarly, p 3 1 is equal to p 3 2 is equal to half and p 4 2 is 1 and p 5 2 is 1. So, here from here you have no choice you have to go to 2 only and from 5 also you can go to 2. Now, let me define d i as the degree of node i. So, that means for example, for this the degree is 2, for this the degree is 4, for this is 2, this is 1 and this is 1 and then by the definition because of this definition you see that immediately since p i j is simply suppose you are at node 1 then your p i j is 1 by 2 because the 2 nodes are incident. So, this is equal to 1 by d i since we are saying that equally likely. So, d i into 1 by d i similarly, d j into. So, for example, if you are looking at 1 2 then here suppose i is 1 and j is 2 then this is half and d 1 is 2. So, this becomes 1 and then when you are here d j is the degree is 4, 4 into p j i 2 1 is 1 by 4 and therefore, the product is 1 here again. So, this holds for all i j and so now looking at this necessary condition is being satisfied. So, that means this random walk where you know you can go from at any node you can traverse any edge and go on wandering around this graph that will be. So, I mean what we are saying is that this is a Markov process and it is time reversible because it does not matter the process has gone on. So, wherever you are then again you start traversing and or you look back to your this thing to your traversals before this. So, it will be the same process there is no change because we I mean we interpreted this with the rate of going forward and the rate of going backwards is exactly the same right. So, once and of course, you can look at the numbers as I have written down here. Now, you can try to verify for all other nodes and arcs that these conditions are satisfied. So, therefore, this is an example and so now here we would want to convert the d i's into probabilities and so what we would do is so the probability of the probability of traversing an edge i j is equally likely for all edges i k incident on i right. And so now let me generalize this discussion and we will say that. So, then I will give you a process of writing down the corresponding state vector and how you define the transition probabilities. So, take a undirected graph now with n nodes. So, just take the general case and we will define the probability vector s by saying that the i th probability state vector is component is d i upon sigma d i. So, you take the degrees what we had defined here and now we just normalizing. So, essentially if you want to convert these two probabilities you have to just define this by the total number of edges which will be summation d i. So, you are adding up the degrees of each node. So, which will actually become so like for example, sigma i if you do it here for this case it will be the degrees are 6, 7, 8 and 10. So, summation d i is 10 which is twice the number of edges. So, when you add up all the degrees they add up to twice the number of edges in the graph. So, here we are normalizing. So, therefore this is d i upon sigma d i then s i's are probabilities because when you add up sigma s i, sigma s i this will be sigma d i divided by sigma d i which is sorry which is 1. So, these are probability vectors and as they will satisfy this because I am defining this is p i j as I am saying that p i j is 1 upon d i at node i whatever the degree of the node then I take the probability of traversing each of the edges which are incident on i as equally likely. So, it will be 1 upon d i. So, whatever the degree of node i and then all edges which are incident on node i I will take the probability as so i to j. So, this will be 1 upon d i and similarly p j i will be 1 upon d j. So, here we are at node j then whatever the number of edges which are incident on j then 1 upon d j and so p j i is 1 by d j. So, as we saw in this example and now you can easily verify that because you have simply divided each s i by this thing. So, therefore the equations will remain the same and so these will be satisfied. So, these this probability state vector and these transition probabilities define your satisfy your time reversibility equations. And so we will say that you know wandering around or this random walk on an undirected graph can be looked upon as a time reversible Markov chain right. And you see here one one did not have to do any hassle with solving a system of linear equations to compute your state probabilities stationary state probabilities. So, just simple formula gives you the way to compute them right. And this is what we really want to show that because of the property of time reversibility things become so simple fine. So, so this is finally our conclusion that s i's and p i j's satisfy the reversibility equation and so s i's must be the stationary probability vector. Now, you can generalize you can talk of a generalized random walk and here suppose what we are saying is that you have weights attached to the arcs. So, there is a weight w i j which is non negative for the arc i j and if the arc i j is not there or the edge I should say actually this should be called as edge. Because in the directed case it is the normal picture is that you call them arcs when it is when they have a direction. So, otherwise undirected links are called edges. So, this is edge i j and so w i j's are non negative and w i j is 0 if edge i j is not present right. So, we will discard that. Now, what we will say is that again we want to generalize this concept. So, what we will say is that probability of traversing an edge i j when at node i is proportional to w i j let us say. So, I have shown you the weights here for example, edge 1 2 is 1 2 2 5 is 2 and so on. So, I have given you the weights w i j and now what we are saying is that the probability of traversing the edge i j is proportional to w i j. So, obviously because these are numbers integers. So, they cannot be probabilities. So, I will have to normalize them. Now, so I do this I define p i j as w i j upon yeah one more thing I should have spelled out here that in this case in the random walk case you see what is happening is that your probability your s i's the state probabilities are being defined by this right. So, d i upon sigma d i and that means that remember state probability is the stationary state probabilities also represented the fraction of time the system spent on a particular state right. So, here since s i is d i upon sigma d i you see the system will spend more time in state in the state which has higher degree. So, the higher the d i the higher the value of s i because the normalizing factor is the same. So, therefore, the magnitude of s i gets determined by the magnitude of d i and so the system will spend more time in a state which has higher which has more edges incident on it. And of course, I should have spent little more time on the analogy see when we said that this is a Markov process. So, here essentially the nodes are the state of the system we are saying that these are the states in which the system will I mean occupied by the system and then the links are the gives you the transition from that means you can transition from 1 to 2 or you can transition from 1 to 3 and so on. So, the possible the possibilities of transitioning to different states. So, this is the analogy. So, now let us talk about generalized random walk and that is where we are saying that we will have weights attached to the edges and the weights will be 0 whenever the edge is not present. And then we will define the probability of traversing an edge as w i j divided by the total weights of the edges which are incident on that node. So, sigma w i k so the submission respect to k. So, you add up all the weights. So, for example, if you want to look at the probability p 1 2 p 1 2. So, the total weights here are 5. So, p 1 2 would be the weight of the edge 1 2 which is 1. So, 1 divided by 5 similarly, p 1 3 would be the weight is 2 here. So, 2 by 5 and p 1 4 is 0 and p 1 5 there is an edge. So, p 1 5 is 2 by 5. And so and now we have to define the state probabilities and to show you that again you know generalized random walk. That means, now the probabilities of traversing an edge when you are at particular node will be given by this. And therefore, this will again be a this is a random this is a Markov process where again the nodes represent the states and the links the edges give you the states to which you can transition. And now when I define for you state vector stationary probability vector such that the necessary conditions for reversibility are satisfied. Then this is also another example more general example of a reversible Markov process. So, you see the weights attached to the edges then we see that if I define my p i j as w i j upon sigma k w i k. So, now here the notion of you know of going to an edge is equally likely that has been replaced by. So, this is the weight of the edge i j and then divided by total weights of the edges which are incident on that node. So, then that is how we will define p i j and you can see that if all w i j are the same then this will be exactly the same. That means, if you just take this as I mean the number of edges which are incident then this p i j will reduce to 1 by the number of the degree of the node. So, this is the general this is the generalization of the random walk and so you will define p i j as w i j this. So, now we will if you write this as this then this will be sigma w i k summation respect to k p i j is w i j and of course, this condition we are imposing that w i j is w j i. So, then in that case and so again since I have been able to write this as this. So, w j i if you take the same equation w j i can be written as p j i into see the p i j represent p j i summation w j k summation over k because here it was w i k. So, here it will be the summation w j k k because you are at node j. So, from j you are transitioning to i. So, therefore, all weights of all the edges which are incident on node j which are of the kind j k. So, you add up all the weights of the edges incident on node j and this now. So, now once you get this then you see this is your reversibility equation because your p i j's are the transition probabilities and now I just have to define my corresponding state probability probabilities and then you see this will give me a reversible time reversible Markov process this is the idea. So, as I said that your s i's we will be proportional to summation w i k over k and so we will normalize s i that is you let s i be take the summation of all the weights and so sigma w i k with summation with respect to k divided by summation with respect to i and k of w i k total weight. And so therefore, by our result that we proved earlier s i's are the stationary probabilities. So, essentially the same concept go through and you can now take a general case you can assign any sets of weights to the edges and then you can define the corresponding transition probabilities and you will see that this will again be this will be generalized random walk. So, you can and you can very easily see that it is you know reversible in the sense that the process can go on and but if you start going backwards then again it will be the same process that is repeated. So, exactly the same forward or backward does not make a difference. So, therefore, in other words we can now get a feeling for the time reversible Markov processes and the converse will also help you to fix ideas better. Now, what we are saying is that any reversible chain is of this form. So, given a reversible chain we want to say that you will be able to associate undirected graph and give weights to the edges such that you know and then you can define the corresponding transition probabilities and your state vector this is simple. So, therefore, now see that means if you are given a reversible chain then this is the set of equations. So, that means there are some s i's and p i j's which satisfy this necessary condition. So, this is given to you that the time reversibility equations are satisfied by the state vector s and the transition probabilities p i j. So, some reversible chain is there. Now, we will start a sign we will say that we can draw a undirected graph and the nodes will be the. So, we can construct a graph with nodes as states and the edges i j for which p i j is positive. So, wherever there is a positive p i j then the corresponding link will be there otherwise it will not be there. Now, let me define the weights on the edges. So, w i j I will simply define as s i p i j and this again by the definition because same s j p j i will be w j i. So, immediately you get that the weights are symmetric. So, w i j is w j i. So, by using this equation now you want to compute the transition probabilities and which we will show can be done in terms of the w i j's. So, you want to compute the probability x n is i given that x n minus 1 is j. So, this because I am constructing a undirected graph and I am associating weights w i j. So, remember with the from the generalized random walk this transition probability we defined as w i j upon sigma k w i k exactly as here. So, since given a Markov process I am constructing a graph undirected graph where the nodes are the states and then now I have to and then the weights are well defined through this equation and w i j is w j i. So, once you have the weights then our process of you know generalizing random walk gives us that the probability of transitioning from I am sorry this should have been also let me write this as see it should have been I am writing w i j. So, this should be j and this should be i. So, from i to j you are transitioning and so the probability would be w i j upon summation w i k summation in respect to k. This is exactly what we have defined here and now let us substitute for w i j from here this is s i p i j and then summation if you sum up respect to j or k it is a dummy variable does not matter. So, you are summing up this s i p i k with respect to k now since i is independent of k. So, s i comes out and sigma p i k with respect to k is equal to 1 this is 1 remember transition matrix and you are summing up the components of a row. So, therefore, this is equal to 1. So, then s i s i cancels and of course, as I earlier said it and I again repeated that s i's are not 0 because if an s i is 0 then the probability of being in that state is 0 and so we can always reduce we can remove that state from the process and come talk and work with a reduced process right. So, therefore, of course, these are meaningful only when s i's are not 0. So, s i gets cancelled and you are left with p i j. So, that means once you given this then I can assign the weights by this equation and then once I have these weights I can now define my transition probabilities in terms of these weights right w i j upon sigma w i k and once I have these transition probabilities I can also define my s i's they just reverting back to the process. So, here s i's were this and so similarly we can say that from here summation w i j is summation j is equal to summation j s i p i j. So, this becomes this and therefore, this is s i. So, here your s i's are proportional to summation w i j some with respect to j and since s i's have to be probabilities I can normalize them. So, define by the total sum of weights and so this gives me probabilities and so my this thing is complete that means given any Markov process which satisfies the time reversibility equations I can assign random walk with it and assign weights I can define the weights I can define the transition probabilities and the state probabilities. So, therefore, any time reversible Markov chain can be modelled as a random walk and you can determine the weights and the you can determine the transition probabilities and the state probabilities and so this is a very simple in the sense that now you really do not to compute your these and this you can do it with respect to you know we do not have to solve system of equations and so this simplifies. But of course, this is only a small class of processes Markov processes which would be which would satisfy time reversibility condition. So, I think this brings to an end of course, I should also just mention that the non-reversible Markov chain examples one example and this is taken from Berstein's lecture you know at Harvard he has given lectures on Markov processes Markov chains. So, he says that you know worldwide web so you can imagine you know each web page as a state of the system and so web pages are states and edges. So, again you can picture this as a graph, but this will be a directed graph. So, for example, just take 4 web pages or maybe you can take 5 web pages does not matter and then you see it is like if you are at page 1 here then you can go from here to page 2 or you can go from here to page 3.  So, therefore, and this is a very small example because you know the millions and millions of web pages and they will be connected and it is you know anytime you open a page it will link you to hundreds and thousands of pages. And of course, there is a way of ranking and so on all that algorithm is there, but in any case. So, the whole idea is that you can picture this as a directed graph. So, each node will be a web page and the pages which are connected to a particular node will be directed by a link. So, for example, from 1 you can go to 3, but you cannot go from 3 to 1. Similarly, you can go from 1 to 2, but you cannot go from 2 to 1 and so on. But at 4 you can go from 1 to 4, 4 to 1 and similarly from 4 to 2, but not 2 to 4. So, you can immediately see that this will not be a time reversible process. Of course, there is algorithm to show you and then how do you compute the state probabilities and so on. Again there is a whole algorithm interesting one which gives you a method of not actually having to solve system of equations again and you can compute the state probabilities and so on. But there is a way of computing the transition probabilities also. So, example web page is worldwide if you look at this then this will be I am searching on the web is not a it will be a Markov process because it will depend on see the where you are just the probability of where you want to go will be this probability will not be dependent on how you reached one. So, it is easy to picture that the search on the web will be a Markov process, but it will certainly not be reversible Markov chain. So, I think with this I would like to end the discussion or this thing on Markov processes and now you would like to talk about continuous Markov processes and then go on to specialized continuous Markov processes. See after having looked at the discrete Markov time process Markovian processes stochastic processes discrete stochastic processes with Markovian property. So, we have spent quite a bit of time on looking at the properties and characteristics of such processes. We will now be looking at because again the continuous time processes are also very important and especially the Markovian ones and would like to now through a series of lectures show you the particular kinds of Markovian continuous time processes. So, and so want to show you the transition from discrete time processes to continuous time processes and same and how the Markovian property also translates when you consider time as varying continuously instead of discrete time. So, we say that a continuous time process we describe it with as x t x is the random variable. So, x t comma t greater than or equal to 0. So, this is as t varies you get different values. So, and since t is greater than or equal to 0. So, it is simply varying continuously the time is varying continuously and we say that if continuous time stochastic process taking on values in the set of non negative integers. So, these values would be positive integers non negative can be 0 also and the property the process is Markov process if for all s and t your and non negative integers i j and x u where u is varying between 0 and s. So, these are all non negative integers probability that x t plus s is j given that x s is i. So, at time s the system is occupying state i let us say because these are the non negative integers. So, we have the non negative integers describe the state it is occupying. So, this tells you the state the value of x t will tell you the state that the system is occupying at time t.  So, given all the past history that means the states which the system occupied from time 0 to s then at time s it is in i and now at time t plus s it is in j. So, this probability is equal to the probability that x t plus s is j given that x s is i that means this past history is redundant you. So, you do not want the probability this probability will only depend on this that means what is your present state and then after time t it is occupying state j. So, this probability is independent of how you reached a state i at time s. So, that means whatever happened between 0 and s is not is immaterial. Now, which I am saying in words here that is the conditional distribution of the future x t plus s given the present x s and the past depends only on the present and is independent of the past. And this property and of course and if this probability is also independent of s that means it does not matter what time and if you remember the condition we were saying for stationarity that we were saying that probability in the discrete case we were saying that x plus 1 is j given that x n is i is equal to probability x 1 is j given that x naught is i. So, the same property that is so it does not matter when you are considering this conditional probability whether at time 1 or at time n plus n plus 1 does not matter. So, then we said that in this case these the system or the process is stationary because it is independent of the time. So, same property is being carried over here. So, if this probability is independent of s. So, essentially you are saying that no matter s is 10th day or 15th day or the 0th day does not matter if in the 0th day the system is occupying state i then at x t at x t it will be j and this will be the same no matter what time s takes. So, if this probability is independent of s then we say that the continuous Markov process is stationary. And now just let us consider the finite case that means the system it is a continuous process but it can occupy finite states i varying from 0, 1 to m. And now we associate a random wearable t i which is the amount of time the process spends in state i. So, it continues to be in state i and how do you sort of express this property or how do you describe this t i. So, we say that suppose the system enters state i at time t prime equal to s. Then for any fixed amount of time t greater than 0 this greater than t will be possible if it has been continuously that means if x t prime is i for all t prime in the interval s to t plus s. So, at time s it started it entered the state i and now you want to know for how long it will continue in that state that means for all values of t of t prime between s and t plus s this value should continue to be i. So, this is the kind of random wearable we want to. So, the amount of time the process spends in state i. So, these are the important thing and we have just now said that and we say that this is a Markovian property with stationary probabilities implies that probability i greater than t plus s given t i is greater than s is the same as probability i greater than t because I can take s to be 0 and then this will simply be that initially it is state 0 and then now it is in continues to be state 0. So, the probability in that case amount of time the process spends in state i. So, I will take the time s to be 0 sorry it is not the state. So, s is 0 then simply you started in state i and so it will be independent of when you are considering this probability. So, that means only the duration of occupying the state i that is important it does not matter. So, it does not matter at what point of time you are considering this. So, essentially this just means that the process has been in time in state i for time t. So, therefore, this is now this is the that means t i is memoryless. So, the kind of continuous that means when you take the continuous process and you impose the Markovian property then it actually translates to saying that this random variable t i is memoryless. And if now you remember of course, we did not prove this part when we talked of exponential distribution negative exponential distribution we said that any random variable which has a negative exponential distribution is memoryless and exactly this property. That means t i would be and because the course level was such that I could not prove the reverse thing that any distribution having a memoryless property has to be negative exponential. I did not prove that part, but may be later on sometime when you do an advance course you can see how that property is proved. So, in any case since this is a Markovian process memoryless. So, therefore, t i will have a negative exponential distribution. So, now I will be describing to you talking about Poisson processes and then birth and death processes very interesting and they also model lot of situations in practical life. And lot of processes you can show have this property approximately of course, you cannot say that you can always model the real situation very accurately. So, we will be talking about and so then see I will be referring to birth and death processes as mm 1. So, it will be that the arrival process is Markovian and the departure process.  So, you want to model that situation. So, here you describe such processes by mm 1 property which means that you know the arrival process. So, you can actually show that if the arrival pattern is Poisson then the inter arrival times will be exponential. And so the inter arrival times have a Markovian property then the service times will also be shown to be under the conditions of course, the conditions that we will impose will be this thing. So, they will under the service times will also follow an exponential distribution. So, we will call it mm and then 1 server. So, this is the connection and therefore, you see that why it was very important that I talk about discrete Markov processes and then continuous Markov processes which again have the same property Markovian property. In this case can again be written down as this and this will be the memory less property which implies that the T i has a negative exponential distribution. So, the birth and death processes that we will consider will have the same problem under this we will consider the birth and death processes where the inter arrival times follow have a Markovian have a negative exponential distribution and the service times also have a negative exponential distribution. So, then we can very easily describe the system to be mm 1 with 1 server and of course, you can also consider more than 1 server and we will derive lot of interesting results for the parameters related with such distributions.


Alrighty, I will call the meeting of public works. Sir, we'll start with roll call. Alder Heidemann. Alder Heidemann here. Alder Rust. Present. Alder Remy. Here. Alder Salazar. Here. And Alder Decker is here. Let's start with the pledge of allegiance. I pledge allegiance to the spirit of life of the United States of America and to the Republic for which it stands one nation, under God, indivisible with liberty and justice for all. I think everyone knows everyone here, so I think we can skip the introductions. We'll move to number five. Proof of minutes from July 1st. I move to approve. Second. I'll submit in second. Any discussion on those minutes? All those in favor? Aye. Aye. None opposed? Chair votes aye. Those are approved. Okay, number six. General Ordinance number 14-2324, July 17th, 2023. In Ordinance repealing article 14-3, article 14-4, article 48-3, article 48-6, and creating article 48-8, so as to simplify regulations for utilizing public property. I will speak to this matter. So, staff has been working for, as long as I have been employed by the city, to update various aspects of using public property. Parks, sidewalks, other rights of way. We have had a lot of ongoing complaints about our process of being confusing and complicated, so this was an effort to streamline everything to make our user friendly. So we are, there's a lot of changes and I'm not going to go through all of them as far as the complaint of relating to encroachments on the sidewalk cafes and things like that. We're now changing it from use-based to duration-based. So we don't necessarily treat different uses differently, treat them differently based on if they use the space up to 90 days or 90 days or greater. You will be seeing in the near future, proposed fee schedule update that will go along with this. Our goal is to have this completely approved in time for the day when we open up for reservations for the next year's events. I'm open to questions. We'll have questions. Thank you, Chairman. What's in place now? Is there anybody that's, the change, does that affect anybody in a negative way that's twice done it for the last 50 years? So there's somebody who can come back and say, hey, why did you change it? I ought to do this. I understood everything what my responsibilities were and now you're doing this to me. There may be people who felt they understood everything, but there were a lot of people who felt they didn't. A lot of people would complain that they didn't know, if I want to put a planter in front of my business door, do I need a permit for that? If I want to put a bench in front of my window, do I need a permit for that? Our ordinances weren't clear. Now it is clear. What do I need to do for a sidewalk cafe? What do I need to provide to the city, get it approved? What are the restrictions for having a sidewalk cafe? Now it's clear. So I can't envision a situation where someone is going to complain that these changes impacted them negatively and if there is a situation that comes out, I would ask you to refer that to me so that we can review it because maybe there's something we can consider. But our goal was to make this better for everyone. And I understand that. So the chief is not involved in that. So does anybody from any outside organization that's gonna say, hey, listen, we were never involved or we can actually help implement this? So the business improvement district was interested in seeing these changes go through. Then that was staff right before I got hired, I think. David, were you involved in that meeting? I was early on, but then I think Dawn and Heather and some of the other staff, there was some dialogue back and forth on some of these changes. And for the most part, we took all of their comments and it's a much more user friendly, positive versus that in the past it was, this is way too confusing. No one wants to do it. They don't want to deal with you. That's why nothing ever gets done. Well, I guess. So that's the impetus to get where we're headed. Was you always the chance to trick someone into doing something that they weren't supposed to be doing and then we could love you to find out? No, unfortunately, the old way was so poorly structured that we had limited awareness and had a lot of people who would do things. So like a very common example that we would see would be like a board sign placed in the side of history that would have required some type of permit because putting something cities right of ways, pedestrian access point needs to comply with the ADA. Before the big things, in which there's landowners and benches, we also had a privilege. Just once you started to do the longer duration of the large, large, electrical. You also have questions. I just want to say I'm going to put people on this. I'm going to need to make it easier for the businesses to have a business that we don't have to work with. We want to work with businesses we want to be able to make smooth as easy as possible and make the business. How will this get communicated out to, like, will the bid be sharing the businesses or the data from the front sells peer? I'm not sure. I'll have to talk with the mayor's office about putting something out of social media in addition to the bid. They brought, I've had communication with Heather Cleveland who's working with the bid on this issue. But as far as like a media campaign, we thought that through yet. And I think, Heather, in the office, we're also, as part of this, we're having some new software that will be available for online rentals of parks and online transactions. And a part of this is part of that rollout, we're going to roll these permit applications as well and have it all basically available, interactive and a lot more cleared for people to, instead of having to pick up the phone and ask, well, where do I go for this? So who, who should I need? I understand for the park rentals. I'm specifically talking about, I'm being a little selfish of like my district of businesses who aren't going to kind of necessarily go to your website to rent a shelter. Some of these things are, from the tech side walk to your, you know, the A-Frames, some of this isn't turn rental based, it's business based. Correct, but there's still some of it will need a permit and will be managed through this permit system. But we'll, we'll work with like the big district, we'll push all this new information out, we'll have a flyer and we'll have information on there about the new, the new regulations and how it will be streamlined. And if you have any questions, this is the process. Okay, yeah, okay. And then I do just want to comment briefly there will be, we'll be asking for an amendment to this. We had one more staff meeting today and caught something. So we'll be asking for an amendment today as well. That's right here. So. Okay. Okay, any other, okay, for a motion. I move to approve. I'll second. Okay, motion is being seconded. And then we also would need an amend move to amend. So the section 48 reads as follow, 48-95 reads as follows. And I'll just skip this, you have that one down. It has a copy already. Oh, okay. No person shall encroach upon, occupy or construct or encumber any public street or highway or park thereof unless expressly authorized to do so by the common council or by permanent in accordance with this code or a specifically allowed by state law or another section of this code. No encroach or you reduce the pedestrian path to travel less than it continues with a five feet or extend into the frontage of adjacent properties. So the amendment to this is adding, this is our prohibition subsection, right? So this is how we're going to be enforcing citations. And we're adding that you can't encroach into the frontage of your neighbor's property. So if I own this parcel and I want to put a sidewalk cafe in front of it, I don't permission to put a sidewalk cafe the entire block long.  Yeah, that makes sense. Unless they get permission from their neighbor or no. We would need to see some. I would expect that the neighbor would submit a request as well. I can't envision a situation where we don't try to think. I think most people want that. Most businesses want the deep boundaries. Yeah. Yeah. I was trying to think there was round. I think it's good. That's fine. So we need that amendment to that also. I move to approve the amendment. Second. Most made an amendment. Well, first we'll vote on the amendment and then we'll vote on the entire thing. So we're all in favor of the amendment. Aye. Any opposed? Chair votes aye. That goes on to us. And now we will vote on the entire process. All those in favor? Aye. Any opposed? Chair votes aye. It is approved. Don't you have to read the whole thing though? No. No. Do you have? I was reading them all. You have like four hours? I was reading them all. Okay. That was all we had on the agenda. Next meeting date is August 15th, 2023. So you guys may be exhausted today, but you need to motion to adjourn. I move to adjourn. Second. Second. All in favor? Aye. Aye. Opposed? Chair votes aye. We are adjourned.


at the people and you have a new very big PC this is not a mini PC anymore it's a big PC right yes firstly we have introduced our family first version was x8 with seven inches second version was a 8.9 inch and third version is a 10.8 inch we call this a X10 X10 so this is a nice big display what's the resolution the full HD 1920 full HD and it's nice touch yes so it's a very high quality Windows experience right here and what's the CPU CPU is changed here so it's a Z8300 Z8300 and so let's see the connection we have a lamp port we have HDMI outputs we have a totally for USB to here the other two years we are on the side here yes one is USB 3 speed yes and one Michael some buttons my course these slots but speaker speaker we have a two loudest speaker yeah 1.5 watts and what is this so this is a TV nice optional it's a serial port for some industry use so your product has been used a lot for industrial already yes so some industrial customer they love to use this well this is a multi multifunctional products you can use this as a mini PC as a desktop tablet you can also use this a media box or to watch it streaming also you can use this as a smart home control center or IOT control center or you can build in this into the car and anywhere this is also a kind of all-in-one PC because this is a touch panel all right and the price is good price is good compared with all-in-one PC is much cheaper even the big one yeah big one is also a good price yeah but it's a is it heavy or it's not so heavy right it's a heavy compared with this is a tablet but a bigger than Tabry and but with a more USB and lamppost this is a mini PC but it was displayed this is all-in-one PC but with battery so the definition of this product is a question yeah some battery right now how long is battery life battery life could be up to six hours six hours all right so this product is very stable your your this category yeah it's very special market we are saying we are so we created three version already and it's not the first generation you had the previous generation is a set generation or third generation yes all right so how soon is this available it's already in the market so people can already buy X10 yes all right what's the retail price right now you tell price it will be around $199 the Wi-Fi connection is good yes this is nice big antenna right here is a bigger antenna right cool so available worldwide yes and distributors and everybody can come touch it this is Windows OS yeah and how about the RAM and and flash the RAM is 4 GB fresh is 32 or 64 GB all right there's only 4 GB version you have 2 GB RAM also 2 GB is we can do by request all right so 4 GB RAM and with a Windows 10 license everything is in here


The form in a bin will bite. Deleted levels in video games have always been a source of fascination for gamers, and one of the best known examples of them is the four deleted zones in Sonic 2. Get in Palace, Wood, Dust Hill, and Genocide City slash Cyber City are all listed on the level select screen of a publicly available Sonic 2 beta. Get in Palace and Wood Zone can be partially played, and there is an old preview picture of what is believed to be Dust Hill. Genocide City however, is a mystery. Selecting it in the beta will simply load a blank screen where Sonic will instantly fall to his death. The lack of information and excessively threatening name have made this zone one of the biggest mysteries in gaming. Recently, I came across what was claimed to be a more complete beta of Sonic 2, which had all the missing zones intact and fully playable. I was skeptical that such a thing would exist, since most deleted levels are cut because they were never finished, but the download description claimed every zone had been completed, and removed for an unexplained reason. I started playing the beta, aside from Tails not being present in gameplay, the game initially seemed identical to the final version. After completing Emerald Hill and Chemical Plant Zone however, I ended up in Dust Hill. Dust Hill was pretty similar to the lone screenshot of it, a standard desert themed level. The oddly slow banjo music in the background was a little unsettling, but everything else felt just like a normal Sonic 2 zone. The Robotnik boss was his standard vehicle with robotic arms holding six shooter guns, although they fired the standard energy bullets. After Dust Hill, I went through aquatic ruins, Casino Night, and Hilltop Zone with no differences from the ones in the final game. After Hilltop, I entered Wood Zone.  The music had a tribal feel to it, Robotnik was thought on a few floating platforms above a spiked pit, he used an axe attachment to his vehicle to eliminate platforms and attack you. In Mystic Cave Zone, I noticed the first difference from the final version besides the added levels. I collected the seventh Chaos Emerald in it, and didn't get any message about Super Sonic, just a Sonic Got Them All message. I couldn't turn into Super Sonic either. After completing Oil Ocean, I went to get in Palace Zone. It was pretty much like the version in the well-known beta, nothing unusual until I got to the end of the second act. Tails was tied to the Master Emerald, Robotnik was hovering above him, doing a laughing animation. Sonic turned into Super Sonic, and ran past the Master Emerald, grabbing Tails, right before Robotnik fired a gigantic beam at the Emerald, shattering it. I got a message saying Sonic saved Tails, and the screen faded. Metropolis Zone started, I could change into Super Sonic with 50 rings now, and Tails was following me. The rest of the game was just like the normal version, Genocide City Zone never showed up. Confused about Genocide City's absence, I looked around online trying to find information about the version I had just played. I couldn't find anything, so I decided to try replaying the game without collecting the Chaos Emeralds. Everything in the game was identical until I reached the end of Head in Palace. Tails was still tied to the Emerald, Robotnik was still above him. Sonic ran to the Emerald to try and save Tails, but Robotnik fired an energy beam diagonally, knocking Sonic back. Robotnik fired his huge beam at the Master Emerald, getting Tails this time. I heard a loud high-pitched shriek, which I guess was supposed to be a voice sample from Tails. When the beam went away, Tails and the Master Emerald were both gone without a trace. Robotnik did a laughing animation, and flew away. Sonic did an animation I had never seen before, where he fell to the ground and just lay there. The words, you couldn't save him, appeared on the screen, and the level faded out. The next zone, as I was expecting, was Genocide City. When it loaded, it was a blank screen, just like the well-known data. Sonic fell to the bottom, and died. I had 14 lives when I reached it, and this falling sequence repeated itself 12 times. When I was down to one life though, the level finally loaded. The best way I can describe the graphics is a combination of chemical plant and metropolis zone, with many objects in the background on fire. The music seemed like a remix of the title screen music, but played with nothing but deep bass tones. There didn't seem to be any rings in the zone, so being down to my last life, I proceeded with caution. There didn't seem to be any enemies in the zone either, in their place were the sprites for the animals you free from batmicks, lying on the ground, not moving. More and more animals appeared as I went deeper into the level, soon the floors were covered with them. The only challenges in the level were some simple platforming sequences, had to jump over gaps in the floor that lead to a burning fire at the bottom of the screen. After going through what felt like a normal Sonic 2 level in length, I reached the goal sign. There was a small gap in the floor before the sign, after touching the sign instead of running to the right like he usually does. Sonic turned around and just looked in the direction of the gas for about 30 seconds. Then he ran into it, falling to his death. I got the game over screen, I had forgotten that I had earned a couple continues earlier in the game. I selected the yes continue option, but I heard a near-splitting buzzing noise, like games do when you choose a menu option you aren't allowed to. I tried a couple more times, but the game clearly wasn't going to let me continue. I finally chose no, and got a game over screen similar to the bad ending in Sonic 1. Except instead of juggling emeralds, Robotnik was juggling the bodies of the creatures you free from Badniks. I had to reset the game to get away from that screen. I was disturbed by what I had just seen, this certainly explained why Genocide City had been removed from the game, but I couldn't imagine what made Sega even consider doing something like this. Even though I had already played through the game and got in the good ending, I felt like I had to do it again, that I couldn't leave the game the way my second playthrough had ended. So for the third time in one day, I started the Sonic 2 beta. The first oddity was the title screen. Tails was gone from it, Sonic didn't seem to notice, there was just a bit of empty space the circle both of them are coming out of. I started the game, and it seemed normal until I collected 50 rings and entered the first bonus stage. Instead of rings coming at me, wave after wave of bombs appeared. I dodged them for as long as I could, but finally got it. Instead of doing his ring losing animation, the 3D Sonic model did a death animation, and the bonus stage ended. The results screen listed zero for every stat, but the message at the top was different, in solid black text. You can't bring back the dead. Getting really scared at this point, I collected another 50 rings as quickly as I could, but the bonus stage I entered was identical, ending with the same message. I deleted the beta from my computer, and downloaded it again, so I could get the good ending again. I nearly screamed when I saw the title screen without Tails on it, and as I feared, I got the impossible bonus stage again. But this time, the message was different when I lost. You can't reverse your mistakes. I was terrified, and was clinging to the irrational belief that if I could just get the good ending again, everything would be better. I went on a different computer, downloaded the beta, and got the same title screen. Acting on baseless instinct by this point, I went into the bonus stage again. The message this time. You have to accept your mistakes. I deleted the beta from this computer as well. I realized that the computers were sharing an internet source, that there was a possibility this was some kind of trick or virus. I went to my trusty Genesis, took out the Sonic 2 card I had had for 17 years. If I could just see Tails in it, I knew everything would be okay. But I still haven't gotten up the courage to risk it. Every rational part of me knows the beta couldn't possibly affect my cartridge, but I'm too afraid, afraid of what will happen if I see the title screen without Tails in it. I dream about it every night, but I just know that it could get so much worse. It had been about two weeks since I had played the Sonic 2 beta, I had kept dreaming about it every night. The dreams were getting worse and worse, I was waking up from them covered in sweat, I couldn't get back to sleep, I was too tired to function during the day. I knew I had to try my Sonic 2 card, it was the only way I could move past this. I was too afraid to try it by myself however. I invited a friend over, and not wanting him to think I was crazy, I casually suggested playing Sonic 2. I turned on my Genesis, heard the familiar... voice, and then the title screen came up. Tails wasn't in it, and I screamed at the top of my lungs. My friend was understandably startled, and asked what the hell was wrong with me. Barely holding back tears, I blurted out the whole story in a barely coherent babble. When I was finished, my friend just stared at me for a few seconds, then spoke. What are you talking about? Tails was on the title screen, just like he always is. I wasn't able to respond, somehow this made things seem even worse, now I wasn't even sure if it really was some kind of curse, or if I had just gone crazy. I sat in complete silence for a few minutes, my friend made up an excuse about having to be somewhere and left, I can't blame him. After the initial shock wore off, I tried actually playing the game. Tails wasn't there, and the bonus round was impossible. I got this message after losing. You can't run from your failures. I had absolutely no idea what to do at this point. I considered checking myself into a mental institution, but that last message about running from my problems made me afraid to ignore the game. Thinking about the messages, I decided I only had one option, even if nothing good was likely to come of it, I had to play through the game again.  Aside from the lack of Tails and bonus stages, the first two zones were completely normal. I wasn't surprised at this point when Dust Hill came up after Chemical Plant, but after going a few screens into it, I saw something new in the background. Tails, hanging from a noose on one of those old West style stands you see in Hangman games. This image would repeat itself in the background every few screens worth of scrolling. When I got to where I had thought the boss before, there was another image of Tails being hanged in the background. Robotnik wasn't in his special boss vehicle, just the generic Sonic 2 floating vehicle he makes his escapes on. He did a laughing animation, and flew away. There was no victory screen, it just faded out and went to aquatic ruins. The zones that are in the final game were normal, but when I got to Wood Zone, there was another change. I had noticed textures in the wood that looked like faces on my first two playthroughs, but now they were much clearer, Tails' face, in a twisted screen. These were carved everywhere in the level, when I got to the boss the biggest carving yet was in the background. Again, Robotnik just did a laughing animation and left, causing the screen to fade out. Mystic Cave and Oil Ocean were normal, then I reached Get in Palace. Get in Palace had changed a lot more than Dust Hill and Wood Zone, there was no music at all, and no enemies either. I walked through to empty levels, until I reached the part where Robotnik had killed Tails. Nothing was there, not the Master Emerald Tails or Robotnik. Sonic went into his despair pose from when Tails had been killed, and stayed like that for about 30 seconds, until the screen faded out. Genocide City started, and it too was very different. This time it was filled with enemies, demon-shaped robots covered in fire.  There were also lava spots shooting up from the bottom of the screen, and fireballs falling from the sky. This was one of the hardest platforming levels I had ever played, but after several deaths I made it to the goal sign, which still had the floor gap next to it. I touched the sign, and this time I did the trick that lets you control Sonic during the end of Levels Portale. It worked, and Sonic didn't run into the pit. The victory message was in that familiar black text. It won't bring him back. The screen faded, and Genocide City Act 2 appeared. The graphics were different here. The fire had burned out, replaced by ashes and soot covered ruins in the background. Again, there were no enemies, the corpses of the animals that became Batmanx had returned, but this time they were all laying in a pile of ash. Also like my first visit to the Zone, the only obstacles were some small gaps in the floor. This time they looked like holes that had been burned through it. I reached the end of the Zone, Robotnik was in his vehicle, at the right end of the screen, about Level with Sonic. He didn't move, so I attacked him. He made the usual flashing damage animation, so I kept doing it. After 8 gets, he still hadn't reacted or been defeated, but the black text appeared again. What do you hope to accomplish? Not sure what else to do, I kept attacking Robotnik. After a few more hits. Killing him won't bring your friend back. I continued to attack Robotnik, the message changed every few hits. You let him die, that will never change. Revenge won't soothe you forever. Like the past, he is lost forever.   You have no one to blame but yourself. Take responsibility for your failure.  After getting all these messages, I got an idea of what the game wanted me to do. Instead of jumping at Robotnik to attack him, I walked into him, causing Sonic to take damage and die. One final message came up. You have paid the only acceptable price. The game reset, and the title screen came up. This time, Sonic wasn't there either, there was just an empty circle. I started the game, and the screen the common data sends you to when you select Genocide City appeared. There was no timer, no Sonic falling to his death, nothing. I turned the system on and off and tried again, the same thing happened. I tried the beta on my computer, same thing, same screen. I tried another Sonic game, it was the same, everything in the series had erased him. I haven't tried to play a Sonic game in quite a while now, but I see that one screen every time I close my eyes.


Let's have a look at a situation where things are moving in more than one spatial dimension. Supposing I have one mass heading in one direction with some velocity. We'll give it velocity v1 and we'll say it has mass in one. And we have a different particle and I'm going to call this particle 2. It's going to have velocity v2 and it's going to have a mass m2. I know I'm not being very imaginative but it's much harder to mess up when you have such a boring naming system like that. And those two particles are going to collide with one another. And when they collide they're going to stick together. And so I've got a before diagram and an after diagram. Now I suppose these velocities are all vectors so I should give them effect notation. One of the really handy things about drawing diagrams is it lets you mark the symbols. So for example I gave that v1 and v2 and called this having mass m2 and this having mass m1. And the diagram makes it very clear to me well is what and that's a very useful property of doing this. And so I need to put my mass for this thing and that's obviously going to be the two things stuck together from conservation of mass in 1 plus m2. And if I want to find out for example how fast this is going and in what direction then I'm going to need a conservation law because tracking the individual forces involved in those things sticking together is going to be very messy. And so what I can talk about is I can talk about the conservation momentum. So I know that the momentum before and the momentum before is made up of two pieces because we have two particles. The momentum before is equal to the momentum afterwards. I'll call that p final. Now the momentum before is made up of the mass and the velocity. And again this is because we are working non-relativistically here. Okay now the important thing to realize about this equation here or indeed about this equation here are that these are vector equations. Well there's a couple of ways of looking at that. First of all you could say well the magnitudes of both sides have to be the same and the directions of both sides have to be the same. Or one of the more useful ways of looking at vectors is you can break them down into their components. And so what we could say is that the x component of these two vectors added together has to be equal to the x component of that vector. Or we could say that the y components of those two vectors added together has to equal the y component of that vector. Or the z. And if I'm going to be talking about x to y then I should have an x and y in my diagram so I know which is which. And now I can start to do this. So we'll start with the x component. Now up here this velocity v1 is going exactly in the x direction. And so the x component of it is going to be its full magnitude of v1. And up here the x component of this one is actually zero because v2 is going in the y direction. And so we've got an equation for the x component of v3. Now let's do the y component. And now the y component of this one is zero. And the y component of this one is precisely v2. I make sure that this one is going in that direction and that's where I've defined my y. And so I've got to make sure that I don't get a minus sign from that. But in this case v2 is going in the positive y direction. And here I have an equation of motion for the y component of v3. And so I have two unknowns, two equations, I can work them out. Now once again we do a quick check of units. We've got mass divided by mass, so that gives us nothing. And we've got velocity equals velocity. So that works well. And it's fairly obviously the same on the bottom line. Let's also check limits. There are lots of limits we can pick. So to start with let's assume that the first mass isn't moving, which means the second mass just goes straight up into it.  So if we look down at our equations down here, if the first mass wasn't moving, that would be zero. So this would be zero. And so this thing here would not be moving sideways, which is correct. And it would be moving straight up instead. However, if this mass say was zero, we'd expect no matter how fast it was going, it wouldn't really change the trajectory of the first particle. So if we go down here and set mass two to zero, then what we get is that this is zero, because the top line there is zero. And so we'd find that it would be going only in the horizontal direction. And indeed it'd be going the same velocity it always was. So in other words, if this had zero mass, even when they stuck together, the velocity of the first mass would be unchanged, like a tiny insect running into a truck. And that's exactly what our equations say is the limits look good. And if we wanted to work out the angle of which these two masses move after they stick together, then we can easily work that out in terms of the components because what we have up here is the y component of velocity. And the x component of the velocity. And so the tan of theta is going to be the ratio of those two, which is just going to be... And so you can see that the tan of that angle is just going to be the ratio of the momenta of the two particles.


All right Welcome to today's habit of code Wait, am I hurt? Yeah, I think so All right, I think it works All right so Today we're gonna be doing some We're gonna be doing some Advertisement code again We did yesterday Took us a while to get started, but We managed so Today Let's see what we can do We're not gonna be too long today, I think I mean usually we take like Half an hour hour like the first days are very easy, right? But then It gets progressively harder. All right, let's look at today's task. Oh, and also, yeah, I updated my GTC Got new Haskell language server. So Everything works right this time Probably don't need it like we didn't need it yesterday, but yeah, it's nice to have some ID support, right? All right So what's happened so far is that the elves were traveling through some forests? Wasn't quite sure why actually, but We're waiting to Let's actually go back in. Yeah digging to the lower a bit Yeah, so we're So where does this actually say the lower right like we just get Some calorie. Okay, we're going to the annual expedition to the Grove Where the fruit grows? Okay, I mean, this is not as good lore as before right there was better kind of our saving Santa We're helping said now. She's like, oh, we're gonna trip to collect food Anyway, maybe there's a twist. Maybe the lore will improve, but you know This is more about the gameplay and not the law all right, so we're on our way there and And now the elves have set camp up on the beach and they're gonna be playing a rock-paper-scissors tournament Okay Right, I mean we now rock paper scissors work. Okay Scissors to face paper blah blah blah Appreciative of your help yesterday one of y'all gives you an encrypted strategy guide. Well This will be sure to help you win the first column is what your opponent's gonna play a for rock B for paper C for scissors The second column That's all the elf is called away to have with someone's tent The second calling your reason must be what you should play in response X for rock why for papers have a system Winning every time would be suspicious. So the responses must have been carefully chosen The winner of the whole tournament is a play with a highest score your 12 scores some your scores each So we get this So you're on the score for the shape you selected one for rock for paper scissors Plus the score for the outcome of the round Okay, so let's calculate the score From the strategy Uh-huh, so I'm guessing now we're gonna be calculating it based on this one And then we're gonna be trying to find like an optimal strategy Sounds good. All right, so let's copy this input in there I have fully Already created Like the framework file, you know some prep goes into these Streams, right? All right, so let's say example All right, paste it Okay, so I guess We are just gonna read the input. Okay, so Um Read input just gonna take the in the file path and then give us an IO of Pears of Let's just say I'm calling moves. Okay, let's define data moves equals Rock or paper or a scissor Driving show eq or don't let just Okay, so we're gonna be giving a pair of moves comma moves. Sorry Now let's write the function that goes Esther to move So we could just go character to move, but we're gonna do it like a string to move a Is equal to a for rock be for papers a for scissors g equals rock e is gonna be Scissor Esther to move She is gonna be I don't know be for paper, right paper and then Okay, and now let's make it work for our moons x no X for rock why for paper said for scissors, okay said Read input equals do okay, so F is gonna be read file We're gonna do line read file Okay, this is gonna be file name read file filing, okay You know we could be clever here, but let's just not okay Let ours line, so it's gonna be a three character string so it's gonna be C and then space and then Column let's call this so you call them one and then column two and then empty string C1 comma C2 now. Let's actually change this to Characters Chop to move Okay, this is oh This should be a move, okay now and then we do And then we do a square parsed line Equals this so there's no safety here, but that's okay a map parsed line Boom now. Let's say just see what it says Read input Example into Print what does it say? Okay, we need to go GC see we got the fancy one 9.4.2 that's good stuff Alright, we run G8 C let's go Day 2.HS 3, oh day 2 and then we're gonna run day 2 Rock paper paper rock scissor scissor So it was okay, so I got the moves Okay, so score round Think we're gonna score for the paper shape you selected. Okay, so okay, so score round Score round is gonna take a pair of move comma move That's actually just to find Equals it's gonna be a list of and score round is gonna taste around to it Okay, so Cell score, okay, selection score is going to be Cell score equals Rock equals one paper was two right? And says it was three Scissor and then okay, this is a Cell score is moved in so it's gonna be Cell score me plus plus Score for the outcome of the round zero if you lost three for round of the draw six Okay, so Okay, that should actually be This should actually be this right score around this was That's actually just to move to move And then we say Rock beats paper Ah But the opponent does first Okay, so we'll say Yeah, there's a rock beats paper. So we get zero if that's the case Paper beats scissors so that's zero and Scissors be paper Okay, so those are going to the zero rounds if we lose Now we're gonna flip all of these Let's see Now these are all gonna be three Okay So rocks be paper paper scissors is a piece of paper paper rocks. It's just paper anything else. They are equal, right? No, this was gonna be six, right? I'm making maybe group And this should be Okay, so Paper so if I play paper they play rock. I should get five places. There's a play rock that gets zero If I play scissors they pay paper I get six if they play Paper I play rock I get zero and if I play rock Six and then this is Yes, okay, and otherwise it's true All right round scoring function done Then we'll do total score That takes a round and gives us an eight.  So now we're gonna do this and and then we're gonna Not just print. We are going to Map a score first. So we get eight one five. Let's see that matches here So first one is eight then we get one and then we get six The third round the draw will play a shooting scissors giving you a score three plus three equals six of cells score. Ah, this was three Sorry, this is why we test, right? Sandy check done eight one six Okay, now let's get our puzzle input Let's have a new file And put and let's run it back. Oh, yeah, sorry. We didn't do this some actually So we just do Some one three five six five, let's see. All right, first gold star Now let's see what's gonna happen in part two. So you know we're doing it quick today And Also tomorrow Because it's the weekend and Surprisingly enough, I want to do things on the weekend. So I'm gonna I think I'll do it around like two o'clock Right European time, right? So Yes, I kind of do it, you know doing the more like not in the morning, right? I don't want to wake up But I do it afternoon and then I can do whatever in the evening So if you want to join tomorrow, it's Two o'clock. All right. Anyway, the second column says how the round is and X means you need to lose Y means you need to end the round in a draw and Said means you need to win. Good luck Okay, we don't have to figure out the strategy. We just have to figure out a Figure out what shape to choose the round rinse as indicated This is just a big statement, right? Okay, so lose draw win Okay, okay. So I want to do this in a clever way okay, so So this was a part one equals sum dot map Okay print dot part one So now we're gonna do part two to Okay, let's click here get this annotation Part two So it takes in Part one two takes in a Okay part two It goes part two prime Something okay, so how do I do one round here? print Dot Okay, it's going to be part two prime You can take a move and a move and a And return ah So we choose and then we score the round. Okay part two prime okay, so it's So let's see here So part two Up and then res Okay, so because it's already a move. So let's just say rock here we need We need to lose Okay Paper here we need to draw So why was a draw and said was win? a You need to win. Okay So this is win Okay, so, uh Let's derive enum here No So what I want to do is I want to click take This is win. Oh, sorry Okay, so, um This is So what I want to do is I want to I'm going to take the Where um Scores Okay, so let's uh, let's actually Do it in a different way. Let's just call this This is Okay, and now we're gonna do like case matching here. So we're gonna say Uh, if we get rock under the res We need to win Here we need to uh paper out of the rest we need to scissors Scissors From the rest we need to Lose. Okay. So now we have it all in the same thing. I was aware Uh other res equals. So we're gonna say, uh, we're gonna say a map score round hop Over all the moves from rock to This is you get what I mean a other red. So This will tell us a What the other res is Let's actually do here score round I think if you sort on pairs you always sort by the last one, right? Sorry a One two I think this default sort is a Oh you're sorting the first one Okay, so we're gonna ah We got a new follower. Oh Not bad. I got five wheels That is less than yesterday, but it's not that uh, okay, so we're gonna say Okay This is gonna be score round up and and and Okay, uh, and then we're going to sort this Right and then We're going to take this second one So now then we've kind of gotten a list of moves we need to take So for the win we need to select the biggest one So this will be other res A2 this will be other res one And this will be other res zero So, um So other move Equals case res of let's just do it this way Other move a in equals case res res of fellow Haskell enjoyer. Yeah It is the best language to paper users You know, if we actually defined this in the opposite way, this would be super easy but We didn't do it Um, let's not do this paper scissors Okay, uh, and sword is not in the prelude, which is hilarious Okay, what do you call anyone couldn't measure the type with uh, uh, what was that? I got two sub community subjects I have no idea what that means That was not there before but Ah, you have subs now. Wow Nice things ahead of a moment. I'm still in like thought here wait, and So this is the other move we have to pick if this type checks, but it doesn't right so Uh Couldn't match the magic type. It won't be okay other res Oh Maybe I need to do uh, okay. Yes. Just give me the wrong thing other res is a list of uh Moves, yeah S&D Okay, and so This will actually be We're going to say total so we're gonna say, uh Uh Equal to total score Of up and Uh other, uh Dollar other move in Now let's map this over the example Uh, and let's see what it says 492 Oh, we're supposed to get four one seven Ah We need to reverse this boom four one seven I think there's a thing to do this like a function that goes from enum to like int right enum a a to From enum So then we just don't reverse it and this one will be a From enum res Let's just fancy it up a bit Still the same. Okay cool Uh, and then we take the sum of this I guess Yeah part two equals A sum dot map part two prime. Okay run on the example 12 input 12424 Let's see All right, we did part two Uh, and it took us 30 minutes See the first days are quite uh Quite nice. It's a bit You know we get started You get our groove on we got our setup going People are aching For more, uh Advent of code in haskell but It's gonna get a lot harder. I think like the first 10 days will be like, uh, okay And then it like Then it starts getting really hard and then it starts getting So like, you know date 10 is like, that's okay It's a bit hard. It'll take you maybe an hour or an hour and a half You have to not just do it but also think about the performance and then It starts getting super hard Hey like day 16 and you're like, oh my god All right, but uh Yeah, so Thanks for tuning in today Uh, not a long stream today Here for a good time not for a long time as they say, but um Yeah It's gonna be like this for the first couple of days, but thanks for tuning in and uh Yeah, so two o'clock tomorrow so Four hours before this one started so in 19 and a half hours, we're gonna do uh advent of code day three And and then you know people have their evenings free, right? You don't have to be Tuning in on a Saturday night But uh, yeah, thanks for tuning in and uh, see you tomorrow. Hopefully All right. Bye. Bye Uh, I need to sit like this. Yeah All right. Bye. Bye