0% found this document useful (0 votes)
24 views30 pages

Artificial Intelligence PYQ Theory

Uploaded by

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

Artificial Intelligence PYQ Theory

Uploaded by

juhi2781
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

What is Natural Language Processing ?

Natural Language Processing (NLP) is a branch of AI focused on computer-human


interaction through language. It involves using computational techniques to understand
and process natural language, like text and speech. NLP is widely used in personal
assistants and other applications, with a recent shift towards statistical approaches like
machine learning. Its goal is to enable computers to interpret and generate human
language, facilitating smoother communication between humans and machines.

What
● are the types of NLP models?

NLP models can be classified into two main types: rule-based and statistical. Rule-
based models use predefined rules and dictionaries to analyze and generate natural
language data. Statistical models use probabilistic methods and data-driven
approaches to learn from language data and make predictions.

What are the applications of NLP models?

NLP models have many applications in various domains and industries, such as
search engines, chatbots, voice assistants, social media analysis, text mining,
information extraction, natural language generation, machine translation, speech
recognition, text summarization, question answering, sentiment analysis, and more.

Lexical Analysis − It involves identifying and analyzing the structure of words. Lexicon of a language
means the collection of words and phrases in a language. Lexical analysis is dividing the whole chunk
of txt into paragraphs, sentences, and words.

Syntactic Analysis (Parsing) − It involves analysis of words in the sentence for grammar and arranging
words in a manner that shows the relationship among the words. The sentence such as “The school
goes to boy” is rejected by English syntactic analyzer.

Semantic Analysis − It draws the exact meaning or the dictionary meaning from the text. The text is
checked for meaningfulness. It is done by mapping syntactic structures and objects in the task
domain. The semantic analyzer disregards sentence such as “hot ice-cream”.

Discourse Integration − The meaning of any sentence depends upon the meaning of the sentence just
before it. In addition, it also brings about the meaning of immediately succeeding sentence.

Pragmatic Analysis − During this, what was said is re-interpreted on what it actually meant. It involves
deriving those aspects of language which require real world knowledge.
What Is Natural Language Understanding (NLU)?

● Natural Language Understanding (NLU) is the ability of a computer to


understand human language. You can use it for many applications,
such as chatbots, voice assistants, and automated translation services.

● The most basic form of NLU is parsing, which takes text written in
natural language and converts it into a structured format that
computers can understand.

● For example, the words "hello world" would be converted into their
respective parts of speech (nouns and verbs), while "I am hungry"
would be split into two sentences: "I am" and "hungry."

● Parsing is only one part of NLU; other tasks include sentiment analysis,
entity recognition, and semantic role labeling.

● Natural language understanding (NLU) is an artificial


intelligence-powered technology that allows machines to understand
human language. The technology sorts through mispronunciations,
lousy grammar, misspelled words, and sentences to determine a
person’s actual intent. To do this, NLU has to analyze words, syntax,
and the context and intent behind the words.

● Natural Language Understanding (NLU) connects with human


communication’s deeper meanings and purposes, such as feelings,
objectives, or motivation. It employs AI technology and algorithms,
supported by massive data stores, to interpret human language
What is Artificial Intelligence ?

Artificial Intelligence (AI) refers to the development of computer systems of


performing tasks that require human intelligence. AI aids, in processing amounts of
data identifying patterns and making decisions based on the collected information.
This can be achieved through techniques like Machine Learning, Natural Language
Processing, Computer Vision and Robotics. AI encompasses a range of abilities
including learning, reasoning, perception, problem solving, data analysis and
language comprehension. The ultimate goal of AI is to create machines that can
emulate capabilities and carry out diverse tasks, with enhanced efficiency and
precision. The field of AI holds potential to revolutionize aspects of our daily lives.

Applications of AI
AI has been dominant in various fields such as −
Gaming ,Expert Systems, Vision Systems , Speech Recognition, Handwriting
Recognition, Intelligent Robots

NLU vs. NLP vs. NLG


Natural language understanding is taking in an input text string and

analyzing whatwhen
For example, it means. It canreads
a human happen on a small
a user's scale.
question on Twitter and replies
with an answer, or on a large scale, like when Google parses millions of
documents to figure out what they're about.

Natural language processing is the process of turning human-readable text


into computer-readable data. It's used in everything from online search
engines to chatbots that can understand our questions and give us answers
based on what we've typed.

Natural language generation is the process of turning computer-readable


data into human-readable text. For example, if you wanted to build a bot
that could talk back to you as though it were another person, you might use
NLG software to make sure it sounded like someone else was typing for
them (rather than just spitting out random words).
Agents in Artificial Intelligence

In artificial intelligence, an agent is a computer program or system that is designed to


perceive its environment, make decisions and take actions to achieve a specific goal or
set of goals. The agent operates autonomously, meaning it is not directly controlled by a
human operator.
Agents can be classified into different types based on their characteristics, such as
whether they are reactive or proactive, whether they have a fixed or dynamic
environment, and whether they are single or multi-agent systems.

Explain Human preference in encoding uncertainty

Human preference in encoding uncertainty refers to the tendencies or biases that humans
exhibit when parsing ambiguous language structures or sentences. Parsing involves analyzing
the syntactic structure of a sentence to determine its meaning, and ambiguity arises when there
are multiple possible interpretations for a given sentence.

The text outlines several principles that reflect human preferences in resolving ambiguity during
parsing:

1. Minimal Attachment: People prefer simpler sentence structures when faced with ambiguity.
They tend to choose interpretations that involve the fewest elements in the sentence's structure.

2. Right Association (Late Closure): When encountering new parts of a sentence, like
phrases or clauses, people tend to assume they're connected to the most recent part they've
read or heard. This helps maintain a smooth flow of understanding.

