0% found this document useful (0 votes)
3 views16 pages

Cos 307 Tutorial Guide

The document is a tutorial guide for the course COS 307 on Artificial Intelligence, discussing the capabilities of machines, categories of AI, and the role of machine learning. It covers various AI concepts such as supervised and unsupervised learning, decision trees, backpropagation, and expert systems, as well as their applications in real-world scenarios. Additionally, it explains problem-solving techniques like divide-and-conquer and inference strategies like forward and backward chaining.

Uploaded by

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

Cos 307 Tutorial Guide

The document is a tutorial guide for the course COS 307 on Artificial Intelligence, discussing the capabilities of machines, categories of AI, and the role of machine learning. It covers various AI concepts such as supervised and unsupervised learning, decision trees, backpropagation, and expert systems, as well as their applications in real-world scenarios. Additionally, it explains problem-solving techniques like divide-and-conquer and inference strategies like forward and backward chaining.

Uploaded by

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

TUTORIAL GUIDE

COURSE CODE: COS 307

COURSE COURSE TITLE: ARTIFICIAL INTELLIGENCE

1a (i). Can machines think?

Solution

The question of whether machines can think hinges entirely on how one defines "thinking." If thinking

is defined as the logical processing of information and solving complex problems, then modern

computers already demonstrate this capability. However, if thinking requires consciousness, subjective

experience, and understanding, then machines have not yet achieved this more profound cognitive state.

Ultimately, while machines can simulate thought with remarkable proficiency, they do not possess the

sentient awareness that characterizes human thinking

1a (ii) What are the categories of Artificial Intelligence

This is the most popular way to categorize AI, describing how "intelligent" or "autonomous" the system

is compared to human intelligence.

A. Artificial Narrow Intelligence (ANI)

 What it is: AI that is designed and trained for one specific task. This is the only form of AI that

exists today.

 Key Trait: Excels at its single task but cannot perform outside its defined boundaries.

 Examples:

o Voice Assistants: Siri, Alexa, Google Assistant.

o Recommendation Systems: Netflix, Amazon, Spotify algorithms.

o Image Recognition Software: Facebook's photo tagging, self-driving car vision systems.

o Spam Filters in your email.

o Chess-playing programs like Deep Blue.

B. Artificial General Intelligence (AGI)

1
 What it is: A hypothetical form of AI that possesses the ability to understand, learn, and apply

its intelligence to solve any problem that a human being can.

 Key Trait: It would have self-awareness, consciousness, and the cognitive abilities to reason, pla

n, and learn from experience across a wide range of domains, just like a human.

 Status: This does not exist yet and is the primary goal of many AI research labs. It's the type of

AI you see in movies like Her or Ex Machina.

C. Artificial Superintelligence (ASI)

 What it is: A hypothetical AI that surpasses human intelligence and ability in virtually every f

ield.

 Key Trait: It would be smarter than the best human brains in every conceivable category—scien

tific creativity, general wisdom, and social skills. The concept of an "intelligence explosion" or

"singularity" is often associated with ASI.

 Status: Purely theoretical and a subject of much philosophical and ethical debate.

D. The Machine Learning (ML): A subset of AI that uses statistical techniques to enable machines to

"learn" from data without being explicitly programmed for every task.

o Deep Learning (DL): A subset of ML that uses artificial neural networks with many laye

rs ("deep" networks) to analyze complex patterns in data. It's behind most recent AI break

throughs.

E. Natural Language Processing (NLP): AI that enables computers to understand, interpret, and g

enerate human language.

F. Expert System

G. Computer Vision: Computer vision is a field of artificial intelligence that trains computers to int

erpret and understand the visual world. By digitally processing and analyzing images and videos,

machines can accurately identify and classify objects and then react to what they "see.".

2
H. Robotics: Robotics is the field of engineering and computer science focused on creating machin

es, called robots, to perform tasks automatically. These robots can be guided by an external contr

ol device or have their control system embedded within them to sense, reason, and act in the phy

sical world. .

