0% found this document useful (0 votes)
67 views18 pages

AI Lab Question Bank

The document outlines various programming tasks and algorithms related to artificial intelligence, including implementing travel plans using Hill Climbing, creating Prolog rule bases for familial relationships, solving the N-Queens problem, and developing games like Tic-Tac-Toe and Rock-Paper-Scissors. It also discusses mathematical calculations in Prolog, semantic search in Python, and solving the Traveling Salesman Problem. Each task emphasizes the application of algorithms and programming languages to solve specific problems in AI and logic.

Uploaded by

venkat Mohan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views18 pages

AI Lab Question Bank

The document outlines various programming tasks and algorithms related to artificial intelligence, including implementing travel plans using Hill Climbing, creating Prolog rule bases for familial relationships, solving the N-Queens problem, and developing games like Tic-Tac-Toe and Rock-Paper-Scissors. It also discusses mathematical calculations in Prolog, semantic search in Python, and solving the Traveling Salesman Problem. Each task emphasizes the application of algorithms and programming languages to solve specific problems in AI and logic.

Uploaded by

venkat Mohan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

A. Build a travel plan to assist the tourists in visiting a new city with 6 major attractions.

The user wants


to visit all attractions with the least total travel time, starting and ending at their hotel. However, they
want quick suggestions, even if not perfectly optimal. Implement a basic Hill Climbing algorithm to
find a near-optimal delivery route among 6 locations. Run the algorithm multiple times and show
whether the algorithm might get stuck in local optima.

B. Create a rule base in prolog for the facts given below: 1. John is male 2. Paul is male 3. George is
male . 4. Susan, marry, Linda and Kate are female. 5. John is the parent Mary, 6. john is the parent
Paul, 7. Susan is the parent Mary, 8. Susan is the parent Paul, 9. Paul is the parent Linda, 10. Paul is
the parent George, 11. Linda is the parent Kate. Answer the given Query:
a) Who is the mother of Mary?
b) Who is the father of George?
c) Is John and Susan is sibling?
d) Is Marry and Paul is sibling?

A. ABC university is designing an automated tour guide system for new students. The system should
guide them through all major buildings (library, labs, lecture halls, admin office, etc.) in the shortest
walking distance, starting and ending at the front gate. Model this system to find a near-optimal delivery
route among 5 locations. Run the algorithm multiple times and show whether the algorithm might get
stuck in local optima.

B. Model a scheduling system for a conference that involves assigning sessions to rooms and time slots in
such a way that no two sessions with overlapping topics or speakers occur simultaneously in adjacent
rooms. Model a conflict-free scheduling approach as an instance of the N-Queens problem. Implement a
solution using backtracking for N = 8
A. A local courier company needs to optimize the delivery routes of its van which visits multiple
delivery points in a city. They want to minimize travel distance while ensuring every location is
visited exactly once and the van returns to the starting point. Implement a basic Hill Climbing
algorithm to find a near-optimal delivery route among 5 locations. Run the algorithm multiple times
and show whether the algorithm might get stuck in local optima.

B. Write Prolog facts and queries based on the given relationship description:
a. Prem and Suba are parents of Priya and Raj.

b. Priya and Raj are siblings.


c. Sophie is a friend of both Priya and Raj.
d. Prem and Raj are male.
e. Suba, Priya, and Sophie are female.
Write Prolog queries and get the answer:
a. Find Priya’s parents.
b. Check if Priya and Raj are siblings
c. Find Raj’s friends.
d. Verify if Suba is female.
A. Assume that you are given an 8×8 chessboard, and your task is to place 8 queens on the board such that
no two queens attack each other. A queen can attack another if they share the same row, column, or
diagonal. Starting with a random arrangement of queens—one in each column—use the hill climbing
algorithm to rearrange them until no two queens are attacking each other.

B. A university is tracking students' placement preparation and job offers. The system keeps track of
Students and Their Skills:Define the tasks in prolog for the following:

Students Skills:
 Sofi has skills in Python and Machine Learning.
 Antony is proficient in Java and Data Structures.
 Raj knows C++ and Databases.
Companies and Required Skills:
 Google is looking for candidates with Python and Machine Learning skills.
 Microsoft requires employees with Java and Data Structures expertise.
 Amazon hires candidates who are skilled in C++ and Databases.
