week 2 Flashcards
- What is the primary purpose of knowledge representation (KR) in AI?
A. To replace human experts
B. To store large volumes of data
C. To enable reasoning and decision-making
D. To increase computer processing speed
Correct Answer: C
- In a semantic network, what do the edges between nodes represent?
A. Processing speed
B. Logical operators
C. Relationships between concepts
D. Inference accuracy
Correct Answer: C
Which of the following is NOT a component of an expert system?
A. User Interface
B. Inference Engine
C. Search Engine
D. Knowledge Base
Correct Answer: C
A key advantage of using ontologies in knowledge representation is:
A. Reduced memory usage
B. Fast execution
C. Interoperability and knowledge reuse
D. Simpler syntax
Correct Answer: C
Propositional logic can express uncertainty clearly.
❌ False
Rule-based systems rely on IF-THEN rules for reasoning.
✅ True
Semantic networks use nodes to represent concepts and edges to represent relationships.
✅ True
The knowledge base in an expert system processes user input.
❌ False
Q1: Construct a simple Python dictionary to represent a semantic network of three animals: Dog, Cat, and Bird. Include relationships like “is-a”, “has-a”, and “can”.
semantic_network = {
“Dog”: {
“is-a”: “Mammal”,
“has-a”: [“Tail”, “Fur”],
“can”: [“Bark”]
},
“Cat”: {
“is-a”: “Mammal”,
“has-a”: [“Whiskers”, “Tail”],
“can”: [“Meow”]
},
“Bird”: {
“is-a”: “Animal”,
“has-a”: [“Wings”, “Beak”],
“can”: [“Fly”, “Sing”]
}
}
Define a rule-based system for a simple medical diagnosis using Python. Include rules for flu and tonsillitis.
def diagnose(symptoms):
if “fever” in symptoms and “cough” in symptoms:
return “Possible Flu”
elif “sore_throat” in symptoms and “difficulty_swallowing” in symptoms:
return “Possible Tonsillitis”
else:
return “Diagnosis unclear”
print(diagnose([“fever”, “cough”])) # Output: Possible Flu
How does knowledge representation contribute to the effectiveness of expert systems?
Sample Answer:
Knowledge representation provides the structure and format in which knowledge is stored. Without a proper KR scheme (like rules, ontologies, or semantic networks), the expert system’s reasoning ability would be limited. It enables machines to draw logical conclusions, relate concepts, and solve domain-specific problems similar to human experts.
What are the challenges of using knowledge representation in real-world applications, and how can they be addressed?
Sample Answer:
Challenges include scalability (managing large knowledge bases), uncertainty (incomplete or imprecise data), and interoperability (different systems using different KR models). These can be addressed through modular ontologies, probabilistic reasoning methods, and standardized formats for KR (like OWL or RDF).
You’re building a telehealth app that helps users self-assess their symptoms before seeing a doctor.
Q: How would you design an expert system architecture for this app? Explain each component.
✅ Solution:
Knowledge Base:
Contains rules like:
IF fever AND cough THEN Possible Flu
IF sore throat AND difficulty swallowing THEN Possible Tonsillitis
Knowledge Representation:
Use rule-based representation (IF-THEN) and semantic tags for symptoms.
Inference Engine:
Matches user input against rules to make a diagnosis.
User Interface:
Accepts symptom input and returns possible diagnosis or next steps.
Output:
Recommendations like “Take a flu test” or “Visit a clinic”.