1b (i). Do you think that machines can take up the roles of human beings

While machines can excel at specific tasks, especially those involving data and repetition, they lac

k the inherent human capacities for empathy, intuition, and genuine understanding. Therefore, the

y cannot fully take up the complex, emotional, and ethical roles that define human relationships an

d leadership. Machines are best viewed as powerful tools that augment human capabilities rather t

han replace the essence of what it means to be human.

Take Note Machine can take the human roles that is repetitive in nature

1b(ii) What is machine learning?

Machine learning is a branch of artificial intelligence where computers use data to identify patterns and

make decisions with minimal human programming. Instead of following strict, predefined rules, these

systems learn and improve their performance as they are exposed to more information. It is the core

technology behind things like recommendation systems, voice assistants, and fraud detection.

1c. Explain the basic machine learning approaches

Learning Goa
Approach Data Used Analogy Example
l

Map inputs to Learning with an a Spam filtering, Pri


Supervised Labeled
known outputs nswer key ce prediction

Customer segment
Find hidden pa Finding structure
Unsupervised Unlabeled ation, Data compre
tterns without a guide
ssion

Learn a policy
Interaction & Learning by trial a Game-playing AI,
Reinforcement to maximize re
Rewards nd error Robotics
ward

3
Learning Goa
Approach Data Used Analogy Example
l

A student doing ho
Mostly Unlabe Improve learni Photo tagging with
Semi-Supervis mework with a fe
led, some Lab ng with a little a few labeled exa
ed w answers provide
eled guidance mples
d

for Each of the Mentioned Above

4
TUTORIAL TWO

i. What is the role of back propagation in model building?

1. Backpropagation ("backward propagation of errors") is the core algorithm for training neural

networks. It efficiently calculates how every weight in the network contributes to the final error,

allowing the network to learn from its mistakes.

2. Backpropagation provides an efficient way to train complex, multi-layered neural networks. It is the

fundamental engine that makes deep learning possible by making the calculation of gradients

computationally feasible.

ii. Decision tree is one of the algorithms for building predictive malaria system. Generate

the decision tree

5
iii. Using Python programming language, implement the model in 2b

Code

class MalariaDiagnosis:

def __init__(self):
[Link] = {
6
'blood_positive': "LIKELY MALARIA - High Confidence",
'no_fever': "UNLIKELY MALARIA - Low Risk",
'no_travel': "UNLIKELY MALARIA - Low Risk",
'cyclical_chills': "LIKELY MALARIA - Treat and Consider Repeat Test",
'no_chills': "UNLIKELY MALARIA - Consider Other Causes",
'severe_headache': "LIKELY MALARIA - Moderate Confidence",
'mild_headache': "UNLIKELY MALARIA - Low Suspicion"
}
def diagnose(self):
print("=== Malaria Diagnosis ===\n")

if input("Blood Test Positive? (y/n): ").lower() == 'y':


return [Link]['blood_positive']

if input("Fever? (y/n): ").lower() == 'n':


return [Link]['no_fever']

if input("Travel to endemic area? (y/n): ").lower() == 'n':


return [Link]['no_travel']

chills = input("Chills & Sweats? (c=cyclical, y=yes, n=no): ").lower()


if chills == 'c':
return [Link]['cyclical_chills']
elif chills == 'n':
return [Link]['no_chills']

if input("Severe headache & body aches? (y/n): ").lower() == 'y':


return [Link]['severe_headache']
else:
return [Link]['mild_headache']
# Usage
diagnosis_system = MalariaDiagnosis()
result = diagnosis_system.diagnose()
print(f"\n{result}")

RESULTS

7
8
TUTORIAL 3

Explain the meaning of divide-and-conquer, how does it’s technique improve efficiency when solving

problems,

Answer: Divide-and-conquer is a problem-solving strategy that breaks a complex problem into smaller,

independent sub-problems of the same type, solves each sub-problem recursively, and then combines their results

to obtain the final solution. It improves efficiency by reducing the size of the problem at each step, often

transforming a problem of size n into multiple sub problems of size n/2.

