Unit2_Introduction_To_Problem_Solving
Unit2_Introduction_To_Problem_Solving
INTRODUCTION
TO PROBLEM
SOLVING
- Praveen Kumar R
WHAT IS PROBLEM
SOLVING ?
We have a problem and want to find a solution !
Different meanings in different contexts …
From Wikipedia (!) :
In psychology, problem solving refers to a state
of desire for reaching a definite goal from a
present condition that either is not directly
moving toward the goal, is far from it, or needs
more complex logic for finding a missing
description of conditions or steps toward the
goal.
In computer science and in the part of artificial
intelligence that deals with algorithms, problem
solving encompasses a number of techniques
known as algorithms, heuristics, root cause
analysis, etc.
IDEALLY PROBLEM SOLVING
Solve
Problem Solution
IN PRACTICE
Solve
Problem Solution
Informal
abstraction
interpretation
Compute Formal
Representation Output
SOLUTION
WHAT IS A SOLUTION?
DIS-ADVANTAGES
It can behave as an unguided depth-first search in the worst case scenario.
ALGORITHM
It can get stuck in a loop as DFS.
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.
The dilemma comes in because neither prisoner is aware of what the other prisoner did. So, what do you think is the
Nash Equilibrium action in this problem? It is very intuitive to think that prisoners would collaborate with each other
and stay silent.
But then we also know that prisoners have evident self-interest in minimizing the imprisonment they receive. And
even if they remain silent, they still get imprisonment of a year each.
Let’s say that Ben also goes through the rational thought process as Alan. Ben also comes to the conclusion that no
matter what Alan chooses, he will always benefit from confessing. Now, if we superimpose the Rational thinking of
both these prisoners, the result is something like this:
If the image is classified as “generated” or the fake image is caught by the discriminator, the Generator network adjusts its
parameters. On the other hand, if the “Discriminator” classifies the generated fake image as one from the dataset, then the
“Discriminator” adjusts its parameters.
This competitive process goes on until a state is reached where there is no more scope of improvement.
This state is called the “Nash Equilibrium”.
BOARD GAMES
Usually Two person games.
Zero Sum Game
One wins and other loses
Complete Information Games
Both can see the board
Alternate Moves are available
Deterministic
Luck is not involved
GAME TREE
A Layered Tree
Player Max and Min Choose
Alternatively
Square: Max
Circle: Min
W: Win
L: Loss
D: Draw
GAME TREE (CONT.)
MINIMAX BACKUP RULE
The leaves are labelled with the outcome of the
game.
When both players are rational the outcome of the
game is fixed
The minimax value is the outcome with both play
perfectly
Minimax value can be computed by applying the
minimax rule bottom up.
STRATEGIES
Strategies in a game tree are sub trees that
represents choices of one Player
IMPORTANCE OF DECOMPOSITION
THE SYLLOGISM
In a valid argument
The Greek Syllogism embodies the notion of formal logic.
An argument is valid if it conforms to a valid form IF the premises are True
THEN the conclusions are necessarily True
All men are mortal All cities are congested
Socrates is a man Delhi is a city
____________________ ___________________
Socrates is mortal Delhi is congested
KNOWLEDGE REPRESENTATION
AND REASONING
PROPOSITIONAL LOGIC FIRST ORDER LOGIC
If earth were spherical it would have cast curved shadow One of Tinker, Tailor, Soldier, or Spy is the culprit. The culprit
on the moon. It casts curved shadow on the moon. SO it stole the document. Tinker and Soldier did not steal the
must be spherical. document. If Tailor or Spy is the culprit, then document must
be in Paris.
Give the above facts show that the following sentence is true.
A progressive high tech company is one with atleast five If Tweety is a bird then conclude that tweety can fly, because
women on its board of directors and one in which all the in general most birds fly.
employees have technical degrees and a salary of minimum
Rs. 100,000/- In real world agent has to come to conclusion with
incomplete information. Once they receive New Information,
A progressive high tech company IS a tech company. conclusion may change.
KNOWLEDGE REPRESENTATION
AND REASONING
EVENT CALCULUS EPISTEMIC REASONING
Jogesh made a cup of tea and kept it on a table. Meanwhile From the previous example, Jogesh knows that its Smita who
Smita saw the cup of tea and drank it. When Jogesh came had made the cup empty.
back he saw the cup was empty. Smita knows that Jogesh Knew she had drank the tea.
Reasoning about Time, action and change. Knowledge and Belief of agents.
FUZZY LOGIC & CONCEPTUAL
DEPENDENCY
FUZZY LOGIC
The term fuzzy refers to things that are not clear or are vague. In the real world
many times we encounter a situation when we can’t determine whether the state is
true or false, their fuzzy logic provides very valuable flexibility for reasoning. In this
way, we can consider the inaccuracies and uncertainties of any situation.
FUZZIFICATION
DEFUZZIFICATION
It is used to convert inputs i.e. crisp numbers into fuzzy sets. Crisp
It is used to convert the fuzzy sets obtained by the inference
inputs are basically the exact inputs measured by sensors and passed
engine into a crisp value. There are several defuzzification
into the control system for processing, such as temperature, pressure,
methods available and the best-suited one is used with a
rpm’s, etc.
specific expert system to reduce the error.
ADVANTAGES OF FUZZY LOGIC SYSTEM ADVANTAGES ,
This system can work with any type of inputs whether it is
imprecise, distorted or noisy input information. DISADVANTAGES &
The construction of Fuzzy Logic Systems is easy and
understandable. APPLICATIONS
Fuzzy logic comes with mathematical concepts of set theory
and the reasoning of that is quite simple.
APPLICATIONS OF FUZZY LOGIC SYSTEM
It provides a very efficient solution to complex problems in
It is used in the aerospace field for altitude control of spacecraft and
all fields of life as it resembles human reasoning and
satellites.
decision-making.
It has been used in the automotive system for speed control, traffic
The algorithms can be described with little data, so little
control.
memory is required.
It is used for decision-making support systems and personal
DIS-ADVANTAGES OF FUZZY LOGIC SYSTEM evaluation in the large company business.
Many researchers proposed different ways to solve a given It has application in the chemical industry for controlling the pH,
problem through fuzzy logic which leads to ambiguity. There drying, chemical distillation process.
is no systematic approach to solve a given problem through Fuzzy logic is used in Natural language processing and various
fuzzy logic. intensive applications in Artificial Intelligence.
Proof of its characteristics is difficult or impossible in most Fuzzy logic is extensively used in modern control systems such as
cases because every time we do not get a mathematical expert systems.
description of our approach. Fuzzy Logic is used with Neural Networks as it mimics how a person
As fuzzy logic works on precise as well as imprecise data so would make decisions, only much faster. It is done by Aggregation of
most of the time accuracy is compromised. data and changing it into more meaningful data by forming partial
truths as Fuzzy sets.
CONCEPTUAL DEPENDENCY THEORY CONCEPTUAL DEPENDENCY
THE CD theory defines a semantic base for natural lanugages
The Objective was to understand natural language stories.
The CD theory is designed for everyday actions.
More specific domains would require a specific set of primitives.
Basic Unit -> CONCEPTUALIZATION (something like a well formed formula)
Main Component -> EVENT (defined by an ACTOR, an ACTION, an OBJECT, a sense of direction)
METHODS
In the distribution model-based clustering method, the
data is divided based on the probability of how a dataset
belongs to a particular distribution. The grouping is done
by assuming some distributions commonly Gaussian
Distribution.
PARTITIONING CLUSTERING
It is a type of clustering that divides the data into non-
HIERARCHICAL CLUSTERING
Hierarchical clustering can be used as an alternative for the
hierarchical groups. It is also known as the centroid-based
partitioned clustering as there is no requirement of pre-
method. The most common example of partitioning clustering is
specifying the number of clusters to be created. In this
the K-Means Clustering algorithm.
technique, the dataset is divided into clusters to create a
tree-like structure, which is also called a dendrogram. The
observations or any number of clusters can be selected by
DENSITY-BASED CLUSTERING cutting the tree at the correct level. The most common
The density-based clustering method connects the highly- example of this method is the Agglomerative Hierarchical
dense areas into clusters, and the arbitrarily shaped algorithm.
distributions are formed as long as the dense region can be
connected. This algorithm does it by identifying different FUZZY CLUSTERING
clusters in the dataset and connects the areas of high densities
Fuzzy clustering is a type of soft method in which a data
into clusters. The dense areas in data space are divided from
object may belong to more than one group or cluster. Each
each other by sparser areas.
dataset has a set of membership coefficients, which
depend on the degree of membership to be in a cluster.
Fuzzy C-means algorithm is the example of this type of
clustering; it is sometimes also known as the Fuzzy k-
means algorithm.
APPLICATIONS OF CLUSTERING
In Identification of Cancer Cells: The clustering algorithms are widely
used for the identification of cancerous cells. It divides the cancerous
and non-cancerous data sets into different groups.
In Search Engines: Search engines also work on the clustering technique.
The search result appears based on the closest object to the search
query. It does it by grouping similar data objects in one group that is far
from the other dissimilar objects. The accurate result of a query depends
on the quality of the clustering algorithm used.
Customer Segmentation: It is used in market research to segment the
customers based on their choice and preferences.
In Biology: It is used in the biology stream to classify different species of
plants and animals using the image recognition technique.
In Land Use: The clustering technique is used in identifying the area of
similar lands use in the GIS database. This can be very useful to find that
for what purpose the particular land should be used, that means for
which purpose it is more suitable.
CLASSIFICATION
The Classification algorithm is a Supervised Learning
technique that is used to identify the category of new
observations on the basis of training data. In
Classification, a program learns from the given dataset or
observations and then classifies new observation into a
number of classes or groups. Such as, Yes or No, 0 or 1,
Spam or Not Spam, cat or dog, etc. Classes can be called
as targets/labels or categories.
THE BEST EXAMPLE OF AN ML
CLASSIFICATION ALGORITHM IS EMAIL
SPAM DETECTOR.
The main goal of the Classification algorithm is to identify
the category of a given dataset, and these algorithms are
mainly used to predict the output for the categorical data.
CLASSIFIER
CLASSIFICATION
The algorithm which implements the classification on a dataset is
known as a classifier. There are two types of Classifications: ALGORITHMS
Binary Classifier: If the classification problem has only two possible
outcomes, then it is called as Binary Classifier.
Examples: YES or NO, MALE or FEMALE, SPAM or NOT SPAM, CAT
or DOG, etc.
Multi-class Classifier: If a classification problem has more than two TYPES OF ML CLASSIFICATION
outcomes, then it is called as Multi-class Classifier. ALGORITHMS:
Example: Classifications of types of crops, Classification of types of
music. Classification Algorithms can be further divided into the
Mainly two category:
USE CASES OF CLASSIFICATION ALGORITHMS Linear Models
Logistic Regression
Classification algorithms can be used in different places. Below are Support Vector Machines
some popular use cases of Classification Algorithms: Non-linear Models
Email Spam Detection K-Nearest Neighbours
Speech Recognition Kernel SVM
Identifications of Cancer tumor cells. Naïve Bayes
Drugs Classification Decision Tree Classification
Biometric Identification, etc. Random Forest Classification
Why use Decision Trees?
DECSION TREES
There are various algorithms in Machine learning, so choosing the
best algorithm for the given dataset and problem is the main point to
remember while creating a machine learning model. Below are the
Decision Tree is a Supervised learning technique that can be used for two reasons for using the Decision tree:
both classification and Regression problems, but mostly it is preferred Decision Trees usually mimic human thinking ability while making a
for solving Classification problems. It is a tree-structured classifier, decision, so it is easy to understand.
where internal nodes represent the features of a dataset, branches The logic behind the decision tree can be easily understood because it
represent the decision rules and each leaf node represents the shows a tree-like structure.
outcome.
In a Decision tree, there are two nodes, which are the Decision Node
and Leaf Node. Decision nodes are used to make any decision and
have multiple branches, whereas Leaf nodes are the output of those
decisions and do not contain any further branches.
The decisions or the test are performed on the basis of features of the
given dataset.
It is a graphical representation for getting all the possible solutions to
a problem/decision based on given conditions.
It is called a decision tree because, similar to a tree, it starts with the
root node, which expands on further branches and constructs a tree-
like structure.
In order to build a tree, we use the CART algorithm, which stands for
Classification and Regression Tree algorithm.
A decision tree simply asks a question, and based on the answer
(Yes/No), it further split the tree into subtrees.
DECISION TREE TERMINOLOGIES
Root Node: Root node is from where the decision tree starts. It DECISION TREE
represents the entire dataset, which further gets divided into two or
more homogeneous sets.
Leaf Node: Leaf nodes are the final output node, and the tree cannot
be segregated further after getting a leaf node.
Splitting: Splitting is the process of dividing the decision node/root
node into sub-nodes according to the given conditions.
Branch/Sub Tree: A tree formed by splitting the tree.
Pruning: Pruning is the process of removing the unwanted branches
from the tree.
Parent/Child node: The root node of the tree is called the parent
node, and other nodes are called the child nodes.
HOW IT WORKS?
Step-1: Begin the tree with the root node, says S, which contains the complete dataset.
Step-2: Find the best attribute in the dataset using Attribute Selection Measure (ASM).
Step-3: Divide the S into subsets that contains possible values for the best attributes.
Step-4: Generate the decision tree node, which contains the best attribute.
Step-5: Recursively make new decision trees using the subsets of the dataset created in step -3.
Continue this process until a stage is reached where you cannot further classify the nodes and
called the final node as a leaf node.
DECISION TREE
ADVANTAGES OF THE DECISION TREE DISADVANTAGES OF THE DECISION TREE
It is simple to understand as it follows the
The decision tree contains lots of layers,
same process which a human follow while
which makes it complex.
making any decision in real-life.
It may have an overfitting issue, which can
It can be very useful for solving decision-
be resolved using the Random Forest
related problems.
algorithm.
It helps to think about all the possible
For more class labels, the computational
outcomes for a problem.
complexity of the decision tree may
There is less requirement of data cleaning
increase.
compared to other algorithms.
ARTIFICIAL NEURAL NETWORK (ANN)
The term "Artificial neural network" refers to a biologically inspired sub-field of artificial intelligence modeled
NEURAL NETWORK after the brain. An Artificial neural network is usually a computational network based on biological neural
networks that construct the structure of the human brain. Similar to a human brain has neurons interconnected
to each other, artificial neural networks also have neurons that are linked to each other in various layers of the
networks. These neurons are known as nodes.
There are various types of Artificial Neural Networks (ANN) depending upon the human brain neuron and network
NEURAL NETWORK
functions, an artificial neural network similarly performs tasks. The majority of the artificial neural networks will have
some similarities with a more complex biological partner and are very effective at their expected tasks. For example,
segmentation or classification.
Feedback ANN:
In this type of ANN, the output returns into the network to accomplish the best-evolved results internally. As per the
University of Massachusetts, Lowell Centre for Atmospheric Research. The feedback networks feed information back
into itself and are well suited to solve optimization issues. The Internal system error corrections utilize feedback
ANNs.
Feed-Forward ANN:
A feed-forward network is a basic neural network comprising of an input layer, an output layer, and at least one layer
of a neuron. Through assessment of its output by reviewing its input, the intensity of the network can be noticed
based on group behavior of the associated neurons, and the output is decided. The primary advantage of this network
is that it figures out how to evaluate and recognize input patterns.
ADVANTAGES OF ANN DISADVANTAGES OF ANN
Parallel processing capability:
Artificial neural networks have a numerical value that can perform Assurance of proper network structure:
There is no particular guideline for determining the structure of
NEURAL NETWORK
more than one task simultaneously.
Storing data on the entire network: artificial neural networks. The appropriate network structure is
Data that is used in traditional programming is stored on the whole accomplished through experience, trial, and error.
network, not on a database. The disappearance of a couple of pieces Unrecognized behavior of the network:
of data in one place doesn't prevent the network from working. It is the most significant issue of ANN. When ANN produces a testing
Capability to work with incomplete knowledge: solution, it does not provide insight concerning why and how. It
After ANN training, the information may produce output even with decreases trust in the network.
inadequate data. The loss of performance here relies upon the Hardware dependence:
significance of missing data. Artificial neural networks need processors with parallel processing
Having a memory distribution: power, as per their structure. Therefore, the realization of the
For ANN is to be able to adapt, it is important to determine the equipment is dependent.
examples and to encourage the network according to the desired Difficulty of showing the issue to the network:
output by demonstrating these examples to the network. The ANNs can work with numerical data. Problems must be converted into
succession of the network is directly proportional to the chosen numerical values before being introduced to ANN. The presentation
instances, and if the event can't appear to the network in all its mechanism to be resolved here will directly impact the performance of
aspects, it can produce false output. the network. It relies on the user's abilities.
Having fault tolerance: The duration of the network is unknown:
Extortion of one or more cells of ANN does not prohibit it from The network is reduced to a specific value of the error, and this value
generating output, and this feature makes the network fault- does not give us optimum results.
tolerance.
THANK YOU