0% found this document useful (0 votes)
1 views

ARTIFICIAL INTELLIGENCE

Artificial Intelligence (AI) is a branch of computer science focused on creating intelligent machines that can replicate human behavior and decision-making. Key goals of AI include solving complex tasks, learning autonomously, and performing functions traditionally requiring human intelligence across various fields such as healthcare, finance, and robotics. AI can be categorized based on capabilities (Weak AI, General AI, Super AI) and functionality (Reactive Machines, Limited Memory, Theory of Mind, Self-Awareness), with expert systems serving as a significant application that mimics human expertise in specific domains.

Uploaded by

sumit kumar
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)
1 views

ARTIFICIAL INTELLIGENCE

Artificial Intelligence (AI) is a branch of computer science focused on creating intelligent machines that can replicate human behavior and decision-making. Key goals of AI include solving complex tasks, learning autonomously, and performing functions traditionally requiring human intelligence across various fields such as healthcare, finance, and robotics. AI can be categorized based on capabilities (Weak AI, General AI, Super AI) and functionality (Reactive Machines, Limited Memory, Theory of Mind, Self-Awareness), with expert systems serving as a significant application that mimics human expertise in specific domains.

Uploaded by

sumit kumar
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/ 31

Artificial Intelligence

Artificial Intelligence : Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial
defines "man-made," and intelligence defines "thinking power", hence AI means "a man-made thinking power."
So, we can define AI as:
"It is a branch of computer science by which we can create intelligent machines which can behave like a human, think
like humans, and able to make decisions."
Goals of Artificial Intelligence
Following are the main goals of Artificial Intelligence:
1. Replicate human intelligence
2. Solve Knowledge-intensive tasks
3. An intelligent connection of perception and action
4. Building a machine which can perform tasks that requires human intelligence such as:
o Proving a theorem
o Playing chess
o Plan some surgical operation
o Driving a car in traffic
5. Creating some system which can exhibit intelligent behavior, learn new things by itself, demonstrate, explain, and
can advise to its user.
Applications of AI
AI in Astronomy
o Artificial Intelligence can be very useful to solve complex universe problems. AI technology can be helpful for
understanding the universe such as how it works, origin, etc.
2. AI in Healthcare
o In the last, five to ten years, AI becoming more advantageous for the healthcare industry and going to have a
significant impact on this industry.
o Healthcare Industries are applying AI to make a better and faster diagnosis than humans. AI can help doctors with
diagnoses and can inform when patients are worsening so that medical help can reach to the patient before
hospitalization.
3. AI in Gaming
o AI can be used for gaming purpose. The AI machines can play strategic games like chess, where the machine
needs to think of a large number of possible places.
4. AI in Finance
o AI and finance industries are the best matches for each other. The finance industry is implementing automation,
chatbot, adaptive intelligence, algorithm trading, and machine learning into financial processes.
5. AI in Data Security
o The security of data is crucial for every company and cyber-attacks are growing very rapidly in the digital world.
AI can be used to make your data more safe and secure. Some examples such as AEG bot, AI2 Platform,are used
to determine software bug and cyber-attacks in a better way.
6. AI in Social Media
o Social Media sites such as Facebook, Twitter, and Snapchat contain billions of user profiles, which need to be
stored and managed in a very efficient way. AI can organize and manage massive amounts of data. AI can analyze
lots of data to identify the latest trends, hashtag, and requirement of different users.
7. AI in Travel & Transport
o AI is becoming highly demanding for travel industries. AI is capable of doing various travel related works such as
from making travel arrangement to suggesting the hotels, flights, and best routes to the customers. Travel
industries are using AI-powered chatbots which can make human-like interaction with customers for better and
fast response.
8. AI in Automotive Industry
o Some Automotive industries are using AI to provide virtual assistant to their user for better performance. Such as
Tesla has introduced teslabot, an intelligent virtual assistant.
o Various Industries are currently working for developing self-driven cars which can make your journey more safe
and secure.
9. AI in Robotics:
o Artificial Intelligence has a remarkable role in Robotics. Usually, general robots are programmed such that they
can perform some repetitive task, but with the help of AI, we can create intelligent robots which can perform tasks
with their own experiences without pre-programmed.
o Humanoid Robots are best examples for AI in robotics, recently the intelligent Humanoid robot named as Erica
and Sophia has been developed which can talk and behave like humans.
10. AI in Entertainment
o We are currently using some AI based applications in our daily life with some entertainment services such as
Netflix or Amazon. With the help of ML/AI algorithms, these services show the recommendations for programs
or shows.
11. AI in Agriculture
o Agriculture is an area which requires various resources, labor, money, and time for best result. Now a day's
agriculture is becoming digital, and AI is emerging in this field. Agriculture is applying AI as agriculture robotics,
solid and crop monitoring, predictive analysis. AI in agriculture can be very helpful for farmers.
12. AI in E-commerce
o AI is providing a competitive edge to the e-commerce industry, and it is becoming more demanding in the e-
commerce business. AI is helping shoppers to discover associated products with recommended size, color, or
even brand.
13. AI in education:
o AI can automate grading so that the tutor can have more time to teach. AI chatbot can communicate with students
as a teaching assistant.
o AI in the future can be work as a personal virtual tutor for students, which will be accessible easily at any time
and any place.
Types of Artificial Intelligence:
Artificial Intelligence can be divided in various types, there are mainly two types of main categorization which are based
on capabilities and based on functionally of AI. Following is flow diagram which explain the types of AI.

AI type-1: Based on Capabilities


1. Weak AI or Narrow AI:
o Narrow AI is a type of AI which is able to perform a dedicated task with intelligence.The most common and
currently available AI is Narrow AI in the world of Artificial Intelligence.
o Narrow AI cannot perform beyond its field or limitations, as it is only trained for one specific task. Hence it is
also termed as weak AI. Narrow AI can fail in unpredictable ways if it goes beyond its limits.
o Apple Siriis a good example of Narrow AI, but it operates with a limited pre-defined range of functions.
o IBM's Watson supercomputer also comes under Narrow AI, as it uses an Expert system approach combined with
Machine learning and natural language processing.
o Some Examples of Narrow AI are playing chess, purchasing suggestions on e-commerce site, self-driving cars,
speech recognition, and image recognition.
2. General AI:
o General AI is a type of intelligence which could perform any intellectual task with efficiency like a human.
o The idea behind the general AI to make such a system which could be smarter and think like a human by its own.
o Currently, there is no such system exist which could come under general AI and can perform any task as perfect
as a human.
o The worldwide researchers are now focused on developing machines with General AI.
o As systems with general AI are still under research, and it will take lots of efforts and time to develop such
systems.
3. Super AI:
o Super AI is a level of Intelligence of Systems at which machines could surpass human intelligence, and can
perform any task better than human with cognitive properties. It is an outcome of general AI.
o Some key characteristics of strong AI include capability include the ability to think, to reason,solve the puzzle,
make judgments, plan, learn, and communicate by its own.
o Super AI is still a hypothetical concept of Artificial Intelligence. Development of such systems in real is still
world changing task.

Artificial Intelligence type-2: Based on functionality


1. Reactive Machines
o Purely reactive machines are the most basic types of Artificial Intelligence.
o Such AI systems do not store memories or past experiences for future actions.
o These machines only focus on current scenarios and react on it as per possible best action.
o IBM's Deep Blue system is an example of reactive machines.
o Google's AlphaGo is also an example of reactive machines.
2. Limited Memory
o Limited memory machines can store past experiences or some data for a short period of time.
o These machines can use stored data for a limited time period only.
o Self-driving cars are one of the best examples of Limited Memory systems. These cars can store recent speed of
nearby cars, the distance of other cars, speed limit, and other information to navigate the road.
3. Theory of Mind
o Theory of Mind AI should understand the human emotions, people, beliefs, and be able to interact socially like
humans.
o This type of AI machines are still not developed, but researchers are making lots of efforts and improvement for
developing such AI machines.
4. Self-Awareness
o Self-awareness AI is the future of Artificial Intelligence. These machines will be super intelligent, and will have
their own consciousness, sentiments, and self-awareness.
o These machines will be smarter than human mind.
o Self-Awareness AI does not exist in reality still and it is a hypothetical concept.

What is an Expert System?