Placement Status:
 Sofi has been placed at Google.
 Antony got a job at Microsoft.
 Raj is still preparing for placements.

Write Queries in Prolog to answer:

a. Who are the students still preparing for placements?


b. Which students have Python skills?
c. Which company hired John?
d. What companies are looking for Java-skilled candidates?
e. Is Alice placed in a company?

A. Imagine you are developing an AI for a puzzle-solving game like the 8-puzzle (sliding tiles 1 to 8 with
one blank). The AI uses a Hill Climbing algorithm to solve the puzzle by moving tiles to reduce the
number of misplaced tiles (heuristic: number of tiles not in their goal position). In this context, each puzzle
configuration is a state, and the possible moves from the current configuration (up, down, left, right of the
blank tile) form the state space. You are tasked with implementing Hill Climbing as a state space search
algorithm to find a solution that reaches the goal state.Write Java/ Python code for a basic Hill Climbing
algorithm applied to the 8-puzzle problem using the above heuristic.

B. Write Prolog facts and queries for the based on the given relationship description:

1. Prem and Suba are parents of Priya and Raj.


2. Priya and Raj are siblings.
3. Sophie is a friend of both Priya and Raj.
4. Prem and Raj are male.
5. Suba, Priya, and Sophie are female.

Write Prolog queries and get the answer:


1. Find Priya’s parents.
2. Check if Priya and Raj are siblings
3. Find Raj’s friends.
4. Verify if Suba is female.
A.A robot is navigating through a grid-like factory floor from Start (A) to Goal (F). It can move to
connected positions, but must always move towards the position with the lowest heuristic value h(n).
Use the Hill Climbing Algorithm to determine the optimal movement path. If the robot reaches a
dead-end (local maximum), it will stop and not backtrack.

B. A student is learning mathematical calculations using Prolog. The goal is to implement:

a. Fibonacci series using recursion

The student will enter a number, and Prolog will compute the result
A. Assume that an initial state of a 8-puzzle problem is depicted in fig (a) and its final state to be reached is
depicted below. Consider g(n) = Depth of node and h(n) = Number of misplaced tiles. Write a Java/ Python
code to find the most cost-effective path to reach the final state from initial state using A* Algorithm.

B.A student is learning mathematical calculations using Prolog. The goal is to implement: Basic
arithmetic operations (Addition, Subtraction, Multiplication, Division. The student will enter a number,
and Prolog will compute the result

A. Write a JAVA /Python program to implement a path finding problem using A* search. The expected
output is an optimal path with lowest cost.

B.A school is organizing a math competition where students are given problems involving permutations.
One task is to determine the number of unique ways students can be arranged in a line, depending on the
number of participants. This is calculated using the factorial of the number of students.

Your job is to create a Prolog program that helps the organizer compute this automatically
A. Tic-Tac-Toe -a board game is played alternatively by two players. It is a game in which two players write
either O or X in a pattern of nine squares. It is won by the first player who places three Os or three Xs in
a straight line. Tic-Tac -Toe (along with a lot of other games) involves looking ahead and trying to figure
out what the person playing against you might do next. Implement the above game using adversarial
search played between two players or between a player and a system.

The rules of the game are:


a. The game is played on a grid that's 3 squares by 3 squares.
b. You are X , your friend (or the computer in this case) is O . Players take turns putting their
marks in empty squares.
c. The first player to get 3 of her marks in a row (up, down, across, or diagonally) is the winner.
d. When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game
ends in a tie.

Strategy to be applied: To beat the computer (or at least tie), you need to make use of a little bit of
strategy. Strategy here is figuring out what you need to do to win. Part of your strategy is trying to
figure out how to get three X s in a row. The other part is trying to figure out how to stop the
computer from getting three O s in a row. After you put an X in a square, you start looking ahead.
Where's the best place for your next X ? You look at the empty squares and decide which ones are
good choices which ones might let you make three X s in a row. You also have to watch where the
computer puts its O . That could change what you do next. If the computer gets two O s in a row,
you have to put your next X in the last empty square in that row, or the computer will win. You are
forced to play in a particular square or lose the game.

If you always pay attention and look ahead, you'll never lose a game of Tic-Tac-Toe. You may
not win, but at least you'll tie. Implement this adversarial game search using Java / Python.

B .A student is learning mathematical calculations using Prolog. The goal is to implement Fibonacci
series using recursion. The student will enter a number, and Prolog will compute the result
A. In the game "Rock, Paper, Scissors," two opponents randomly toss out hand gestures, and each one
wins, loses or draws with equal probability. rock paper scissors are a hand game for two or more
players. Participants say “rock, paper, scissors” and then simultaneously form their hands into the
shape of a rock (a fist), a piece of paper (palm facing downward), or a pair of scissors (two fingers
extended). The rules are straightforward:

 Rock smashes scissors - Rock wins against scissors


 Paper covers rock- paper wins against rock
 Scissors cut paper- scissors win against paper.

Using the description and rules above, you can make a game of rock paper scissors. Take the input
from user, the goal here is to ask the user what they would like to choose as an action .

Strategy to be applied: Make the Computer Choose

A competitive game of rock paper scissors involves strategy. Rather than trying to develop a model
for that, though, you can save yourself some time by having the computer select a random
action. Implement the above competitive game using adversarial game search in Java/ Python

B. Create a rule base in prolog for the facts given below: 1. John is male 2. Paul is male 3. George is
male . 4. Susan, marry, Linda and Kate are female. 5. John is the parent Mary, 6. john is the parent Paul, 7.
Susan is the parent Mary, 8. Susan is the parent Paul, 9. Paul is the parent Linda, 10. Paul is the parent
George, 11. Linda is the parent Kate. Answer the given:
e) Who is the mother of Mary?
f) Who is the father of George?
g) Is John and Susan is sibling?
h) Is Marry and Paul is sibling?

