Question: Write the program in C++ . 1.) Implement the mutually-recursive max_value and min_value functions specified in Figure 5.3 and use them to find the max

Write the program in C++. 1.) Implement the mutually-recursive max_value and min_value functions specified in Figure 5.3 and use them to find the max (root's value) of a 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)) 

Below is algorithms of the above implementations requirements and a better understanding.

Figure 5.3:

Write the program in C++. 1.) Implement the mutually-recursive max_value and min_value

Figure 5.2:

functions specified in Figure 5.3 and use them to find the max

function MINIMAX-DECISION state) returns an action ACTIONS(s) return arg maxa MIN-VALUE(RESULT(state, a)) function Max-VALUE(state) returns a utility value if TerMINAL-TEST(state) then return UTILITY(state) for each a in ACTIONs(state) do v MAX(u, MIN-VALUE(RESULT(s, a))) return iv function MIN-VALUE(state) returns a utility value if TERMINAL-TEST(state) then return UTILITY (state) for each a in AcTIONS(state) do u MIN(u, MAX-VALUE(RESULT(s, a))) return v Figure 5.3 An algorithm for calculating minimax decisions. It returns the action corre- sponding to the best possible move, that is, the move that leads to the outcome with the best utility, under the assumption that the opponent plays to minimize utility. The functions MAX-VALUE and MIN-VALUE go through the whole game tree, all the way to the leaves, to determine the backed-up value of a state. The notation argmaxa e s f(a) computes the element a of set S that has the maximum value of f(a)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!