Q1. You are building a medical diagnosis system for rare diseases. How would you represent medical knowledge (facts and rules)? What are the advantages of using an ontology?
Use a knowledge base with frames or description logic.
Represent symptoms, diseases, and relationships.
Ontology allows hierarchical classification (e.g., disease subtypes), inheritance, and reasoning consistency.
Represent symptoms, diseases, and relationships.
Ontology allows hierarchical classification (e.g., disease subtypes), inheritance, and reasoning consistency.
Q2. A chatbot needs to understand that "Paris is the capital of France" and "France is a country in Europe". Represent these facts using predicate logic. Then answer: "What is the capital of a country in Europe?"
Use inference by backward chaining.
capital(France, Paris)
country(France)
country_in(France, Europe)Query: ∃c ∃x (capital(c,x) ∧ country_in(c, Europe)) → x = Paris.Use inference by backward chaining.
Q3. Compare semantic networks and frames. Give an example where frames are more expressive.
Semantic networks are graphs of nodes (concepts) and edges (relations).
Frames add structure: slots with default values, procedural attachments, and inheritance.
Example: frame "Car" has slots "make", "model", and a method "drive()".
Frames add structure: slots with default values, procedural attachments, and inheritance.
Example: frame "Car" has slots "make", "model", and a method "drive()".
Q4. You have a rule-based expert system for loan approval. Explain forward chaining and backward chaining. Which is more suitable for goal-driven diagnosis?
Forward chaining: start with facts (credit score, income) and apply rules to derive new facts.
Backward chaining: start from goal (approve loan) and work backwards to find supporting evidence.
Backward chaining suits diagnosis (goal‑driven).
Backward chaining: start from goal (approve loan) and work backwards to find supporting evidence.
Backward chaining suits diagnosis (goal‑driven).
Q5. A knowledge graph for a product recommendation system. What types of relationships would you store? How can you use it to recommend "customers who bought X also bought Y"?
Relationships: product_category, bought_together, similar_to, belongs_to.
For "also bought", traverse the graph: find all products co‑purchased with X via transaction edges, then aggregate frequency.
For "also bought", traverse the graph: find all products co‑purchased with X via transaction edges, then aggregate frequency.