A. Create a rule base in prolog for the facts given below:

Facts:

a. Lucy is a professor
b. All professors are people.
c. John is the dean.
d. Deans are professors.
e. All professors consider the dean a friend or don’t know him.
f. Everyone is a friend of someone.
g. People only criticize people that are not their friends.
Prove whether the statement " Lucy criticized John” is true or not using Prolog.

B. The objective of a 4 Queens problem is to place 4 queens on a chessboard in such a way that no
queens can capture a piece. This means that no two queens may be placed on the same row, column,
or diagonal. Select a suitable technique in AI and develop a python / Java code to address the above
scenario.
A. Create a rule base in prolog for the facts given below: 1. jack owns bmw car, 2. john owns chevy
car, 3. olivia owns civic car, 4. jane owns chevy car, 5. bmw car is sedan 6. civic car is sedan, 7.
Chevy car is truck. Answer the given Query:

1. What does john own?


2. Does john own something?
3. Who owns car chevy?
4. Does jane own sedan?
5. Does jane own truck?

B. Model a scheduling system for a conference that involves assigning sessions to rooms and time
slots in such a way that no two sessions with overlapping topics or speakers occur simultaneously in
adjacent rooms. Model a conflict-free scheduling approach as an instance of the N-Queens problem.
Implement a solution using backtracking for N = 8.

A. A student is learning mathematical calculations using Prolog. The goal is to implement:

Basic arithmetic operations (Addition, Subtraction, Multiplication, Division). The student will
enter a number, and Prolog will compute the result

B.Write a Python program to perform semantic search using the following steps: Use a small list of
sentences as your document corpus. Take a user query as input. Convert both the query and documents into
embeddings using a pre-trained model (e.g., all-MiniLM-L6-v2 from sentence-transformers).Calculate
cosine similarity between the query and each document. Display the top 3 most similar sentences to the user
query. Can use any pretrained model for your semantic search.

A. A school is organizing a math competition where students are given problems involving permutations.
One task is to determine the number of unique ways students can be arranged in a line, depending on the
number of participants. This is calculated using the factorial of the number of students. Develop a Prolog
program that helps the organizer compute this automatically.