An expert system is a computer program that is designed to solve complex problems and to provide decision-making
ability like a human expert. It performs this by extracting knowledge from its knowledge base using the reasoning and
inference rules according to the user queries.
The expert system is a part of AI, and the first ES was developed in the year 1970, which was the first successful approach
of artificial intelligence. It solves the most complex issue as an expert by extracting the knowledge stored in its knowledge
base. The system helps in decision making for complex problems using both facts and heuristics like a human expert.
It is called so because it contains the expert knowledge of a specific domain and can solve any complex problem of that
particular domain. These systems are designed for a specific domain, such as medicine, science, etc.
The performance of an expert system is based on the expert's knowledge stored in its knowledge base. The more
knowledge stored in the KB, the more that system improves its performance. One of the common examples of an ES is a
suggestion of spelling errors while typing in the Google search box.
Below is the block diagram that represents the working of an expert system:
Below are some popular examples of the Expert System:
o DENDRAL: It was an artificial intelligence project that was made as a chemical analysis expert system. It was
used in organic chemistry to detect unknown organic molecules with the help of their mass spectra and knowledge
base of chemistry.
o MYCIN: It was one of the earliest backward chaining expert systems that was designed to find the bacteria
causing infections like bacteraemia and meningitis. It was also used for the recommendation of antibiotics and the
diagnosis of blood clotting diseases.
o PXDES: It is an expert system that is used to determine the type and level of lung cancer. To determine the
disease, it takes a picture from the upper body, which looks like the shadow. This shadow identifies the type and
degree of harm.
o CaDeT: The CaDet expert system is a diagnostic support system that can detect cancer at early stages.
Characteristics of Expert System
o High Performance: The expert system provides high performance for solving any type of complex problem of a
specific domain with high efficiency and accuracy.
o Understandable: It responds in a way that can be easily understandable by the user. It can take input in human
language and provides the output in the same way.
o Reliable: It is much reliable for generating an efficient and accurate output.
o Highly responsive: ES provides the result for any complex query within a very short period of time.
Components of Expert System
An expert system mainly consists of three components:
o User Interface
o Inference Engine
o Knowledge Base

1. User Interface
With the help of a user interface, the expert system interacts with the user, takes queries as an input in a readable format,
and passes it to the inference engine. After getting the response from the inference engine, it displays the output to the
user. In other words, it is an interface that helps a non-expert user to communicate with the expert system to find a
solution.
2. Inference Engine(Rules of Engine)
o The inference engine is known as the brain of the expert system as it is the main processing unit of the system. It
applies inference rules to the knowledge base to derive a conclusion or deduce new information. It helps in
deriving an error-free solution of queries asked by the user.
o With the help of an inference engine, the system extracts the knowledge from the knowledge base.
o There are two types of inference engine:
o Deterministic Inference engine: The conclusions drawn from this type of inference engine are assumed to be
true. It is based on facts and rules.
o Probabilistic Inference engine: This type of inference engine contains uncertainty in conclusions, and based on
the probability.
Inference engine uses the below modes to derive the solutions:
o Forward Chaining: It starts from the known facts and rules, and applies the inference rules to add their
conclusion to the known facts.
o Backward Chaining: It is a backward reasoning method that starts from the goal and works backward to prove
the known facts.
3. Knowledge Base
o The knowledgebase is a type of storage that stores knowledge acquired from the different experts of the particular
domain. It is considered as big storage of knowledge. The more the knowledge base, the more precise will be the
Expert System.
o It is similar to a database that contains information and rules of a particular domain or subject.
o One can also view the knowledge base as collections of objects and their attributes. Such as a Lion is an object
and its attributes are it is a mammal, it is not a domestic animal, etc.
o
Components of Knowledge Base
o Factual Knowledge: The knowledge which is based on facts and accepted by knowledge engineers comes under
factual knowledge.
o Heuristic Knowledge: This knowledge is based on practice, the ability to guess, evaluation, and experiences.
Knowledge Representation: It is used to formalize the knowledge stored in the knowledge base using the If-else rules.
Knowledge Acquisitions: It is the process of extracting, organizing, and structuring the domain knowledge, specifying
the rules to acquire the knowledge from various experts, and store that knowledge into the knowledge base.

Participants in the development of Expert System


There are three primary participants in the building of Expert System:
1. Expert: The success of an ES much depends on the knowledge provided by human experts. These experts are
those persons who are specialized in that specific domain.
2. Knowledge Engineer: Knowledge engineer is the person who gathers the knowledge from the domain experts
and then codifies that knowledge to the system according to the formalism.
3. End-User: This is a particular person or a group of people who may not be experts, and working on the expert
system needs the solution or advice for his queries, which are complex.
ADVANTAGES OF EXPERT SYSTEM
Before using any technology, we must have an idea about why to use that technology and hence the same for the ES.
Although we have human experts in every field, then what is the need to develop a computer-based system. So below are
the points that are describing the need of the ES:
1. No memory Limitations: It can store as much data as required and can memorize it at the time of its application.
But for human experts, there are some limitations to memorize all things at every time.
2. High Efficiency: If the knowledge base is updated with the correct knowledge, then it provides a highly efficient
output, which may not be possible for a human.
3. Expertise in a domain: There are lots of human experts in each domain, and they all have different skills,
different experiences, and different skills, so it is not easy to get a final output for the query. But if we put the
knowledge gained from human experts into the expert system, then it provides an efficient output by mixing all
the facts and knowledge
4. Not affected by emotions: These systems are not affected by human emotions such as fatigue, anger, depression,
anxiety, etc.. Hence the performance remains constant.
5. High security: These systems provide high security to resolve any query.
6. Considers all the facts: To respond to any query, it checks and considers all the available facts and provides the
result accordingly. But it is possible that a human expert may not consider some facts due to any reason.
7. Regular updates improve the performance: If there is an issue in the result provided by the expert systems, we
can improve the performance of the system by updating the knowledge base.
Capabilities of the Expert System
Below are some capabilities of an Expert System:
o Advising: It is capable of advising the human being for the query of any domain from the particular ES.
o Provide decision-making capabilities: It provides the capability of decision making in any domain, such as for
making any financial decision, decisions in medical science, etc.
o Demonstrate a device: It is capable of demonstrating any new products such as its features, specifications, how
to use that product, etc.
o Problem-solving: It has problem-solving capabilities.
o Explaining a problem: It is also capable of providing a detailed description of an input problem.
o Interpreting the input: It is capable of interpreting the input given by the user.
o Predicting results: It can be used for the prediction of a result.
o Diagnosis: An ES designed for the medical field is capable of diagnosing a disease without using multiple
components as it already contains various inbuilt medical tools.
Advantages of Expert System
o These systems are highly reproducible.
o They can be used for risky places where the human presence is not safe.
o Error possibilities are less if the KB contains correct knowledge.
o The performance of these systems remains steady as it is not affected by emotions, tension, or fatigue.
o They provide a very high speed to respond to a particular query.
Limitations of Expert System
o The response of the expert system may get wrong if the knowledge base contains the wrong information.
o Like a human being, it cannot produce a creative output for different scenarios.
o Its maintenance and development costs are very high.
o Knowledge acquisition for designing is much difficult.
o For each domain, we require a specific ES, which is one of the big limitations.
o It cannot learn from itself and hence requires manual updates.
Applications of Expert System
o In designing and manufacturing domain
It can be broadly used for designing and manufacturing physical devices such as camera lenses and automobiles.
o In the knowledge domain
These systems are primarily used for publishing the relevant knowledge to the users. The two popular ES used for
this domain is an advisor and a tax advisor.
o In the finance domain
In the finance industries, it is used to detect any type of possible fraud, suspicious activity, and advise bankers that
if they should provide loans for business or not.
o In the diagnosis and troubleshooting of devices
In medical diagnosis, the ES system is used, and it was the first area where these systems were used.
o Planning and Scheduling
The expert systems can also be used for planning and scheduling some particular tasks for achieving the goal of
that task.

Expert System Development Life Cycle:


Problem Identification Phase:
Identifying the problem and opportunity where the organization can obtain benefits from expert system, and establishing
the Expert system general goals.
Feasibility Study Phase:
Assessing the feasibility of the expert system development in terms of its technical operational and economical feasibility.
Project Planning Phase:
Planning for the expert system project, including development team members, working environment, project schedule,
and budget.
Knowledge Acquisition Phase:
Extracting domain knowledge from domain experts and determining the system’s requirements.
Knowledge Representation Phase:
Representing key concepts from domain and inter relationships between these concepts using formal representation
methods.
Knowledge Implementation Phase:
Coding the formalized knowledge in to a working prototype.
Verification and Validation:
Verifying and validating working prototype against the system requirements, and revising it necessary according to
domain expert’s feedback.
Installation and Training:
Installing the final prototype in an operating environment, training the users and developing documentation and user
manual.
Operation/ Evolution / Maintenance:
Running the system in an operating environment, evaluating its performance and benefits and maintaining system.