3. Lexical Preferences: The specific words used in a sentence can influence how people
interpret ambiguous parts. Some words, like verbs, have preferences for how they interact with
other parts of the sentence. This can override other parsing principles in certain situations.n
essence, when people encounter uncertainty in understanding a sentence, they typically opt for
simpler structures, assume new parts relate to what came just before, and take into account the
specific words used to help make sense of the ambiguity.
Agents can be grouped into five classes based on their degree of perceived intelligence and capability :

Simple Reflex agent:


A simple reflex agent in AI operates based on the current percept (input) it receives, using predefined condition-action rules to
decide on its actions. It does not consider the history of percepts or learn from experience.

Key Components:Percept:
Current input from the environment.
Condition-Action Rules: Predefined "if-then" rules.
Action: Output based on the current percept.
Model-based reflex agent
○ The Model-based agent can work in a partially observable environment, and track the situation.

○ A model-based agent has two important factors:

○ Model: It is knowledge about "how things happen in the world," so it is called a


Model-based agent.

○ Internal State: It is a representation of the current state based on percept history.

○ These agents have the model, "which is knowledge of the world" and based on the model they
perform actions.
Goal-based agents
○ The knowledge of the current state environment is not always sufficient to decide for an agent to
what to do.

○ The agent needs to know its goal which describes desirable situations.

○ Goal-based agents expand the capabilities of the model-based agent by having the "goal"
information.

○ They choose an action, so that they can achieve the goal.

Utility-based agents
○ These agents are similar to the goal-based agent but provide an extra component of utility
measurement which makes them different by providing a measure of success at a given state.

○ Utility-based agent act based not only goals but also the best way to achieve the goal.

○ The Utility-based agent is useful when there are multiple possible alternatives, and an agent has
to choose in order to perform the best action.

○ The utility function maps each state to a real number to check how efficiently each action
achieves the goals.

Learning Agents
○ AlearningagentinAIisthetypeofagentwhichcanlearnfromitspastexperiences,orithas
learningcapabilities.

○ Itstartstoactwithbasicknowledgeandthenabletoactandadaptautomaticallythrough
learning.

○ Alearningagenthasmainlyfourconceptualcomponents,whichare:

a. Learning element: It is responsible for making improvements by learning environment


from

b. Critic: Learningelementtakesfeedbackfromcriticwhichdescribesthathowwellthe
agentisdoingwith
respecttoafixedperformancestandard.

c. Performance element: It is responsible for selecting external action

d. Problem generator: This component is responsible for suggesting actions that will
tolead
new and
informative experiences.
Knowledge Acquisition
● Knowledge Acquisition in AI Overview:
● Knowledge acquisition in artificial intelligence encompasses the sophisticated
process of gathering, filtering, and comprehending information and experiences within
specific domains.
● It serves as the cornerstone for both machine learning and knowledge-based
systems, providing the foundational understanding necessary for AI systems to make
informed decisions.

● Methods of Knowledge Acquisition:


● Expert Systems: Experts contribute rules and knowledge to AI systems, allowing
them to emulate human decision-making processes within specialized domains.

● Learning from Examples: AI systems learn patterns and generalizations from curated
training data, a common approach in machine learning.

● Natural Language Processing: Utilizing advanced techniques like text mining, this
method extracts knowledge from textual data, aiding in information comprehension.

● Semantic Web: Standards like RDF and OWL enable structured representation of
knowledge on the internet, facilitating computer processing.

● Knowledge Representation and Reasoning: Knowledge is formalized using logical


frameworks, enabling automated reasoning crucial for complex
problem-solving.

● Goals of Knowledge Acquisition:


● Efficiency: Streamlining problem-solving by reducing time and effort requirements
in AI tasks.

● Quality Enhancement: Elevating the accuracy and quality of solutions through


insightful data analysis and pattern recognition.

● Despite challenges, knowledge acquisition drives innovation and advancement in


artificial intelligence.

● Challenges of Knowledge Acquisition:


● Data Acquisition: Obtaining accurate and representative data can be challenging
and costly.

● Role of Knowledge Acquisition in AI:


● Data Source Selection: Choosing high-quality, relevant data sources is crucial for AI
system performance.

● Feature Engineering: Preprocessing data to optimize AI system learning and


performance.

● Model Selection: Selecting appropriate AI models tailored to specific tasks and domains.

● Transfer Learning: Enabling AI systems to adapt and learn from new environments and
data streams for real-world applicability.
Parsing
1. Parsing Definition: Parsing is an automated process that analyzes the structure
of a sentence based on predefined grammar rules and a lexicon. It involves
breaking down the sentence into its constituent parts and determining their
syntactic relationships.

2. Syntactic and Semantic Analysis: The process includes both syntactic


analysis, which focuses on the grammatical structure, and potentially semantic
analysis, which considers the meaning and interpretation of the text.

3. Role of the Parser: A parser, which is a computer program, executes the


parsing process. It takes a natural language sentence as input and generates a
structured output for further analysis.

4. Grouping and Labeling: During parsing, the parser groups and labels different
parts of the sentence to illustrate their relationships. This helps in understanding
how the components of the sentence interact.

5. Incorporating Lexicon Information: The parsing process is aided by


information from the lexicon, which serves as a dictionary of words.

6. Importance of Lexicon: The lexicon provides crucial information to determine


the function and meanings of words within a sentence. This ensures the
accuracy of the parsing process.

7. Visual Representation: Basic parsing techniques are often visually represented


in diagrams or figures. These visual aids help in understanding the parsing
process more intuitively.
What is Learning?