B. A Given a set of cities and distance between every pair of cities, find the shortest possible route that visits
every city exactly once and returns to the starting point. Write a JAVA /Python program to implement the
same, assume vertex 1 as a starting city from where sales person starts his travelling.
A. Assume that you are given two jugs, a 4-gallon one and a 3-gallon one. Neither have any measuring
markers on it. There is a tap that can be used to fill the jugs with water. Create the rule base for the given
situation and prove how you get exactly 2 gallons of water into the 4-gallon jug?
B. Given a list of cities and the distances between each pair of cities, what is the shortest possible route that
visits each city exactly once.” The traveling salesman problem is NP-hard, and the solution space scales
factorially with the number of cities. The time complexity of the brute force approach is O(n!), which makes
a TSP with fairly large number of cities infeasible to solve with modern computers. The hill climbing
algorithm is one of the most naive approaches in solving the TSP. A random solution, a random sequence of
cities, is generated. Then, all successor states of the solution is evaluated, where a successor state is obtained
by switching the ordering of two cities adjacent in the solution. Finally, the best successor is chosen as the
new state, and its successors are evaluated, and this continues until a satisfactory solution is obtained.

A. Solve the given problem using Prolog


a. A hungry monkey is in a room, and he is near the door.
b. The monkey is on the floor.
c. Bananas have been hung from the center of the ceiling of the room.
d. There is a block (or chair) present in the room near the window.
e. The monkey wants the banana, but cannot reach it.

So how can the monkey get the bananas? Create a knowledge base and solve the problem.

B. The objective of a 4 Queens problem is to place 4 queens on a chessboard in such a way that no
queens can capture a piece. This means that no two queens may be placed on the same row, column,
or diagonal. Select a suitable technique in AI and develop a python / Java code to address the above
scenario
A.Given a set of cities City1, City2, City3, City4 and distances between them as shown below. A salesman
has to start from City 1, travel through all the cities and return to City1. Write a JAVA /Python program to
implement the same, assume there are various possible routes, but the problem is to find the shortest possible
route.

A travelling salesman, named VishnuKarthick

B.A university is tracking students' placement preparation and job offers. The system keeps track of
Students and Their Skills:Define the tasks in prolog for the following:

Students Skills:
 Sofi has skills in Python and Machine Learning.
 Antony is proficient in Java and Data Structures.
 Raj knows C++ and Databases.
Companies and Required Skills:
 Google is looking for candidates with Python and Machine Learning skills.
 Microsoft requires employees with Java and Data Structures expertise.
 Amazon hires candidates who are skilled in C++ and Databases.
Placement Status:
 Sofi has been placed at Google.
 Antony got a job at Microsoft.
 Raj is still preparing for placements.

Write Queries in Prolog to answer:

1. Who are the students still preparing for placements?


2. Which students have Python skills?
3. Which company hired John?
4. What companies are looking for Java-skilled candidates?
5. Is Alice placed in a company?
A. A monk at a temple is given three rods and N disks of different sizes, arranged in descending order
(largest at the bottom) on the first rod. His task is to move all the disks to the third rod, following these
rules:

1. Only one disk can be moved at a time.


2. A disk can only be placed on an empty rod or a larger disk.
3. The second rod can be used as an auxiliary rod.

The monk needs to determine the minimum number of moves to complete the task.

a. Define facts and rules to represent Tower of Hanoi problem in Prolog


b. Write a recursive solution that prints the moves required to solve the puzzle.
c. Run queries for different values of N (number of disks).

Write a program in prolog to solve Traveling salesman problem : A salesman needs to visit a set of cities
exactly once and return to the starting city while minimizing the total travel cost. The cities are connected by
roads, each with a specific distance.
B. Model a scheduling system for a conference that involves assigning sessions to rooms and time slots
in such a way that no two sessions with overlapping topics or speakers occur simultaneously in adjacent
rooms. Model a conflict-free scheduling approach as an instance of the N-Queens problem. Implement a
solution using backtracking for N = 8

A. Write Prolog facts and queries for the based on the given relationship description:

1. Prem and Suba are parents of Priya and Raj.


