AI Problem Solving and Agent Design: Assignment Solutions, Exams of Nursing

Solutions to an ai assignment, covering topics such as search algorithms (hill-climbing, a*, branch-and-bound) and the peas model for ai agents. It includes detailed explanations and examples for various scenarios, such as flood prediction, covid-19 detection, pothole filling, greenhouse management, and gas leak detection. The document also addresses neural network design for disease diagnosis, comparing single and multiple network approaches. This material is useful for students studying artificial intelligence and machine learning, providing practical insights into algorithm application and agent design principles. A comprehensive overview of ai problem-solving techniques and agent design principles, making it a valuable resource for students and practitioners in the field.

Typology: Exams

2025/2026

Available from 11/23/2025

jayden-smith-8
jayden-smith-8 🇺🇸

763 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AI Assignment
SCI/ICT/1269/22
a) You and some friends are lost in a new city . You get into a big fight about the best way to find a
path from your start position (S) to your goal (G), and so you split up and each try a different
search technique. You and your friends always break ties in lexicographic order.
. i) One of your friend Tom decides to try Hill-Climbing using an extended list, because it seems like the
easy way out. What is the final path that Tom will find? S->I->K->G
ii)How many times will Tom need to backtrack, show your workings. 3 Times
ii) James suggests that you use an A* search using both the heuristic and an extended list, show James
tree like solution . S|B|I|K|G
iii)What is the final path that James will find? S->B->I->K->G
iv)Kamau is still skeptical about the results so far. he proposes a branch-and-bound search instead. Will
Kamau search produce the same path as James ? If so, explain why. If not, explain why not
Kamau’s branch-and-bound search may produce the same path as James’ A* search. Both method
explore the search in a systematic way, but branch-and-bound uses bounding functions to prune
branches that are unlikely to lead the goal, which can make it more efficient.
pf3
pf4
pf5
pf8

Partial preview of the text

Download AI Problem Solving and Agent Design: Assignment Solutions and more Exams Nursing in PDF only on Docsity!

AI Assignment

SCI/ICT/1269/

a) You and some friends are lost in a new city. You get into a big fight about the best way to find a

path from your start position (S) to your goal (G), and so you split up and each try a different search technique. You and your friends always break ties in lexicographic order.

. i) One of your friend Tom decides to try Hill-Climbing using an extended list, because it seems like the easy way out. What is the final path that Tom will find? S->I->K->G ii)How many times will Tom need to backtrack, show your workings. 3 Times ii) James suggests that you use an A* search using both the heuristic and an extended list, show James tree like solution. S|B|I|K|G iii)What is the final path that James will find? S->B->I->K->G iv)Kamau is still skeptical about the results so far. he proposes a branch-and-bound search instead. Will Kamau search produce the same path as James? If so, explain why. If not, explain why not Kamau’s branch-and-bound search may produce the same path as James’ A search. Both method explore the search in a systematic way, but branch-and-bound uses bounding functions to prune branches that are unlikely to lead the goal, which can make it more efficient.*

b) Describe PEAS model for the following AI agent

  • An agent that reports threat of flood activity in Kenya:
  • An agent to detect COVID-19 Virus
  • NAKURU-KABARAK pothole filler agent
  • Green house smart agent
  • Gas leak detection system

1. An agent that reports threat of flood activity in Kenya

  • Performance Measure: o Accuracy of flood prediction o Timeliness of flood alerts o Number of lives/property saved by timely warnings o Geographic coverage (wide area affected)
  • Environment: o Weather conditions (rain, temperature, etc.) o River levels, rainfall patterns, and historical flood data o Satellite imagery, meteorological data o Government and disaster response systems
  • Actuators: o Sending alerts via SMS, emails, or mobile apps o Activating sirens or warning systems o Updating databases or online platforms
  • Sensors: o Rain gauges o Satellite sensors for weather data o River level sensors (stream gauges) o Environmental monitoring systems

2. An agent to detect COVID-19 Virus

  • Performance Measure: o Accuracy and speed of detection (test result time) o Reduction in transmission through early detection o Percentage of cases identified compared to actual cases
  • Environment: o Infected individuals (virus spread in the population)

o Greenhouse environment (temperature, humidity, CO2 levels) o Types of crops being grown o External weather conditions (temperature, light, rain, etc.) o Soil conditions and water supply

  • Actuators: o Adjusting temperature (e.g., turning on/off heaters or cooling systems) o Managing irrigation systems (watering crops) o Activating lights for photosynthesis o Opening/closing windows or ventilation systems
  • Sensors: o Temperature sensors (for air and soil) o Humidity sensors (for controlling moisture levels) o Soil moisture sensors o Light sensors (for monitoring sunlight exposure) o CO2 level sensors (for optimizing plant growth)

