Tải bản đầy đủ (.pdf) (6 trang)

Bai giai tri tue nhan tao tut 3

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (551.11 KB, 6 trang )

TRƯỜNG ĐẠI HỌC BÁCH KHOA TP.HCM

Khoa Khoa học & Kỹ thuật Máy tính



TUTORIAL SESSION 3

HEURISTIC SEARCH AND GAME PLAYING

Question 1: Prove each of the following statements: (refer wikipedia for uniform-cost search algorithm)
a. Breadth-first search is a special case of uniform-cost search.
b. Breadth-first search, depth-first search, and uniform-cost search are special cases of best-first
search.
c. Uniform-cost search is a special case of A* search.
Solution:
a. When all step costs are equal, g(n) ~ depth(n), so uniform-cost search reproduces breadth-first
search.
b. Breadth-first search is best-first search with f(n) = depth(n).
Depth-first search is best-first search with f(n) = - depth(n).
Uniform-cost search is best-first search with f(n) = g(n).
c. Uniform-cost search is A* search with h(n) = 0.

Question 2:
Consider the n blocks world in which only one block can be on another block or on the table. And,
possible actions including picking up a block from the table, putting a block down on the table,
stacking a block on another block, and unstacking a block from another block.
Consider the problem of 3 blocks world with start and goal state in Figure 1.
 Draw the search tree resulting from using best-first search with the heuristic function as the
number of blocks not in the correct place as an estimate of the remaining distance to the
goal. For example, the heuristic value for start state is 2 since blocks A and C are not in the


correct place (but block B is) relative to the goal state.
 Repeat previous question with steepest ascent hill climbing. Compare the number of
expanded nodes.
 Draw the search tree resulting from using A-start with g being the number of operators
executed and h being the same heuristic as about. Give your opinion about this heuristic
function.
Notes:
 In the situation where we can’t decide which node to expand next. Choose it randomly.
 If the search tree resulting from using heuristic function, write node’s evaluation value beside it.
 Each node of search tree will have the state representation as the node’s label. For example, the
start state will be “(on(C,F), on(B,F), on(A,B))”

Figure 1. 3 block world
Best first search



Steepest-ascent hill climbing

A star


Question 3:
A program is developed to play the Tic-Tac-Toe game using the Minimax algorithm. Unfortunately, it is
not easy to sharp out a good static function for such a game (you may try and see). So, a simple function
is then developed as follows:
 If the X’s player wins a board, the score for the board is 1.
 If the O’s player wins a board, the score for the board is -1
 Otherwise, it returns 0.


The function is, in fact, very straightforward and trivial, but it is quite natural. In addition, we will
empower its by another means: the Minimax is allowed to run with unlimited depth.
Show that with the board given in Figure 2, the X’s player will win if played by the above-mentioned
program.


Figure 2. An example board of Tic-Tac-Toe

Question 4:
Figure 3 presents a resultant Minimax-applied tree. What are the corresponding resultant
trees when the alpha-beta prunes are applied.

Figure 3. A resultant Minimax-applied tree

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×