2. Priya and Raj are siblings.
3. Sophie is a friend of both Priya and Raj.
4. Prem and Raj are male.
5. Suba, Priya, and Sophie are female.
Write Prolog queries and get the answer:
1. Find Priya’s parents.
2. Check if Priya and Raj are siblings
3. Find Raj’s friends.
4. Verify if Suba is female.
B. In the game "Rock, Paper, Scissors," two opponents randomly toss out hand gestures, and each one
wins, loses or draws with equal probability. rock paper scissors are a hand game for two or more players.
Participants say “rock, paper, scissors” and then simultaneously form their hands into the shape of a rock (a
fist), a piece of paper (palm facing downward), or a pair of scissors (two fingers extended). The rules are
straightforward:

 Rock smashes scissors - Rock wins against scissors


 Paper covers rock- paper wins against rock
 Scissors cut paper- scissors wins against paper.

Using the description and rules above, you can make a game of rock paper scissors. Take the input from
user, the goal here is to ask the user what they would like to choose as an action .Strategy to be applied:
Make the Computer Choose. A competitive game of rock paper scissors involves strategy. Rather than
trying to develop a model for that, though, you can save yourself some time by having the computer select a
random action. Implement the above competitive game using adversarial game search in Java/ Python
A. Create the knowledge base in prolog for the given facts and rules and find answers for the question
using logical reasoning.
Facts: 1. Idly is a breakfast
2. Dosa is a breakfast
3. Chappathi is a dinner
4. Briyani is a lunch
5. Idly is a food
6. Dosa is a food
7. Chappathi is a food
8. Briyani is a food

Create a rule in prolog such that Every food is a meal OR Anything is a meal if it is a food. Find answer for
the queries using the knowledge base created:
a. Is Pizza a food?
b. Is Idly a food?
c. Which food is meal and lunch?
d. Is Dosa a dinner?
e. Is Idly a breakfast?

B. A travelling salesman, named VishnuKarthick plans to visit five cities 1, 2, 3, 4 & 5. The travel time (in
hours) between these cities is shown below: How should Mr. Karthick schedule his touring plan in order
to minimize the total travel time, if he visits each city once a week?
A.Water jug problem: There are three jugs (a,b,c), whose capacity is respectively:3 litres, 5 litres and 8
litres. Initially jugs a and b are empty and jug c is full of water. Goal is to find a sequence of pouring actions
by which you can measure out litres of water into one of the jugs without spilling any. State representation
will be as follows: A state is a list: [ how_reached, Jugstate1, Jugstate2, Jugstate3 ] where each JugstateN is
a list of the form: [jugname, capcity, content] .The initial state is given as initial_state( [initial, [a,3,0],
[b,5,0], [c,8,8]]).The first two jugs are empty and the third jug is having 8 litres and its capacity is also 8
liters. The goal state is to accept any state where one of the jugs contains 4 litres of water: Like any of the
following: jug A or B or C has four liters.

goal_state( [_, [a,_,4], [b,_,_], [c,_,_]]).


goal_state( [_, [a,_,_], [b,_,4], [c,_,_]]).
goal_state( [_, [a,_,_], [b,_,_], [c,_,4]]).
Is itpossible to reach goal state from the initial state? Solve the problem with all possible state
transitions using prolog

B. The goal of the 5-Queens problem is to position four queens on a chessboard such that none of them can
attack each other. This requires that no two queens share the same row, column, or diagonal. Given that the
first queen is already placed at row 1, column 1, determine if the remaining three queens can be placed
without conflict. Choose an appropriate AI technique and implement a solution in Python or Java to solve
this scenario

A.Use a pre-trained semantic embedding model to index a company knowledge base (in the form of a
structured FAQ or text corpus). Implement a semantic search system that takes a user's natural language
question and returns the most relevant answer(s). Evaluate your system by running at least five different
questions and show the semantic similarity score
B. In the game "Rock, Paper, Scissors," two opponents randomly toss out hand gestures, and each one wins,
loses or draws with equal probability. rock paper scissors are a hand game for two or more players.
Participants say “rock, paper, scissors” and then simultaneously form their hands into the shape of a rock (a
fist), a piece of paper (palm facing downward), or a pair of scissors (two fingers extended). The rules are
straightforward:

 Rock smashes scissors - Rock wins against scissors


 Paper covers rock- paper wins against rock
 Scissors cut paper- scissors wins against paper.

Using the description and rules above, you can make a game of rock paper scissors. Take the input
from user, the goal here is to ask the user what they would like to choose as an action .

Strategy to be applied: Make the Computer Choose