Machine learning is the branch of Artificial Intelligence that focuses on developing models and
algorithms that let computers learn from data and improve from previous experience without
being explicitly programmed for every task. In simple words, ML teaches the systems to think
and understand like humans by learning from the data.

There are several types of machine learning, each with special characteristics and applications.
Some of the main types of machine learning algorithms are as follows:

1. Supervised Machine Learning 2. Unsupervised Machine Learning

3. Semi-Supervised Machine Learning 4. Reinforcement Learning


1. Supervised Learning: In supervised learning, the AI system is trained on a labeled
dataset, where each input is associated with a corresponding output. The system learns
to map inputs to outputs by generalizing from the examples provided during training.
Common supervised learning tasks include classification and regression.

2. Unsupervised Learning: Unsupervised learning involves training the AI system on


unlabeled data, without explicit supervision. The system learns to identify patterns,
clusters, or relationships within the data without being told explicitly what to look for.
Clustering, dimensionality reduction, and anomaly detection are examples of
unsupervised learning tasks.

3. Reinforcement Learning: In reinforcement learning, the AI agent learns to make


decisions by interacting with an environment and receiving feedback in the form of
rewards or penalties. The agent learns through trial and error, adjusting its actions to

maximize cumulative reward over time. Reinforcement learning is commonly used in


game playing, robotics, and autonomous systems.

4. Semi-supervised Learning: Semi-supervised learning combines elements of


supervised and unsupervised learning, where the AI system is trained on a combination
of labeled and unlabeled data. This approach leverages both types of data to improve
learning efficiency and generalization performance.
What are the learning methods ?

Learning methods in AI refer to the specific algorithms or techniques used to train


artificial intelligence systems. These methods vary in complexity, applicability, and the
types of problems they are suited to address.Here are some common learning
methods:

Artificial Neural Networks: Neural networks are a class of machine learning


algorithms inspired by the structure and function of the human brain. They consist of
interconnected nodes, or neurons, organized into layers. Neural networks can learn
complex patterns and relationships in data through a process called backpropagation,
where errors are propagated backward through the network to adjust the weights of
connections.

Decision Trees: Decision trees are hierarchical models that recursively split data into
smaller subsets based on feature values, leading to a tree-like structure of decisions.
Each internal node represents a decision based on a feature, and each leaf node
represents a class label or prediction. Decision trees are interpretable and can handle both numerical and
categorical data.

Support Vector Machines (SVM): SVM is a supervised learning algorithm used for classification and
regression tasks. It finds the optimal hyperplane that separates data points of different classes in a high-
dimensional space. SVM aims to maximize the margin between classes while minimizing classification
errors.

k-Nearest Neighbors (k-NN): k-NN is a simple and intuitive algorithm for classification and regression.
Given a new data point, it predicts the class label or value based on the majority vote or average of its k
nearest neighbors in the training dataset. The choice of k influences the model's bias-variance tradeoff.

Clustering Algorithms: Clustering algorithms group similar data points together based on their proximity
or similarity in feature space. Common clustering methods include k-means clustering, hierarchical
clustering, and density-based clustering. Clustering is an unsupervised learning technique used for data
exploration, pattern recognition, and anomaly detection.

Ensemble Learning: Ensemble learning combines multiple individual models to improve predictive
performance and robustness. Examples of ensemble methods include Random Forests, Gradient
Boosting Machines (GBM), AdaBoost, and Stacking. Ensemble techniques leverage the diversity of
models to reduce overfitting and achieve better generalization on unseen data.

Deep Learning: Deep learning is a subset of neural network algorithms that involve architectures with
multiple layers of neurons, allowing for the representation of complex patterns and hierarchical
abstractions. Deep learning has revolutionized various fields, including computer vision, natural language
processing, and speech recognition, by achieving state-of-the-art performance on challenging tasks.

These are just a few examples of learning methods in AI, each with its strengths, weaknesses, and
applications across different domains and problem types. Choosing the appropriate learning method
depends on factors such as the nature of the data, the complexity of the problem, and the desired
outcomes.
What is Regression?

Regression is a statistical approach used to analyze the relationship between a


dependent variable (target variable) and one or more independent variables (predictor
variables). The objective is to determine the most suitable function that characterizes
the connection between these variables.

It seeks to find the best-fitting model, which can be utilized to make predictions or draw
conclusions.

Regression in Machine Learning

It is a supervised machine learning technique, used to predict the value of the


dependent variable for new, unseen data. It models the relationship between the input
features and the target variable, allowing for the estimation or prediction of numerical
values.

Regression analysis problem works with if output variable is a real or continuous value,
such as “salary” or “weight”. Many different models can be used, the simplest is the
linear regression. It tries to fit data with the best hyper-plane which goes through the
points.

Logistic Regression:Logistic regression helps you figure out the probability of


someone buying the product or not, based on those clues. But instead of just saying
"yes" or "no," it gives you a probability score between 0 and 1.

Here's how it works:

Data Gathering: You collect data on people who did or didn't buy the product, along with
info about their age, income, etc.

Model Building: Logistic regression looks at all these clues and figures out the
relationship between each clue (called a feature) and the probability of someone buying
the product. It tries to draw a line through the data that best separates the buyers from
the non-buyers.

Probability Prediction: Once the model is trained, you can give it new clues about a
person, like their age and income, and it'll give you a probability score of how likely they
are to buy the product.

Decision Making: Based on that probability score, you can make a decision. For
example, if the score is above a certain threshold, you might decide to target that
person with a marketing campaign.

So, logistic regression is like a smart detective that helps you predict the probability of
an event happening based on various clues, which is super handy in making decisions
in many real-world situations!
Semantic Network
Semantic networks are a type of data representation incorporating linguistic information
that describes concepts or objects and the relationship or dependency between them.
There are mainly four ways of knowledge representation which are given as follows:

1. Logical Representation
2. Semantic Network Representation
3. Frame Representation
4. Production Rules

Semantic Network Representation


Semantic networks are alternatives to predicate logic for knowledge representation. In
Semantic networks, we can represent our knowledge in the form of graphical networks.
This network consists of nodes representing objects and arcs which describe the
relationship between those objects. Semantic networks can categorize the object in
different forms and can also link those objects. Semantic networks are easy to
understand and can be easily extended.

This representation consist of mainly two types of relations:


● IS-Arelation(Inheritance)
● Kind-of-relation

Drawbacks in Semantic representation:


1. Semantic networks take more computational time at runtime as we need to
traverse the complete network tree to answer some questions.
2. Semantic networks do not have any standard definition for the link names.

3. These networks are not intelligent and depend on the creator of the system.

Advantages of Semantic network:


1. Semantic networks are a natural representation of knowledge.

2. Semantic networks convey meaning in a transparent manner.

3. These networks are simple and easily understandable.


What is Fuzzy Logic?
The 'Fuzzy' word means the things that are not clear or are vague. Sometimes, we
cannot decide in real life that the given problem or statement is either true or false. At
that time, this concept provides many values between the true and false and gives the

flexibility to find the best solution to that problem.

Fuzzy logic contains the multiple logical values and these values are the truth values of a
variable or problem between 0 and 1. This concept was introduced by Lofti Zadeh in 1965 based
on the Fuzzy Set Theory. This concept provides the possibilities which are not given by
computers, but similar to the range of possibilities generated by humans.

Following are the characteristics of fuzzy logic:

● It is used for helping the minimization of the logics created by the human.

● It is the best method for finding the solution of those problems which are suitable for
approximate or uncertain reasoning.

● It always offers two values, which denote the two possible solutions for a problem and
statement.

● It allows users to build or create the functions which are non-linear of arbitrary
complexity.

● In fuzzy logic, everything is a matter of degree.

● In the Fuzzy logic, any system which is logical can be easily fuzzified.

● It is based on natural language processing.

● It is also used by the quantitative analysts for improving their algorithm's execution.

● It also allows users to integrate with the programming.


What are difference between Fuzzy set and Crisp Set?

Fuzzy Set Crisp Set

Fuzzy sets allow for degrees of Crisp sets, also known as classical
membership between 0 and 1, sets, follow traditional set theory,
representing the extent to which an where elements either belong to the
element belongs to the set. set (1) or do not belong to the set (0).
Membership grades can range from There are no intermediate values or
fully belonging (1) to not belonging at degrees of membership in crisp sets.
all (0), with intermediate values
indicating partial membership.

Fuzzy sets are suitable for Crisp sets are binary in nature and
representing and reasoning with are not designed to handle
uncertainty, ambiguity, and vagueness uncertainty. They are suitable for
in data or concepts. They allow for situations where elements can be
flexible modeling of imprecise clearly categorized as either belonging
information and are particularly useful or not belonging to a set without
when dealing with subjective or ambiguity.
qualitative data.

Fuzzy sets find applications in fields Crisp sets are commonly used in
such as artificial intelligence, control traditional mathematics, logic, and
systems, decision-making, pattern computer science applications where
recognition, and expert systems, exact categorization or classification is
where uncertainty and imprecision are required, such as in database queries,
inherent in the data or reasoning set theory, and formal logic.
process.

Fuzzy sets are represented by Crisp sets are represented by

membership functions, which assign a characteristic functions or set notation,


degree of membership to each indicating explicitly which elements
element in the universe of discourse. belong to the set and which do not,
These membership functions describe without any degrees of membership.
how well each element fits into the set.

Fuzzy sets offer flexibility in modeling Crisp sets are rigid in their
complex relationships and capturing representation, defining strict
nuances in data that may not fit neatly boundaries between elements that
into crisp categories. They can belong to the set and those that do
represent gradual transitions and not. They are suitable for situations
fuzzy boundaries between categories, where clear-cut distinctions between
allowing for more realistic and categories are sufficient, but may
expressive modeling. struggle to capture the richness of
real-world data with fuzzy or
overlapping characteristics.
What is Forward and Backward Chaining? Write the difference between them.

Forward chaining and backward chaining are two fundamental inference methods used
in artificial intelligence and knowledge representation systems, particularly in the
context of rule-based systems and expert systems. These methods are employed to

deduce conclusions from a set of rules or facts, enabling automated reasoning and
decision-making.

Forward Chaining:
Forward chaining, also known as data-driven reasoning or goal-oriented reasoning,
starts with the available facts and rules and iteratively applies them to infer new
conclusions until a specific goal or condition is satisfied. It proceeds in a forward
direction, moving from the known facts to potential conclusions.

How forward chaining works:

Initialization: It begins with an initial set of known facts or data.


Rule Application: Rules are applied to the available facts to derive new conclusions or
additional facts.
Repeated Application: The process continues iteratively, applying rules to the new facts
generated in each step.
Goal Evaluation: It terminates when a specific goal or condition is met, indicating the
desired outcome.

Backward Chaining:
Backward chaining, also known as goal-driven reasoning or backward reasoning, starts
with the desired goal or conclusion and works backward to determine the sequence of
steps needed to achieve that goal. It focuses on finding the conditions or facts that
must be true in order for the goal to be reached.

How backward chaining works:

Goal Definition: It starts with a specific goal or conclusion that needs to be satisfied.
Rule Selection: Rules are selected based on their relevance to the goal or conclusion.
Hypothesis Testing: The system attempts to find evidence or facts that support the
conditions specified by the selected rules.
Recursive Process: If the evidence is not directly available, the process recursively
applies backward chaining to determine the conditions required to satisfy the selected
rules.
Termination: The process continues until the necessary conditions are met or until no
further backward chaining is possible.
Forward Chaining Backward Chaining

