លំហសិក្សាកម្ពុជា លំហសិក្សាកម្ពុជា V1.0
ចូល ចុះឈ្មោះ

Homework Quick Quiz. [ Lesson 1 ]

មូលសង្ខេប / Abstract

Homework for my own studies!!.

ពាក្យគន្លឹះ
Quick Quiz
1. What is the difference between a knowledge base and Working Memory?
    In Artificial Intelligence (AI), a Knowledge Base and Working Memory are used to store information, but they have different purposes.
   
    1.1 Knowledge Base (KB)

    A Knowledge Base is a collection of facts, rules, and information that an AI system uses to 

solve problems or make decisions.

    Example:
    A medical expert system contains these rules:

  • If a person has a fever and a cough, they may have the flu.
  • If the temperature is above 38°C, the person has a fever.

    Purpose: To store general knowledge and rules that the system can use repeatedly.

    1.2 Working Memory (WM)

    Working Memory stores temporary information about the current problem that an AI system 

    is solving.

    Example:
    A patient visits a medical expert system:

  • Patient's temperature = 39°C.
  • Patient has a cough.
  • Patient has a headache.                      
     The system uses these facts to analyze the patient's condition.
    Purpose: To store current facts and information needed to solve a specific problem.

2. What does an Inference Engine do?
    An Inference Engine is a component of an Artificial Intelligence (AI) system that uses logical rules and available facts to draw conclusions or make decisions.

    2.1 Main Functions

  • Applies rules: Uses rules stored in the Knowledge Base.
  • Reasons logically: Analyzes facts in Working Memory.
  • Draws conclusions: Produces results based on facts and rules.
  • Makes decisions: Determines an appropriate result or recommendation.

     2.2 Example : 

Imagine an AI system that checks whether a person has a fever.

    Knowledge Base (KB):

  •     Rule: IF temperature > 38°C, THEN the person has a fever.

    Working Memory (WM):

  •     Fact: The person's temperature is 39°C.

    Inference Engine:

  •    Compares the fact with the rule.
  •    Determines that 39°C is greater than 38°C.
  •    Applies the rule.

Result: The system concludes that the person has a fever.

3. Why does a logic error need information for the expected output? 

    Logic Errors need expected output because we need to know what the correct result should be. 

    So, we can compare it with the actual result from the program.

Example in Python

a = 5 
b = 10
result= a - b 
print(result)
  • Expected Output: 15 (if we intend to add 10 + 5)
  • Actual Output: -5 (the program calculates 5 - 10)

This indicates a logic error because we used - instead of +.

Why do we need Expected Output?

    We need Expected Output to compare it with Actual Output, identify logic errors, and correct the program to produce the correct result.

4. When evidence isn't enough, how should the program respond?

    When evidence isn't enough, the program should respond that it lacks sufficient information to draw a reliable conclusion. It should ask for more information or evidence instead of guessing.

5. Why doesn’t Run Submitted Code on the Flask Server?

    We should not run submitted code directly on the Flask server because it may contain malicious code that could damage the server, access sensitive data, or execute unauthorized commands. Instead, we should run it in a secure, isolated environment (sandbox) to protect the server.



Reference: 

    - ChatGPT & Google: For search keywords and Q&A : 

  1. IOE Notes. Artificial Intelligence: Expert System. Available at: https://ioenotes.edu.np/media/notes/AI/Artiticial-Intelligence-AI-Chapter-7-2-expert-system-ioenotes-edu-np.pdf

  2. ScienceDirect. Expert System – An Overview. Available at: https://www.sciencedirect.com/topics/computer-science/expert-system

  3. Python Software Foundation. Errors and Exceptions. Available at: https://docs.python.org/3/tutorial/errors.html

  4. Pallets Projects. Flask Security Considerations. Available at: https://flask.palletsprojects.com/en/stable/web-security/

  5. Pallets Projects. Flask Quickstart. Available at: https://flask.palletsprojects.com/en/stable/quickstart/

  6. PortSwigger. Python Code Injection. Available at: https://portswigger.net/kb/issues/00100f10_python-code-injection

   

 - Grammarly: For grammar in this homework writing: https://www.grammarly.com/?utm_source=chatgpt.com



ចែករំលែក 2
រក្សាទុក
facebook: 1 telegram: 1
ការផ្សព្វផ្សាយ
ការផ្សព្វផ្សាយ
មតិយោបល់ 0
ចូលគណនី ដើម្បីបញ្ចេញមតិ