The class of finite state machines that we defined in the previous video, is what is called a pure finite state machine, and it allows transitions when the inputs change. In many cases, we would like to have transitions when certain conditions that might involve the input, the state, and maybe also the output happen. For instance, consider the problem of controlling the temperature of a room. We already saw the model of the physics for that problem. This will require transitions of the heater from on to off and from off to on, when the temperature is in certain range. Let's take a simple situation. Suppose that we have a mode of operation that corresponds to on. This is when the heater is on and then a mode of operation that corresponds to off, which is when the heater is off. It is expected that if you would like your temperature to remain within the range, let's say minimum temperature or maximum temperature, they're not in T max respectively, that you will transition from on to off when the temperature has reach the value T max and that you'll have a transition from off to on when the temperature has reach the threshold T min. Now we can think about this logic as a finite state machine with two modes. In such a model we could have two modes. Q will be in the set of a state on, off. This will define my capital Q for the finite state machine. But now, transitions occur when the following conditions hold. We can think about V being the input to the machine equal to the temperature. So, when the input to the machine is large or equal than T max, and the current mode is on, then a transition should occur, while when the input is less or equal than T min, and the mode of operation corresponds to off, another transition will occur. The function L is the guard function and now transitions can occur. When that function has a particular sign, we can actually say when this function is less or equal than zero, and this is arbitrary, it could be larger or equal than zero or some other condition. With that guard function now we can have a model of a finite state machine that has a transition function that governs the evolution of the state. It's output also depends on a function of the state. And now the transitions occur when the function L, which is the guard function, satisfies this condition. So now this model right here which expands the previous model which is known as pure finite state machines, leads to another model of a finite state machine with guards. As you see with this example, this function can craft according to the conditions of transitions that one would like the changes to happen and then the evolution of the state will change when those conditions are true.