Proceeds from known facts to potential Proceeds from the desired goal or
conclusions. conclusion to the conditions or facts
needed to achieve it.

Starts with the available facts or data Starts with the desired goal or
conclusion.

Applies rules iteratively to generate new Works backward from the goal,
conclusions until a goal is reached. determining the conditions needed to
satisfy the goal.

Terminates when a specific goal or Terminates when the necessary


condition is satisfied. conditions for reaching the goal are
identified.

Useful in situations where the initial data Useful in problem-solving and


or facts are readily available and the goal decision-making tasks where the desired
is to explore potential outcomes. goal is known and the focus is on
determining the steps needed to achieve
it.

Generally simpler and more Can be more complex, especially in


straightforward, suitable for systems with situations with nested goals or
a large number of rules and facts. dependencies.

Can be more efficient in systems with a Can be more efficient when the focus is
large amount of data or when the goal is on reaching a specific goal or conclusion,
to explore multiple potential outcomes. as it avoids unnecessary rule
applications.
Define prior probability and conditional probability. State Bayes’s theorem.
How is it useful for decision making under uncertainty?

Prior Probability:
Prior probability refers to the probability of an event occurring before any additional
information is taken into account. It represents the initial belief or expectation about the
likelihood of an event based on prior knowledge, historical data, or assumptions. Prior
probabilities are often denoted by P(A), where A is an event of interest.

Conditional Probability:
Conditional probability refers to the probability of an event occurring given that another
event has already occurred. It represents the updated probability of an event based on
new information or a specific condition. Conditional probabilities are denoted by P(A|B),
where A is the event of interest and B is the condition or event that has already
occurred.

Bayes' Theorem:
Bayes' theorem is a fundamental theorem in probability theory that describes how to
update the probability of an event based on new evidence or information.
Mathematically, it is expressed as follows:

Where:

P(A|B) is the conditional probability of event A given event B.


P(B|A) is the conditional probability of event B given event A.
P(A) is the prior probability of event A.
P(B) is the prior probability of event B.

Usefulness for Decision Making under Uncertainty:

Bayes' theorem is extremely useful for decision-making under uncertainty because it


provides a systematic way to update beliefs or probabilities based on new evidence or
information.
Explain the importance of expert system. What are the various knowledge
representative techniques used in expert system?

Expert systems are computer-based systems that mimic the problem-solving ability of a
human expert in a specific domain. They are important because they can capture and
utilize the knowledge and expertise of human experts to solve complex problems, make
decisions, and provide recommendations in various domains.

The importance of expert systems lies in their ability to:

Capture and Preserve Expertise: Expert systems can capture and preserve the
knowledge and expertise of human experts, even when those experts are not available
or are difficult to access. This ensures that valuable expertise is retained within the
organization or domain.

Consistent Decision Making: Expert systems provide consistent decision-making


processes based on predefined rules and knowledge, reducing the variability and
subjectivity often associated with human decision-making. This consistency is
particularly valuable in critical or high-stakes domains where accuracy and reliability are
paramount.

Rapid Problem Solving: Expert systems can quickly analyze complex problems and
provide solutions or recommendations based on the accumulated knowledge and rules.
This enables organizations to solve problems more efficiently and effectively, leading to
improved productivity and performance.

Training and Education: Expert systems can serve as training tools for novices by
providing guidance, explanations, and recommendations based on expert knowledge.
They can help transfer expertise from experienced practitioners to new employees or
students, accelerating the learning process.

24/7 Availability: Expert systems can be available around the clock, providing
on-demand assistance and support to users regardless of time or location. This ensures
that expertise is accessible whenever needed, improving responsiveness and customer
satisfaction.
Knowledge Representation Techniques in Expert Systems:

Various knowledge representation techniques are used in expert systems to capture,


organize, and utilize expert knowledge effectively. Some common techniques include:

Rule-Based Systems: Expert systems often use a rule-based approach, where


knowledge is represented as a set of rules that link conditions to actions or
conclusions. These rules encode the expertise of human experts in the form of "if-then"
statements.

Semantic Networks: Semantic networks represent knowledge as a network of


interconnected nodes, where each node represents a concept or entity, and the links
between nodes represent relationships or associations between them.

Frames: Frames are a knowledge representation technique that organizes knowledge


into structured units called frames, which consist of slots for storing attributes or
properties of objects, along with default values, inheritance relationships, and methods
for processing.

Production Systems: Production systems model knowledge as a set of production


rules, similar to rule-based systems. However, production systems typically operate in a
cyclic manner, continuously applying rules to a working memory containing facts or
data.

Ontologies: Ontologies provide a formal and structured representation of knowledge by


defining concepts, relationships, and properties within a specific domain. They enable
the encoding of domain knowledge in a standardized and interoperable format.

Fuzzy Logic: Fuzzy logic allows for the representation of uncertainty and vagueness in
expert knowledge by using linguistic variables and fuzzy sets to describe relationships
between variables and conditions.

Bayesian Networks: Bayesian networks represent knowledge using probabilistic


graphical models, where nodes represent random variables and edges represent
probabilistic dependencies between variables. They are useful for modeling uncertainty
and making probabilistic inferences.

These knowledge representation techniques allow expert systems to effectively


capture, organize, and utilize expert knowledge, enabling them to perform complex
reasoning and decision-making tasks in various domains.
LISP