5. Gas Leak Detection System

  • Performance Measure: o Detection accuracy (minimizing false positives/negatives) o Speed of detection (early detection of leaks) o Ability to minimize damage by triggering safety measures o Coverage area of detection
  • Environment: o Gas pipelines, homes, factories, or any industrial site o Gas composition (types of gases such as methane, propane, etc.) o The presence of flammable materials or conditions that may lead to explosions
  • Actuators: o Activating alarms or sirens to warn people o Shutting off gas supply to prevent further leakage o Sending real-time alerts to emergency services o Controlling ventilation systems to disperse gas
  • Sensors: o Gas detectors (e.g., methane, propane, carbon monoxide sensors) o Pressure sensors in pipes or containers o Temperature sensors (to detect unusual fluctuations that could indicate a leak) o Humidity sensors (for detecting conditions that promote gas leak detection)

C. Perform the minimax algorithm, without alpha-beta based on tree. Write the minimum value at

each node

c) Assume we have a set of data from patients who have visited KABARK health care centre during

the year 2023, A set of features (e.g., temperature, height) have been also extracted for each patient. Your goal is to decide whether a new visiting patient has any of diabetes, heart disease, or Alzheimer disease (a patient can have one or more of these diseases).As an Machine learning expert ,you have decided to use a neural network to solve this problem which has two choices: either to train a separate neural network for each of the diseases or to train a single neural network with one output neuron for each disease, but with a shared hidden layer. Which method do you think will be appropriate given the above scenario? Justify your answer. Given the scenario, training a single neural network with one output neuron for each disease (diabetes, heart disease, and Alzheimer’s disease), but with a shared hidden layer would be the more appropriate method. Here’s the reasoning behind this choice:

1. Shared Hidden Layers Capture Common Features

  • Disease Interrelation : The diseases (diabetes, heart disease, and Alzheimer’s) are often interrelated and share common risk factors. For example, high blood pressure, obesity, and genetics might contribute to the onset of multiple diseases. By sharing a hidden layer, the neural network can learn these common patterns across diseases, which is more efficient than training separate networks for each disease.

d) Suppose you are asked to find the shortest path from H to G in the graphs below. For both of

the graphs explain why the heuristic values shown are not valid for A*. Note the differences in the graphs at nodes F and E. I. II. To explain why the heuristic values shown for both graphs are not valid for A , let's first recall the fundamental rule for a heuristic to be valid for A search:

Validity of Heuristics in A* Search:

For A* to work correctly, the heuristic must be admissible , which means it must never overestimate the true cost to reach the goal. This ensures that A* always finds the shortest path. Additionally, the heuristic should be consistent (also known as the monotonicity property), meaning that the heuristic value at a node should satisfy the following condition: h(n)≤c(n,a,n′)+h(n′)h(n) \leq c(n, a, n') + h(n')h(n)≤c(n,a,n′)+h(n′) Where:

  • h(n)h(n)h(n) is the heuristic value at node nnn
  • c(n,a,n′)c(n, a, n')c(n,a,n′) is the actual cost from node nnn to node n′n'n′
  • h(n′)h(n')h(n′) is the heuristic value at node n′n'n′ This condition ensures that the heuristic does not violate the principle of optimality. Now, let's discuss the specific graphs and the issues with the heuristic values at nodes F and E.

Graph I:

  • Issue at Node F : In Graph I, the heuristic value for node F is invalid if it overestimates the cost to reach the goal G. A* will incorrectly prioritize exploring node F over other nodes if the heuristic value is not admissible. If the heuristic for F suggests that the cost from F to G is lower than it actually is , the search may be misled into exploring paths that lead to suboptimal solutions.
  • Why It’s Invalid : A heuristic is invalid if the value at node F overestimates the true remaining cost from F to the goal G. For example, if the cost from F to G is higher than what the heuristic value suggests, this will violate the admissibility condition, potentially causing A* to fail to find the optimal path.

Graph II:

  • Issue at Node E : In Graph II, the heuristic value for node E may be invalid if it violates the consistency property, meaning it doesn’t satisfy the inequality for consistency mentioned above. In particular, if the cost from E to its neighbor F plus the heuristic value at F is less than the heuristic value at E , then the heuristic for E is inconsistent.
  • Why It’s Invalid : If the heuristic at E overestimates the cost to G , or the cost from E to F plus the heuristic value at F is greater than the heuristic value at E , then A* might

overlook an optimal path through E and choose a less optimal path due to the heuristic misleading the search.