Types of search algorithms


Based on the search problems we can classify the search algorithms into uninformed (Blind search) search and
informed search (Heuristic search) algorithms.

Uninformed/Blind Search:
The uninformed search does not contain any domain knowledge such as closeness, the location of the goal. It operates in a
brute-force way as it only includes information about how to traverse the tree and how to identify leaf and goal nodes.
Uninformed search applies a way in which search tree is searched without any information about the search space like
initial state operators and test for the goal, so it is also called blind search.It examines each node of the tree until it
achieves the goal node.
It can be divided into five main types:
o Breadth-first search
o Uniform cost search
o Depth-first search
o Iterative deepening depth-first search
o Bidirectional Search
Informed Search
Informed search algorithms use domain knowledge. In an informed search, problem information is available which can
guide the search. Informed search strategies can find a solution more efficiently than an uninformed search strategy.
Informed search is also called a Heuristic search.
A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find a good solution in
reasonable time.
Informed search can solve much complex problem which could not be solved in another way.
An example of informed search algorithms is a traveling salesman problem.
1. Greedy Search
2. A* Search
Hill Climbing Algorithm in Artificial Intelligence
o 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.
o 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.
o It is also called greedy local search as it only looks to its good immediate neighbor state and not beyond that.
o A node of hill climbing algorithm has two components which are state and value.
o Hill Climbing is mostly used when a good heuristic is available.
o In this algorithm, we don't need to maintain and handle the search tree or graph as it only keeps a single current
state.
Features of Hill Climbing:
Following are some main features of Hill Climbing Algorithm:
o Generate and Test variant: Hill Climbing is the variant of Generate and Test method. The Generate and Test
method produce feedback which helps to decide which direction to move in the search space.
o Greedy approach: Hill-climbing algorithm search moves in the direction which optimizes the cost.
o No backtracking: It does not backtrack the search space, as it does not remember the previous states.
State-space Diagram for Hill Climbing:
The state-space landscape is a graphical representation of the hill-climbing algorithm which is showing a graph between
various states of algorithm and Objective function/Cost.
On Y-axis we have taken the function which can be an objective function or cost function, and state-space on the x-axis. If
the function on Y-axis is cost then, the goal of search is to find the global minimum and local minimum. If the function of
Y-axis is Objective function, then the goal of the search is to find the global maximum and local maximum.

Different regions in the state space landscape:


Local Maximum: Local maximum is a state which is better than its neighbor states, but there is also another state which
is higher than it.
Global Maximum: Global maximum is the best possible state of state space landscape. It has the highest value of
objective function.
Current state: It is a state in a landscape diagram where an agent is currently present.
Flat local maximum: It is a flat space in the landscape where all the neighbor states of current states have the same value.
Shoulder: It is a plateau region which has an uphill edge.
Types of Hill Climbing Algorithm:
o Simple hill Climbing:
o Steepest-Ascent hill-climbing:
o Stochastic hill Climbing:
1. Simple Hill Climbing:
Simple hill climbing is the simplest way to implement a hill climbing algorithm. It only evaluates the neighbor node
state at a time and selects the first one which optimizes current cost and set it as a current state. It only checks it's
one successor state, and if it finds better than the current state, then move else be in the same state. This algorithm has the
following features:
o Less time consuming
o Less optimal solution and the solution is not guaranteed
Algorithm for Simple Hill Climbing:
o Step 1: Evaluate the initial state, if it is goal state then return success and Stop.
o Step 2: Loop Until a solution is found or there is no new operator left to apply.
o Step 3: Select and apply an operator to the current state.
o Step 4: Check new state:
a. If it is goal state, then return success and quit.
b. Else if it is better than the current state then assign new state as a current state.
c. Else if not better than the current state, then return to step2.
o Step 5: Exit.

State Space Search


A state space is a mathematical representation of a problem that defines all possible states that the problem can be in.
Furthermore, in search algorithms, we use a state space to represent the current state of the problem, the initial state, and
the goal state. Additionally, we represent each state in the state space by a set of variables.
State space search is a method used widely in artificial intelligence and computer science to find a solution to a
problem by searching through the set of possible states of the problem. Furthermore, a state space search algorithm
uses the state space to navigate from the initial state to the goal state. Additionally, it generates and explores possible
successors of the current state until we find a solution.
The state space size can greatly affect a search algorithm’s efficiency. Hence, it’s important to choose an appropriate
representation and search strategy to efficiently search the state space.
The most famous state space search algorithm is the A* algorithm. Other popular state space search algorithms
are breadth-first search (BFS), depth-first search (DFS), hill climbing, simulated annealing, and genetic algorithms.
3. Steps
Now let’s discuss the steps of a typical state space search algorithm:

The first step is to initialize the search by setting the initial state as the current state. After the initialization step, we check
if the current state is a goal state. Finally, if the current state is a goal state, we terminate the algorithm and return the
result.
However, if the current state is not the goal state, we generate the set of possible states that can be reached from the
current state. Additionally, these states are known as successor states. Furthermore, for each successor state, we check if it
has been previously visited. If the state is already explored, we skip the state. If it has not been visited, we add it to the
queue of states to be visited.
Moving forward, we set the next state in the queue as the current state and check if it’s a goal state. If we find the goal
state, we return the result. Otherwise, we repeat the previous step until we find the goal state or finish exploring all the
states. Furthermore, if all possible states have been explored and we can’t reach the target state, we return with no
solution.
Example
A common example of a state space search is the 8-puzzle problem. The 8-puzzle is a sliding puzzle that consists of 8
numbered tiles in a 3 3 grid and one blank space. The goal is to rearrange the tiles from a given initial state to a final goal
state by sliding the tiles into the blank space.
In this problem, we represent the state space by the 9 tiles in the puzzle and their positions in the grid. Additionally, we
present each state in the state space by a 3 3 array with values from 1 to 8. Finally, we represent a blank space with an
employ tile.
The initial state represents the starting configuration of the tiles. The goal state represents the desired configuration.
Furthermore, the search algorithms use the state space to find a sequence of moves that transform the initial state into the
goal state.
For example, we can use the breadth-first search to explore all possible states reachable from the initial state. It explores
all the states one by one in a sequence. It ensures the solution but can become very slow for large state spaces. Other
algorithms, such as A* search, use heuristics to guide the search more efficiently.
We’re taking a practical example of an 8-puzzle problem. Let’s pick current and target states for this example:

Here, we aim to start from the current state and reach the target state by sliding the numbers through the bank.
Furthermore, the approach is to explore all the states we can reach from the current state. For each new state, we check if
it’s the target state or not. Let’s take a look at how to reach the target state from the current state:

What is a Production System in AI?


A production system in AI is a framework that assists in developing computer programs to automate a wide range of
tasks. It significantly impacts the creation of AI-based systems like computer software, mobile applications, and
manufacturing tools. By establishing rules, a production system empowers machines to demonstrate particular behaviors
and adapt to their surroundings.
In Artificial Intelligence, a production system serves as a cognitive architecture. It encompasses rules representing
declarative knowledge, allowing machines to make decisions and act based on different conditions. Many expert systems
and automation methodologies rely on the rules defined in production systems to guide their behavior.
A production system’s architecture consists of rules structured as left-hand side (LHS) and right-hand side (RHS)
equations. The LHS specifies the condition to be evaluated, while the RHS determines the output or action resulting from
the estimated condition. This rule-based approach forms the foundation of production systems in AI, enabling machines to
process information and respond accordingly.
The representation of knowledge in AI comprises various components used for making intelligent machines. In the next
section, we will discuss the important components of a production system in Artificial Intelligence.
Components of a Production System in AI
For making an AI-based intelligent system that performs specific tasks, we need an architecture. The architecture of a
production system in Artificial Intelligence consists of production rules, a database, and the control system.

Let us discuss each one of them in detail.


