Answer the following questions
Question 1
A* is an informed search algorithm. What is an informed search? How is it different from uninformed search?
Question 2
A* uses a heuristic function f(n) in its search for a solution. Explain the components of f(n). Why do you think f(n) is more effective than h(n), the heuristic function used by greedy best-first?
Question 3
For A* to return the minimum-cost solution, the heuristic function used should be admissible and consistent. Explain what these two terms mean.
Question 4
For the 9-tile soring problem, assume that you start from this initial state
7 | 2 | 4 |
5 | 6 | |
8 | 3 | 1 |
The Goal State is:
1 | 2 | 3 |
4 | 5 | 6 |
7 | 8 |
The cost of moving any tile is 1.
Let the heuristic function h(n) = number of misplaced tiles.
For the shown configuration, there are four options for the next move:
- Move 5 to the right
- Move 6 to the left
- Move 2 down
- Move 3 up
Each of these moves has a value f(n) = h(n) + g(n).
- If we choose to Move 5 to the right, then
- g(n) = 1. That is, it took us one step to reach this state from the initial state.
- h(n) = number of misplaced tiles. The misplaced tiles are {7,4,8,3,1}. So the number of misplaced tiles = h(n) = 5.
If we choose to Move 6 to the left, g(n) is still = 1, but h(n) will change because the number of misplaced tiles is different.
A* works by computing f(n) = h(n) + g(n) for each of these possible moves. Then it chooses the move with the lowest f(n).
Apply A* to generate 3 states starting at the initial state above. That is, show the next three moves that will be chosen by A*. Show your calculations to compute g(n), h(n) and f(n) for all the possible moves (states).
Question 5
Repeat the exercise above with the 9-tile sorting problem using the heuristic function:
h(n) = sum of distances of tiles from their goal position
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps
Hi please answer the following follow up questions as well, posted them as another question.
Question 4
For the 9-tile soring problem, assume that you start from this initial state
7 | 2 | 4 |
5 | 6 | |
8 | 3 | 1 |
The Goal State is:
1 | 2 | 3 |
4 | 5 | 6 |
7 | 8 |
The cost of moving any tile is 1.
Let the heuristic function h(n) = number of misplaced tiles.
For the shown configuration, there are four options for the next move:
- Move 5 to the right
- Move 6 to the left
- Move 2 down
- Move 3 up
Each of these moves has a value f(n) = h(n) + g(n).
- If we choose to Move 5 to the right, then
- g(n) = 1. That is, it took us one step to reach this state from the initial state.
- h(n) = number of misplaced tiles. The misplaced tiles are {7,4,8,3,1}. So the number of misplaced tiles = h(n) = 5.
If we choose to Move 6 to the left, g(n) is still = 1, but h(n) will change because the number of misplaced tiles is different.
A* works by computing f(n) = h(n) + g(n) for each of these possible moves. Then it chooses the move with the lowest f(n).
Apply A* to generate 3 states starting at the initial state above. That is, show the next three moves that will be chosen by A*. Show your calculations to compute g(n), h(n) and f(n) for all the possible moves (states).
Question 5
Repeat the exercise above with the 9-tile sorting problem using the heuristic function:
h(n) = sum of distances of tiles from their goal position
Hi please answer the following follow up questions as well, posted them as another question.
Question 4
For the 9-tile soring problem, assume that you start from this initial state
7 | 2 | 4 |
5 | 6 | |
8 | 3 | 1 |
The Goal State is:
1 | 2 | 3 |
4 | 5 | 6 |
7 | 8 |
The cost of moving any tile is 1.
Let the heuristic function h(n) = number of misplaced tiles.
For the shown configuration, there are four options for the next move:
- Move 5 to the right
- Move 6 to the left
- Move 2 down
- Move 3 up
Each of these moves has a value f(n) = h(n) + g(n).
- If we choose to Move 5 to the right, then
- g(n) = 1. That is, it took us one step to reach this state from the initial state.
- h(n) = number of misplaced tiles. The misplaced tiles are {7,4,8,3,1}. So the number of misplaced tiles = h(n) = 5.
If we choose to Move 6 to the left, g(n) is still = 1, but h(n) will change because the number of misplaced tiles is different.
A* works by computing f(n) = h(n) + g(n) for each of these possible moves. Then it chooses the move with the lowest f(n).
Apply A* to generate 3 states starting at the initial state above. That is, show the next three moves that will be chosen by A*. Show your calculations to compute g(n), h(n) and f(n) for all the possible moves (states).
Question 5
Repeat the exercise above with the 9-tile sorting problem using the heuristic function:
h(n) = sum of distances of tiles from their goal position
- What is the heuristic function of greedy best-first search? O f(n) not equals to h(n) f(n) less than h(n) f(n) equals h(n) O f(n) greater than h(n)arrow_forward1. Determine the running time of the following algorithm. Write summations to represent loops and solve using bounding. Be sure to show work on both the upper bound and lower bound, justify the split, and check that the bounds differ by only a constant factor. Use asymptotic notation to write the answer. Func1(n) 1 2 3 4 5 6 7 8 9 10 11 S← 0; for i ←n to n² do for j← 1 to i do for k9n to 10n² do for mi to k end end end return (s); end s+s + i- j + k −m;arrow_forwardPlease help me solve Part A of this problemarrow_forward
- Explain why the Gale-Shapley Algorithm lasts at most n rounds, with at most n^2 total proposals. Also explain why the algorithm must eventually terminate, with every resident and every hospital getting matched.arrow_forwardLet T(n) be defined by the T(n) = 4T(n/2) + 2n, T(1) = c Compute T(4) by iterating forwards and express your answer in terms of c. T(4) = divide-and-conquer recurrencearrow_forwardPlease Describe in detail how to solvearrow_forward