i. Efficient solving problem: it reduces the complexity of problems making them easier to solve.

ii. to improve scalability: reduce large problem by breaking them into smaller manageable pieces

iii. enhanced parallelism: it allows for parallel processing hence improves computation efficiency

iv. it provides foundation key data structure and algorithm

v. Structured problem solving and modularity: it provides a discipline framework for thinking, and

decomposing problems

9
TUTORIAL 4

Explain the difference between forward chaining and backward chaining in a knowledge-based system. In

your answer, describe how each method works, its typical applications, and give one example scenario

where one is preferable to the other.

Answer:

Forward Chaining: Also called data-driven reasoning. Starts with known facts in the knowledge base and applies

inference rules to derive new facts until a goal is reached. Useful when all input data is available and the system

needs to discover possible conclusions.

Example: In a medical expert system, forward chaining can take patient symptoms (facts) and apply rules to infer

possible diseases.

Backward Chaining: Also called goal-driven reasoning. Starts with a goal (hypothesis) and works backward,

checking which rules could support the goal, and recursively verifying whether the premises of those rules are

satisfied. Useful when the system has a specific hypothesis to test.

Example: In the same medical system, if the doctor suspects malaria, backward chaining tests whether patient

symptoms and facts in the knowledge base support this hypothesis.

Key Differences:

Forward chaining moves from facts to conclusions (data → goal), while backward chaining moves from goal to

facts (goal → data).

Forward chaining is better when there are many possible outcomes; backward chaining is better when a specific

hypothesis needs testing.

Both techniques are inference strategies: forward chaining is exploratory and generates conclusions from known

data, while backward chaining is confirmatory and tests specific goals.

10
TUTORIAL FIVE

A. Explain how Pattern Recognition works

Pattern recognition is the process of using machine learning algorithms to recognize patterns. It means

sorting data into categories by analyzing the patterns present in the data. it allows for detecting and