Global Database
A global database consists of the architecture used as a central data structure. A database contains all the necessary data
and information required for the successful completion of a task. It can be divided into two parts as permanent and
temporary. The permanent part of the database consists of fixed actions, whereas the temporary part alters according to
circumstances.
Production Rules
Production rules in AI are the set of rules that operate on the data fetched from the global database. Also, these production
rules are bound with precondition and postcondition that gets checked by the database. If a condition is passed through a
production rule and gets satisfied by the global database, then the rule is successfully applied. The rules are of the form
A®B, where the right-hand side represents an outcome corresponding to the problem state represented by the left-hand
side.
Control System
The control system checks the applicability of a rule. It helps decide which rule should be applied and terminates the
process when the system gives the correct output. It also resolves the conflict of multiple conditions arriving at the same
time. The strategy of the control system specifies the sequence of rules that compares the condition from the global
database to reach the correct result.

What are the characteristics of Artificial Intelligence problems?


Artificial Intelligence (AI) problems refer to a wide range of tasks that involve the development of algorithms or systems
that can perform tasks that typically require human-level intelligence, such as decision-making, language processing,
image recognition, and problem-solving.
AI problems are characterized by several key features, including:
1. Complexity: AI problems are often highly complex, requiring the processing of large amounts of data and the
ability to handle uncertainty and ambiguity. The algorithms and systems developed to solve these problems must
be able to manage complexity and make decisions based on incomplete or uncertain information.
2. Non-linearity: Many AI problems exhibit non-linear relationships, meaning that small changes in the input can
lead to significant changes in the output. This makes it difficult to develop algorithms that can accurately predict
outcomes or make decisions based on input data.
3. Context dependence: AI problems often require the ability to understand context and make decisions based on
the specific situation or environment. For example, a language processing system must be able to understand the
meaning of words in the context of a sentence or paragraph.
4. Creativity: Some AI problems require the ability to generate novel solutions or ideas, often using techniques such
as generative adversarial networks (GANs) or evolutionary algorithms. These techniques allow AI systems to
learn from existing data and generate new and innovative solutions to complex problems.
5. Learning and adaptation: AI problems often require the ability to learn and adapt over time based on new data
or feedback. This is achieved through techniques such as machine learning, deep learning, and reinforcement
learning, which enable AI systems to improve their performance over time.
6. Multi-disciplinary: AI problems often require expertise from multiple fields, including computer science,
mathematics, statistics, and cognitive psychology. Successful AI systems must be designed and developed by
teams with a wide range of skills and knowledge.
7. Ethical considerations: AI problems raise ethical and social concerns related to privacy, security, bias, and
fairness. The development of AI systems requires careful consideration of these issues to ensure that the
technology is used ethically and responsibly.
Problem-solving agents:
In Artificial Intelligence, Search techniques are universal problem-solving methods. Rational agents or Problem-solving
agents in AI mostly used these search strategies or algorithms to solve a specific problem and provide the best result.
Problem-solving agents are the goal-based agents and use atomic representation. In this topic, we will learn various
problem-solving search algorithms.
Search Algorithm Terminologies:
o Search: Searchingis a step by step procedure to solve a search-problem in a given search space. A search problem
can have three main factors:
a. Search Space: Search space represents a set of possible solutions, which a system may have.
b. Start State: It is a state from where agent begins the search.
c. Goal test: It is a function which observe the current state and returns whether the goal state is achieved or
not.
o Search tree: A tree representation of search problem is called Search tree. The root of the search tree is the root
node which is corresponding to the initial state.
o Actions: It gives the description of all the available actions to the agent.
o Transition model: A description of what each action do, can be represented as a transition model.
o Path Cost: It is a function which assigns a numeric cost to each path.
o Solution: It is an action sequence which leads from the start node to the goal node.
o Optimal Solution: If a solution has the lowest cost among all solutions.
Properties of Search Algorithms:
Following are the four essential properties of search algorithms to compare the efficiency of these algorithms:
Completeness: A search algorithm is said to be complete if it guarantees to return a solution if at least any solution exists
for any random input.
Optimality: If a solution found for an algorithm is guaranteed to be the best solution (lowest path cost) among all other
solutions, then such a solution for is said to be an optimal solution.
Time Complexity: Time complexity is a measure of time for an algorithm to complete its task.
Space Complexity: It is the maximum storage space required at any point during the search, as the complexity of the
problem.
1.) Best-first Search Algorithm (Greedy Search):
Greedy best-first search algorithm always selects the path which appears best at that moment. It is the combination of
depth-first search and breadth-first search algorithms. It uses the heuristic function and search. Best-first search allows us
to take the advantages of both algorithms. With the help of best-first search, at each step, we can choose the most
promising node. In the best first search algorithm, we expand the node which is closest to the goal node and the closest
cost is estimated by heuristic function, i.e.
1. f(n)= g(n).
Were, h(n)= estimated cost from node n to the goal.
The greedy best first algorithm is implemented by the priority queue.
Best first search algorithm:
o Step 1: Place the starting node into the OPEN list.
o Step 2: If the OPEN list is empty, Stop and return failure.
o Step 3: Remove the node n, from the OPEN list which has the lowest value of h(n), and places it in the CLOSED
list.
o Step 4: Expand the node n, and generate the successors of node n.
o Step 5: Check each successor of node n, and find whether any node is a goal node or not. If any successor node is
goal node, then return success and terminate the search, else proceed to Step 6.
o Step 6: For each successor node, algorithm checks for evaluation function f(n), and then check if the node has
been in either OPEN or CLOSED list. If the node has not been in both list, then add it to the OPEN list.
o Step 7: Return to Step 2.
Advantages:
o Best first search can switch between BFS and DFS by gaining the advantages of both the algorithms.
o This algorithm is more efficient than BFS and DFS algorithms.
Disadvantages:
o It can behave as an unguided depth-first search in the worst case scenario.
o It can get stuck in a loop as DFS.
o This algorithm is not optimal.
Example:
Consider the below search problem, and we will traverse it using greedy best-first search. At each iteration, each node is
expanded using evaluation function f(n)=h(n) , which is given in the below table.

In this search example, we are using two lists which are OPEN and CLOSED Lists. Following are the iteration for
traversing the above example.

Expand the nodes of S and put in the CLOSED list


Initialization: Open [A, B], Closed [S]
Iteration 1: Open [A], Closed [S, B]
Iteration 2: Open [E, F, A], Closed [S, B]
: Open [E, A], Closed [S, B, F]
Iteration 3: Open [I, G, E, A], Closed [S, B, F]
: Open [I, E, A], Closed [S, B, F, G]
Hence the final solution path will be: S----> B----->F----> G
Time Complexity: The worst case time complexity of Greedy best first search is O(bm).
Space Complexity: The worst case space complexity of Greedy best first search is O(bm). Where, m is the maximum
depth of the search space.
Complete: Greedy best-first search is also incomplete, even if the given state space is finite.
Optimal: Greedy best first search algorithm is not optimal.
2.) A* Search Algorithm:
A* search is the most commonly known form of best-first search. It uses heuristic function h(n), and cost to reach the
node n from the start state g(n). It has combined features of UCS and greedy best-first search, by which it solve the
problem efficiently. A* search algorithm finds the shortest path through the search space using the heuristic function. This
search algorithm expands less search tree and provides optimal result faster. A* algorithm is similar to UCS except that it
uses g(n)+h(n) instead of g(n).
In A* search algorithm, we use search heuristic as well as the cost to reach the node. Hence we can combine both costs as
following, and this sum is called as a fitness number.