LISP is a programming language famous for its symbolic expressions, functional programming
style, and dynamic typing. It's known for its powerful macro tools that enable metaprogramming,
automatic memory management via garbage collection, and interactive development
environments. LISP has been crucial in AI research and symbolic computation, shaping the
development of many programming languages. Its flexibility and expressive capabilities make it
ideal for tasks like language processing, expert systems, and quick prototyping. Despite its age,
LISP remains relevant, driving innovation in programming languages and AI applications.

Features of Common LISP:


● It is machine-independent
● It uses iterative design methodology, and easy extensibility.
● It allows updating the programs dynamically.
● It provides high level debugging.
● It provides advanced object-oriented programming.
● It provides a convenient macro system.
● It provides wide-ranging data types like, objects, structures, lists,
vectors, adjustable arrays, hash-tables, and symbols.
● It is expression-based.
● It provides an object-oriented condition system.
● It provides a complete I/O library.
● It provides extensive control structures.
What do you understand by the term 'uncertainty' in AI? How is
uncertainty managed in artificial intelligence? Briefly discuss the
structures used to manage knowledge uncertainty

Uncertainty in artificial intelligence (AI) refers to the lack of complete information or the
presence of variability in data and models. Understanding and modeling uncertainty is
crucial for making informed decisions and improving the robustness of AI systems.
AI deals with uncertainty by using models and methods that assign probabilities to
different outcomes.
Managing Uncertainty:
AI uses various techniques to handle uncertainty and make decisions:

Probabilistic Logic Programming (PLP):


● Combines logic and probability to deal with uncertain facts and rules.
● Uses probabilities to make decisions and learn from data.
● Techniques like Bayesian logic and Markov logic networks help in practical
applications.

Fuzzy Logic Programming (FLP):


● Blends regular logic with fuzzy logic to handle ambiguity.
● Helps in decision-making and learning from uncertain information.
● Useful in language understanding, image processing, and decision-making.
Nonmonotonic Logic Programming (NMLP):
● Handles inconsistency in logic programming.
● Allows for handling unexpected situations and making decisions in uncertain
environments.
Paraconsistent Logic Programming (PLP):
● Deals with conflicting information.
● Helps in working with contradictory facts and rules without creating chaos.
Hybrid Logic Programming (HLP):
● Combines different styles of logic programming to handle complex and uncertain
information.
● Incorporates probabilistic reasoning, fuzzy logic, and other techniques.
● Useful in managing interactions between computer systems and organizing
information.
Probability Theory:

● Plays a central role in AI for handling uncertainty.


● Techniques like Bayes' rule and Bayesian statistics help in updating probabilities
with new data.
● Enables informed decision-making in uncertain situations.
Is Regression a supervised learning? Justify your answer. Compare
regression with classification with examples.

Yes, regression is a supervised learning technique. In supervised learning, the algorithm


learns from labeled data, where each input data point is associated with a
corresponding output label. In the case of regression, the output variable is continuous,
meaning it can take any numerical value within a certain range. The goal of regression is
to predict or estimate the value of the output variable based on input features.

Regression can be justified as supervised learning because:

Labeled Data: In regression, the training dataset consists of input-output pairs, where
each input is associated with a known output value.

Learning from Examples: The regression algorithm learns from these examples to
establish a relationship between the input features and the output variable.

Objective: The objective of regression is to minimize the difference between the


predicted output values and the actual output values in the training dataset, typically
measured using a loss function such as mean squared error.

Comparison with Classification:

Regression: In regression, the output variable is continuous, representing a quantity or a


numerical value. For example, predicting house prices based on features like size,
location, and number of rooms is a regression problem. Here, the output is a continuous
value representing the price of the house.

Classification: In classification, the output variable is categorical, meaning it belongs to


a specific class or category. For example, classifying emails as spam or non-spam
based on features like words in the email body is a classification problem. Here, the
output is a discrete value representing the class label (spam or non-spam).

In summary, regression is a supervised learning technique where the goal is to predict a


continuous output variable based on input features. It learns from labeled data and
aims to minimize the difference between predicted and actual output values. Compared
to classification, regression deals with continuous output variables, while classification
deals with categorical output variables.
What is the goal of the support vector machine (SVM)? How to compute
margin?

● Support Vector Machine (SVM) is a powerful supervised learning algorithm used


for classification and regression tasks. Its primary goal is to find the optimal
hyperplane that best separates the data points of different classes in a
high-dimensional space.

● SVM is a versatile and effective algorithm for classification tasks, especially in


scenarios where there is a clear margin of separation between classes or when
the data is not linearly separable. It has been widely used in various fields such
as machine learning, pattern recognition, bioinformatics, and finance.

● The goal of Support Vector Machine (SVM) is to find the optimal hyperplane that
best separates the data points of different classes in a high-dimensional space.
This hyperplane is chosen in such a way that it maximizes the margin, which is
the distance between the hyperplane and the nearest data point (support vector)
of each class. The margin represents the margin of separation or the level of
confidence in the classification.

To compute the margin in SVM, you follow these steps:

1. Find the Support Vectors: Identify the data points (support vectors) that lie
closest to the hyperplane. These support vectors are the data points that have a
non-zero slack variable (or margin).

2. Compute the Margin: The margin is the perpendicular distance from the
hyperplane to the closest support vector. Mathematically, the margin can be
calculated as the inverse of the Euclidean norm (magnitude) of the weight vector
(w) of the hyperplane.
∥𝑤∥
Margin=
1
Where: 𝑤 = w is the weight vector of the hyperplane.

3. Normalize the Margin: In some cases, the margin may need to be normalized by
dividing it by the Euclidean norm of the weight vector. This normalization ensures
that the margin is invariant to the scale of the weight vector.

Normalized Margin=
∥𝑤∥

𝑀𝑎𝑟𝑔𝑖𝑛
What i s first order predicate Logic?
○ First-order logic is another way of knowledge representation in artificial
intelligence. It is an extension to propositional logic.

○ FOL is sufficiently expressive to represent the natural language statements in a


concise way.
● First-order predicate logic, also known as first-order logic or first-order logic with
equality, is a formal system used in mathematical logic and computer science to
express statements and reason about relationships between objects in a domain.

● In the topic of Propositional logic, we have seen that how to represent


statements using propositional logic. But unfortunately, in propositional logic, we
can only represent the facts, which are either true or false. PL is not sufficient to
represent the complex sentences or natural language statements. The
propositional logic has very limited expressive power. Consider the following
sentence, which we cannot represent using PL logic.PL logic is not sufficient, so
we required some more powerful logic, such as first-order logic.
It extends propositional logic by introducing quantifiers and variables, allowing for more
expressive statements. In first-order logic:

Predicates: Predicates are symbols representing properties or relations between


objects. They can be unary (applying to a single object) or binary (relating two objects)
or n-ary (relating multiple objects).

Quantifiers: First-order logic includes quantifiers such as "forall" (∀) and "exists" (∃),
allowing for statements about all objects in the domain (universal quantification) or at
least one object (existential quantification).

Variables: Variables represent unspecified objects in the domain. They can be


universally or existentially quantified within a statement.

Functions and Constants: First-order logic allows for the use of functions and constants
to denote operations and specific objects, respectively.

Equality: First-order logic includes the equality symbol (=) to express relationships
between objects being equal.
Explain Hill Climbing Algorithm.

● Hill climbing algorithm is a local search algorithm which continuously moves in


the direction of increasing elevation/value to find the peak of the mountain or
best solution to the problem. It terminates when it reaches a peak value where no
neighbor has a higher value.

● Hill climbing algorithm is a technique which is used for optimizing the


mathematical problems. One of the widely discussed examples of Hill climbing
algorithm is Traveling-salesman Problem in which we need to minimize the
distance traveled by the salesman.
● It is also called greedy local search as it only looks to its good immediate
neighbor state and not beyond that.

● A node of hill climbing algorithm has two components which are state and value.

● Hill Climbing is mostly used when a good heuristic is available.

● In this algorithm, we don't need to maintain and handle the search tree or graph
as it only keeps a single current state.
Explain plateau, ridge, and local maxima.
1. Local Maximum: A local maximum is a peak state in the landscape which is better
than each of its neighboring states, but there is another state also present which is
higher than the local maximum.
Solution: Backtracking technique can be a solution of the local maximum in state space
landscape. Create a list of the promising path so that the algorithm can backtrack the
search space and explore other paths as well.

2. Plateau: A plateau is the flat area of the search space in which all the neighbor states
of the current state contains the same value, because of this algorithm does not find
any best direction to move. A hill-climbing search might be lost in the plateau area.

Solution: The solution for the plateau is to take big steps or very little steps while
searching, to solve the problem. Randomly select a state which is far away from the
current state so it is possible that the algorithm could find non- plateau region.

3. Ridges: A ridge is a special form of the local maximum. It has an area which is higher
than its surrounding areas, but itself has a slope, and cannot be reached in a single
move.

Solution: With the use of bidirectional search, or by moving in different directions, we


can improve this problem.
Explain A* algorithm with an example.

● A* (pronounced "A-star") is a powerful graph traversal and pathfinding


algorithm widely used in artificial intelligence and computer science. It is
mainly used to find the shortest path between two nodes in a graph, given
the estimated cost of getting from the current node to the destination
node. The main advantage of the algorithm is its ability to provide an
optimal path by exploring the graph in a more informed way compared to
traditional search algorithms such as Dijkstra's algorithm.
● Algorithm A* combines the advantages of two other search algorithms:
Dijkstra's algorithm and Greedy Best-First Search. Like Dijkstra's algorithm,
A* ensures that the path found is as short as possible but does so more
efficiently by directing its search through a heuristic similar to Greedy
Best-First Search. A heuristic function, denoted h(n), estimates the cost of
getting from any given node n to the destination node.

● A* Search algorithm is one of the best and popular technique used in


path-finding and graph traversals.

● A* combines a cost function that measures actual path cost (g(n)) with a
heuristic function (h(n)) that estimates the remaining cost to the goal. This
combination guides the algorithm efficiently.

● The open set and closed set are essential data structures in A* for
managing the exploration of nodes. The open set contains nodes to be
evaluated, while the closed set holds nodes already evaluated.

● Algorithm A* selects the nodes to be explored based on the lowest value of


f(n), preferring the nodes with the lowest estimated total cost to reach the
goal.

● Heuristics play a vital role in A*, providing estimates of how close a node is
to the goal. Admissible and consistent heuristics help prioritize exploration.

● A* is widely used in GPS navigation, video games, robotics, network


routing, supply chain management, and urban planning, among other
applications.
● The choice of heuristic can significantly affect the algorithm's
performance, making it important to select an appropriate heuristic for the
problem at hand.
Here are the key steps involved in A*:
1. Initialization:

● Begin by initializing two sets: the open set and the closed set.
● The open set initially contains only the starting node, while the closed set
is empty.
● Set the cost of reaching the starting node (g-score) to zero and calculate
the heuristic cost estimate to the goal (h-score) for the starting node.

2. Main Loop:

● The main loop continues until one of two conditions is met:


● The goal node is reached, and the optimal path is found.
● The open set is empty, indicating that no path exists to the goal.
3. Selecting the Node for Evaluation:

● At each iteration of the loop, select the node from the open set with the
lowest f-score (f = g + h).
● This node is the most promising candidate for evaluation, as it balances
the actual cost incurred (g) and the estimated remaining cost (h).

4. Evaluating Neighbors:

● For the selected node, consider its neighboring nodes (also known as
successors).
● Calculate the actual cost to reach each neighbor from the current node
(g-score).
● Calculate the heuristic cost estimate from each neighbor to the goal
(h-score).

5. Updating Costs:

● For each neighbor, calculate the total estimated cost (f-score) by summing
the actual cost (g-score) and the heuristic estimate (h-score).
● If a neighbor is not in the open set, add it to the open set.
● If a neighbor is already in the open set and its f-score is lower than the
previously recorded f-score, update the neighbor's f-score and set its
parent to the current node. This means a shorter path to the neighbor has
been discovered.
6. Moving to the Next Node:

● After evaluating the neighbors of the current node, move the current node
to the closed set, indicating that it has been fully evaluated.
● Return to the main loop and select the next node for evaluation based on
its f-score.

7. Goal Reached or No Path Found:

● If the goal node is reached, the algorithm terminates, and the optimal path
can be reconstructed by backtracking from the goal node to the starting
node using the parent pointers.
● If the open set becomes empty without reaching the goal, the algorithm
terminates with the conclusion that no path exists.

8. Path Reconstruction (Optional):

● Once the goal is reached, you can reconstruct the optimal path by
following the parent pointers from the goal node back to the starting node.
This path represents the shortest route.

Explain AO* algorithm with an example.


● The AO* algorithm, short for "Anytime Optimistic" algorithm, is a search
algorithm used in artificial intelligence and computer science to find the
optimal path or solution in a graph or state space. It is particularly useful in
applications like robotics, pathfinding, and planning, where finding the best
possible solution is essential.

● The AO* algorithm belongs to the family of informed search algorithms,


meaning it utilizes heuristics or estimated cost functions to guide the
search process. It efficiently balances the trade-off between computation
time and the quality of the solution. Unlike some other algorithms that
focus solely on finding the optimal solution, AO* provides a series of
progressively improving solutions, making it adaptable to various
scenarios.
● Incremental Refinement: AO* is an extension of the A* algorithm that
supports incremental refinement of solutions. It continuously refines its
solution as it explores the search space, providing increasingly better
solutions over time.

● Anytime Search: AO* is an anytime algorithm, meaning it can provide an


optimal solution at any point during the search process. It can be stopped
at any time to return the best solution found so far, even if it is not yet
optimal.

● Heuristic-Based Search: Similar to A*, AO* uses heuristic functions to


guide the search towards the goal node. It estimates the cost from each
node to the goal node, allowing it to prioritize nodes that are likely to lead
to the shortest path.

● Termination: AO* does not have a fixed termination condition like A*.
Instead, it can be terminated at any point during the search process to
return the best solution found so far. This makes it suitable for real-time
applications where finding the optimal solution within a limited time frame
is more important than finding the globally optimal solution.

● Progressive Improvement: AO* continuously improves its solution as it


explores more nodes in the search space. While the solution may initially
be suboptimal, it becomes increasingly better over time until an optimal
solution is reached or the algorithm is stopped. This makes AO* useful in
situations where finding the best possible solution quickly is more critical
than finding the absolute best solution.
How AO* algorithm works:
● Starting with a Smart Plan: AO*beginsbymakinganeducatedguess
aboutthebestwaytoreachthegoal,usingwhatitknowsabouttheproblem.

● Continuous Learning: As it explores, AO* doesn't just settle for its first
guess. It keeps learning and refining its plan, getting better and better as it
goes along.

● Flexible Solutions: Unlike some methods that demand perfection, AO* is


okay with giving you its best guess, even if it's not 100% perfect. It's all
about finding the best solution within your time limit.

● Smarter Searches: AO* is like having a guide who knows the shortcuts. It
uses clever tricks to look in the most promising places first, making its
search faster and more efficient.

● Best Solution on Demand: Need a solution ASAP? AO* is ready to give you
Backpropagation Algorithm
● In machine learning, backpropagation is an effective algorithm used to train
artificial neural networks, especially in feed-forward neural networks.

● Backpropagation is an iterative algorithm, that helps to minimize the cost


function by determining which weights and biases should be adjusted. During
every epoch, the model learns by adapting the weights and biases to minimize
the loss by moving down toward the gradient of the error. Thus, it involves the
two most popular optimization algorithms, such as gradient descent or
stochastic gradient descent.

● Computing the gradient in the backpropagation algorithm helps to minimize the


cost function and it can be implemented by using the mathematical rule called
chain rule from calculus to navigate through complex layers of the neural
network.

● The Backpropagation algorithm works by two different passes, they are:

1. Forward pass
2. Backward pass

How the backpropagation algorithm works:


Forward Pass: In the first step, the algorithm performs a forward pass through the
neural network. It takes an input data point and passes it through the network layer by
layer, computing the output of each neuron using the current set of weights and biases.
Compute Error: Once the output is computed, the algorithm compares it to the true
target value for that input data point. This comparison generates an error signal, which
quantifies how far off the network's prediction is from the true target.
Backward Pass: In the next step, the algorithm performs a backward pass through the
network. It propagates the error signal backward, from the output layer to the input layer,
adjusting the weights and biases of each neuron along the way to minimize the error.
Gradient Descent: The adjustments to the weights and biases are made using an
optimization technique called gradient descent. This involves calculating the gradient of
the error function with respect to each weight and bias, and then updating them in the
opposite direction of the gradient to minimize the error.
Repeat: Steps 1 to 4 are repeated for multiple iterations or epochs until the network's
performance converges to a satisfactory level or until a stopping criterion is met.

You might also like