Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the following program in C++ In a minimax tree the root is conventionally the max player and the utility function for leaf nodes is

Write the following program in C++ In a minimax tree the root is conventionally the max player and the utility function for leaf nodes is what the max player wants to maximize. After the max player moves, the root of the rest of the game is the min player, who wants to minimize the utility function. Code in C++ the mutually-recursive max_value and min_value functions specified in Figure 5.3 and use them to find the min (root's value) of a min tree read in from the keyboard as a nested list. For example, the tree in Figure 5.2 would be input as ((3,12,8),(2,4,6),(14,5,2)) with the triangles inverted so the root is min, and the tree passed out in class would be input as ((3,8,(7,(3,0,7),(8,8,2))), (4,(7,9,8),8), (((3,6,4),2,6),((9,2,9),4,7,(6,4,5) ),4,(6,4,5)) ) with the triangles inverted so the root is min. 

image text in transcribed

image text in transcribed

MAX 51 MIN di d2 3 12 8 14 5 Figure 5.2 A two-ply game tree. The nodes are "MAX nodes," in which it is MAX's turn to move, and the nodes are ..MIN nodes." The terminal nodes show the utility values for MAX; the other nodes are labeled with their minimax values. MAX's best move at the root is al, because it leads to the state with the highest minmax value, and MIN's best reply is because it leads to the state with the lowest minimax value MAX 51 MIN di d2 3 12 8 14 5 Figure 5.2 A two-ply game tree. The nodes are "MAX nodes," in which it is MAX's turn to move, and the nodes are ..MIN nodes." The terminal nodes show the utility values for MAX; the other nodes are labeled with their minimax values. MAX's best move at the root is al, because it leads to the state with the highest minmax value, and MIN's best reply is because it leads to the state with the lowest minimax value

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 9th International Conference Dasfaa 2004 Jeju Island Korea March 2004 Proceedings Lncs 2973

Authors: YoonJoon Lee ,Jianzhong Li ,Kyu-Young Whang

2004th Edition

3540210474, 978-3540210474

More Books

Students also viewed these Databases questions

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago