Question: Problem 1 . ( 3 0 points ) For problem 1 , you will put answers in your writeup for a - c . Also

Problem 1.(30 points)
For problem 1, you will put answers in your writeup for a - c. Also make alterations to the given python module.
a. Run the ps3.py code. You will be prompted to play tic-tac-toe against a minimax agent. Common wisdom suggests that the best first move is the center square. The agent doesnt begin by playing in the center square. Why do you think the agent plays where it does instead of the center? Give an explanation (4-5 sentences) in your writeup.
I am not sure.
b. Alter the ps3.py codes main function so that it calls problem 1b instead of problem 1a. You will be prompted to play connect-4 against an alpha-beta with cutoff agent that is using a silly evaluation function. See if you can defeat the agent in a few games. Describe (3-4 sentences) what your plan to defeat it every time. Explain briefly (2-3 sentences) why your plan works.
c. In the function c4 good eval, write a new evaluation function. Using this function, write code in problem 1c that will play an alpha-beta agent with depth cutoff 4 using your evaluation function against a random agent. Play once as X and once as O.(Note: For this problem and also 1(d) and also 2(b), it may help to write a version of your eval function to evaluate as X and another version of your eval function to evaluate as O. This is fine.) Have the function return a tuple (nx, no), where nx is the number of games that your agent wins as X, and no is the number of games that your agent wins as O. So if you win both games, you return (1,1).
Describe (2-3 sentences) your evaluation function in your writeup and explain (2-3 sentences) why you think it should do well. If your agent doesnt usually win against a random agent, then you probably did something wrong.
d. In the function problem 1d, run 8 games of an alpha-beta-cutoff agent using my eval- uation function versus an alpha-beta-cutoff agent using your evaluation function, with each agent playing 4 times as X and 4 times as O. Run four of games at depth limit 2 for both agents, then four games at depth limit 3 for both agents. Return a tuple (nx, no), where nx is the number of games that your agent wins as X, and no is the number of games that your agent wins as O. So if you win all 8 games, you return (4,4).
Problem 2.(20 points)
For problem 2, you will put answers in your writeup for a. Also make alterations to the given python module.
a. Find the definition for Gomoku (5-in-a-row) in the aima code. Build an evaluation function for gomoku. In your writeup, briefly explain what your evaluation function is doing.
b. In the function problem 2b, run 8 games of a random agent versus an alpha-beta-cutoff agent using your evaluation function, with each agent playing 4 times as X and 4 times as O. Choose a depth cutoff that will allow each game to complete in under 20 seconds. Have the function return a tuple (nx, no), where nx is the number of games that your agent wins as X, and no is the number of games that your agent wins as O. So if your agent wins every single game, it will return (4,4).(Note: As mentioned above, it may help to write a version of your eval function to evaluate as X and another version of your eval function to evaluate as O. This is fine.)

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 Programming Questions!