Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

CSC-325:Introduction to Artificial Intelligence

Semester 6 (FALL 2021)


Lecturer: Amna Iftikhar

ASSIGNMENT 1
Submission Deadline: 08th November, 2021
Student’s name: ____________________ Reg# : __________

Problem #1 (Farmer and boat)

A farmer wishes to carry a wolf (i.e., the family pet), a goat and a cabbage across a river, from
the south to the north shore. The farmer is the proud owner of a small rowing boat called Bounty
which he feels is easily up to the job. Unfortunately the boat is only large enough to carry at most
the farmer and one other item. Worse again, if left unattended the wolf will eat the goat and the
goat will eat the cabbage. How can the farmer safely transport the wolf, the goat and the cabbage to
the opposite shore?

a) Define the problem:


 Description of the states
o Initial state
o Goal
 Transitions (actions)
 Constriants
 Cost function

b) Build the states space for the above problem (only with possible states).

Problem#2 (8-Queens)
The n‐queens problem is a popular problem originally proposed by a chess player in 1848. It requires
putting n queens on an n x n chess board such that none of the queens is attacking any of the other
queens. In case you’re unfamiliar with chess, a queen can move in any direction for any number of
squares:
Concretely, the picture on the right, above, shows a solution to the 8‐queens problem. Find a solution
to the n‐queens problem through a search space.
a) Define the problem:
 Description of the states
o Initial state
o Goal
 Transitions (actions)
 Constraints
 Cost function
b) Build the states space (only with possible states).
Problem #3(Sliding Puzzle)

Consider the following sliding-blocks puzzle, consisting of three black tiles, three white tiles, and an
empty space. The initial configuration for the puzzle consists of all the black tiles to the left, all of the
white tiles to the right, and the empty space in the middle. For example, the following shows the
initial configuration:
B B B W W W
The goal is to reverse the locations of the tiles, i.e., have all white tiles to the left and all black tiles to the
right, with the space in the middle. There are two types of moves allowed. A tile can move into an
adjacent empty space, or it can jump over one or two adjacent tiles into the empty space.

a) Define the problem:

 Description of the states


o Initial state
o Goal
 Transitions (actions)
 Constraints
 Cost function
b) Draw the states space for the above problem.

Problem #4(Tic-Tac-Toe)
Tic-tac-toe game, the objective is to manage to get 3 noughts (or 3 crosses) in a row (in whatever
direction); whoever manages to do so is a winner, otherwise the game draws. You better know how to
play the game, but the objective here is to develop the game tree for this game (well, as much as you can,
if not possible, or feasible, to draw completely by you), as shown below:

IMPORTANT INSTRUCTIONS:

Remember, the assignments may help you for the preparation of your future quizzes and/or examinations!

WISH YOU THE BEST OF LUCK


*******************************

You might also like