+ All Categories
Home > Documents > CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence...

CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence...

Date post: 28-Jun-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
61
CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020
Transcript
Page 1: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

CS 4700:Foundations of

Artificial Intelligence

Spring 2020Prof. Haym Hirsh

Lecture 2January 24, 2020

Page 2: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Reminder:

If you’re not enrolled,get on the waitlist

(There’s a small checkbox that’s easy to miss)

I’m optimistic about people getting in

Page 3: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Reminder: Homework 1

• Due: Friday, Jan 31, 11:59pm

• No late submissions!

• Tests background material

• Graded in time for add deadline

Page 4: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

CS 4701:Practicum in

Artificial Intelligence

Organizational Meeting:Fri, Jan 25, 4:30pm, Gates G01

Makeup time likely to be Monday at 9am or 4:30pm(see website http://www.cs.cornell.edu/courses/cs4701/)

Email: [email protected]

Page 5: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Reminder:First Karma Lecture

The Principal-Agent Value Alignment Problemin Artificial Intelligence

Dylan Hadfield-MenellUC Berkeley

Jan 28 11:40am-12:40pmGates G01

Page 6: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Readings

• Skim Chapters 1 and 2• Chapter 1: broad overview of AI complementary to this lecture

• History

• Relationship to other fields

• Chapter 2: frames how the textbook presents subjects

Page 7: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

ArtificialIntelligence

NaturalLanguage

Understanding

ComputerVision

RoboticsMachineLearning

GamesPlanning/

AutomatedReasoning

Page 8: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Chapter 2

Defines an “Agent”:

a (typically software) entity interacting with some environment

• Perceive by receiving “percepts” from“sensors” (pixels, audio signal, radar, …)

• Acts in environment via “actions” using“actuators”

• Goal: Act “rationally” – maximizes some“performance measure” (either explicitlyor embedded within it)

Page 9: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Chapter 2

Page 10: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Chapter 2

AI

Page 11: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Reminder:First Karma Lecture

The Principal-Agent Value Alignment Problemin Artificial Intelligence

Dylan Hadfield-MenellUC Berkeley

Jan 28 11:40am-12:40pmGates G01

Page 12: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Reminder:First Karma Lecture

The Principal-Agent Value Alignment Problemin Artificial Intelligence

Dylan Hadfield-MenellUC Berkeley

Jan 28 11:40am-12:40pmGates G01

Page 13: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Key idea in AI: Search

Page 14: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Key idea in AI: Search

Formulating a problem so that a computer

can find a sequence of steps to solve it

Page 15: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

http://www.willowgarage.com/blog/2009/09/04/robot-comics-path-planning

Page 16: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Machine Learning

Page 17: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

8 Queens Problem

Place 8 queens on an 8x8 chessboard so that no queen attacks any other

http://wikistack.com/wp-content/uploads/2015/03/8queen.jpeg

Page 18: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

N Queens Problem

Place N queens on an NxN chessboard so that no queen attacks any other

http://wikistack.com/wp-content/uploads/2015/03/8queen.jpeg

Page 19: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Rubik’s Cube

Page 20: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Today:

Sections 3.1-3.4

Page 21: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

ArtificialIntelligence

NaturalLanguage

Understanding

ComputerVision

RoboticsMachineLearning

GamesPlanning/

AutomatedReasoning

Page 22: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

ArtificialIntelligence

NaturalLanguage

Understanding

ComputerVision

RoboticsMachineLearning

GamesPlanning/

AutomatedReasoning

Page 23: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

ArtificialIntelligence

NaturalLanguage

Understanding

ComputerVision

RoboticsMachineLearning

GamesPlanning/

AutomatedReasoning

Page 24: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Example

Tiling mxn rectangles with L “trominoes”

Page 25: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Example

Tiling 2x3 rectangles with L “trominoes”

Page 26: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Example

Tiling 2x3 rectangles with L “trominoes”

Page 27: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Example

Tiling a 5x6 rectangle with L “trominoes”?

Page 28: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

• States:• The range of situations that can be considered (Rubik’s cube configurations, locations of robot)

• Initial State: Starting point (messed up cube, current robot location)

• Goal State/Condition:

• Desired end state (solved cube)

• State satisfying goal condition (robot recharged)

Page 29: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

• States:• The range of situations that can be considered (Rubik’s cube configurations, locations of robot)

• Initial State: Starting point (messed up cube, current robot location)

• Goal State/Condition:

• Desired end state (solved cube)

• State satisfying goal condition (robot recharged)

• Actions (aka Operators):• Take you from one state to another (turning a Rubik’s cube)

• May have different costs (energy costs of robot actions)

Page 30: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

States + Actions = Graph

Page 31: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

States + Actions = Graph

Solving a problem=

Finding paths in the graphfrom Initial State to Goal

Page 32: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

States + Actions = Graph

Solving a problem=

Finding paths in the graphfrom Initial State to Goal

=“Search”

Page 33: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

Finding paths in the graphfrom Initial State to Goal

Which path?

Any

Page 34: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

Finding paths in the graphfrom Initial State to Goal

Which path?

Shortest

Page 35: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

Finding paths in the graphfrom Initial State to Goal

Which path?

Shortest?

Page 36: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

Finding paths in the graphfrom Initial State to Goal

Which path?

Shortest

Page 37: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

Finding paths in the graphfrom Initial State to Goal

Which path?

Least cost(ex: least energy)

Page 38: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Formalizing a ProblemKey Idea: “State Space Search”

Finding paths in the graphfrom Initial State to Goal

Which path?

Any – and just want goal state(don’t care about the path)

Page 39: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Search Algorithms vs Graph Algorithms

Search problem = algorithm on a graph

Page 40: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Search Algorithms vs Graph Algorithms

Search problem = algorithm on a graph

Differences:• Graph isn’t given to us but is implicitly defined by the initial

state s0 and the actions A• Instead of complexity as a function of |V| and |E|, often in

terms of |A| (“branching factor”, b) and distance to a goal state (d) – for example O(bd)

Page 41: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

Page 42: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

Boat can hold 1-2 peopleCannot have cannibals outnumbering missionaries on either bank

Boat must be piloted by a personStart with 3 missionaries and 3 cannibals on left side, with a boat

End with all 6 on the right side

Page 43: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

States: (M,C,Side)M = # of missionaries on left side of river

C = # of cannibals on left side of riverSide = canoe on L(eft) or R(ight) side of river

Page 44: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

States: (M,C,Side)M = # of missionaries on left side of river

C = # of cannibals on left side of riverSide = canoe on L(eft) or R(ight) side of river

Initial State = (3,3,L)

Page 45: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

States: (M,C,Side)M = # of missionaries on left side of river

C = # of cannibals on left side of riverSide = canoe on L(eft) or R(ight) side of river

Initial State = (3,3,L)

Goal Condition = (0,0,?)

Page 46: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

States: (M,C,Side)M = # of missionaries on left side of river

C = # of cannibals on left side of riverSide = canoe on L(eft) or R(ight) side of river

Initial State = (3,3,L)

Goal Condition = (0,0,?)

Actions: M, C, MM, MC, CC takes canoe across river

Page 47: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

Actions:M: one missionary takes boat across

C: one cannibal takes boat acrossMM: two missionaries take boat across

CC: two cannibals take boat acrossMC: one of each takes boat across

Page 48: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L) sample search process