interpreting repeated structures in data (images, sounds, text, numbers,

Goal: To categorize, predict, or make decisions based on learned patterns.

It works through the following processes

1. Data Collection

Input data (images, sensor readings, text, etc.)

2. Preprocessing

Clean noise, normalize data, enhance features.

Example: Adjusting brightness in an image for better detection.

3. Feature Extraction

Identify key characteristics (e.g., edges in an image, word frequencies in text).

Example: Extracting facial landmarks (eyes, nose, mouth) for face recognition.

4. Model Training

Use algorithms to learn patterns from labeled or unlabeled data.

Common methods:

Supervised Learning (trained with labeled data, e.g., "This is a cat").

Unsupervised Learning (finds hidden patterns without labels, e.g., clustering

Deep Learning (neural networks automatically detect complex patterns).

5. Classification/Prediction

The model assigns a label or makes a decision.


11
Example:

Classifying an email as "spam" or "not spam."

Detecting a tumor in an X-ray image.1mk

6. Evaluation & Feedback

Test accuracy, adjust the model, and improve over time.

B. Real-World Applications of pattern recognition

Computer Vision

Used to extract meaningful features from image/video samples for applications like biomedical imaging.

Face recognition (iPhone Face ID), object detection (Tesla Autopilot).

Speech & Audio Processing

Voice assistants (Siri, Alexa), music recommendation.

Healthcare

Detecting diseases in X-rays, ECG analysis.

Finance

Fraud detection, stock market prediction.

Natural Language Processing (NLP)

Sentiment analysis, chatbots, translation.

Seismic analysis

Used in discovering, imaging and interpreting patterns in seismic recording

FINGERPRINT IDENTIFICATION

It is widely in biometric systems for fingerprint matching and identification

AUTONOMOS VEHICLES. It is applied in self-driving cars to recognize obstacles, roads signs and

pedestrians for navigation

C. Real-World Applications of the vision system

12
i. Industrial Automation

Defect detection: Spot micro-cracks in manufacturing.

Robotic guidance: Precise assembly via 2D/3D vision.

Barcode/OCR reading: Logistics and inventory tracking.

ii. Healthcare

Radiology: Detect tumors in X-rays/MRIs (e.g., AI-assisted breast cancer screening).

Surgery: Augmented reality overlays for surgeons.

iii. Autonomous Systems

Self-driving cars: Recognize traffic signs, pedestrians, lanes (Tesla, Waymo).

Drones: Inspect power lines or crops.

iv. Retail & Security

Cashier-less stores: Amazon Go tracks items picked by customers.

Facial recognition: Airports, smartphone unlocking (Face ID).

v. Agriculture

Crop monitoring: Detect disease/pests via drone imagery.

Harvesting robots: Identify ripe fruits using spectral imaging.

13
TUTORIAL SIX

A. Define expert system and state its primary objectives. How does it differ from a

conventional procedural program

Expert systems are crucial subset of artificial intelligence (AI) that simulates the decision-making

ability of a human expert. These systems use a knowledge base filled with domain-specific information

and rules to interpret and solve complex problems. For example,

i. a medical expert system can analyze a patient’s symptoms and suggest possible diagnoses or

treatments.

ii. a financial expert system can evaluate market trends and recommend investment strategies.

iii. to preserve and replicate human expertise. This is especially useful in fields where expert knowledge

is scarce or expensive.

How does an expert system differ from a procedural program

They differ because they can achieve the following

1. Preserving Expertise: They capture the knowledge of human experts and store it in a digital format.

This ensures that valuable expertise isn’t lost when an expert retires or leaves.

2. Improving Decision-Making: By relying on data and rules, expert systems provide consistent and

unbiased recommendations.

3. Saving Time and Money: They automate tasks that would otherwise require human intervention,

reducing costs and increasing efficiency.

4. Accessibility: Expert systems make expert-level knowledge available to non-experts, democratizing

access to specialized information.

B. Basic Components of an Expert System

An expert system is made up of several interconnected components, each playing a crucial role in its

functionality. Let’s break them down:


14
1. Knowledge Base: The Heart of the System

The knowledge base is the heart of an expert system. It contains all the facts, rules, and expert

knowledge related to a specific domain. Think of it as a library filled with textbooks, research papers,

and expert opinions. The accuracy and completeness of the knowledge base directly impact the system’s

performance. If the knowledge is outdated or incomplete, the system’s recommendations may be flawed.

2. Inference Engine: The Brain Behind the Decisions

The inference engine is the brain of the expert system. It processes the information stored in the

knowledge base to draw conclusions or make recommendations. The inference engine uses reasoning

strategies (like forward chaining or backward chaining) to analyze data and apply rules.

 Forward Chaining: Starts with available data and works toward a conclusion. For example, "If the

temperature is high and the patient has a cough, diagnose a respiratory infection."

 Backward Chaining: Starts with a goal and works backward to find supporting evidence. For

example, "If the goal is to diagnose diabetes, check for symptoms like frequent urination and high

blood sugar."

3. User Interface: Bridging the Gap Between System and User

The user interface is the bridge that allows users to interact with the expert system. It’s designed to be

intuitive and user-friendly, ensuring that even non-experts can use the system effectively. Users provide

a query (problem or question), and the system processes the request. The system then delivers advice or

recommendations back to the user.

4. Explanation Module: Building Trust Through Transparency

15
The explanation module is a critical feature that explains how the system arrived at a particular

conclusion. It’s like a teacher showing their work when solving a math problem. This module provides

users with a clear, step-by-step explanation of the system’s reasoning.

 This transparency is especially important in fields like healthcare and finance, where decisions can

have significant consequences.

 Example: A medical expert system might explain, "I diagnosed pneumonia because the patient has a

fever, cough, and abnormal chest X-ray."

5. Knowledge Acquisition Module: Keeping the System Up-to-Date

The knowledge acquisition module is responsible for updating and expanding the knowledge base. It

ensures that the system stays current with the latest information and trends. Without regular updates, the

system’s knowledge base can become outdated, reducing its effectiveness.

16

You might also like