At each point in the search space, only those node is expanded which have the lowest value of f(n), and the algorithm
terminates when the goal node is found.
Algorithm of A* search:
Step1: Place the starting node in the OPEN list.
Step 2: Check if the OPEN list is empty or not, if the list is empty then return failure and stops.
Step 3: Select the node from the OPEN list which has the smallest value of evaluation function (g+h), if node n is goal
node then return success and stop, otherwise
Step 4: Expand node n and generate all of its successors, and put n into the closed list. For each successor n', check
whether n' is already in the OPEN or CLOSED list, if not then compute evaluation function for n' and place into Open list.
Step 5: Else if node n' is already in OPEN and CLOSED, then it should be attached to the back pointer which reflects the
lowest g(n') value.
Step 6: Return to Step 2.
Advantages:
o A* search algorithm is the best algorithm than other search algorithms.
o A* search algorithm is optimal and complete.
o This algorithm can solve very complex problems.
Disadvantages:
o It does not always produce the shortest path as it mostly based on heuristics and approximation.
o A* search algorithm has some complexity issues.
o The main drawback of A* is memory requirement as it keeps all generated nodes in the memory, so it is not
practical for various large-scale problems.
Example:
In this example, we will traverse the given graph using the A* algorithm. The heuristic value of all states is given in the
below table so we will calculate the f(n) of each state using the formula f(n)= g(n) + h(n), where g(n) is the cost to reach
any node from start state.
Here we will use OPEN and CLOSED list.

Solution:
Initialization: {(S, 5)}
Iteration1: {(S--> A, 4), (S-->G, 10)}
Iteration2: {(S--> A-->C, 4), (S--> A-->B, 7), (S-->G, 10)}
Iteration3: {(S--> A-->C--->G, 6), (S--> A-->C--->D, 11), (S--> A-->B, 7), (S-->G, 10)}
Iteration 4 will give the final result, as S--->A--->C--->G it provides the optimal path with cost 6.

What is knowledge representation?


Humans are best at understanding, reasoning, and interpreting knowledge. Human knows things, which is knowledge and
as per their knowledge they perform various actions in the real world. But how machines do all these things comes
under knowledge representation and reasoning. Hence we can describe Knowledge representation as following:
o Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence which concerned with AI
agents thinking and how thinking contributes to intelligent behavior of agents.
o It is responsible for representing information about the real world so that a computer can understand and can
utilize this knowledge to solve the complex real world problems such as diagnosis a medical condition or
communicating with humans in natural language.
o It is also a way which describes how we can represent knowledge in artificial intelligence. Knowledge
representation is not just storing data into some database, but it also enables an intelligent machine to learn from
that knowledge and experiences so that it can behave intelligently like a human.
What to Represent:
Following are the kind of knowledge which needs to be represented in AI systems:
o Object: All the facts about objects in our world domain. E.g., Guitars contains strings, trumpets are brass
instruments.
o Events: Events are the actions which occur in our world.
o Performance: It describe behavior which involves knowledge about how to do things.
o Meta-knowledge: It is knowledge about what we know.
o Facts: Facts are the truths about the real world and what we represent.
o Knowledge-Base: The central component of the knowledge-based agents is the knowledge base. It is represented
as KB. The Knowledgebase is a group of the Sentences (Here, sentences are used as a technical term and not
identical with the English language).
Knowledge: Knowledge is awareness or familiarity gained by experiences of facts, data, and situations. Following are the
types of knowledge in artificial intelligence:
Types of knowledge
Following are the various types of knowledge:
1. Declarative Knowledge:
o Declarative knowledge is to know about something.
o It includes concepts, facts, and objects.
o It is also called descriptive knowledge and expressed in declarativesentences.
o It is simpler than procedural language.
2. Procedural Knowledge
o It is also known as imperative knowledge.
o Procedural knowledge is a type of knowledge which is responsible for knowing how to do something.
o It can be directly applied to any task.
o It includes rules, strategies, procedures, agendas, etc.
o Procedural knowledge depends on the task on which it can be applied.
3. Meta-knowledge:
o Knowledge about the other types of knowledge is called Meta-knowledge.
4. Heuristic knowledge:
o Heuristic knowledge is representing knowledge of some experts in a filed or subject.
o Heuristic knowledge is rules of thumb based on previous experiences, awareness of approaches, and which are
good to work but not guaranteed.
5. Structural knowledge:
o Structural knowledge is basic knowledge to problem-solving.
o It describes relationships between various concepts such as kind of, part of, and grouping of something.
o It describes the relationship that exists between concepts or objects.

AI knowledge cycle:
An Artificial intelligence system has the following components for displaying intelligent behavior:
o Perception
o Learning
o Knowledge Representation and Reasoning
o Planning
o Execution
The above diagram is showing how an AI system can interact with the real world and what components help it to show
intelligence. AI system has Perception component by which it retrieves information from its environment. It can be visual,
audio or another form of sensory input. The learning component is responsible for learning from data captured by
Perception comportment. In the complete cycle, the main components are knowledge representation and Reasoning. These
two components are involved in showing the intelligence in machine-like humans. These two components are independent
with each other but also coupled together. The planning and execution depend on analysis of Knowledge representation
and reasoning.
Approaches to knowledge representation:
There are mainly four approaches to knowledge representation, which are givenbelow:
1. Simple relational knowledge:
o It is the simplest way of storing facts which uses the relational method, and each fact about a set of the object is
set out systematically in columns.
o This approach of knowledge representation is famous in database systems where the relationship between
different entities is represented.
o This approach has little opportunity for inference.
Example: The following is the simple relational knowledge representation.
Player Weight Age
Player1 65 23
Player2 58 18
Player3 75 24
2. Inheritable knowledge:
o In the inheritable knowledge approach, all data must be stored into a hierarchy of classes.
o All classes should be arranged in a generalized form or a hierarchal manner.
o In this approach, we apply inheritance property.
o Elements inherit values from other members of a class.
o This approach contains inheritable knowledge which shows a relation between instance and class, and it is called
instance relation.
o Every individual frame can represent the collection of attributes and its value.
o In this approach, objects and values are represented in Boxed nodes.
o We use Arrows which point from objects to their values.
o Example:

3. Inferential knowledge:
o Inferential knowledge approach represents knowledge in the form of formal logics.
o This approach can be used to derive more facts.
o It guaranteed correctness.
o Example: Let's suppose there are two statements:
a. Marcus is a man
b. All men are mortal
Then it can represent as;

man(Marcus)
∀x = man (x) ----------> mortal (x)s
4. Procedural knowledge:
o Procedural knowledge approach uses small programs and codes which describes how to do specific things, and
how to proceed.
o In this approach, one important rule is used which is If-Then rule.
o In this knowledge, we can use various coding languages such as LISP language and Prolog language.
o We can easily represent heuristic or domain-specific knowledge using this approach.
o But it is not necessary that we can represent all cases in this approach.
Requirements for knowledge Representation system:
A good knowledge representation system must possess the following properties.
1. 1. Representational Accuracy:
KR system should have the ability to represent all kind of required knowledge.
2. 2. Inferential Adequacy:
KR system should have ability to manipulate the representational structures to produce new knowledge
corresponding to existing structure.
3. 3. Inferential Efficiency:
The ability to direct the inferential knowledge mechanism into the most productive directions by storing
appropriate guides.
4. 4. Acquisitional efficiency- The ability to acquire the new knowledge easily using automatic methods.
Techniques of knowledge representation
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

1. Logical Representation
Logical representation is a language with some concrete rules which deals with propositions and has no ambiguity in
representation. Logical representation means drawing a conclusion based on various conditions. This representation lays
down some important communication rules. It consists of precisely defined syntax and semantics which supports the
sound inference. Each sentence can be translated into logics using syntax and semantics.
Syntax:
o Syntaxes are the rules which decide how we can construct legal sentences in the logic.
o It determines which symbol we can use in knowledge representation.
o How to write those symbols.
Semantics:
o Semantics are the rules by which we can interpret the sentence in the logic.
o Semantic also involves assigning a meaning to each sentence.
Logical representation can be categorised into mainly two logics:
a. Propositional Logics
b. Predicate logics
Advantages of logical representation:
1. Logical representation enables us to do logical reasoning.
2. Logical representation is the basis for the programming languages.
Disadvantages of logical Representation:
1. Logical representations have some restrictions and are challenging to work with.
2. Logical representation technique may not be very natural, and inference may not be so efficient.
2. Semantic Network Representation
Semantic networks are alternative of 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:
a. IS-A relation (Inheritance)
b. Kind-of-relation
Example: Following are some statements which we need to represent in the form of nodes and arcs.
Statements:
a. Jerry is a cat.
b. Jerry is a mammal
c. Jerry is owned by Priya.
d. Jerry is brown colored.
e. All Mammals are animal.

In the above diagram, we have represented the different type of knowledge in the form of nodes and arcs. Each object is
connected with another object by some 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. It might be possible in the worst case scenario that after traversing the entire tree, we find
that the solution does not exist in this network.
2. Semantic networks try to model human-like memory (Which has 1015 neurons and links) to store the information,
but in practice, it is not possible to build such a vast semantic network.
3. These types of representations are inadequate as they do not have any equivalent quantifier, e.g., for all, for some,
none, etc.
4. Semantic networks do not have any standard definition for the link names.
5. 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.
3. Frame Representation
A frame is a record like structure which consists of a collection of attributes and its values to describe an entity in the
world. Frames are the AI data structure which divides knowledge into substructures by representing stereotypes situations.
It consists of a collection of slots and slot values. These slots may be of any type and sizes. Slots have names and values
which are called facets.
Facets: The various aspects of a slot is known as Facets. Facets are features of frames which enable us to put constraints
on the frames. Example: IF-NEEDED facts are called when data of any particular slot is needed. A frame may consist of
any number of slots, and a slot may include any number of facets and facets may have any number of values. A frame is
also known as slot-filter knowledge representation in artificial intelligence.
Frames are derived from semantic networks and later evolved into our modern-day classes and objects. A single frame is
not much useful. Frames system consist of a collection of frames which are connected. In the frame, knowledge about an
object or event can be stored together in the knowledge base. The frame is a type of technology which is widely used in
various applications including Natural language processing and machine visions.
Example: 1
Let's take an example of a frame for a book
Slots Filters
Title Artificial Intelligence
Genre Computer Science
Author Peter Norvig
Edition Third Edition
Year 1996
Page 1152
Example 2:
Let's suppose we are taking an entity, Peter. Peter is an engineer as a profession, and his age is 25, he lives in city London,
and the country is England. So following is the frame representation for this:
Slots Filter
Name Peter
Profession Doctor
Age 25
Marital status Single
Weight 78
Advantages of frame representation:
1. The frame knowledge representation makes the programming easier by grouping the related data.
2. The frame representation is comparably flexible and used by many applications in AI.
3. It is very easy to add slots for new attribute and relations.
4. It is easy to include default data and to search for missing values.
5. Frame representation is easy to understand and visualize.
Disadvantages of frame representation:
1. In frame system inference mechanism is not be easily processed.
2. Inference mechanism cannot be smoothly proceeded by frame representation.
3. Frame representation has a much generalized approach.
4. Production Rules
Production rules system consist of (condition, action) pairs which mean, "If condition then action". It has mainly three
parts:
o The set of production rules
o Working Memory
o The recognize-act-cycle
In production rules agent checks for the condition and if the condition exists then production rule fires and corresponding
action is carried out. The condition part of the rule determines which rule may be applied to a problem. And the action
part carries out the associated problem-solving steps. This complete process is called a recognize-act cycle.
The working memory contains the description of the current state of problems-solving and rule can write knowledge to
the working memory. This knowledge match and may fire other rules.
If there is a new situation (state) generates, then multiple production rules will be fired together, this is called conflict set.
In this situation, the agent needs to select a rule from these sets, and it is called a conflict resolution.
Example:
o IF (at bus stop AND bus arrives) THEN action (get into the bus)
o IF (on the bus AND paid AND empty seat) THEN action (sit down).
o IF (on bus AND unpaid) THEN action (pay charges).
o IF (bus arrives at destination) THEN action (get down from the bus).
Advantages of Production rule:
1. The production rules are expressed in natural language.
2. The production rules are highly modular, so we can easily remove, add or modify an individual rule.
Disadvantages of Production rule:
1. Production rule system does not exhibit any learning capabilities, as it does not store the result of the problem for
the future uses.
2. During the execution of the program, many rules may be active hence rule-based production systems are
inefficient.
Difference between Propositional Logic and Predicate Logic
Logical reasoning forms the basis for a huge domain of computer science and mathematics. They help in establishing
mathematical arguments, valid or invalid.
1. Propositional Logic :
A proposition is basically a declarative sentence that has a truth value. Truth value can either be true or false, but it needs
to be assigned any of the two values and not be ambiguous. The purpose of using propositional logic is to analyze a
statement, individually or compositely.
For example :
The following statements :

1. If x is real, then x2 > 0


2. What is your name?
3. (a+b)2 = 100
4. This statement is false.
5. This statement is true.
Are not propositions because they do not have a truth value. They are ambiguous.
But the following statements :

1. (a+b)2 = a2 + 2ab + b2
2. If x is real, then x2 >= 0
3. If x is real, then x2 < 0
4. The sun rises in the east.
5. The sun rises in the west.
Are all propositions because they have a specific truth value, true or false.
The branch of logic that deals with proposition is propositional logic.
2. Predicate Logic :
Predicates are properties, additional information to better express the subject of the sentence. A quantified predicate is a
proposition , that is, when you assign values to a predicate with variables it can be made a proposition.
For example :
In P(x) : x>5, x is the subject or the variable and ‘>5’ is the predicate.
P(7) : 7>5 is a proposition where we are assigning values to the variable x, and it has a truth value, i.e. True.
The set of values that the variables of the predicate can assume is called the Universe or Domain of Discourse or Domain
of Predicate.
Difference between Propositional Logic and Predicate Logic :

Propositional Logic Predicate Logic


1 Propositional logic is the logic that deals with a Predicate logic is an expression consisting of variables with a
collection of declarative statements which have a truth specified domain. It consists of objects, relations and
value, true or false. functions between the objects.
2 It is the basic and most widely used logic. Also known It is an extension of propositional logic covering predicates
as Boolean logic. and quantification.
3 A proposition has a specific truth value, either true or A predicate’s truth value depends on the variables’ value.
false.
4 Scope analysis is not done in propositional logic. Predicate logic helps analyze the scope of the subject over
the predicate. There are three quantifiers : Universal
Quantifier (∀) depicts for all, Existential Quantifier (∃)
depicting there exists some and Uniqueness Quantifier (∃!)
depicting exactly one.
5 Propositions are combined with Logical Operators or Predicate Logic adds by introducing quantifiers to the
Logical Connectives like Negation(¬), Disjunction(∨), existing proposition.
Conjunction(∧), Exclusive OR(⊕), Implication(⇒),
Bi-Conditional or Double Implication(⇔).
6 It is a more generalized representation. It is a more specialized representation.
7 It cannot deal with sets of entities. It can deal with set of entities with the help of quantifiers.

Propositional Equivalences
Introduction
Two logical expressions are said to be equivalent if they have the same truth value in all cases. Sometimes this fact helps
in proving a mathematical result by replacing one expression with another equivalent expression, without changing the
truth value of the original compound proposition.
Types of propositions based on Truth values
There are three types of propositions when classified according to their truth values
1. Tautology – A proposition which is always true, is called a tautology.
2. Contradiction – A proposition which is always false, is called a contradiction.
3. Contingency – A proposition that is neither a tautology nor a contradiction is called a contingency.

What is perception
Perception is the process of acquiring, interpreting, selecting, and organizing sensory information.
Perception presumes sensation, where various types of sensors each converts a certain type of simple signal into data of
the system. To put the data together and to make sense out of them is the job of the perception mechanism.
Perception can be seen as a special type of categorization (or classification, pattern recognition) where the inputs are
sensory data, and the outputs are categorical judgments and conceptual relations.
The difficulty of the task comes from the need of multiple levels of abstraction, where the relations among data items are
many-to-many, uncertain, and changing over time.
Accurately speaking, we never "see things as they are", and perception process of an intelligent system is often (and
should be) influenced by internal and external factors beside the signals themselves. Furthermore, perception is not a pure
passive process driven by the input.
In AI, the study on perception is mostly focused on the reproduction of human perception, especially on the perception of
aural and visual signals. However, this is not necessarily the case since the perception mechanism of a computer system
does not have to be identical to that of a human being.

What are Neural Networks?


Neural networks mimic the basic functioning of the human brain and are inspired by how the human brain interprets
information. They solve various real-time tasks because of its ability to perform computations quickly and its fast
responses.

Artificial Neural Network has a huge number of interconnected processing elements, also known as Nodes. These nodes
are connected with other nodes using a connection link. The connection link contains weights, these weights contain the
information about the input signal. Each iteration and input in turn leads to updation of these weights. After inputting all
the data instances from the training data set, the final weights of the Neural Network along with its architecture is known
as the Trained Neural Network. This process is called Training of Neural Networks.These trained neural networks solve
specific problems as defined in the problem statement.
Types of tasks that can be solved using an artificial neural network include Classification problems, Pattern Matching,
Data Clustering, etc.
Importance of Neural Networks
We use artificial neural networks because they learn very efficiently and adaptively. They have the capability to learn
“how” to solve a specific problem from the training data it receives. After learning, it can be used to solve that specific
problem very quickly and efficiently with high accuracy.
Some real-life applications of neural networks include Air Traffic Control, Optical Character Recognition as used by
some scanning apps like Google Lens, Voice Recognition, etc.
What are Neural Networks Used For?
Neural networks are employed across various domains for:
• Identifying objects, faces, and understanding spoken language in applications like self-driving cars and voice assistants.
• Analyzing and understanding human language, enabling sentiment analysis, chatbots, language translation, and text
generation.
• Diagnosing diseases from medical images, predicting patient outcomes, and drug discovery.
• Predicting stock prices, credit risk assessment, fraud detection, and algorithmic trading.
• Personalizing content and recommendations in e-commerce, streaming platforms, and social media.
• Powering robotics and autonomous vehicles by processing sensor data and making real-time decisions.
• Enhancing game AI, generating realistic graphics, and creating immersive virtual environments.
• Monitoring and optimizing manufacturing processes, predictive maintenance, and quality control.
• Analyzing complex datasets, simulating scientific phenomena, and aiding in research across disciplines.
• Generating music, art, and other creative content.
Types of Neural Network in Machine Learning
Explore different kinds of neural networks in machine learning in this section:
(i) ANN
ANN is also known as an artificial neural network. It is a feed-forward neural network because the inputs are sent in the
forward direction. It can also contain hidden layers which can make the model even denser. They have a fixed length as
specified by the programmer. It is used for Textual Data or Tabular Data. A widely used real-life application is Facial
Recognition. It is comparatively less powerful than CNN and RNN.
(ii) CNN
Convolutional Neural Networks is mainly used for Image Data. It is used for Computer Vision. Some of the real-life
applications are object detection in autonomous vehicles. It contains a combination of convolutional layers and neurons. It
is more powerful than both ANN and RNN.
(iii) RNN
It is also known as Recurrent Neural Networks. It is used to process and interpret time series data. In this type of model,
the output from a processing node is fed back into nodes in the same or previous layers. The most known types of RNN
are LSTM (Long Short Term Memory) Networks
Now that we know the basics about Neural Networks, We know that Neural Networks’ learning capability is what makes
it interesting. There are 3 types of learnings in Neural networks, namely
1. Supervised Learning
2. Unsupervised Learning
3. Reinforcement Learning
Supervised Learning
As the name suggests, it is a type of learning that is looked after by a supervisor. It is like learning with a teacher. There
are input training pairs that contain a set of input and the desired output. Here the output from the model is compared with
the desired output and an error is calculated, this error signal is sent back into the network for adjusting the weights. This
adjustment is done till no more adjustments can be made and the output of the model matches the desired output. In this,
there is feedback from the environment to the model.

Unsupervised Learning
Unlike supervised learning, there is no supervisor or a teacher here. In this type of learning, there is no feedback from the
environment, there is no desired output and the model learns on its own. During the training phase, the inputs are formed
into classes that define the similarity of the members. Each class contains similar input patterns. On inputting a new
pattern, it can predict to which class that input belongs based on similarity with other patterns. If there is no such class, a
new class is formed.

Reinforcement Learning
It gets the best of both worlds, that is, the best of both Supervised learning and Unsupervised learning. It is like learning
with a critique. Here there is no exact feedback from the environment, rather there is critique feedback. The critique tells
how close our solution is. Hence the model learns on its own based on the critique information. It is similar to supervised
learning in that it receives feedback from the environment, but it is different in that it does not receive the desired output
information, rather it receives critique information.
How Does a Neural Network work?
According to Arthur Samuel, one of the early American pioneers in the field of computer gaming and artificial
intelligence, he defined machine learning as:
Example
Suppose we arrange for some automatic means of testing the effectiveness of any current weight assignment in terms of
actual performance and provide a mechanism for altering the weight assignment so as to maximize the performance. We
need not go into the details of such a procedure to see that it could be made entirely automatic and to see that a machine so
programmed would “learn” from its experience.

The first neuron from the first layer is connected to all the inputs from the previous layer, Similarly, the second neuron
from the first hidden layer will also be connected to all the inputs from the previous layer and so on for all the neurons in
the first hidden layer.
For neurons in the second hidden layer (outputs of the previously hidden layer) are considered as inputs and each of these
neurons are connected to previous neurons, likewise. This whole process is called Forward propagation.
After this, there is an interesting thing that happens. Once we have predicted the output it is then compared to the actual
output. We then calculate the loss and try to minimize it. But how can we minimize this loss? For this, there comes
another concept which is known as Back Propagation. We will understand more about this in another article. I will tell
you how it works. First, the loss is calculated then weights and biases are adjusted in such a way that they try to minimize
the loss. Weights and biases are updated with the help of another algorithm called gradient descent. We will understand
more about gradient descent in a later section. We basically move in the direction opposite to the gradient. This concept is
derived from the Taylor series.
Deep Learning vs Machine Learning: Neural Networks
Here’s a comparison of Machine Learning and Deep Learning in the context of neural networks:
Aspect Machine Learning Deep Learning
Hierarchy of Layers Typically shallow architectures Deep architectures with many layers
Feature Extraction Manual feature engineering needed Automatic feature extraction and representation
learning
Feature Learning Limited ability to learn complex features Can learn intricate hierarchical features
Performance May have limitations on complex tasks Excels in complex tasks, especially with big data
Data Requirements Requires carefully curated features Can work with raw, unprocessed data
Training Complexity Relatively simpler to train Requires substantial computation power
Domain Specificity May need domain-specific tuning Can generalize across domains
Applications Effective for smaller datasets Particularly effective with large datasets
Representations Relies on handcrafted feature representations Learns hierarchical representations
Interpretability Offers better interpretability Often seen as a “black box”
Algorithm Diversity Utilizes various algorithms like SVM, Random Mostly relies on neural networks
Forest
Computational Lighter computational requirements Heavy computational demand
Demand
Scalability May have limitations in scaling up Scales well with increased data and resources

Difference between Supervised and Unsupervised Learning


Supervised and Unsupervised learning are the two techniques of machine learning. But both the techniques are used in
different scenarios and with different datasets. Below the explanation of both learning methods along with their difference
table is given.

Supervised Machine Learning:


Supervised learning is a machine learning method in which models are trained using labeled data. In supervised learning,
models need to find the mapping function to map the input variable (X) with the output variable (Y).

Supervised learning needs supervision to train the model, which is similar to as a student learns things in the presence of a
teacher. Supervised learning can be used for two types of problems: Classification and Regression.
Learn more Supervised Machine Learning
Example: Suppose we have an image of different types of fruits. The task of our supervised learning model is to identify
the fruits and classify them accordingly. So to identify the image in supervised learning, we will give the input data as
well as output for that, which means we will train the model by the shape, size, color, and taste of each fruit. Once the
training is completed, we will test the model by giving the new set of fruit. The model will identify the fruit and predict
the output using a suitable algorithm.
Unsupervised Machine Learning:
Unsupervised learning is another machine learning method in which patterns inferred from the unlabeled input data. The
goal of unsupervised learning is to find the structure and patterns from the input data. Unsupervised learning does not
need any supervision. Instead, it finds patterns from the data by its own.
Learn more Unsupervised Machine Learning
Unsupervised learning can be used for two types of problems: Clustering and Association.
Example: To understand the unsupervised learning, we will use the example given above. So unlike supervised learning,
here we will not provide any supervision to the model. We will just provide the input dataset to the model and allow the
model to find the patterns from the data. With the help of a suitable algorithm, the model will train itself and divide the
fruits into different groups according to the most similar features between them.
The main differences between Supervised and Unsupervised learning are given below:
Supervised Learning Unsupervised Learning
Supervised learning algorithms are trained using labeled data. Unsupervised learning algorithms are trained using
unlabeled data.
Supervised learning model takes direct feedback to check if it Unsupervised learning model does not take any feedback.
is predicting correct output or not.
Supervised learning model predicts the output. Unsupervised learning model finds the hidden patterns in
data.
In supervised learning, input data is provided to the model In unsupervised learning, only input data is provided to
along with the output. the model.
The goal of supervised learning is to train the model so that it The goal of unsupervised learning is to find the hidden
can predict the output when it is given new data. patterns and useful insights from the unknown dataset.
Supervised learning needs supervision to train the model. Unsupervised learning does not need any supervision to
train the model.
Supervised learning can be categorized Unsupervised Learning can be classified
in Classification and Regression problems. in Clustering and Associations problems.
Supervised learning can be used for those cases where we Unsupervised learning can be used for those cases where
know the input as well as corresponding outputs. we have only input data and no corresponding output
data.
Supervised learning model produces an accurate result. Unsupervised learning model may give less accurate
result as compared to supervised learning.
Supervised learning is not close to true Artificial intelligence Unsupervised learning is more close to the true Artificial
as in this, we first train the model for each data, and then only Intelligence as it learns similarly as a child learns daily
it can predict the correct output. routine things by his experiences.
It includes various algorithms such as Linear Regression, It includes various algorithms such as Clustering, KNN,
Logistic Regression, Support Vector Machine, Multi-class and Apriori algorithm.
Classification, Decision tree, Bayesian Logic, etc.

What is Fuzzy Logic?


Fuzzy Logic resembles the human decision-making methodology. It deals with vague and imprecise information. This is
gross oversimplification of the real-world problems and based on degrees of truth rather than usual true/false or 1/0 like
Boolean logic.
Take a look at the following diagram. It shows that in fuzzy systems, the values are indicated by a number in the range
from 0 to 1. Here 1.0 represents absolute truth and 0.0 represents absolute falseness. The number which indicates the
value in fuzzy systems is called the truth value.

In other words, we can say that fuzzy logic is not logic that is fuzzy, but logic that is used to describe fuzziness. There can
be numerous other examples like this with the help of which we can understand the concept of fuzzy logic.
Fuzzy Logic was introduced in 1965 by Lofti A. Zadeh in his research paper “Fuzzy Sets”. He is considered as the father
of Fuzzy Logic.
Comparing the degrees of truth with Boolean logic vs. fuzzy logic
Fuzzy logic applications
Various types of AI systems and technologies use fuzzy logic. This includes vehicle intelligence, consumer electronics,
medicine, software, chemicals and aerospace.
• In automobiles, fuzzy logic is used for gear selection and is based on factors such as engine load, road conditions and
style of driving.
• In dishwashers, fuzzy logic is used to determine the washing strategy and power needed, which is based on factors
such as the number of dishes and the level of food residue on the dishes.
• In copy machines, fuzzy logic is used to adjust drum voltage based on factors such as humidity, picture density and
temperature.
• In aerospace, fuzzy logic is used to manage altitude control for satellites and spacecrafts based on environmental
factors.
• In medicine, fuzzy logic is used for computer-aided diagnoses, based on factors such as symptoms and medical
history.
• In chemical distillation, fuzzy logic is used to control pH and temperature variables.
• In natural language processing, fuzzy logic is used to determine semantic relations between concepts represented by
words and other linguistic variables.
• In environmental control systems, such as air conditioners and heaters, fuzzy logic determines output based on factors
such as current temperature and target temperature.
• In a business rules engine, fuzzy logic may be used to streamline decision-making according to predetermined
criteria.
Fuzzy Logic - Membership Function

We already know that fuzzy logic is not logic that is fuzzy but logic that is used to describe fuzziness. This fuzziness is
best characterized by its membership function. In other words, we can say that membership function represents the degree
of truth in fuzzy logic.

Following are a few important points relating to the membership function −


• Membership functions were first introduced in 1965 by Lofti A. Zadeh in his first research paper “fuzzy sets”.
• Membership functions characterize fuzziness (i.e., all the information in fuzzy set), whether the elements in fuzzy
sets are discrete or continuous.
• Membership functions can be defined as a technique to solve practical problems by experience rather than
knowledge.
• Membership functions are represented by graphical forms.
• Rules for defining fuzziness are fuzzy too.

The fuzzy inference process has the following steps.


• Fuzzification of the input variables.
• Application of the fuzzy operator (AND or OR) in the antecedent.
• Implication from the antecedent to the consequent.
• Aggregation of the consequents across the rules.
• Defuzzification

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.
Local Environment Setup
If you are still willing to set up your environment for Lisp programming language, you need the following two softwares
available on your computer, (a) Text Editor and (b) The Lisp Executer.
Text Editor
This will be used to type your program. Examples of few editors include Windows Notepad, OS Edit command, Brief,
Epsilon, EMACS, and vim or vi.
Name and version of text editor can vary on different operating systems. For example, Notepad will be used on Windows,
and vim or vi can be used on windows as well as Linux or UNIX.
The files you create with your editor are called source files and contain program source code. The source files for Lisp
programs are typically named with the extension ".lisp".
Before starting your programming, make sure you have one text editor in place and you have enough experience to write a
computer program, save it in a file, finally execute it.
LISP expressions are called symbolic expressions or s-expressions. The s-expressions are composed of three valid objects,
atoms, lists and strings.
Any s-expression is a valid program.
LISP programs run either on an interpreter or as compiled code.
The interpreter checks the source code in a repeated loop, which is also called the read-evaluate-print loop (REPL). It
reads the program code, evaluates it, and prints the values returned by the program.
A Simple Program
Let us write an s-expression to find the sum of three numbers 7, 9 and 11. To do this, we can type at the interpreter
prompt.
(+ 7 9 11)
LISP returns the result −
27
If you would like to run the same program as a compiled code, then create a LISP source code file named myprog.lisp and
type the following code in it.
Live Demo
(write (+ 7 9 11))
When you click the Execute button, or type Ctrl+E, LISP executes it immediately and the result returned is −
27
LISP Uses Prefix Notation
You might have noted that LISP uses prefix notation.
In the above program the + symbol works as the function name for the process of summation of the numbers.
In prefix notation, operators are written before their operands. For example, the expression,
a*(b+c)/d
will be written as −
(/ (* a (+ b c) ) d)
Let us take another example, let us write code for converting Fahrenheit temp of 60o F to the centigrade scale −
The mathematical expression for this conversion will be −
(60 * 9 / 5) + 32
Create a source code file named main.lisp and type the following code in it.
Live Demo
(write(+ (* (/ 9 5) 60) 32))
When you click the Execute button, or type Ctrl+E, LISP executes it immediately and the result returned is−
140

Basic Building Blocks in LISP


LISP programs are made up of three basic building blocks −
• atom
• list
• string
An atom is a number or string of contiguous characters. It includes numbers and special characters.
Following are examples of some valid atoms −
hello-from-tutorials-point
name
123008907
*hello*
Block#221
abc123
A list is a sequence of atoms and/or other lists enclosed in parentheses.
Following are examples of some valid lists −
( i am a list)
(a ( a b c) d e fgh)
(father tom ( susan bill joe))
(sun mon tue wed thur fri sat)
()
A string is a group of characters enclosed in double quotation marks.
Following are examples of some valid strings −
" I am a string"
"a ba c d efg #$%^&!"
"Please enter the following details :"
"Hello from 'Tutorials Point'! "
Adding Comments
The semicolon symbol (;) is used for indicating a comment line.
For Example,
Live Demo
(write-line "Hello World") ; greet the world

; tell them your whereabouts

(write-line "I am at 'Tutorials Point'! Learning LISP")


When you click the Execute button, or type Ctrl+E, LISP executes it immediately and the result returned is −
Hello World

I am at 'Tutorials Point'! Learning LISP

LISP data types


In LISP, variables are not typed, but data objects are.
LISP data types can be categorized as.
• Scalar types − for example, number types, characters, symbols etc.
• Data structures − for example, lists, vectors, bit-vectors, and strings.
Any variable can take any LISP object as its value, unless you have declared it explicitly.
Although, it is not necessary to specify a data type for a LISP variable, however, it helps in certain loop expansions, in
method declarations and some other situations that we will discuss in later chapters.
The data types are arranged into a hierarchy. A data type is a set of LISP objects and many objects may belong to one
such set.
The typep predicate is used for finding whether an object belongs to a specific type.
The type-of function returns the data type of a given object.
Type Specifiers in LISP
Type specifiers are system-defined symbols for data types.
array fixnum package simple-string
atom float pathname simple-vector
bignum function random-state single-float
bit hash-table ratio standard-char
bit-vector integer rational stream
character keyword readtable string
[common] list sequence [string-char]
compiled-function long-float short-float symbol
complex nill signed-byte t
cons null simple-array unsigned-byte
double-float number simple-bit-vector vector
Apart from these system-defined types, you can create your own data types. When a structure type is defined
using defstruct function, the name of the structure type becomes a valid type symbol.

You might also like