Page 49: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R)

(3,1,R)

(2,2,R)

M

MMC

MC

CC

Page 50: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R) – terminal node, no successors, cannibals eat missionary

(1,3,R)

(3,2,R)

(3,1,R)

(2,2,R)

M

MMC

MC

CC

Page 51: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R) – terminal node, no successors, cannibals eat missionary

(3,2,R)

(3,1,R)

(2,2,R)

M

MMC

MC

CC

Page 52: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R) – not a goal state, generate successors

(3,1,R)

(2,2,R)

M

MMC

CC

MC

Page 53: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R)

(3,1,R)

(2,2,R)

M

MMC

CCC

MC

Page 54: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R) – no new successors

(3,1,R)

(2,2,R)

M

MMC

CCC

MC

Page 55: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R)

(3,1,R) – not a goal, generate successors

(2,2,R)

M

MMC

CCC

MC

Page 56: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R)

(3,1,R)

(2,2,R)

(3,2,L)

M

MMC

CCC

CC C

MC

Page 57: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R)

(3,1,R)

(2,2,R)

(3,2,L) – not a goal, generate successors

M

MMC

CCC

CC C

MC

Page 58: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R)

(3,1,R)

(2,2,R)

(3,2,L)

(3,0,R)

(2,2,R)

(1,2,R)

M

MMC

CCC

CC C

C

CC

M

MMMC

Page 59: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R)

(3,1,R)

(2,2,R)

(3,2,L)

(3,0,R)

(2,2,R)

(1,2,R)

You get the idea

M

MMC

CCC

CC C

C

CC

M

MMMC

Page 60: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

Missionaries and Cannibals

(3,3,L)

(2,3,R)

(1,3,R)

(3,2,R)

(3,1,R)

(2,2,R)

(3,2,L)

(3,0,R)

(2,2,R)

(1,2,R)

You get the idea

State Space= GraphM

MMC

CCC

CC C

C

CC

M

MMMC

Page 61: CS 4700: Foundations of Artificial Intelligence · CS 4700: Foundations of Artificial Intelligence Spring 2020 Prof. Haym Hirsh Lecture 2 January 24, 2020

State Space = Graph

What algorithms might we use?


Recommended