A competitive game of rock paper scissors involves strategy. Rather than trying to develop a model
for that, though, you can save yourself some time by having the computer select a random
action. Implement the above competitive game using adversarial game search in Java/ Python
A. Building a semantic search engine for a legal firm that wants to retrieve relevant legal documents and
case summaries using natural language queries. The firm has a collection of 100+ legal documents stored
in plain text format. Load the legal documents, generate embeddings, and implement a search interface
that returns the top 5 most relevant documents for a user query. Demonstrate your system by testing it
with at least three semantically rich queries.

B. A school is organizing a math competition where students are given problems involving
permutations. One task is to determine the number of unique ways students can be arranged in a line,
depending on the number of participants. This is calculated using the factorial of the number of students.
your job is to create a Prolog program that helps the organizer compute this automatically

A. Build a simple semantic search engine for the college’s academic FAQs using a pre-trained sentence
embedding model. Store at least 20 FAQ entries or academic policy texts in a database or list. When a
student enters a natural language query, your system should return the top 3 most semantically similar
responses. Test your system with at least 5 different queries phrased differently from the original
documents.
B. Tic-Tac-Toe -a board game is played alternatively by two players. It is a game in which
two players write either O or X in a pattern of nine squares. It is won by the first player who places three
Os or three Xs in a straight line. Tic-Tac -Toe (along with a lot of other games) involves looking ahead
and trying to figure out what the person playing against you might do next. Implement the above game
using adversarial search played between two players or between a player and a system.

A. Write a Python program to perform semantic search using the following steps:
Use a small list of sentences as your document corpus. Take a user query as input. Convert both the
query and documents into embeddings using a pre-trained model (e.g., all-MiniLM-L6-v2 from
sentence-transformers).Calculate cosine similarity between the query and each document. Display the
top 3 most similar sentences to the user query. Can use any pretrained model for your semantic search.

B. Write Prolog facts and queries for the based on the given relationship description:
1. Prem and Suba are parents of Priya and Raj.
2. Priya and Raj are siblings.
3. Sophie is a friend of both Priya and Raj.
4. Prem and Raj are male.
5. Suba, Priya, and Sophie are female.
Write Prolog queries and get the answer:
1. Find Priya’s parents.
2. Check if Priya and Raj are siblings
3. Find Raj’s friends.
4. Verify if Suba is female.
A. A travelling salesman, named Tharun plans to visit five cities Madurai, Kolkata, Bangalore, Pune and
Delhi. The travel time by car (in hours) between these cities is shown below:

To
Madurai Kolkata Bangalore Pune Delhi
Madurai ∞ 27 7 15 29
From Kolkata 27 ∞ 34 22 25
Bangalore 7 34 ∞ 13 34
Pune 15 22 13 ∞ 26
Delhi 29 25 34 26 ∞

How should Mr. Tharun schedule his touring plan to minimize the total travel time, if he visits each
city once in four months?

B. Create the knowledge base in prolog for the given facts and rules and find answers for the question
using logical reasoning.
Facts: 1. Idly is a breakfast
2. Dosa is a breakfast
3. Chappathi is a dinner
4. Briyani is a lunch
5. Idly is a food
6. Dosa is a food
7. Chappathi is a food
8. Briyani is a food

Create a rule in prolog such that Every food is a meal OR Anything is a meal if it is a food. Find
answer for the queries using the knowledge base created:
1. Is Pizza a food?
2. Is Idly a food?
3. Which food is meal and lunch?
4. Is Dosa a dinner?
5. Is Idly a breakfast?
A. A travelling salesman, named Sundar plans to visit five cities Madurai, Kolkata, Bangalore, Pune and
Delhi. The travel distance by car (in kms) between these cities is shown below.

To
Madurai Kolkata Bangalore Pune Delhi
Madurai ∞ 2264 436 1262 2519
Kolkata 2264 ∞ 1854 1901 1471
From
Bangalore 436 1854 ∞ 842 2157
Pune 1262 1901 842 ∞ 1440
Delhi 2519 1471 2157 1440 ∞

How should Mr. Sundar schedule his touring plan to minimize the total travel time, if he visits each
city once in three months?

B.Write Prolog facts and queries based on the given relationship description:

1. Prem and Suba are parents of Priya and Raj.


