0% found this document useful (0 votes)
16 views4 pages

AI Concepts: Algorithms & Knowledge Representation

Uploaded by

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

AI Concepts: Algorithms & Knowledge Representation

Uploaded by

ripi6981
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Artificial Intelligence – Unit 1 & 2 Answers

1. What is Iterative Deepening A* Algorithm?


Iterative Deepening A* (IDA*) is a search algorithm that combines the space-efficiency of
Depth-First Search (DFS) with the optimality and goal-directedness of A* search.
How it works: IDA* performs repeated depth-first searches with an increasing cost
threshold. Each iteration prunes paths whose total estimated cost f(n)=g(n)+h(n) exceeds
the current threshold. When goal not found, threshold increases to the smallest pruned
node's f(n).
Key advantage: Much lower memory than A* (linear in solution depth) while retaining
optimality when an admissible heuristic is used.
2. Explain knowledge representation using propositional logic with an example.
Propositional logic represents facts as atomic propositions that are either true or false.
Logical connectives (AND, OR, NOT, →, ↔) combine propositions to form rules and sentences.
It is simple but cannot express relations between objects or use quantifiers.
Example:
P: "It is raining."
Q: "The ground is wet."
Rule: P → Q (If it is raining, then the ground is wet).
Using propositional logic an AI system can apply such rules to deduce Q when P is true.
3. What is an Agent in AI? Which are the different types of agents?
Agent: An entity that perceives its environment through sensors and acts upon it through
actuators to achieve objectives.
Types of agents:
- Simple reflex agent: Acts only on current percept; uses condition-action rules (e.g.,
basic vacuum cleaner).
- Model-based reflex agent: Maintains an internal state (model) to handle partial
observability.
- Goal-based agent: Chooses actions to achieve explicit goals (plans actions considering
future states).
- Utility-based agent: Uses a utility function to choose actions that maximize expected
performance/utility.
- Learning agent: Improves performance by learning from experiences and feedback.
4. Explain Greedy Best First Search algorithm with an example.
Greedy Best-First Search selects the node that seems closest to the goal according to a
heuristic h(n). It expands nodes with smallest h(n) first and ignores cost-so-far g(n).
How it works: Use a priority queue ordered by h(n); always expand lowest h(n).
Example: In a map, greedy BFS always moves toward the city with the smallest straight-line
distance to the destination. It is fast but not guaranteed to be optimal or complete in
some graphs.
5. Write the characteristics of an expert system.
Characteristics:
- High performance: Solves problems at an expert level in a narrow domain.
- Domain-specific knowledge: Encodes specialist knowledge in a knowledge base.
- Inference engine: Applies rules to derive conclusions from facts.
- Explanation facility: Can explain reasoning and justify decisions.
- Maintainability & Modifiability: Knowledge can be updated without changing core code.
- Reliability and consistency: Reproduces decisions reliably for the same inputs.
6. Explain how frames are used in knowledge representation.
Frames are structured records representing stereotyped situations, objects, or concepts. A
frame contains slots (attributes) and associated values; slots may have default values,
constraints, or procedural attachments.
Example: Frame "Car" → slots: make, model, color, engine_type, number_of_wheels.
Frames support inheritance (Car is-a Vehicle) and allow compact, organized representation
of related knowledge.
7. List any two differences between Uninformed and Informed Search Techniques.
- Knowledge: Uninformed search uses no domain-specific information about the goal
location; Informed search uses heuristics estimating distance to goal.
- Efficiency: Uninformed search (BFS/DFS) can be inefficient in large spaces; Informed
search (A*, Greedy) is generally faster and more directed.
8. Convert the sentences into clausal form and prove that John likes peanuts using
resolution.
Sentences:
1) "John likes all kinds of food."
FOL: ∀x (Food(x) → Likes(John, x))
Clausal form: ¬Food(x) ∨ Likes(John, x)
2) "Apples are food."
FOL: Food(Apples)
Clausal form: Food(Apples)
3) "Bill eats peanuts and is still alive."
FOL: Eats(Bill, Peanuts) ∧ Alive(Bill)
Clausal form: Eats(Bill, Peanuts), Alive(Bill)
Assume also: Food(Peanuts) (peanuts are food).
Goal: Likes(John, Peanuts)
Negate goal: ¬Likes(John, Peanuts)
Resolution steps:
- From clause ¬Food(x) ∨ Likes(John, x) and ¬Likes(John, Peanuts) unify with x = Peanuts →
derive ¬Food(Peanuts).
- Resolve ¬Food(Peanuts) with Food(Peanuts) → empty clause.
Thus contradiction arises, so Likes(John, Peanuts) is proved.
9. Convert "Every child loves every candy" to clause form.
FOL: ∀x ∀y (Child(x) ∧ Candy(y) → Loves(x,y))
Eliminate implication and apply De Morgan:
∀x ∀y (¬Child(x) ∨ ¬Candy(y) ∨ Loves(x,y))
Clausal form: ¬Child(x) ∨ ¬Candy(y) ∨ Loves(x,y)
10. What is the significance of using OPEN and CLOSED list in search algorithms?
- OPEN list (fringe): Nodes generated but not yet expanded; used to select next node
(queue in BFS, priority queue in A*).
- CLOSED list: Nodes already expanded; prevents revisiting, reduces repeated work, and
avoids infinite loops. Together they ensure efficiency and correctness in many search
algorithms.
11. What is a semantic network and how it is used to represent knowledge?
A semantic network is a graph-based knowledge representation where nodes denote
concepts/objects and edges denote labeled relations (e.g., is-a, has-a, part-of). It
captures inheritance, relationships, and associations in an intuitive visual form.
Example: Dog --is-a--> Mammal; Dog --has--> Tail. Useful for inheritance, quick lookups,
and concept mapping.
12. What is meant by heuristic search? Define a heuristic function for 8-tiles problem.
Heuristic search uses an estimate (heuristic) of the cost from a node to the goal to guide
the search toward promising states and reduce exploration.
Common heuristics for 8-puzzle:
- h1: Number of misplaced tiles (count tiles not in goal position)
- h2: Sum of Manhattan distances (for each tile, horizontal + vertical moves to reach
goal)
h2 is usually more informed (dominates h1) and often yields fewer node expansions.
13. List the major applications of Expert system.
- Medical diagnosis and treatment recommendations (e.g., MYCIN-like systems)
- Fault diagnosis and troubleshooting in engineering systems
- Financial analysis, credit scoring, and fraud detection
- Configuration and design (e.g., hardware/software setup)
- Customer support systems and help desks
14. Explain A* algorithm (general explanation)
A* uses f(n) = g(n) + h(n) where:
- g(n): cost from start to current node n
- h(n): estimated cost from n to goal (heuristic)
The node with lowest f(n) is expanded next. If h(n) is admissible (never overestimates),
A* is both complete and optimal. Common uses: pathfinding in maps, robotics, games.
15. Solve by BFS and DFS (given tree)
Graph:
A → {B, C}
B → {D, E}
C → {F, G}
D, E, F, G → {}
BFS (level-order): A, B, C, D, E, F, G
DFS (preorder, expand B before C and children in left-to-right): A, B, D, E, C, F, G
BFS uses a queue (broad then deep), DFS uses a stack (deep then backtrack).
16. Differentiate total order plan and partial order plan.
- Total-order plan: All actions are totally ordered; execution sequence is fully
specified. Simpler to execute but less flexible.
- Partial-order plan: Only necessary ordering constraints are specified; unrelated actions
remain unordered, increasing flexibility and enabling concurrency when possible.
17. Convert the following English sentences to FOL.
(i) All students are smart.
∀x (Student(x) → Smart(x))
(ii) There is a healthy food that is delicious.
∃x (HealthyFood(x) ∧ Delicious(x))
(iii) Everybody loves somebody.
∀x ∃y Loves(x, y)
(iv) Every dog chases every cat.
∀x ∀y (Dog(x) ∧ Cat(y) → Chases(x, y))
18. Explain how values are propagated in the given tree using Alpha-Beta pruning.
Alpha-Beta pruning optimizes minimax by carrying two bounds:
- Alpha (α): best value found so far for maximizer (lower bound)
- Beta (β): best value found so far for minimizer (upper bound)
While exploring, if a node's value proves worse than the current bound (α ≥ β), that
branch is pruned because it cannot affect the final decision. This reduces node
evaluations while preserving the minimax result. Nodes pruned are those that cannot
possibly improve the ancestor's choice.
19. Write the differences between predicate logic and propositional logic.
- Propositional logic: Works with atomic propositions (true/false). No internal structure
in propositions; cannot express quantifiers or relations between objects.
- Predicate logic: Introduces predicates, functions, variables, and quantifiers (∀, ∃).
Much more expressive; can describe properties of and relations between objects.
Example: Propositional: Raining. Predicate: Rain(City) or Owns(John, Car).
20. Explain forward and backward chaining with an example.
- Forward chaining (data-driven): Start from known facts and apply rules to infer new
facts until the goal is reached.
Example: Given "Wet ground" and "If wet ground then slippery", we infer "Slippery".
- Backward chaining (goal-driven): Start from a goal and work backwards, finding rules
that support the goal and proving their premises.
Example: To prove "Slippery", check rules that produce "Slippery" and verify their
prerequisites (e.g., "Wet ground").
21. Explain how expert systems are different from traditional programs?
- Expert systems separate the knowledge base (domain rules/facts) from the inference
engine (reasoning mechanism); rules can be updated without changing program logic.
- Traditional programs typically intermingle logic and data, follow fixed algorithms, and
lack explanation facilities or symbolic reasoning built-in.
- Expert systems are designed for reasoning under uncertainty and to mimic an expert's
decision process; traditional programs follow deterministic algorithms.

