程序代写代做代考 CM3112 Artificial Intelligence

CM3112 Artificial Intelligence
Fuzzy logic: Relations
Steven Schockaert
SchockaertS1@cardiff.ac.uk
School of Computer Science & Informatics Cardiff University

Relations
The Cartesian product of sets A and B is defined as: A ⇥ B = {(a, b) | a 2 A, b 2 B}
A relation R from A to B is defined as a subset of A × B Example:
Films = {the Dark Knight, the Fellowship of the Ring, . . . } Characters = {Batman, Joker, Frodo, . . . }
FeaturesIn = {(Batman, the Dark Knight), (Joker, the Dark Knight), . . . } FeaturesIn ⊆ Characters × Films

o
{}
c
gramme ={cs, cs-sf, cs-hpc, cs-vc, se, cse, maths}
Core ={(cm3101, bis), (cm3102, cs-vc), (cm3103, cs-hpc), (cm3102, cs-v
Direct product
Optional ={(cm3101, se), (cm3102, cs), (cm3102, maths), …} We call A a set in the universe X if A⊆X
Core ✓ Module ⇥ Programme Optional ✓ Module ⇥ Programme Let A be a set in the universe X and R a relation from X to Y. The direct
product of A and R, written A∘R is defined as: AR={b|there exists an a2A such that (a,b)2R}
Example:
Films = {the Dark Knight, the Fellowship of the Ring, . . . } Characters = {Batman, Joker, Frodo, . . . }
FeaturesIn = {(Batman, the Dark Knight), (Joker, the Dark Knight), . . . } Superheroes = {Batman, . . . }
Superheroes ∘ FeaturesIn = {the Dark Knight, . . . }

Direct product
Y
R
A
X

Direct product
Y
A∘R
R
A
X

Module = {cm3101, cm3102, …, cm3301} Fuzzy sets and fuzzy relations
Lecturer = {ne, pr, xs, dw, aj, cj, …}
Taught-by = {(cm3101, ne), (cm3102, pr), (cm3102, xs), .
A fuzzy set A in a universe X is a mapping from X to [0,1]
Aut-CS-mods = {cm3102, cm3103, cm3104, cm3105, cm3106
A fuzzy relation R from X to Y is a fuzzy set in X × Y cm3107, cm3108}
t-CS-mods Taught-by = {pr, xs, dw, aj, cj, js, tb, md, am, ks, ap, cm, ss The direct product of A and R w.r.t. a t-norm T is defined for b in Y as:
(AT R)(b)=maxT(A(x),R(x,b)) x2X
where we assume that eit8>her the universes X and Y are finite or that
< x2 A and R are defined by contin2uous mappings 6x 2 if 2  x  4 A(x) = 0 otherwise if 4  x  6 . u} >:
8yx5

Direct product Y
R
0
0
0
0
0
0
0.25
0.75
0
0.25
0
0
0.5
1
0.25
0
0.75
0
0
0.5
0.5
0
0
1
0
0
0.25
0
0
0.25
1
1
0
0.25
0
0
0
0
0
0
1
0.5
0
0
0
0
0
0
0.25
0.5
1
0
0.75
0
0
0
A
X

Direct product w.r.t. TM Y
R
0
0.5
0.25
0
0.75
0
0
0
0
0
0
0
0
0.25
0.75
0
0.25
0
0
0.5
1
0.25
0
0.75
0
0
0.5
0.5
0
0
1
0
0
0.25
0
0
0.25
1
1
0
0.25
0
0
0
0
0
0
1
0.5
0
0
0
0
0
0
0.25
A∘R
0.5
1
0
0.75
0
0
0
A
X

Direct product w.r.t. TP Y
R
0
0.375
0.125
0
0.75
0
0
0
0
0
0
0
0
0.25
0.75
0
0.25
0
0
0.5
1
0.25
0
0.75
0
0
0.5
0.5
0
0
1
0
0
0.25
0
0
0.25
1
1
0
0.25
0
0
0
0
0
0
1
0.5
0
0
0
0
0
0
0.25
A∘R
0.5
1
0
0.75
0
0
0
A
X

Direct product w.r.t. TW Y
R
0
0.25
0
0
0.75
0
0
0
0
0
0
0
0
0.25
0.75
0
0.25
0
0
0.5
1
0.25
0
0.75
0
0
0.5
0.5
0
0
1
0
0
0.25
0
0
0.25
1
1
0
0.25
0
0
0
0
0
0
1
0.5
0
0
0
0
0
0
0.25
A∘R
0.5
1
0
0.75
0
0
0
A
X

Example: finite universes
Let the fuzzy set of friends be defined as:
Friends = {frodo/1, sam/1, aragorn/0.75, elrond/0.5, gollum/0.1}
Let the fuzzy relation Likes be defined as
Likes = {(frodo,rabbit)/0.8, (frodo,fish)/0.6, (frodo,lembas)/0.2, (sam,rabbit)/1, (sam,fish)/0.4, (sam,lembas)/0.1, (aragorn,rabbit)/0.9, (aragorn,fish)/0.8, (aragorn,lembas)/0.7, (elrond,rabbit)/0.2, (elrond,fish)/0.6, (elrond,lembas)/1, (gollum,rabbit)/0.3, (gollum,fish)/1, (gollum,lembas)/0}
We use the notation A= {a1/λ1,…,an/λn} to denote the fuzzy set defined by A(ai)=λi (where entries of the form ai/0 are usually omitted)

Example: finite universes
Friends∘Likes is the fuzzy set of food types which my friends like
(Friends∘Likes)(rabbit) = max(T(1,0.8), T(1,1), T(0.75,0.9), T(0.5,0.2), T(0.1,0.3)) (Friends∘Likes)(fish) = max(T(1,0.6), T(1,0.4), T(0.75,0.8), T(0.5,0.6), T(0.1,1)) (Friends∘Likes)(lembas) = max(T(1,0.2), T(1,0.1), T(0.75,0.7), T(0.5,1), T(0.1,0))
Friends = {frodo/1, sam/1, aragorn/0.75, elrond/0.5, gollum/0.1}
Likes = {(frodo,rabbit)/0.8, (frodo,fish)/0.6, (frodo,lembas)/0.2, (sam,rabbit)/1, (sam,fish)/0.4, (sam,lembas)/0.1, (aragorn,rabbit)/0.9, (aragorn,fish)/0.8, (aragorn,lembas)/0.7, (elrond,rabbit)/0.2, (elrond,fish)/0.6, (elrond,lembas)/1, (gollum,rabbit)/0.3, (gollum,fish)/1, (gollum,lembas)/0}

{}
(AT R)(b)=maxT(A(x),R(a,b)) Example: fuzzy numbers
x2X
if 2  x  4
8>< x 2 2 A ( x ) = >: 6 x 2
80
>< y x 5 5 i f 4  x  6 otherwise if 5  y x  10 if y x 10 otherwise real numbers which are about 4 much smaller than R R(x, y) = >:1 0
1
A1
1
5×10 15
5 y-x10 15

>:
8> > > 0
:max 1,
81 ><0 if y  7 if y 2 [7, 14] if y 14 A real numbers which are much larger than about 4 A∘R ) (A R)(y) =?:?? = > 7
1
y
1
1
(A R)(y) =???
T(42,R(4,y) 2
5 10 15

cm3107, cm3108

}
ds Taught-by = {pr, xs, dw, aj, cj, js, tb, md, am, ks, ap, cm, ss}
Direct product in infinite domains
(AT R)(b)=maxT(A(x),R(x,b)) x2X
When A and R are defined over infinite domains such as the reals,
8>< x 2 if 2  x  4 evaluating the direct product A∘R can be difficult 2 6x if 4  x  6 A(x) = In practic8: 2
0 otherwise
yx5
>: if 5  y x  10
precise input to a system (e.g. the measurement of a sensor). In that
5
R(x,y)= 1 ifyx10
case, evaluating the direct product is much easier
0 otherwise
A(x)=(1 ifx=3 80 otherwise
yx5
><>: 5 if5yx10
R(x,y)= 1 ifyx10
(A R)(y) = max T (A(x), R(x, y)) x2X
= T (A(3), R(3, y)) =T(1,R(3,y))
= R(3, y)
0
1
otherwise
(A R)(y) = max T (A(x), R(x, y)) x2X