Introduction To AI
Introduction To AI
1. What is AI?
Artificial Intelligence (AI) is the science of making machines perform tasks that require human intelligence, like
learning, problem-solving, and decision-making.
2. History of AI
• 1947 – Alan Turing discussed AI in a lecture.
• 1956 – John McCarthy coined the term "Artificial Intelligence" at the Dartmouth Conference.
• Turing Test – A test to determine if a machine can mimic human intelligence.
3. Types of AI
• Artificial Narrow Intelligence (ANI) – Specialized tasks (e.g., Siri, ChatGPT).
• Artificial General Intelligence (AGI) – Human-like intelligence (not yet achieved).
• Artificial Super Intelligence (ASI) – Machines surpass human intelligence (theoretical).
4. AI Approaches
• Thinking Humanly – Cognitive Science approach.
• Thinking Rationally – Logic-based AI (Expert Systems).
• Acting Humanly – Turing Test.
• Acting Rationally – AI as a Rational Agent.
5. Intelligent Agents
AI systems that perceive the environment and take action (e.g., self-driving cars). PEAS framework:
• Performance measure
• Environment
• Actuators
• Sensors
6. Search Techniques
• Uninformed Search – BFS, DFS.
• Informed Search – A*, Greedy Search.
• Minimax & Alpha-Beta Pruning – Used in AI game playing.
7. Knowledge Representation & Reasoning
• Logic-Based AI – Propositional & Predicate Logic.
• Probabilistic Reasoning – Bayes’ Theorem, Uncertainty Handling.
8. Machine Learning (ML)
• Supervised Learning – Predicts labels (e.g., spam detection).
• Unsupervised Learning – Clustering data (e.g., customer segmentation).
• Reinforcement Learning – Learning by rewards (e.g., AlphaGo).
9. Deep Learning (DL)
• Neural Networks (ANN, CNN, RNN).
• Used in image recognition, speech processing, chatbots.
10. AI Ethics & Risks
• Job losses, AI bias, accountability issues.
• IBM stopped facial recognition due to biases in AI models.
11. AI Applications
• NLP – ChatGPT, Google Translate.
• Computer Vision – Face recognition, self-driving cars.
• Robotics – AI in healthcare, manufacturing.
Introduction to AI Page 1
Exhaustive Search
Sunday, 2 March, 2025 11:04 AM
5. Bidirectional Search
• Searches from both the start and goal simultaneously.
• They meet in the middle, making search twice as fast.
Example:
Two people starting from opposite ends of a tunnel and meeting in the middle.
Conclusion
• Exhaustive search is powerful but slow in large problems.
• Heuristic search like A* is used in practical AI applications.
• Choosing the right search algorithm depends on the problem type, memory, and efficiency
needs.
8. Conclusion
• Heuristic search makes AI smarter and faster by focusing on the best paths.
• A search is the most powerful* because it considers both past cost and future estimation.
• Used in Google Maps, AI, Robotics, Games, and Optimization problems.
3. Types of Games in AI
Game Type Example Properties
Deterministic Games Chess, Tic-Tac- No luck involved, every move has a fixed result.
Toe
Chance-based Games Poker, Ludo Involves luck (e.g., rolling dice).
Perfect Information Chess, Checkers Players can see the entire game state.
Imperfect Poker, Battleship Players have hidden information (e.g., opponent’s
Information cards).
prolog
CopyEdit
father(john, mary). % John is the father of Mary.
ules ( ogical rela onships
prolog
CopyEdit
parent(X, Y) :- father(X, Y). % X is a parent of Y if X is the father of Y.
ueries ( sk ues ons
prolog
CopyEdit
?- parent(john, mary). % Is John a parent of Mary?
Prolog will answer: YES! ✅
1. What is PROLOG?
• PROLOG stands for PROgramming in LOGic.
• It is a declarative programming language used in Artificial Intelligence (AI), Natural Language
Processing, and Expert Systems.
• Instead of telling the computer how to do something (like C or Java), we tell it what we want,
and PROLOG figures out the solution using logic and inference.
PROLOG is best for problems involving reasoning, rule-based logic, and searching.
prolog
CopyEdit
parent(john, mary). % John is Mary's parent
parent(jane, mary). % Jane is Mary's parent
Rules:
prolog
CopyEdit
father(X, Y) :- parent(X, Y), male(X). % X is Y's father if X is a parent and male.
Query:
prolog
CopyEdit
?- father(john, mary). % Is John Mary's father?
✔ Answer: YES ✅
PROLOG Page 11
prolog
CopyEdit
likes(alice, pizza). % Alice likes pizza
owns(john, car). % John owns a car
B. Rules (If-Then Logic)
• Rules define logical relationships.
• Syntax:
prolog
CopyEdit
head :- body.
• Example:
prolog
CopyEdit
sibling(X, Y) :- parent(Z, X), parent(Z, Y). % X and Y are siblings if they share a parent.
C. Queries (Asking Questions)
• Queries ask for information from facts and rules.
• Example:
prolog
CopyEdit
?- likes(alice, pizza). % Does Alice like pizza?
✔ Answer: Yes ✅
6. Recursion in PROLOG
• PROLOG supports recursive rules, useful for problems like family trees, pathfinding, and
searching.
Example: Family Tree
prolog
CopyEdit
ancestor(X, Y) :- parent(X, Y). % Direct parent
ancestor(X, Y) :- parent(X, Z), ancestor(Z, Y). % Recursive case
Query:
prolog
CopyEdit
?- ancestor(john, mary). % Is John an ancestor of Mary?
✔ PROLOG will check all parent relationships! ✅
PROLOG Page 12
✔ PROLOG will check all parent relationships! ✅
7. Arithmetic in PROLOG
• PROLOG can perform basic math using the is operator.
Example:
prolog
CopyEdit
?- X is 5 + 3.
X = 8. ✅
⚠ PROLOG does not solve equations, only evaluates expressions.
8. Input/Output in PROLOG
• Reading Input:
prolog
CopyEdit
?- write('Enter your name: '), read(Name), write('Hello, '), write(Name).
✔ Output:
yaml
CopyEdit
Enter your name: Alice
Hello, Alice
9. PROLOG Applications
✔ Expert Systems – Medical diagnosis, legal reasoning.
✔ AI & Chatbots – Logic-based responses.
✔ Pathfinding & Games – Finding shortest routes in maps.
✔ Natural Language Processing (NLP) – Understanding human language.
✔ Robotics – Decision-making for robots.
PROLOG Page 13