AI NUMERICALS ANSWERS (NON SOLVING)
1. Autonomous Mars Rover
Performance Measure:
- Scientific Data Quality: Accuracy and precision of measurements taken from soil, rocks, and
atmospheric samples.
- Coverage Area: The amount of Martian terrain explored and analyzed.
- Energy Efficiency: Effective use of available energy (solar power) to maximize operational
time.
- Durability and Reliability: Ability to function over extended periods in harsh conditions without
failure.
Environment:
- Rocky Terrain: Uneven, with potential obstacles such as rocks and craters.
- Extreme Temperatures: Varying from extremely cold nights to relatively warmer days.
- Dust Storms: Frequent and severe, which can block sunlight and interfere with sensors.
- Varying Light Conditions: Day-night cycles and seasons affecting visibility and power
generation.
Actuators:
- Wheels or Tracks: For navigation and mobility across the Martian surface.
- Robotic Arm: For collecting soil and rock samples, and performing close-up scientific
experiments.
- Cameras: For capturing images and videos, aiding navigation, and analyzing the
surroundings.
- Solar Panels: To generate power from sunlight, requiring periodic cleaning due to dust
accumulation.
Sensors:
- Cameras and Spectrometers: For capturing images and analyzing the composition of
materials.
- Temperature and Pressure Sensors: To monitor environmental conditions.
- LIDAR: For 3D mapping of the terrain and obstacle detection.
- Gyroscopes and Accelerometers: For navigation and orientation purposes.
Environment Characterization:
- Observable: Partially observable due to limited sensor range and possible dust interference.
- Agents: Single agent operating independently.
- Deterministic: Stochastic, due to unpredictable environmental conditions like dust storms.
- Episodic: Sequential, with actions depending on previous states and decisions.
- Static: Dynamic, with constantly changing environmental conditions.
- Discrete: Continuous, with a wide range of potential actions and outcomes.
- Known: Partially known, with some prior information about terrain but many unknowns.
2. Self-Driving Car
Performance Measure:
- Safety: Minimizing accidents and ensuring passenger and pedestrian safety.
- Comfort: Providing a smooth and comfortable ride experience for passengers.
- Efficiency: Optimizing fuel consumption and travel time, including route planning and traffic
management.
Environment:
- Urban and Rural Roads: Including highways, city streets, and rural pathways.
- Various Weather Conditions: Such as rain, fog, snow, and clear weather affecting visibility
and traction.
- Dynamic Objects: Other vehicles, pedestrians, cyclists, and obstacles.
Actuators:
- Steering Wheel: For directional control.
- Accelerator and Brake Pedals: For speed control and stopping.
- Gear Shift: For changing gears (automatic or manual).
- Indicators and Lights: For signaling intentions to other road users.
Sensors:
- Cameras: For object detection, lane keeping, and traffic sign recognition.
- LIDAR: For 3D mapping and obstacle detection.
- Radar: For detecting objects and vehicles at a distance.
- Ultrasonic Sensors: For close-range detection, such as parking.
- GPS: For navigation and route planning.
Environment Characterization:
- Observable: Partially observable due to limited sensor range and potential occlusions.
- Agents: Multi-agent, interacting with other vehicles, pedestrians, and infrastructure.
- Deterministic: Stochastic, due to unpredictable behavior of other road users.
- Episodic: Sequential, with continuous feedback influencing subsequent actions.
- Static: Dynamic, with constantly changing traffic and environmental conditions.
- Discrete: Continuous, with numerous possible states and actions.
- Known: Partially known, with some information about routes but dynamic elements like traffic.
3. Part Picking Robot
Performance Measure:
- Accuracy: Precision in picking the correct parts and placing them accurately.
- Speed: Time taken to complete picking and placing tasks.
- Error Rate: Frequency of mistakes such as picking wrong parts or dropping them.
Environment:
- Manufacturing Floor: Structured environment with predefined locations for parts and
assembly.
- Conveyor Belts: Moving parts to different locations.
- Bins with Parts: Organized storage for various components.
Actuators:
- Robotic Arm with Gripper: For picking up and placing parts.
- Conveyor Belt Actuators: For moving parts to and from the robot's reach.
Sensors:
- Cameras: For identifying and locating parts.
- Force Sensors in Gripper: To ensure the correct grip strength.
- Position Encoders: To accurately control the arm's movements.
Environment Characterization:
- Observable: Fully observable, with a controlled environment and known part locations.
- Agents: Single agent, focused on part picking and placement.
- Deterministic: Deterministic, as actions lead to predictable outcomes in a controlled setting.
- Episodic: Sequential, with tasks performed in a sequence.
- Static: Static, with a fixed setup and repetitive tasks.
- Discrete: Discrete, with specific actions and predefined tasks.
- Known: Known, with a well-defined environment and tasks.
4. Map Coloring Problem Formulation
Problem: Color a planar map using only 4 colors such that no two adjacent regions have the
same color.
Initial State:
- An uncolored map represented as a graph where each region is a node and edges represent
adjacency between regions.
Goal Test:
- A valid coloring where each node (region) is assigned one of the four colors and no two
adjacent nodes (regions) share the same color.
Successor Function:
- Assign a color to an uncolored region such that it does not conflict with the colors of adjacent
regions. This generates the next state in the search process.
Cost Function:
- Each step of coloring a region can be assigned a uniform cost (e.g., 1 unit per step),
reflecting the simplicity of the task. Alternatively, a cost of zero could be used if the primary goal
is to find any valid coloring without optimization concerns.
These elements form the basis for algorithms like backtracking, constraint satisfaction, or graph
coloring heuristics to systematically explore possible colorings and ensure compliance with the
problem constraints.
Here are the detailed responses to the questions based on the provided reference book
"Artificial Intelligence and Soft Computing":
5. Design a planning agent for a Blocks World problem
Blocks World Problem: The Blocks World is a classic AI problem consisting of a set of blocks on
a table, which can be stacked on top of each other. The goal is to transform a given initial
configuration of blocks into a desired goal configuration using a sequence of moves.
Initial State: Assume three blocks A, B, and C are on the table, with A on B and B on C.
- on(A, B)
- on(B, C)
- on(C, table)
- clear(A)
- hand_empty
Goal State: The goal is to stack A on B and B on C, forming a single stack.
- on(A, B)
- on(B, C)
- on(C, table)
- clear(A)
- hand_empty
Actions:
1. Pick up (X): Precondition: clear(X), on(X, Y), hand_empty. Effect: holding(X), clear(Y), not
on(X, Y).
2. Put down (X): Precondition: holding(X). Effect: hand_empty, on(X, table), clear(X).
3. Stack (X, Y): Precondition: holding(X), clear(Y). Effect: on(X, Y), hand_empty, clear(X).
4. Unstack (X, Y): Precondition: on(X, Y), clear(X), hand_empty. Effect: holding(X), clear(Y), not
on(X, Y).
Plan:
1. Unstack(A, B)
2. Putdown(A)
3. Unstack(B, C)
4. Stack(B, A)
5. Pickup(A)
6. Stack(A, B)
This sequence of actions will achieve the goal state from the initial state.
6. State space representation for 8-puzzle Problem. What are
possible Heuristic functions for it?
8-puzzle Problem: The 8-puzzle consists of a 3x3 grid with 8 numbered tiles and one empty
space. The goal is to arrange the tiles in a specified order.
State Space Representation: Each state can be represented as a 3x3 matrix. The operators
correspond to moving the blank space (up, down, left, right).
Heuristic Functions:
1. Hamming Distance (h1): The number of misplaced tiles.
- Example: If the goal state is `1 2 3 4 5 6 7 8 blank` and the current state is `1 2 3 4 5 6 8 7
blank`, then h1 = 2.
2. Manhattan Distance (h2): The sum of the distances of the tiles from their goal positions.
- Example: If the goal state is `1 2 3 4 5 6 7 8 blank` and the current state is `1 2 3 4 5 6 8 7
blank`, then h2 = 1 (since tile 7 is 1 move away from its goal position).
3. Initial state, goal test, successor function, and cost function for the Travelling Salesman
Problem (TSP)
Initial State: A list of cities and the distances between each pair of cities. Start from any city,
e.g., city A.
Goal Test: All cities have been visited exactly once, and the salesman returns to the starting city.
Successor Function: Generate the next city to visit from the current city, ensuring no city is
visited more than once.
Cost Function: The total distance traveled. The objective is to minimize this total distance.
4. State space representation for the 5-gallon jug and 3-gallon jug problem
State Space Representation:
- States: Represented as pairs (x, y) where x is the amount of water in the 5-gallon jug and y is
the amount in the 3-gallon jug.
- Initial State: (5, 0)
- Goal State: (z, 1) for any z
Operators:
1. Fill the 5-gallon jug: (x, y) → (5, y)
2. Fill the 3-gallon jug: (x, y) → (x, 3)
3. Empty the 5-gallon jug: (x, y) → (0, y)
4. Empty the 3-gallon jug: (x, y) → (x, 0)
5. Pour water from the 5-gallon jug into the 3-gallon jug until one is either full or empty: (x, y) →
(min(5, x + y), max(0, x + y - 5))
6. Pour water from the 3-gallon jug into the 5-gallon jug until one is either full or empty: (x, y) →
(max(0, x + y - 3), min(3, x + y))
7. Initial state, goal test, successor function, and cost function
for the Travelling Salesman Problem (TSP)
Initial State: A list of cities and the distances between each pair of cities. Start from any city,
e.g., city A.
Goal Test: All cities have been visited exactly once, and the salesman returns to the starting city.
Successor Function: Generate the next city to visit from the current city, ensuring no city is
visited more than once.
Cost Function: The total distance traveled. The objective is to minimize this total distance.
8. State space representation for the 5-gallon jug and 3-gallon jug
problem
State Space Representation:
- States: Represented as pairs (x, y) where x is the amount of water in the 5-gallon jug and y is
the amount in the 3-gallon jug.
- Initial State: (5, 0)
- Goal State: (z, 1) for any z
Operators:
1. Fill the 5-gallon jug: (x, y) → (5, y)
2. Fill the 3-gallon jug: (x, y) → (x, 3)
3. Empty the 5-gallon jug: (x, y) → (0, y)
4. Empty the 3-gallon jug: (x, y) → (x, 0)
5. Pour water from the 5-gallon jug into the 3-gallon jug until one is either full or empty: (x, y) →
(min(5, x + y), max(0, x + y - 5))
6. Pour water from the 3-gallon jug into the 5-gallon jug until one is either full or empty: (x, y) →
(max(0, x + y - 3), min(3, x + y))
5. Environmental characteristics of the WUMPUS world Puzzle
WUMPUS World Environment:
- Static: The environment does not change except by the agent's actions.
- Fully Observable: The agent has sensors to detect stench, breeze, glitter, bump, and scream.
- Deterministic: The outcomes of actions are predictable.
- Discrete: The environment is divided into a grid of rooms.
- Single-Agent: Only one agent (the player) is active in the environment.
6. Formulate the 8-puzzle problem
8-puzzle Problem Formulation:
- States: Each state is a configuration of the 3x3 grid with 8 tiles and one blank space.
- Initial State: A specific configuration of the tiles, e.g., `1 2 3 4 5 6 7 8 blank`.
- Goal State: A configuration where the tiles are in order, e.g., `1 2 3 4 5 6 7 8 blank`.
- Operators: Moves of the blank space (up, down, left, right).
- Goal Test: The current state matches the goal state.
- Path Cost: Each move has a cost of 1.
11. Write first order logic statements for following statements:
(i) Horses, cows, and pigs are mammals.
(ii) Bluebird is a horse.
(iii) Whoever can read is literate.
(iv) Every tree in which any aquatic bird sleeps is beside some
lake.
(v) Anything anyone eats and is not killed by is food.
12. Convert the following propositional logic statement into CNF
: A -> ( B -> <- C )
13.What is FOPL? Represent the following sentences using FOPL
i) John has at least two friends
ii) If two people are friends then they are not enemies.
14.Convert the following English sentence into predicate logic
and then into CNF "The culprit was tall and dark"
15. Consider the following set of sentences
a) Whoever can read is literate
b) Birds are not literate
c) Some birds are intelligent
Prove the following using forward reasoning "Some who are
intelligent cannot read"
16.Convert the following statements into predicate logic
1. All kings are persons.
2. Every city in Maharashtra has temple.
3. An Apple a day keeps doctor away.
4. Anything anyone eats and is not killed by is food.
5. Square of 3 is 9.
17. Give types of parsing and generate the parse tree for a
sentence "The cat ate the fish".
18. What-actions would you take to prove "Some who are
intelligent can't read" using propositional logic
1. Whoever can read is literate.
2. Dolphins are not literate.
3. Some dolphins are intelligent
19. Explain Problem formulation also give the initial state, goal
test, successor function, and cost function for the following.
Choose the formulation that is precise enough to be
implemented.
Problem statement: A 3 foot tall monkey is in a room where some
bananas are suspended from the 8 foot tall ceiling. He would like
to get bananas. The room contains two stackable, movable,
climbable 3 foot high crates.
Problem Formulation: Monkey and Bananas
In this problem, we need to help a monkey, which is 3 feet tall, reach bananas suspended from
an 8-foot-high ceiling. The room contains two stackable, movable, climbable 3-foot-high crates.
The goal is to formulate a solution that allows the monkey to reach the bananas.
Problem Definition:
The monkey can perform the following actions:
1. Move to a crate.
2. Climb onto a crate.
3. Stack one crate on top of another.
4. Move a crate to a different location.
5. Grab the bananas (if within reach).
The state of the problem can be represented by:
1. The position of the monkey (on the floor, on crate 1, on crate 2, or on the stacked crates).
2. The position of the two crates (floor, stacked, moved to different locations).
3. Whether the monkey has the bananas or not.
Initial State:
- Monkey: on the floor.
- Crate 1: on the floor at position P1.
- Crate 2: on the floor at position P2.
- Bananas: hanging from the ceiling.
- Monkey does not have bananas.
Goal State:
- Monkey has the bananas.
Actions (Successor Function):
1. Move to Crate 1:
- Precondition: Monkey is on the floor, crate 1 is not stacked.
- Result: Monkey is at crate 1.
2. Move to Crate 2:
- Precondition: Monkey is on the floor, crate 2 is not stacked.
- Result: Monkey is at crate 2.
3. Climb Crate 1:
- Precondition: Monkey is at crate 1.
- Result: Monkey is on crate 1.
4. Climb Crate 2:
- Precondition: Monkey is at crate 2.
- Result: Monkey is on crate 2.
5. Climb Stacked Crates:
- Precondition: Crates are stacked, and monkey is at stacked crates.
- Result: Monkey is on stacked crates.
6. Stack Crates:
- Precondition: Crate 1 and Crate 2 are on the floor.
- Result: Crates are stacked, monkey is on the floor at stacked crates.
7. Unstack Crates:
- Precondition: Crates are stacked, monkey is on the floor at stacked crates.
- Result: Crates are unstacked, monkey is at crate 1 or crate 2.
8. Move Crate 1 to Position P3:
- Precondition: Monkey is on the floor at crate 1, crate 1 is not stacked.
- Result: Crate 1 is moved to position P3, monkey is at crate 1 at position P3.
9. Move Crate 2 to Position P3:
- Precondition: Monkey is on the floor at crate 2, crate 2 is not stacked.
- Result: Crate 2 is moved to position P3, monkey is at crate 2 at position P3.
10. Grab Bananas:
- Precondition: Monkey is on stacked crates and the crates' height plus monkey's height is 9
feet (>= height of bananas).
- Result: Monkey has the bananas.
Cost Function:
Each action has a cost of 1. The objective is to minimize the total number of actions taken to
achieve the goal state.
Implementation in Detail:
1. State Representation:
- \((M, C1, C2, B)\)
- \(M\): Monkey's position (floor, crate 1, crate 2, stacked crates)
- \(C1\): Crate 1's position (P1, P2, P3)
- \(C2\): Crate 2's position (P1, P2, P3)
- \(B\): Boolean (whether monkey has bananas or not)
2. Initial State:
- \( (floor, P1, P2, False) \)
3. Goal Test:
- \( B = True \)
4. Successor Function:
- As defined in the actions section above, generate new states based on the actions applied to
the current state.
5. Cost Function:
- Each action increments the path cost by 1.
Example Plan:
This plan will help the monkey achieve the goal state of having the bananas.
33. Design a classical planner for air cargo transportation
problem using STRIPS. The problem involves loading, unloading
cargo and flying it from place to place. Define three actions:
Load, Unload and Fly. The actions affect two predicates: In(c, p)
means that cargo e inside plane p, and At(x, a) means that object
x (either plane or cargo) is at airport a.
In the context of the Air Cargo Transportation problem, we will use the Stanford Research
Institute Problem Solver (STRIPS) framework to define and solve the planning problem. The
actions involved are loading, unloading, and flying cargo between airports. We will define these
actions and their effects on the predicates: `In(c, p)` (cargo `c` is inside plane `p`) and `At(x, a)`
(object `x`, which can be either plane or cargo, is at airport `a`).
Actions in STRIPS Representation
1. Load Action
- Action: `Load(c, p, a)`
- Preconditions:
- `At(c, a)` : Cargo `c` is at airport `a`.
- `At(p, a)` : Plane `p` is at airport `a`.
- Effects:
- `¬At(c, a)` : Cargo `c` is no longer at airport `a`.
- `In(c, p)` : Cargo `c` is inside plane `p`.
2. Unload Action
- Action: `Unload(c, p, a)`
- Preconditions:
- `In(c, p)` : Cargo `c` is inside plane `p`.
- `At(p, a)` : Plane `p` is at airport `a`.
- Effects:
- `¬In(c, p)` : Cargo `c` is no longer inside plane `p`.
- `At(c, a)` : Cargo `c` is at airport `a`.
3. Fly Action
- Action: `Fly(p, from, to)`
- Preconditions:
- `At(p, from)` : Plane `p` is at airport `from`.
- Effects:
- `¬At(p, from)` : Plane `p` is no longer at airport `from`.
- `At(p, to)` : Plane `p` is at airport `to`.
34. Solve the Air cargo transport problem using Planning. It
involves loading unloading cargo onto and off of planes and
flying it from place. Initial State is cargo 1 and plane 1 is at
Mumbai airport, cargo 2 and plane 2 is at Delhi airport. Goal State
is cargo 2 should be at Mumbai airport and cargo 1 should be at
Delhi airport.
Solving the Air Cargo Transport Problem Using Planning
We will now apply the STRIPS actions to solve the Air Cargo Transportation problem with the
specified initial and goal states.
Initial State
- `At(cargo1, Mumbai)`
- `At(plane1, Mumbai)`
- `At(cargo2, Delhi)`
- `At(plane2, Delhi)`
Goal State
- `At(cargo1, Delhi)`
- `At(cargo2, Mumbai)`
Plan
1. Load cargo1 into plane1 at Mumbai
- Preconditions: `At(cargo1, Mumbai)`, `At(plane1, Mumbai)`
- Effects: `¬At(cargo1, Mumbai)`, `In(cargo1, plane1)`
2. Fly plane1 from Mumbai to Delhi
- Preconditions: `At(plane1, Mumbai)`
- Effects: `¬At(plane1, Mumbai)`, `At(plane1, Delhi)`
3. Unload cargo1 from plane1 at Delhi
- Preconditions: `In(cargo1, plane1)`, `At(plane1, Delhi)`
- Effects: `¬In(cargo1, plane1)`, `At(cargo1, Delhi)`
4. Load cargo2 into plane2 at Delhi
- Preconditions: `At(cargo2, Delhi)`, `At(plane2, Delhi)`
- Effects: `¬At(cargo2, Delhi)`, `In(cargo2, plane2)`
5. Fly plane2 from Delhi to Mumbai
- Preconditions: `At(plane2, Delhi)`
- Effects: `¬At(plane2, Delhi)`, `At(plane2, Mumbai)`
6. Unload cargo2 from plane2 at Mumbai
- Preconditions: `In(cargo2, plane2)`, `At(plane2, Mumbai)`
- Effects: `¬In(cargo2, plane2)`, `At(cargo2, Mumbai)`
Execution of the Plan
1. `Load(cargo1, plane1, Mumbai)`
2. `Fly(plane1, Mumbai, Delhi)`
3. `Unload(cargo1, plane1, Delhi)`
4. `Load(cargo2, plane2, Delhi)`
5. `Fly(plane2, Delhi, Mumbai)`
6. `Unload(cargo2, plane2, Mumbai)`
This sequence of actions successfully transitions the initial state to the goal state by moving
cargo1 to Delhi and cargo2 to Mumbai using the planes.
By using STRIPS notation and defining the actions with preconditions and effects, the planning
problem is precisely formulated and solved. This ensures a clear and structured approach to
achieving the desired goal state from the initial conditions.