Common questions

Powered by AI

Frames facilitate knowledge representation by organizing data into structured records with slots for attributes and associated values. They allow for inheritance by enabling specific concepts to inherit attributes from more general frames. For example, if a frame 'Car' is defined as a subtype of 'Vehicle', it inherently gains attributes defined for 'Vehicle' unless explicitly overridden. This supports both compact representation of knowledge and efficient transfer of common properties across different instances .

Propositional logic consists of atomic propositions that are either true or false but lacks the ability to express relations between objects or use quantifiers. In contrast, predicate logic introduces predicates, variables, and quantifiers such as 'forall' (∀) and 'exists' (∃), making it much more expressive by allowing the description of properties and relationships between objects, as seen in examples such as 'Rain(City)' or 'Owns(John, Car)' .

Forward chaining begins with known facts and applies inference rules to extract more data until a goal is achieved. It is data-driven and primarily used in situations where all facts can be presented from the start. Conversely, backward chaining begins with the desired goal and works backward by finding applicable rules and testing if their premises hold true, making it goal-driven. This method is practically used when it is more efficient to start with potential solutions and verify them based on existing data .

Alpha-beta pruning enhances the efficiency of the minimax algorithm by eliminating branches in the search tree that cannot affect the final decision, thereby reducing the number of node evaluations. By maintaining two values, alpha and beta, it tracks the best already-explored option along the path for the maximizer and minimizer respectively. If a node’s potential value suggests it would not influence the final choice (when alpha exceeds beta), further exploration of that node is ceased, which significantly reduces computational cost while maintaining optimal decision making .