2. Priya and Raj are siblings.
3. Sophie is a friend of both Priya and Raj.
4. Prem and Raj are male.
5. Suba, Priya, and Sophie are female.

Write Prolog queries and get the answer:


1. Find Priya’s parents.
2. Check if Priya and Raj are siblings
3. Find Raj’s friends.
4. Verify if Suba is female.

A. Create a chatbot to conduct an on-line chat conversation for an online shopping site (like Amazon,
Flipkart, etc.,) using any AI Tool.
B. Create a rule base in prolog for the facts given below:
1. Jack owns BMW car, 2. John owns Chevy car, 3. Olivia owns Civic car, 4. Jane owns chevy car, 5.
BMW car is Sedan 6.Civic car is Sedan, 7. Chevy car is truck.
Answer the given Query:
1. What does John own?
2. Does John own something?
3. Who owns car Chevy?
4. Does Jane own Sedan?
5. Does Jane own truck?
A.The utility of financial chatbots is growing by the day as customers now expect prompt services all the
time. When it comes to balancing finances or managing bills it can be a struggle to find the best solutions to
navigate a numbers-and policy-heavy website. Banks can benefit themselves as well as their customers.
Design a chatbot for XYZ bank to help their customers with instant answers

B. Create a rule base in prolog for the facts given below: 1. Jack owns BMW car, 2. John owns Chevy car, 3.
Olivia owns Civic car, 4. Jane owns chevy car, 5. BMW car is Sedan
Civic car is Sedan, 7. Chevy car is truck. Answer the given Query:
1. What does John own?
2. Does John own something?
3. Who owns car Chevy?
4. Does Jane own Sedan?
5. Does Jane own truck?

A. Tic-Tac-Toe -a board game is played alternatively by two players. It is a ga me in which


two players write either O or X in a pattern of nine squares. It is won by the
first player who places three Os or three Xs in a straight line. Tic-Tac -Toe (along with a lot of other
games) involves looking ahead and trying to figure out what the person playing against you might
do next. Implement the above game using adversarial search played between two players or
between a player and a system.

B.Create a rule base in prolog for the facts given below: 1. Jack owns BMW car, 2. John owns Chevy car,
3. Olivia owns Civic car, 4. Jane owns chevy car, 5. BMW car is Sedan 6.Civic car is Sedan, 7. Chevy car
is truck.
Answer the given Query:
1. What does John own?
2. Does John own something?
3. Who owns car Chevy?
4. Does Jane own Sedan?
5. Does Jane own truck?
A. Build a text-based chatbot application as a healthcare assistant chatbot for a clinic. The chatbot
should help patients by answering basic queries like clinic hours, doctor availability, appointment
booking, and general health advice. The chatbot must: Greet the user, Respond to queries about:

1. Clinic timings
2. Doctor availability (general practitioner, dentist, pediatrician)
3. Appointment booking
4. General health tips
5. Respond appropriately to unrecognized inputs.
6. Exit when the user types "bye" or "exit".

B. A school is organizing a math competition where students are given problems involving
permutations. One task is to determine the number of unique ways students can be arranged in a
line, depending on the number of participants. This is calculated using the factorial of the number
of students.Develop a Prolog program that helps the organizer compute this automatically.

A. A multi-agent system consists of multiple decision-making agents which interact in a shared


environment to achieve common or conflicting goals. It can be a group of agents or humans and
agents that interact with each other and the environment to achieve goals. In such a system, it is
assumed that the agents may not have full knowledge of both the environment and the internal state
of other agents. The interaction between agents may be cooperative or competitive. In a cooperative
interaction, agents work with each other towards a common goal. The aim of this interaction is to
enable agents to distribute and share their knowledge and use the intelligence and capabilities of
each other to solve problems. In a competitive interaction, agents may compete to obtain individual
resources and achieve individual goals.

Design a game with multiple agents for cooperative or competitive interaction to achieve the goal.
Describe type of interaction between the agents with correct implementation in the code to justify
your statement for the multi agent system.

B. A student is learning mathematical calculations using Prolog. The goal is to implement:

Basic arithmetic operations (Addition, Subtraction, Multiplication, Division)

The student will enter a number, and Prolog will compute the result

You might also like