 Hello everyone, this is Alice Gao. In this video, I will solve the two practice questions on determining whether a state is a local and or global optimal. Question one, the neighbor relation says to pick two queens and swap their role positions. The correct answer is C. This state is not a local optimum and not a global optimum. This state is not a global optimum since there are two pairs of queens attacking each other. Now, is this state a local optimal or not? To answer this, we need to calculate the cost of every neighbor and see if any neighbor has a strictly lower cost than the current state. The current state is 3201 with a cost of 2. Among the four queens, there are six ways to choose two queens to swap. For example, if we swap the role positions of the left-most two queens, we get 2301. If we swap the role positions of the first and the third queens from the left, we get 0231. Let's write out all of the six neighbors. Next, let's calculate their costs. Take the state 2301 as an example. There are four pairs of queens attacking each other. 0 and 1, 2 and 3, 0 and 2 and 1 and 3. This state has a cost of 4. Let's calculate the cost of all the six neighbors. Now, we can see that the current state is not a local optimum since at least one state, 0231, has a strictly lower cost. Question 2. Consider the same state but a different neighbor relation. This neighbor relation says to choose one queen and move it to another row in the same column. The correct answer is B. This state is a local optimum but not a global optimum. This state is not a global optimum for the same reason as we discussed in question 1. Now, is this state a local optimum or not? Same as before, let's calculate the costs of all of the neighbors. Since the neighbor relation requires us to move one queen, each empty square corresponds to one neighbor of the current state. For example, the top left square represents the neighbor state where the leftmost queen is moved to the top left square. Therefore, for each empty square, I will construct the neighbor in my mind, calculate its cost and write down the cost of the neighbor in that square. For example, if we move the leftmost queen to the top left square, then we will have two pairs of attacking queens. The cost of this neighbor is 2. If we move the third queen down by 1, we will have four pairs of attacking queens, 0 and 1, 1 and 2, 0 and 2 and 2 and 3. The cost of this neighbor is 4. Let's calculate the cost of all the neighbors. The current state has a cost of 2 and every neighbor's cost is 2 or more. Therefore, the current state is a local optimum. That's everything for this video. Thank you very much for watching. I will see you in the next video. Bye for now.