A heuristic function in a search algorithm is an estimate of the cost from a node to the goal, guiding the search toward more promising states. For the 8-tiles problem, heuristic functions commonly used are: h1, which counts the number of misplaced tiles, and h2, which sums the Manhattan distances of each tile to its goal position. The latter is more informed as it considers the total movement cost, thus leading to fewer node expansions during search. A well-designed heuristic helps balance algorithm speed and resource usage while maintaining solution accuracy .

Partial-order plans specify only the necessary sequence of actions, leaving unrelated actions unordered. This allows for greater flexibility as actions can be executed out of sequence where dependencies allow, enabling concurrency and adaptability in dynamic environments. In contrast, total-order plans require all actions to be sequentially processed in a fully specified order, which can restrict flexibility and efficiency as it does not accommodate parallel processing or changes without reordering actions .

Semantic networks are preferred for knowledge representation because they explicitly illustrate relationships between concepts and provide mechanisms for capturing inheritance and associative thinking. They allow for more intuitive visual representation compared to standard database systems, which primarily focus on data storage and retrieval without an inherent mechanism for representing relationships or inferencing between data points. This makes semantic networks particularly valuable in fields where understanding complex interconnections between concepts is crucial .

A utility-based agent evaluates possible actions based on a utility function that assigns a single measure reflecting the degree of success or performance expected from that action. It aims to maximize this utility. In contrast, a goal-based agent chooses actions to achieve specific goals without explicitly considering the degree of performance of the outcomes quantitatively. While goal-based agents focus on achieving predefined goals, utility-based agents weigh alternatives more broadly to maximize overall utility, making them better suited for more complex environments where trade-offs are necessary .

Expert systems are widely used in medical diagnosis to suggest treatments, in engineering for fault diagnosis and troubleshooting, in finance for credit scoring and fraud detection, in configuration and design tasks, and in customer support systems. They enhance decision making by providing expert-level problem-solving capabilities in these narrow domains, often offering explanations and reasoning behind their conclusions, which aids human users in understanding and trusting the system's outputs .

Iterative Deepening A* (IDA*) uses much less memory compared to A* because it only needs to store a linear amount of memory proportional to the solution depth rather than the entire search tree or graph, as A* does. This makes IDA* particularly advantageous in memory-constrained applications, retaining the optimality of A* when an admissible heuristic is used .

You might also like