Week 01 Lecture Material
Week 01 Lecture Material
EL
Introduction to Soft Computing
PT
Prof. Debasis Samanta
N
Department of Computer Science & Engineering
IIT Kharagpur
1
INTRODUCTION TO SOFT COMPUTING
• Concept of computation
• Hard computing
EL
• Soft computing
PT
• How soft computing?
N
• Hard computing vs. Soft computing
• Hybrid computing
Debasis Samanta
CSE
2
IIT Kharagpur
CONCEPT OF COMPUTATION
EL
Control Action
PT
Figure: Basic of computing
N
𝑦 = 𝑓 𝑥 , 𝑓 is a mapping function.
𝑓 is also called a formal method or an algorithm to solve a problem.
Debasis Samanta
CSE
3
IIT Kharagpur
Important characteristics of computing
EL
• Suitable for problem, which is easy to model mathematically.
PT
N
Debasis Samanta
CSE
4
IIT Kharagpur
Hard computing
EL
Precise result is guaranteed.
PT
Control action is unambiguous.
N
Control action is formally defined (i.e., with mathematical model or
algorithm).
Debasis Samanta
CSE
5
IIT Kharagpur
Examples of hard computing
• Solving numerical problems (e.g., roots of polynomials,
integration, etc.).
• Searching and sorting techniques.
EL
• Solving computational geometry problems (e.g., shortest
PT
tour in a graph, finding closet pair of points given a set of
N
points, etc.).
• many more…
Debasis Samanta
CSE
6
IIT Kharagpur
Soft computing
• The term soft computing was proposed by the inventor of
fuzzy logic, Lotfi A. Zadeh. He describes it as follows.
Definition 1: Soft computing
EL
Soft computing is a collection of methodologies that aim to exploit the
PT
tolerance for imprecision and uncertainty to achieve tractability, robustness,
and low solution cost. Its principal constituents are fuzzy logic, neuro-
N
computing, and probabilistic reasoning. The role model for soft computing is
the human mind.
Debasis Samanta
CSE
7
IIT Kharagpur
Characteristics of soft computing
• It does not require any mathematical modeling of problem solving.
• It may not yield the precise solution.
EL
• Algorithms are adaptive (i.e., it can adjust to the change of dynamic
environment).
PT
• Use some biological inspired methodologies such as genetics, evolution,
Ant’s behaviors, particles swarming, human nervous system, etc.).
N
Debasis Samanta
CSE
8
IIT Kharagpur
Examples of soft computing
Soft
EL
computing
⋮
PT
N
Example: Hand written character recognition
(Artificial Neural Networks)
Debasis Samanta
CSE
9
IIT Kharagpur
Examples of soft computing
EL
maximum return
⋮
PT
N
Example: Money allocation problem
(Evolutionary Computing)
Debasis Samanta
CSE
10
IIT Kharagpur
Examples of soft computing
EL
PT
NExample: Robot movement
(Fuzzy Logic)
Debasis Samanta
CSE
11
IIT Kharagpur
How soft computing?
• How a student learns from his teacher?
• Teacher asks questions and tell the answers then.
• Teacher puts questions and hints answers and asks whether the
EL
answers are correct or not.
PT
• Student thus learn a topic and store in his memory.
N
• Based on the knowledge he solves new problems.
• This is the way how human brain works.
• Based on this concept Artificial Neural Network is used to solve problems.
Debasis Samanta
CSE
12
IIT Kharagpur
How soft computing?
• How world selects the best?
• It starts with a population (random).
• Reproduces another population (next generation).
EL
• Rank the population and selects the superior individuals.
PT
• Genetic algorithm is based on this natural phenomena.
N
• Population is synonymous to solutions.
• Selection of superior solution is synonymous to exploring the optimal
solution.
Debasis Samanta
CSE
13
IIT Kharagpur
How soft computing?
• How a doctor treats his patient?
• Doctor asks the patient about suffering.
• Doctor find the symptoms of diseases.
EL
• Doctor prescribed tests and medicines.
PT
• This is exactly the way Fuzzy Logic works.
N
• Symptoms are correlated with diseases with uncertainty .
• Doctor prescribes tests/medicines fuzzily.
Debasis Samanta
CSE
14
IIT Kharagpur
Hard computing vs. Soft computing
Hard computing Soft computing
It requires a precisely stated It is tolerant of imprecision,
analytical model and often a lot of uncertainty, partial truth, and
computation time. approximation.
EL
It is based on binary logic, crisp
It is based on fuzzy logic, neural
PT
systems, numerical analysis and
nets and probabilistic reasoning.
crisp software.
N
It has the characteristics of precision It has the characteristics of
and categoricity. approximation and dispositionality.
Debasis Samanta
CSE
15
IIT Kharagpur
Hard computing vs. Soft computing
EL
It can deal with ambiguous and
It requires exact input data.
noisy data.
PT
It is strictly sequential. It allows parallel computations.
It produces precise answers. It can yield approximate answers
N
Debasis Samanta
CSE
16
IIT Kharagpur
Hybrid computing
• It is a combination of the conventional hard computing and
emerging soft computing.
EL
HC SC
PT
N
Hybrid computing
Debasis Samanta
CSE
17
IIT Kharagpur
In this course…
• You will be able to learn
• Basic concepts of Fuzzy algebra and then how to solve problems using
Fuzzy logic.
EL
• The framework of Genetic algorithm and solving varieties of
PT
optimization problems.
N
• How to build an artificial neural network and train it with input data to
solve a number of problems, which are not possible to solve with hard
computing.
Debasis Samanta
CSE
18
IIT Kharagpur
EL
PT
N
Debasis Samanta
CSE
19
IIT Kharagpur
Soft Computing
EL
Introduction to Fuzzy Logic
PT
Prof. Debasis Samanta
N
Department of Computer Science and Engineering
IIT Kharagpur
1
What is Fuzzy logic?
• Fuzzy logic is a mathematical language to express something.
• This means it has grammar, syntax, semantic like a language for
communication.
EL
• There are some other mathematical languages also known
• Relational algebra (operations on sets)
PT
• Boolean algebra (operations on Boolean variables)
• Predicate algebra (operations on well formed formulae (wff), also called predicate
N
propositions)
• Fuzzy logic deals with Fuzzy set or Fuzzy algebra.
Debasis Samanta
CSE
IIT KHARAGPUR 2
What is fuzzy?
EL
• Antonym of fuzzy is crisp
PT
Example: Are the chips crisp?
N
Debasis Samanta
CSE
IIT KHARAGPUR 3
Example : Fuzzy logic vs. Crisp logic
Yes or No
Crisp answer
True or False
EL
· Milk Yes
PT
· Water
A liquid Crisp
· Coca
N
No
· Sprite
Is the liquid
colorless?
Debasis Samanta
CSE
IIT KHARAGPUR 4
Example : Fuzzy logic vs. Crisp logic
May be
May not be
EL
Fuzzy answer Absolutely
PT
Partially
N
etc.
Debasis Samanta
CSE
IIT KHARAGPUR 5
Example : Fuzzy logic vs. Crisp logic
Score
99
Extremely honest
· Ankit
· Rajesh
EL
Very honest 75
· Santosh
Fuzzy
PT
· Kabita Honest at times 55
· Salmon
N
Extremely dishonest 35
Is the person
honest?
Debasis Samanta
CSE
IIT KHARAGPUR 6
World is fuzzy!
EL
Our world better
described fuzzily
PT
N
Debasis Samanta
CSE
IIT KHARAGPUR 7
Concept of fuzzy system
Fuzzy element(s)
Fuzzy sets
I
EL
N
P Fuzzy rules
U
PT
T
Fuzzy implications
(Inferences)
N
O
U
T
Fuzzy system P
U
T
Debasis Samanta
CSE
IIT KHARAGPUR 8
Concept of fuzzy set
To understand the concept of fuzzy set it is better, if we first clear our idea of
crisp set.
X = The entire population of India.
H = All Hindu population = {ℎ1 , ℎ2 , ℎ3 , … … , ℎ𝐿 , }
EL
M = All Muslim population ={𝑚1 , 𝑚2 , 𝑚3 , … … , 𝑚𝑁 , }
PT
Universe of discourse X
N
H
Here, All are the sets of finite numbers of individuals.
M
Such a set is called crisp set.
Debasis Samanta
CSE
IIT KHARAGPUR 9
Example of fuzzy set
Let us discuss about fuzzy set.
X = All students in NPTEL.
S = All Good students.
EL
S = {(𝑠, 𝑔(𝑠)) | 𝑠 ∈ 𝑋 } and g(s) is a measurement of goodness of the
student s.
PT
N
Example:
S = 𝑅𝑎𝑗𝑎𝑡, 0.8 , 𝐾𝑎𝑏𝑖𝑡𝑎, 0.7 , 𝑆𝑎𝑙𝑚𝑎𝑛, 0.1 , 𝐴𝑛𝑘𝑖𝑡, 0.9 , etc.
Debasis Samanta
CSE
IIT KHARAGPUR 10
Fuzzy set vs. Crisp set
EL
It is a collection of elements. It is a collection of ordered pairs.
PT
Inclusion of an element s ∈ X into S Inclusion of an element s ∈ X into F
is crisp, that is, has strict boundary is fuzzy, that is, if present, then with
N
yes or no. a degree of membership.
Debasis Samanta
CSE
IIT KHARAGPUR 11
Fuzzy set vs. Crisp set
Note: A crisp set is a fuzzy set, but, a fuzzy set is not necessarily a crisp set.
Example:
EL
H = (ℎ1 , 1 , (ℎ2 , 1) … … … , (ℎ𝐿 , 1)}
PT
Person = (𝑝1 , 0 , (𝑝2 , 0) … … … , (𝑝𝑁 , 0)}
N
In case of a crisp set, the elements are with extreme values of degree of
membership namely either 1 or 0.
Debasis Samanta
CSE
IIT KHARAGPUR 12
Degree of membership
How to decide the degree of memberships of elements in a fuzzy set?
EL
𝜇 0.95 0.90 0.80 0.01 0.65 0.75
PT
N
How the cities of comfort can be judged?
Debasis Samanta
CSE
IIT KHARAGPUR 13
Example: Course evaluation in a crisp way
𝐸𝑋 ∶ Marks ≥ 90
𝐴 ∶ 80 ≤ Marks < 90
𝐵 ∶ 70 ≤ Marks < 80
EL
𝐶 ∶ 60 ≤ Marks < 70
PT
𝐷 ∶ 50 ≤ Marks < 60
N
𝑃 ∶ 35 ≤ Marks < 50
𝐹 ∶ Marks ≤ 35
Debasis Samanta
CSE
IIT KHARAGPUR 14
Example: Course evaluation in a crisp way
F P D C B A EX
1
EL
PT
N
0
35 50 60 70 80 90 100
Debasis Samanta
CSE
IIT KHARAGPUR 15
Example: Course evaluation in a fuzzy way
F P D C B A EX
1
EL
PT
N
0
35 50 60 70 80 90 100
Debasis Samanta
CSE
IIT KHARAGPUR 16
Few examples of fuzzy set
• High Temperature
• Low Pressure
• Colour of Apple
EL
• Sweetness of Orange
PT
• Weight of Mango
N
Note: Degree of membership values lie in the range [0...1].
Debasis Samanta
CSE
IIT KHARAGPUR 17
Some basic terminologies and notations
Definition 1: Membership function (and Fuzzy set)
If 𝑋 is a universe of discourse and 𝑥 ∈ 𝑋, then a fuzzy set A in 𝑋 is
defined as a set of ordered pairs, that is
A = {(𝑥, 𝜇𝐴 𝑥 )|𝑥 ∈ 𝑋} where 𝜇𝐴 𝑥 is called the membership function
EL
for the fuzzy set A.
PT
Note: 𝜇𝐴 𝑥 map each element of X onto a membership grade (or membership
value) between 0 and 1 (both inclusive).
N
Question: How (and who) decides 𝜇𝐴 𝑥 for a fuzzy set A in X?
Debasis Samanta
CSE
IIT KHARAGPUR 18
Some basic terminologies and notations
Example:
X = All cities in India
EL
A = City of comfort
A={(New Delhi, 0.7), (Bangalore, 0.9), (Chennai, 0.8), (Hyderabad, 0.6),
PT
(Kolkata, 0.3), (Kharagpur, 0)}
N
Debasis Samanta
CSE
IIT KHARAGPUR 19
Membership function with discrete membership
values
The membership
values may be of
EL
discrete values.
µA(x)
PT
N x
A fuzzy set with discrete values of
Debasis Samanta
CSE
IIT KHARAGPUR 20
Membership function with discrete membership
values
Either elements or their membership values (or both) also may be of discrete values.
A ={(0,0.1),(1,0.30),(2,0.78)……(10,0.1)}
EL
1.0
***
0.8
PT
0.6 Note : X = discrete value
µ
0.4 *
0.2 * *** *
*0 * How you measure happiness ??
N
2 4 6 8 10
A = “Happy family”
Debasis Samanta
CSE
IIT KHARAGPUR 21
Membership function with continuous membership
values
1.0
B ( x) 1
EL
4
0.8 x 50
1
0.6 10
µ
0.4
PT
0.2
0 50 100
B={(x,µB(x))}
N
Age (X)
Note : x = real value
B = “Middle aged” = R+
Debasis Samanta
CSE
IIT KHARAGPUR 22
Fuzzy terminologies: Support
Support: The support of a fuzzy set A is the set of all points 𝑥 ∈ 𝑋 such that 𝜇𝐴 (𝑋) > 0
EL
PT
µ
N
support
x
Debasis Samanta
CSE
IIT KHARAGPUR 23
Fuzzy terminologies: Core
Core: The core of a fuzzy set A is the set of all points 𝑥 in 𝑋 such that 𝜇𝐴 𝑋 = 1
EL
PT
1.0
µ
N
0.5
Debasis Samanta
CSE
IIT KHARAGPUR 24
Fuzzy terminologies: Normality
Normality : A fuzzy set A is a normal if its core is non-empty. In other words, we can
always find a point 𝑥 ∈ 𝑋 such that 𝜇𝐴 (𝑋) = 1
EL
1.0
PT
µ
N x
Debasis Samanta
CSE
IIT KHARAGPUR 25
Fuzzy terminologies: Crossover points
Crossover point : A crossover point of a fuzzy set A is a point 𝑥 ∈ 𝑋 at which 𝜇𝐴 (𝑋) =
0.5. That is Crossover (A) ={𝑥|𝜇𝐴 𝑥 = 0.5}
EL
1.0
PT
µ
0.5
N Crossover point
x
Debasis Samanta
CSE
IIT KHARAGPUR 26
Fuzzy terminologies: Fuzzy Singleton
Fuzzy Singleton : A fuzzy set whose support is a single point in 𝑋 with 𝜇𝐴 (𝑥) = 1 is
called a fuzzy singleton. That is |𝐴| = {𝑥|𝜇𝐴 𝑥 = 1}
singleton
EL
1.0
*
PT
* *
µ
0.5
*
* * * * *
core N x
Debasis Samanta
CSE
IIT KHARAGPUR 27
Fuzzy terminologies: 𝜶-cut and strong 𝜶-cut
EL
Strong 𝛼-cut is defined similarly :
PT
𝐴′𝛼 = {𝑥|𝜇𝐴 𝑥 > 𝛼}
N
Note : Support (A) = 𝐴0’ and Core (A) = 𝐴1.
Debasis Samanta
CSE
IIT KHARAGPUR 28
Fuzzy terminologies: Bandwidth
Bandwidth :
For a fuzzy set, the bandwidth (or width) is defined as the distance between the two
unique crossover points:
EL
Bandwidth 𝐴 = |𝑥1 − 𝑥2 |
PT
where 𝜇𝐴 𝑥1 = 𝜇𝐴 𝑥2 = 0.5
N
Debasis Samanta
CSE
IIT KHARAGPUR 29
Fuzzy terminologies: Symmetry
Symmetry :
A fuzzy set A is symmetric if its membership function around a certain point 𝑥 = 𝑐,
namely 𝜇𝐴 𝑥 + 𝑐 = 𝜇𝐴 𝑥 − 𝑐 for all 𝑥 ∈ 𝑋
EL
1.0
µ T
P
N x=c
x
Debasis Samanta
CSE
IIT KHARAGPUR 30
Fuzzy terminologies: Open and Closed
A fuzzy set A is
Open left : If lim 𝑥 → −∞ 𝜇𝐴 𝑥 = 1and lim 𝑥 → +∞ 𝜇𝐴 𝑥 = 0
Open right: If lim 𝑥 → −∞ 𝜇𝐴 𝑥 = 0and lim 𝑥 → +∞ 𝜇𝐴 𝑥 = 1
Closed: If lim 𝑥 → −∞ 𝜇𝐴 𝑥 = lim 𝑥 → +∞ 𝜇𝐴 𝑥 = 0
EL
PT
Open left Open right
Closed
N
Debasis Samanta
CSE
IIT KHARAGPUR 31
Fuzzy vs. Probability
Fuzzy : When we say about certainty of a thing
Example: A patient come to the doctor and he has to diagnose so that
medicine can be prescribed.
Doctor prescribed a medicine with certainty 60% that the
EL
patient is suffering from flue. So, the disease will be cured with
certainty of 60% and uncertainty 40%. Here, in stead of flue,
PT
other diseases with some other certainties may be.
N
Probability: When we say about the chance of an event to occur
Example: India will win the T20 tournament with a chance 60% means
that out of 100 matches, India own 60 matches.
Debasis Samanta
CSE
IIT KHARAGPUR 32
Prediction vs. Forecasting
The Fuzzy vs. Probability is analogical to Prediction vs. Forecasting
Prediction : When you start guessing about things.
Forecasting : When you take the information from the past job and apply it to new job.
EL
PT
The main difference:
N
Prediction is based on the best guess from experiences.
Forecasting is based on data you have actually recorded and packed from previous job.
Debasis Samanta
CSE
IIT KHARAGPUR 33
N
PT
34 EL
Introduction to Soft Computing
EL
Fuzzy membership functions
PT
Rof. Debasis Samanta
N
Department of Computer Science and Engineering
IIT Kharagpur
1
Fuzzy membership functions
A fuzzy set is completely characterized by its membership function (sometimes
abbreviated as 𝑀𝐹 and denoted as 𝜇 ). So, it would be important to learn how a
membership function can be expressed (mathematically or otherwise).
Example:
EL
Note: A membership function can
be on
PT
1.0 1.0
µA
µB
0.6 0.6
N
0.2 0.2
*0 2 4 6 8
*
10 0 10 20 30 40 50 60
b) a continuous universe of
Number of children (X) Age (X)
discourse.
A = Fuzzy set of “Happy family” B = “Young age”
Debasis Samanta
CSE
2
IIT Kharagpur
Fuzzy membership functions
So, membership function on a discrete universe of course is trivial. However, a
membership function on a continuous universe of discourse needs a special attention.
EL
µ
µ
µ
Following figures shows x x x
PT
typical examples of < triangular > < trapezoidal > < curve >
membership functions.
N µ
µ
x x
< non-uniform > < non-uniform >
Debasis Samanta
CSE
3
IIT Kharagpur
Fuzzy MFs : Formulation and parameterization
In the following, we try to parameterize the different MFs on a continuous universe of
discourse.
Triangular MFs : A triangular MF is specified by three parameters {𝑎, 𝑏, 𝑐} and can be
formulated as follows.
EL
0 𝑖𝑓 𝑥 ≤ 𝑎
𝑥−𝑎
PT
1.0 𝑖𝑓 𝑎 ≤ 𝑥 ≤ 𝑏
𝑎 − 𝑏
triangle 𝑥; 𝑎, 𝑏, 𝑐 = 𝑐 − 𝑥
𝑖𝑓 𝑏 ≤ 𝑥 ≤ 𝑐
N
𝑐−𝑏
0 𝑖𝑓 𝑐 ≤ 𝑥
a b c
Debasis Samanta
CSE
4
IIT Kharagpur
Fuzzy MFs: Trapezoidal
A trapezoidal MF is specified by four parameters {𝑎, 𝑏, 𝑐, 𝑑} and can be defined as
follows:
0 𝑖𝑓 𝑥 ≤ 𝑎
𝑥−𝑎
𝑖𝑓 𝑎 ≤ 𝑥 ≤ 𝑏
EL
𝑏−𝑎
trapozoid 𝑥; 𝑎, 𝑏, 𝑐, 𝑑 = 1 𝑖𝑓 𝑏 ≤ 𝑥 ≤ 𝑐
PT
1.0 𝑑−𝑥
𝑖𝑓 𝑐 ≤ 𝑥 ≤ 𝑑
𝑑−𝑐
N
0 𝑖𝑓 𝑑 ≤ 𝑥
a b c d
Debasis Samanta
CSE
5
IIT Kharagpur
Fuzzy MFs: Gaussian
A Gaussian MF is specified by two parameters 𝑐, 𝜎 and can be defined as below:
1 𝑥−𝑐 2
−2 𝜎
𝑔𝑎𝑢𝑠𝑠𝑖𝑎𝑛 𝑥; 𝑐, 𝜎 = 𝑒
EL
c
0.1
0.1c 0.9c
PT
N
Debasis Samanta
CSE
6
IIT Kharagpur
Fuzzy MFs: Generalized bell
It is also called Cauchy MF. A generalized bell MF is specified by three parameters
{𝑎, 𝑏, 𝑐} and is defined as:
1
𝑏𝑒𝑙𝑙(𝑥; 𝑎, 𝑏, 𝑐) =
𝑥 − 𝑐 2𝑏
1+ 𝑎
EL
PT
b
Slope at x =
2a
N
b
Slope at y =
x b y
2a
c-a c c+a
Debasis Samanta
CSE
7
IIT Kharagpur
Example: Generalized bell MFs
1
Example: 𝜇 𝑥 = 1+ 𝑥 2;
a = b = 1 and c = 0;
EL
1.0
PT
1
N -1 0 1
Debasis Samanta
CSE
8
IIT Kharagpur
Generalized bell MFs: Different shapes
EL
Changing a Changing b
PT
Changing a
N Changing a and b
Debasis Samanta
CSE
9
IIT Kharagpur
Fuzzy MFs: Sigmoidal MFs
Parameters: {𝑎, 𝑐} ; where 𝑐 = crossover point and 𝑎 = slope at 𝑐;
1.0
EL
1
𝑆𝑖𝑔𝑚𝑜𝑖𝑑(𝑥; 𝑎, 𝑐) = 𝑥−𝑐
− 𝑎
PT
Slope = a 1+ 𝑒
0.5
c N
Debasis Samanta
CSE
10
IIT Kharagpur
Fuzzy MFs : Example
Example : Consider the following grading system for a course.
Excellent = Marks ≤ 90
Very good = 75 ≤ Marks ≤ 90
EL
Good = 60 ≤ Marks ≤ 75
PT
Average = 50 ≤ Marks ≤ 60
N
Poor = 35 ≤ Marks ≤ 50
Bad= Marks ≤ 35
Debasis Samanta
CSE
11
IIT Kharagpur
Grading System
A fuzzy implementation will look like the following.
Bad poor Average Good Very Good Excellent
1
.8
EL
.6
PT
.4
.2
0
N
10 20 30 40 50 60 70 80 90
marks
You can decide a standard fuzzy MF for each of the fuzzy grade.
Debasis Samanta
CSE
12
IIT Kharagpur
Few More on Membership Functions
EL
PT
N
Debasis Samanta
CSE
13
IIT Kharagpur
Generation of MFs
Given a membership function of a fuzzy set representing a linguistic hedge, we can derive
many more MFs representing several other linguistic hedges using the concept of
Concentration and Dilation.
1. Concentration: 𝐴𝑘 = [𝜇𝐴 𝑥 ]𝑘 ; 𝑘 > 1
EL
2. Dilation: 𝐴𝑘 = [𝜇𝐴 𝑥 ]𝑘 ; 𝑘 < 1
Example : Age = { Young, Middle-aged, Old }
PT
Thus, corresponding to Young, we have : Not young, Very young, Not very young and so on.
Similarly, with Old we can have : Not old, Very old, Very very old, Extremely old, etc.
N
Thus, 𝜇𝐸𝑥𝑡𝑟𝑒𝑚𝑒𝑙𝑦 𝑜𝑙𝑑 𝑥 = (((𝜇𝑂𝑙𝑑 𝑥 )2 )2 )2 and so on
Or, 𝜇𝑀𝑜𝑟𝑒 𝑜𝑟 𝑙𝑒𝑠𝑠 𝑜𝑙𝑑 𝑥 = 𝐴0.5 = (𝜇𝑂𝑙𝑑 𝑥 )0.5
Debasis Samanta
CSE
14
IIT Kharagpur
Linguistic variables and values
1
𝜇𝑦𝑜𝑢𝑛𝑔 𝑥 =bell(x,20,2,0) = 𝑥
1+( )4
20
Young Old
Middle-Aged
EL
1
𝜇𝑜𝑙𝑑 𝑥 =bell(x,30,3,100) = 𝑥−100
1+( 30 )6 Very Old
PT
𝜇𝑚𝑖𝑑𝑑𝑙𝑒−𝑎𝑔𝑒𝑑 𝑥 =bell(x,30,60,50)
N
Not young=𝜇𝑦𝑜𝑢𝑛𝑔 𝑥 = 1 − 𝜇𝑦𝑜𝑢𝑛𝑔 𝑥 0 30 60 90
Debasis Samanta
CSE
15
IIT Kharagpur
EL
PT
N
Debasis Samanta
CSE
16
IIT Kharagpur
Introduction to Soft Computing
EL
Operations on Fuzzy sets
PT
Prof. Debasis Samanta
N
Department of Computer Science and Engineering
IIT Kharagpur
1
Basic fuzzy set operations: Union
Union (A ∪ B): 𝜇𝐴∪𝐵 𝑥 = max(𝜇𝐴 𝑥 , 𝜇𝐵 𝑥 )
Example:
𝐴 = {(𝑥1, 0.5), (𝑥2, 0.1), (𝑥3, 0.4)} and
EL
𝐵 = { 𝑥1, 0.2 , 𝑥2, 0.3 , 𝑥3, 0.5 };
𝐶 = 𝐴 ∪ 𝐵 = { 𝑥1, 0.5 , 𝑥2, 0.3 , 𝑥3, 0.5 }
PT
µA µA
µB µB
N
µ
µAUB
a p x b q c a p x b q c
Debasis Samanta
CSE
2
IIT Kharagpur
Basic fuzzy set operations: Intersection
Intersection (A ∩ B): 𝜇𝐴∩𝐵 𝑥 = min(𝜇𝐴 𝑥 , 𝜇𝐵 𝑥 )
Example:
𝐴 = {(𝑥1, 0.5), (𝑥2, 0.1), (𝑥3, 0.4)} and
EL
𝐵 = { 𝑥1, 0.2 , 𝑥2, 0.3 , 𝑥3, 0.5 };
𝐶 = 𝐴 ∩ 𝐵 = { 𝑥1, 0.2 , 𝑥2, 0.1 , 𝑥3, 0.4 }
PT
µA
µB
N
µA?B
µ
a p x b q c a p x b q c
Debasis Samanta
CSE
3
IIT Kharagpur
Basic fuzzy set operations: Complement
Complement (𝐴𝑐 ): 𝜇𝐴𝑐 𝑥 = 1 − 𝜇𝐴 𝑥
Example:
𝐴 = {(𝑥1, 0.5), (𝑥2, 0.1), (𝑥3, 0.4)}
𝐶 = 𝐴𝑐 = { 𝑥1, 0.5 , 𝑥2, 0.9 , 𝑥3, 0.6 }
EL
µA µA
PT
1.0 µA’
p x N q p x q
Debasis Samanta
CSE
4
IIT Kharagpur
Basic fuzzy set operations: Products
𝜇𝐴∙𝐵 𝑥 = 𝜇𝐴 𝑥 ∙ 𝜇𝐵 𝑥
EL
Scalar product (𝜶 × 𝑨):
PT
𝜇𝛼𝐴 𝑥 = 𝛼 × 𝜇𝐴 𝑥
N
Debasis Samanta
CSE
5
IIT Kharagpur
Basic fuzzy set operations: Sum and Difference
Sum (A + B):
𝜇𝐴+𝐵 𝑥 = 𝜇𝐴 𝑥 + 𝜇𝐵 𝑥 − 𝜇𝐴 𝑥 . 𝜇𝐵 𝑥
Difference (𝐴 − 𝐵 = 𝐴 ∩ 𝐵𝐶 ) :
𝜇𝐴−𝐵 𝑥 = 𝜇𝐴∩𝐵𝐶 𝑥
EL
Disjunctive sum:
𝐴⨁𝐵 = (𝐴𝐶 ∩ 𝐵) ∪ (𝐴 ∩ 𝐵𝐶 )
PT
Bounded Sum:
N
| 𝐴 𝑥 ⨁𝐵 𝑥 |= 𝜇|𝐴(𝑥)⨁𝐵(𝑥)| = min{1, 𝜇𝐴 𝑥 + 𝜇𝐵 𝑥 }
Bounded Difference:
𝐴 𝑥 ⊖𝐵 𝑥 = 𝜇|𝐴(𝑥)⊖𝐵(𝑥)| = max{0, 𝜇𝐴 𝑥 + 𝜇𝐵 𝑥 − 1}
Debasis Samanta
CSE
6
IIT Kharagpur
Basic fuzzy set operations: Equality and Power
Equality (𝐴 = 𝐵):
𝜇𝐴 𝑥 = 𝜇𝐵 𝑥
Power of a fuzzy set 𝐴𝛼 :
EL
𝜇𝐴𝛼 𝑥 = (𝜇𝐴 𝑥 )𝛼
PT
If α < 1, then it is called dilation
N
If α > 1, then it is called concentration
Debasis Samanta
CSE
7
IIT Kharagpur
Basic fuzzy set operations: Cartesian product
Caretsian Product (𝐴 × 𝐵): 𝜇𝐴×𝐵 𝑥, 𝑦 = min(𝜇𝐴 𝑥 , 𝜇𝐵 𝑦 )
Example:
𝐴 𝑥 = {(𝑥1 , 0.2), (𝑥2 , 0.3), (𝑥3 , 0.5), (𝑥4 , 0.6)}
EL
𝐵 𝑦 = { 𝑦1 , 0.8 , 𝑦2 , 0.6 , 𝑦3 , 0.3 }
PT
N
A × 𝐵 = min 𝜇𝐴 𝑥 , 𝜇𝐵 𝑦 =
Debasis Samanta
CSE
8
IIT Kharagpur
Properties of fuzzy sets
Commutativity :
𝐴∩𝐵 = 𝐵∩𝐴
𝐴∪B = 𝐵∪A
Associativity :
EL
𝐴 ∪ (𝐵 ∪ 𝐶) = (𝐴 ∪ 𝐵) ∪ 𝐶
PT
𝐴 ∩ (𝐵 ∩ 𝐶) = (𝐴 ∩ 𝐵) ∩ 𝐶
Distributivity :
N
𝐴 ∪ (𝐵 ∩ 𝐶) = (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶)
𝐴 ∩ (𝐵 ∪ 𝐶) = (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶)
Debasis Samanta
CSE
9
IIT Kharagpur
Properties of fuzzy sets
Idempotence :
𝐴 ∪ 𝐴 = 𝐴
𝐴 ∩ 𝐴 =∅;
𝐴 ∪ ∅; = 𝐴
𝐴 ∩∅; = ∅;
EL
Transitivity :
If 𝐴 ⊆ 𝐵; 𝐵 ⊆ 𝐶 then 𝐴 ⊆ 𝐶
PT
Involution :
(𝐴𝑐 )𝑐 = 𝐴
N
De Morgan’s law :
(𝐴 ∩ 𝐵)𝑐 = 𝐴𝑐 ∪ 𝐵𝑐
(𝐴 ∪ 𝐵)𝑐 = 𝐴𝑐 ∩ 𝐵𝑐
Debasis Samanta
CSE
10
IIT Kharagpur
Example 1: Fuzzy Set Operations
Let A and B are two fuzzy sets defined over a universe of discourse X with
membership functions 𝜇𝐴 𝑥 and 𝜇𝐵 𝑥 , respectively. Two MFs 𝜇𝐴 𝑥 and
𝜇𝐵 𝑥 are shown graphically.
EL
PT
µA(x)
µB(x)
a1
x
a2 a3
N
a4 b1 a1=b2
x
a2=b3 a4
Debasis Samanta
CSE
11
IIT Kharagpur
Example 1: Plotting two sets on the same graph
Let’s plot the two membership functions on the same graph
EL
µB µA
PT
µ
b1
N
x
a1 a2 b4 a3 a4
Debasis Samanta
CSE
12
IIT Kharagpur
Example 1: Union and Intersection
The plots of union 𝐴 ∪ 𝐵 and intersection 𝐴 ∩ 𝐵 are shown in the following.
µB µA
EL
µ
b1 a1 a2 b4 a3 a4
PT
x
N
A B ( x)
A B ( x)
a2 b4
x b1 a1 a2 a3 a4
x
Debasis Samanta
CSE
13
IIT Kharagpur
Example 1: Complementation
The plots of union 𝜇𝐴 𝑥 of the fuzzy set A is shown in the following.
EL
PT
N
Debasis Samanta
CSE
14
IIT Kharagpur
Fuzzy set operations: Practice
Consider the following two fuzzy sets A and B defined over a universe of
discourse [0,5] of real numbers with their membership functions
𝑥
𝜇𝐴 𝑥 = and 𝜇𝐵 𝑥 = 2−𝑥
1+𝑥
EL
Determine the membership functions of the following and draw them
PT
graphically.
I. 𝐴 , 𝐵
II. 𝐴 ∪ 𝐵
N
III. 𝐴 ∩ 𝐵
IV. (𝐴 ∪ 𝐵)𝑐
[Hint: Use De’ Morgan law]
Debasis Samanta
CSE
15
IIT Kharagpur
Example 2: A real-life example
Two fuzzy sets A and B with membership functions 𝜇𝐴 𝑥 and 𝜇𝐵 𝑥 , respectively
defined as below.
A = Cold climate with 𝜇𝐴 𝑥 as the MF.
B = Hot climate with 𝜇𝐵 𝑥 as the M.F.
EL
µA µB
1.0
PT
Here, 𝑋 being the
universe of discourse 0.5
N
representing entire µ
range of temperatures.
-15 -10 -5 0 5 10 15 20 25 30 35 40 45 50
Debasis Samanta
CSE
16
IIT Kharagpur
Example 2: A real-life example
What are the fuzzy sets representing the following?
1. Not cold climate
2. Not hot climate
EL
3. Extreme climate
PT
4. Pleasant climate
N
Note: Note that ”Not cold climate” ≠ ”Hot climate” and vice-versa.
Debasis Samanta
CSE
17
IIT Kharagpur
Example 2: A real-life example
Answer would be the following.
Not cold climate
𝐴 with 1 − 𝜇𝐴 𝑥 as the MF.
Not hot climate
EL
𝐵 with 1 − 𝜇𝐵 𝑥 as the MF.
PT
Extreme climate
N
A ∪ 𝐵 with 𝜇𝐴∪𝐵 𝑥 = max(𝜇𝐴 𝑥 , 𝜇𝐵 𝑥 ) as the MF.
Pleasant climate
A ∩ 𝐵 with 𝜇𝐴∩𝐵 𝑥 = min(𝜇𝐴 𝑥 , 𝜇𝐵 𝑥 ) as the MF.
Debasis Samanta
CSE
18
IIT Kharagpur
Example 2: A real-life example
The plot of the MFs of A ∪ 𝐵 and A ∩ 𝐵 are shown in the following.
EL
PT
N
Debasis Samanta
CSE
19
IIT Kharagpur
EL
PT
N
Debasis Samanta
CSE
20
IIT Kharagpur
Soft Computing
EL
Fuzzy Relations
PT
Prof. Debasis Samanta
N
Department of Computer Science & Engineering
IIT Kharagpur
1
Fuzzy Relations
• Crisp relations
• Operations on crisp relations
EL
• Examples on crisp relations
PT
• Fuzzy relations
N
• Operations on fuzzy relations
• Examples on fuzzy relations
Debasis Samanta
CSE
2
IIT Kharagpur
Crisp relations
• Order pairs:
Suppose, A and B are two (crisp) sets. Then Cartesian product denoted as
𝐴 × 𝐵 is a collection of order pairs, such that
EL
𝐴 × 𝐵 = {(𝑎, 𝑏)|𝑎 ∈ 𝐴 𝑎𝑛𝑑 𝑏 ∈ 𝐵}
Note :
PT
(1) 𝐴 × 𝐵 ≠ 𝐵 × 𝐴 (2) |𝐴 × 𝐵| = |𝐴| × |𝐵|
N
(3) 𝐴 × 𝐵 provides a mapping from 𝑎 ∈ 𝐴 to 𝑏 ∈ 𝐵.
Debasis Samanta
CSE
3
IIT Kharagpur
Crisp relations
Example:
Consider the two crisp sets 𝐴 and 𝐵 as given below.
𝐴 = {1, 2, 3, 4} 𝐵 = {3, 5, 7}.
EL
Then, 𝐴 × 𝐵 = { 1, 3 , 1, 5 , 1, 7 , 2, 3 , 2, 5 , 2, 7 , 3, 3 , (3, 5), 3, 7 ,
PT
4, 3 , 4, 5 , (4, 7)}
N
Let us define a relation as 𝑅 = {(𝑎, 𝑏)|𝑏 = 𝑎 + 1, (𝑎, 𝑏) ∈ 𝐴 × 𝐵}
Then, 𝑅 = { 2, 3 , 4, 5 } in this case.
Debasis Samanta
CSE
4
IIT Kharagpur
Crisp relations
We can represent the relation 𝑅 in a matrix form as follows.
EL
PT
N
Debasis Samanta
CSE
5
IIT Kharagpur
Operations on crisp relations
Suppose, 𝑅(𝑥, 𝑦) and 𝑆(𝑥, 𝑦) are the two relations defined over two crisp sets
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵
EL
• Intersection: 𝑅 𝑥, 𝑦 ∩ 𝑆(𝑥, 𝑦) = 𝑚𝑖𝑛(𝑅 𝑥, 𝑦 , 𝑆(𝑥, 𝑦));
PT
• Complement: 𝑅 𝑥, 𝑦 = 1 − 𝑅(𝑥, 𝑦)
N
Debasis Samanta
CSE
6
IIT Kharagpur
Example: Operations on crisp relations
Suppose, 𝑅(𝑥, 𝑦) and 𝑆(𝑥, 𝑦) are the two relations defined over two crisp sets
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵
0 1 0 0 1 0 0 0
0 0 1 0 0 1 0 0
𝑅= and 𝑆 =
EL
0 0 0 1 0 0 1 0
0 0 0 0 0 0 0 1
PT
Find the following
• 𝑅∪𝑆
N
• 𝑅∩𝑆
• 𝑅
Debasis Samanta
CSE
7
IIT Kharagpur
Composition of two crisp relations
Given 𝑅 is a relation on 𝑋, 𝑌 and 𝑆 is another relation on 𝑌, 𝑍. Then, 𝑅 ∘ 𝑆 is
called a composition of relation on 𝑋 and 𝑍 which is defined as follows.
𝑅 ∘ 𝑆 = { 𝑥, 𝑧 | 𝑥, 𝑦 ∈ 𝑅 𝑎𝑛𝑑 𝑦, 𝑧 ∈ 𝑆 𝑎𝑛𝑑 ∀𝑦 ∈ 𝑌}
EL
Max-Min Composition
PT
Given the two relation matrices 𝑅 and 𝑆, the max-min composition is defined as
𝑇 = 𝑅∘𝑆;
N
𝑇(𝑥, 𝑧) = 𝑚𝑎𝑥{𝑚𝑖𝑛{𝑅 𝑥, 𝑦 , 𝑆(𝑦, 𝑧) 𝑎𝑛𝑑 ∀𝑦 ∈ 𝑌}}
Debasis Samanta
CSE
8
IIT Kharagpur
Composition: Composition
Example : Given 𝑋 = 1, 3, 5 ; 𝑌 = 1, 3, 5 ; 𝑅 = 𝑥, 𝑦 𝑦 = 𝑥 + 2 ;
𝑆 = {(𝑥, 𝑦)|𝑥 < 𝑦}
Here, 𝑅 and 𝑆 is on 𝑋 × 𝑌.
Thus, we have 𝑅 = 1, 3 , 3, 5 , 𝑆 = { 1, 3 , 1, 5 , (3, 5)}
EL
1 0 1 0 1 0 1 1
PT
𝑅=3 0 0 1 𝑎𝑛𝑑 𝑆= 3 0 0 1
5 0 0 0 5 0 0 0
EL
within the relationship.
PT
• The membership values indicate the strength of the relation between the
tuples.
N
Debasis Samanta
CSE
10
IIT Kharagpur
Fuzzy relations
Example:
𝑋 = 𝑡𝑦𝑝ℎ𝑜𝑖𝑑, 𝑣𝑖𝑟𝑎𝑙, 𝑐𝑜𝑙𝑑 , 𝑌 = { 𝑟𝑢𝑛𝑛𝑖𝑛𝑔 𝑛𝑜𝑠𝑒, ℎ𝑖𝑔ℎ 𝑡𝑒𝑚𝑝, 𝑠ℎ𝑖𝑣𝑒𝑟𝑖𝑛𝑔 }
The fuzzy relation 𝑅 is defined as
EL
PT
N
𝑡𝑦𝑝ℎ𝑜𝑖𝑑 0.1 0.9 0.8
𝑅 = 𝑣𝑖𝑟𝑎𝑙 0.2 0.9 0.7
𝑐𝑜𝑙𝑑 0.9 0.4 0.6
Debasis Samanta
CSE
11
IIT Kharagpur
Fuzzy Cartesian product
Suppose
• 𝐴 is a fuzzy set on the universe of discourse 𝑋 with 𝜇𝐴(𝑥)|𝑥 ∈ 𝑋
• 𝐵 is a fuzzy set on the universe of discourse 𝑌 with 𝜇𝐵(𝑦)|𝑦 ∈ 𝑌
EL
PT
Then 𝑅 = 𝐴 × 𝐵 ⊂ 𝑋 × 𝑌 ; where 𝑅 has its membership function given
by 𝜇𝑅 𝑥, 𝑦 = 𝜇𝐴x𝐵 (𝑥, 𝑦) = 𝑚𝑖𝑛{𝜇𝐴 𝑥 , 𝜇𝐵 𝑦 }
N
Debasis Samanta
CSE
12
IIT Kharagpur
Fuzzy Cartesian product
Example :
𝐴 = {(𝑎1, 0.2), (𝑎2, 0.7), (𝑎3, 0.4)} and 𝐵 = {(𝑏1, 0.5), (𝑏2, 0.6)}
EL
PT
𝑎1 0.2 0.2
𝑅 = 𝐴 × 𝐵 = 𝑎2 0.5 0.6
N
𝑎3 0.4 0.4
Debasis Samanta
CSE
13
IIT Kharagpur
Operations on Fuzzy relations
Let 𝑅 and 𝑆 be two fuzzy relations on 𝐴 × 𝐵.
• Union: 𝜇𝑅U𝑆(𝑎, 𝑏) = 𝑚𝑎𝑥{𝜇𝑅 𝑎, 𝑏 , 𝜇𝑆(𝑎, 𝑏)}
• Intersection: 𝜇𝑅∩𝑆 (𝑎, 𝑏) = 𝑚𝑖𝑛{𝜇𝑅 𝑎, 𝑏 , 𝜇𝑆(𝑎, 𝑏)}
EL
• Complement: 𝜇𝑅 𝑎, 𝑏 = 1 − 𝜇𝑅 (𝑎, 𝑏)
PT
• Composition: 𝑇 = 𝑅∘𝑆
N
𝜇𝑅∘𝑆 = 𝑚𝑎𝑥𝑦∈𝑌 {𝑚𝑖𝑛 𝜇𝑅 𝑥, 𝑦 , 𝜇𝑆 𝑦, 𝑧 }
Debasis Samanta
CSE
14
IIT Kharagpur
Operations on Fuzzy relations: Example
Example : 𝑋 = (𝑥1 , 𝑥2 , 𝑥3 ), 𝑌 = 𝑦1 , 𝑦2 , 𝑍 = 𝑧1 , 𝑧2 , 𝑧3 ,
EL
0.6
PT
𝑥1 0.5 0.4 0.5
𝑅 ∘ 𝑆 = 𝑥2 0.5 0.8 0.9
𝑥3 0.6
N
0.6 0.7
Debasis Samanta
CSE
15
IIT Kharagpur
Fuzzy relation : An example
Consider the following two sets 𝑃 and 𝐷, which represent a set of paddy plants and a set
of plant diseases. More precisely
𝑃 = {𝑃1 , 𝑃2 , 𝑃3 , 𝑃4 } a set of four varieties of paddy plants
𝐷 = {𝐷1 , 𝐷2 , 𝐷3 , 𝐷4 } of the four various diseases affecting the plants.
In addition to these, also consider another set 𝑆 = {𝑆1 , 𝑆2 , 𝑆3 , 𝑆4 } be the common
EL
symptoms of the diseases.
Let, 𝑅 be a relation on 𝑃 × 𝐷, representing which plant is susceptible to which diseases,
PT
which is stated as
N
𝑃1 0.6 0.6 0.9 0.8
𝑃 0.1 0.2 0.9 0.8
𝑅= 2
𝑃3 0.9 0.3 0.4 0.8
𝑃4 0.9 0.8 0.4 0.2
Debasis Samanta
CSE
16
IIT Kharagpur
Fuzzy relation : An example
Also, consider 𝑇 be the another relation on 𝐷 × 𝑆, which is given by
EL
𝐷4 0.9 1.0 0.8 0.2
PT
Obtain the association of plants with the different symptoms of the disease using
max-min composition.
N
Hint: Find 𝑅 ∘ 𝑇, and verify that
𝑃1 0.8 0.8 0.8 0.9
𝑃 0.8 0.8 0.8 0.9
𝑅∘𝑆 = 2
𝑃3 0.8 0.8 0.8 0.9
𝑃4 0.8 0.8 0.7 0.9
Debasis Samanta
CSE
17
IIT Kharagpur
Fuzzy relation : Another example
Let, 𝑅 = 𝑥 is relevant to 𝑦
and 𝑆 = 𝑦 is relevant to 𝑧
be two fuzzy relations defined on 𝑋 × 𝑌 and 𝑌 × 𝑍, respectively, where 𝑋 =
{1,2,3}, 𝑌 = {𝛼, 𝛽, 𝛾, 𝛿} and 𝑍 = {𝑎, 𝑏}. Assume that 𝑅 and 𝑆 can be
EL
expressed with the following relation matrices :
PT
𝛼 0.9 0.1
1 0.1 0.3 0.5 0.7
N
𝛽 0.2 0.3
𝑅 = 2 0.4 0.2 0.8 0.9 𝑎𝑛𝑑 𝑆 = 𝛾
0.5 0.6
3 0.6 0.8 0.3 0.2 𝛿 0.7 0.2
Debasis Samanta
CSE
18
IIT Kharagpur
Fuzzy relation : Another example
Now, we want to find 𝑅 ∘ 𝑆, which can be interpreted as a derived fuzzy relation
𝑥 is relevant to 𝑧.
Suppose, we are only interested in the degree of relevance between 2 ∈ 𝑋 and
𝑎 ∈ 𝑍. Then, using max-min composition,
EL
𝜇𝑅∘𝑆 (2, 𝑎) = max{ 0.4 ∧ 0.9 , 0.2 ∧ 0.2 , 0.8 ∧ 0.5 , 0.9 ∧ 0.7 }
= max{0.4, 0.2, 0.5, 0.7} = 0.7
PT
R s
N
1
a
2
b
3
Debasis Samanta
CSE
19
IIT Kharagpur
2D Membership functions : Binary fuzzy relations
(Binary) fuzzy relations are fuzzy sets 𝐴 × 𝐵 which map each element in 𝐴 × 𝐵
to a membership grade between 0 and 1 (both inclusive).
Note that a membership function of a binary fuzzy relation can be depicted with
a 3D plot.
EL
( x, y )
PT
N
Important: Binary fuzzy relations are fuzzy sets with two dimensional MFs and
so on.
Debasis Samanta
CSE
20
IIT Kharagpur
2D membership function : An example
+
Let, 𝑋 = 𝑅 = 𝑦 (the positive real line) and
𝑅 = 𝑋 × 𝑌 = "𝑦 is much greater than 𝑥“
The membership function of 𝜇𝑅 𝑥, 𝑦 is defined as
(𝑦 − 𝑥)
EL
𝑖𝑓 𝑦 > 𝑥
𝜇𝑅 𝑥, 𝑦 = 4
0 𝑖𝑓 𝑦 ≤ 𝑥
PT
Suppose, 𝑋 = {3,4,5} and 𝑌 = {3,4,5,6,7}, then
N
3 0
𝑅=4 0
5 0
0.25
0
0
0.5
0.25
0
0.75
0.5
0.25
1.0
0.75
0.5
Debasis Samanta
CSE
21
IIT Kharagpur
Example:
How you can derive the following?
If x is A or y is B then z is C;
Given that
• R1: If x is A then z is 𝐶 [𝑅1 ∈ 𝐴 × 𝐶]
EL
• R2: If y is B then z is 𝐶 [𝑅2 ∈ 𝐵 × 𝐶]
PT
Hint:
You have given two relations R1 and R2.
N
Then, the required can be derived using the union operation of R1
and R2
Debasis Samanta
CSE
22
IIT Kharagpur
EL
PT
N
Debasis Samanta
CSE
23
IIT Kharagpur