Learning Outcomes
SLO | After this lecture you will be able to... | CLO | Bloom |
|---|---|---|---|
SLO 1.1 | Define intelligence and list its five components with an example of each | CLO1 | C1 Remember |
SLO 1.2 | Explain Artificial Intelligence using three standard definitions | CLO1 | C2 Understand |
SLO 1.3 | Differentiate between a normal (conventional) program and an AI program | CLO1 | C2 Understand |
SLO 1.4 | Compare the four approaches to AI and classify real systems under them | CLO1 | C2 Understand |
CLO1: Explain the applications of AI and agent-based approach to AI.
1. Course Orientation
§1.1 What this course covers
Slide L01-S05
CS-511 is a 3(2-1) course: 2 credit hours of theory (two 90-minute lectures every week) and 1 credit hour of practical (one 3-hour lab every week). There are 32 lectures and 14 practicals. The course has five parts:
Part | Lectures | Main topics |
|---|---|---|
1. Foundations | L01-L04 | What AI is, history, Turing machine, intelligent agents |
2. Logic and Prolog | L05-L09 | Knowledge representation, propositional and predicate logic, resolution, Prolog |
3. Search and Games | L10-L18 | BFS, DFS, heuristics, A*, hill climbing, simulated annealing, minimax, CSP |
4. Uncertainty and Learning | L19-L29 | Expert systems, Bayes, fuzzy logic, machine learning, neural networks, genetic algorithms |
5. AI Applications | L30-L32 | Natural language processing, machine vision, face recognition, robotics |
The practicals use Python (free software) with the scikit-learn and scikit-fuzzy libraries, so you can practise on your own laptop. You will build neural networks and fuzzy systems.
§1.2 Marks distribution
Slide L01-S06
Component | Marks | Details |
|---|---|---|
Sessional | 4 | Quiz 1 (week 7), Quiz 2 (week 14) and two assignments |
Mid-term | 12 | Week 9, 30 minutes: 6 MCQs (1 mark each) + 3 short questions (2 marks each) |
Final theory | 24 | MCQs, short questions and long questions from the whole course |
Practical | 20 | Lab task 10 + lab book 5 + viva 5 |
Total | 60 |
Reminder: Assignment 1 (a report on the Gemini AI tool) is due on 06-10-2026. |
2. What is Intelligence?
§2.1 A simple definition
Slide L01-S08
Definition: Intelligence is the ability to learn from experience, understand, reason (think logically), solve problems and adapt (change) to new situations. |
Example. A cotton farmer near Burewala lost part of his crop to pink bollworm (a cotton pest) last year. This year he checks the flowers early and sprays at the right time. Nobody gave him a new rule book - he learned from experience and changed his behaviour. That is intelligence.
Non-example. A calculator gives 2 + 2 = 4 correctly every time, much faster than a human. But it never learns, never changes and cannot handle a new kind of problem. Being fast and correct is not the same as being intelligent.
§2.2 Five components of intelligence
Slide L01-S09
# | Component | Meaning in simple words | Everyday example | Where in this course |
|---|---|---|---|---|
1 | Learning | Getting better with experience | A child learns that a hot tawa (griddle) burns | Machine learning, neural networks (L24-L28) |
2 | Reasoning | Reaching a conclusion from facts | "The whole street is dark, so it is load-shedding, not my fuse." | Logic, Prolog (L06-L09) |
3 | Problem solving | Finding steps that reach a goal | Planning the cheapest route from Burewala to Lahore | Search (L10-L18) |
4 | Perception | Understanding the world through the senses (eyes, ears) | Recognising a friend's voice on the phone | Machine vision (L31-L32) |
5 | Language | Understanding and using words | Knowing whether "kal" means yesterday or tomorrow from the sentence | NLP (L30) |
§2.3 Case study: the doctor and the vague patient
Slide L01-S10
A patient tells the doctor: "Doctor sahib, I have a little fever, sometimes, and my body is aching." The words "a little" and "sometimes" are vague (not exact). A normal computer program would ask for an exact temperature. The doctor still works it out:
What the doctor notices | What the doctor does | Component used |
|---|---|---|
Vague words: 'a little', 'sometimes' | Understands what the patient means | Language |
Eyes, skin, temperature | Observes the patient | Perception |
It is October (dengue season) | Connects season + symptoms and suspects dengue | Reasoning |
20 dengue patients last month | Uses past experience with similar cases | Learning |
Platelet count is low | Decides the treatment plan | Problem solving |
Lesson: humans handle vague and uncertain (not sure) information easily. A good AI system must do the same. Later we will learn fuzzy logic (Lecture 22) and probability (Lecture 20) for exactly this purpose.
3. What is Artificial Intelligence?
§3.1 A simple definition
Slide L01-S12
Artificial means made by humans, not natural (like artificial flowers). Intelligence is the ability to learn, reason, solve problems and adapt. Putting them together:
Definition: Artificial Intelligence (AI) is the branch of computer science that builds machines and programs that can do tasks which normally need human intelligence. |
Example: Careem or inDrive matches you with the nearest driver and suggests the route. Earlier, a human dispatcher (controller) at a taxi office did this job using his knowledge of the city.
§3.2 Three standard definitions
Slide L01-S13
Who (year) | Definition | Key word |
|---|---|---|
John McCarthy (1956) | "The science and engineering of making intelligent machines, especially intelligent computer programs." | Intelligent machines |
Elaine Rich (1991) | "The study of how to make computers do things which, at the moment, people do better." | People do better |
Russell & Norvig (2021) | "The study of agents that receive percepts from the environment and perform actions." | Agents |
Rich's definition says the line moves with time: in 1991 people were much better at recognising faces than computers; today a phone does it in under a second. Russell and Norvig use the word agent: anything that senses its surroundings (percepts = inputs from sensors) and acts on them. A robot vacuum senses dust and walls, then moves and cleans. This course follows the agent view (Lecture 4).
§3.3 Normal program vs AI program
Slide L01-S14
Feature | Normal (conventional) program | AI program |
|---|---|---|
How it works | Follows fixed steps written by the programmer | Learns from data or searches for a good answer |
New situation | Fails or gives an error | Tries to adapt and still give a sensible answer |
Vague input | Needs exact input (e.g. 102.5 °F) | Can handle vague input (e.g. 'high fever') |
Improves over time | No - only when the code is changed | Yes - with more data and experience |
Example | Electricity bill calculator using the fixed NEPRA tariff formula | Predicting next month's units from past bills, weather and AC use |
Worked example: Is a mobile banking app that transfers Rs 5,000 an AI program? No - it follows fixed steps. Is the same app's fraud alert, which flags an unusual Rs 90,000 transfer at 3 a.m. because it learned your normal pattern, an AI program? Yes - it learned from data and handles a new situation. |
§3.4 Two founding names
Slide L01-S15
- Alan Turing (1950): British mathematician. In his paper "Computing Machinery and Intelligence" he asked "Can machines think?" and proposed the Turing Test (Lecture 3).
- John McCarthy (1956): the Father of AI. He coined (first used) the term "Artificial Intelligence" for the Dartmouth workshop in the USA in 1956, which is called the birth of AI. He later created the LISP language.
4. The Four Approaches to AI
§4.1 The 2 × 2 grid
Slide L01-S17
Researchers have asked two questions: (1) should we look at how the machine thinks (inside) or how it acts (outside)? (2) should we compare it with humans or with an ideal, rational (logically best) standard? The answers give four approaches:
Human-like | Rational (ideal) | |
|---|---|---|
Thinking | Thinking Humanly Cognitive modelling | Thinking Rationally Laws of thought |
Acting | Acting Humanly Turing Test | Acting Rationally Rational agent |
§4.2 Acting humanly: the Turing Test approach
Slide L01-S18
Goal: build a machine whose behaviour cannot be told apart from a human's. In the Turing Test a judge chats (by text) with a hidden human and a hidden machine. If the judge cannot tell which is the machine, it passes. To pass, a machine needs four abilities:
- Natural language processing: talk in a human language such as English or Urdu.
- Knowledge representation: store what it knows or hears.
- Automated reasoning: use stored knowledge to answer questions and draw conclusions.
- Machine learning: adapt to new situations and find patterns.
The total Turing Test also tests vision and physical actions, so it adds computer vision and robotics. Example: a bank's WhatsApp chatbot that replies so naturally that the customer thinks a human agent is typing. Weakness: copying humans also copies human mistakes; usually we want the correct answer.
§4.3 Thinking humanly: the cognitive modelling approach
Slide L01-S19
Goal: build a program whose thinking steps match the steps of the human mind. Cognitive science (the study of how the mind thinks) finds these steps in three ways: introspection (watching your own thoughts), psychological experiments (watching people solve problems) and brain imaging (MRI scans). The classic example is the General Problem Solver (GPS) by Newell and Simon (1957), whose steps were compared with steps reported by people. Local example: a program that learns Urdu words in the same order a child does (ammi, pani, then verbs) and makes the same kinds of mistakes. Weakness: we still do not fully understand the brain.
§4.4 Thinking rationally: the laws of thought approach
Slide L01-S20
Goal: think with correct rules of logic, so that if the facts are true, the conclusion is always true. The Greek philosopher Aristotle wrote syllogisms (patterns of reasoning with two facts and a conclusion):
Aristotle's example | Local example | |
|---|---|---|
Fact 1 | All humans are mortal. | All UAF students have a registration number. |
Fact 2 | Socrates is a human. | Ali is a UAF student. |
Conclusion | So, Socrates is mortal. | So, Ali has a registration number. |
This approach leads to propositional logic, predicate logic and Prolog (Lectures 6-9). Weaknesses: real knowledge is often uncertain ("wheat usually needs 4-5 waterings") and hard to write in exact logic, and solving problems in pure logic can take a very long time.
§4.5 Acting rationally: the rational agent approach
Slide L01-S21
A rational agent does the action that is expected to give the best result, based on what it knows. Rational does not mean perfect: the agent chooses the best action with the information it has at that moment. This is the approach of our textbook and this course, because (1) it is more general - correct logic is only one way of acting well, and quick reflexes (pulling your hand away from a hot tawa) can also be rational - and (2) it is easy to test: did the agent reach its goal?
Example: when the road near the Burewala bypass is blocked, Google Maps does not try to think like a human. It quickly picks the route with the least expected travel time. Most modern AI - self-driving cars, recommendation systems, chess engines - is built as rational agents.
§4.6 Comparing the four approaches
Slide L01-S22
Approach | Goal | Measured against | Example | Weakness |
|---|---|---|---|---|
Acting humanly | Behave like a human | Human behaviour (Turing Test) | Human-like chatbot | Copies human mistakes |
Thinking humanly | Think like a human | Human thought steps | GPS (1957) | Brain not fully understood |
Thinking rationally | Think logically | Rules of logic | Prolog, theorem provers | Uncertain knowledge is hard to write |
Acting rationally | Do the best action | Best expected result | Google Maps, Stockfish | Perfect rationality needs too much computing |
5. Worked Examples: Classifying AI Systems
Slide L01-S23 (class activity). Here are three more systems, solved step by step.
System | Ask: thinking or acting? human or rational? | Approach |
|---|---|---|
Gmail spam filter moves a fake 'prize' e-mail to spam | It acts (moves e-mail). It aims for the best result, not to behave like a person. | Acting rationally |
ELIZA (1966) chatbot that talks like a counsellor to seem human | It acts (chats). Its goal is to appear human to the user. | Acting humanly |
Wheat-disease expert system: IF yellow stripes on leaves AND cool weather THEN yellow rust | It reasons with exact IF-THEN rules, i.e. logic. | Thinking rationally |
6. Common Mistakes
Slide L01-S24
Wrong idea | Correct idea |
|---|---|
AI means robots only. | Most AI is software (Maps, YouTube, spam filters). Robots are one application. |
AI and ChatGPT are the same. | ChatGPT is one AI tool. AI is a whole field: search, logic, learning, vision, language. |
Every computer program is AI. | A bill calculator follows fixed steps. AI learns, reasons or searches. |
The father of AI is Alan Turing. | The father of AI is John McCarthy (1956). Turing asked 'Can machines think?' (1950). |
Rational means human-like. | Rational means doing the best action for the goal, not copying humans. |
Word Bank
Word | Simple meaning | Example |
|---|---|---|
Adapt | Change to fit a new situation | Farmer sprays earlier after a pest attack |
Reason | Think step by step to reach a conclusion | Dark street → load-shedding |
Perception | Understanding through the senses | Recognising a voice |
Vague | Not clear or exact | "A little fever" |
Agent | Something that senses and acts | Robot vacuum |
Percept | An input an agent receives from its sensors | Camera image, microphone sound |
Rational | Doing the best action based on what you know | Taking the fastest route |
Cognitive | Related to thinking and the mind | Cognitive science studies how people think |
Syllogism | Two facts that lead to a conclusion | All UAF students... Ali is... so Ali... |
Coin (a term) | Use a word for the first time | McCarthy coined 'Artificial Intelligence' |
Summary
- Intelligence = learning, reasoning, problem solving, perception and language, plus the ability to adapt.
- AI builds machines that do tasks which normally need human intelligence (McCarthy, Rich, Russell & Norvig).
- An AI program learns or searches; a normal program only follows fixed steps.
- John McCarthy is the father of AI (Dartmouth, 1956); Turing asked 'Can machines think?' (1950).
- Four approaches: thinking humanly, acting humanly, thinking rationally, acting rationally. This course uses the rational agent approach.
Self-Check Questions
- Define intelligence. Why is a calculator not intelligent? (see §2.1)
- Name the five components of intelligence and give one local example of each. (see §2.2)
- In the doctor case study, which component handles the word 'sometimes'? (see §2.3)
- Write Elaine Rich's definition of AI. Why does it say 'at the moment'? (see §3.2)
- Give two differences between a normal program and an AI program, with examples. (see §3.3)
- Who is the father of AI and why? (see §3.4)
- Draw the 2 × 2 grid of the four approaches. (see §4.1)
- Which four abilities does a machine need to pass the Turing Test? (see §4.2)
- What is a syllogism? Write your own example. (see §4.4)
- Why is the rational agent approach preferred in this course? (see §4.5)
- Classify YouTube's video recommendation into one of the four approaches and justify. (see §5)
Reading: Kaplan (2016) Chapter 1; Russell & Norvig (4e) Section 1.1.