Docsity

Artificial Intelligence, Essay - Computer Science, Essays (high school) of Software Engineering

Partial preview of the text

Download Artificial Intelligence, Essay - Computer Science and more Essays (high school) Software Engineering in PDF only on Docsity!

Artificial Intelligence

A Simple Game

 Me vs. a devil

 I have two possible moves: A or B

 If I make move A, devil pays me $4.

 If I make move B, I pay devil $3.

 Which move should I make?

Game Trees

Devil pays me $ I pay devil $

A B

Two Rounds

Devil pays me $ I pay devil $

C D

I pay devil $ I pay devil $

E F

A B

Which move should I make?

Two Rounds

Devil pays me $ I pay devil $

C D

I pay devil $ I pay devil $

E F

A B

Two Rounds

Three Rounds

Three Rounds

Minimax

 This is called the minimax algorithm.

 I'm trying to maximize my winnings,

given that I expect my opponent will try

to minimize my winnings.

Connect Four

 Let's play Connect Four

Connect Four

 How long would it take a computer to

determine the best starting move?

 Too long!!!

 After 20 moves,

roughly 80,000,000,000,000,000 states!

A More Practical Algorithm

1. Look just a few moves ahead.

2. Then estimate how good the board

appears.

Simplest estimation function

value of board for player =

 1000 (if player has 4-in-a-row)

 -1000 (if other player has 4-in-a-row)

 0 (otherwise)

Using our estimation function

What are the values of these boards for the red player? They would all have a value of zero.