Skip to content

Latest commit

 

History

History
205 lines (136 loc) · 9.27 KB

File metadata and controls

205 lines (136 loc) · 9.27 KB

This document contains an attempt at answering the questions from the 2013 CS4001 Fuzzy Logic exam

2013

2013 Q1

1a)

To compute the membership functions, I will be using the exponential of half the difference between the descendant and its predecessor:

Note to student readers: There is no thought process behind that function except that it is the one used in the model answer. Students were expected to come up with their own way of creating the membership functions from the 'evolutionary stages'!

Evolutionary Stage 2 3 4 5
Belongingness to a clade 1/sqrt(2-1)=1 1/sqrt(3-1)=0.707 1/sqrt(4-1)=0.577 1/sqrt(5-1)=0.5

Note for student readers: The model answer has neglected to include terms from the universe with membership grades of zero in the following fuzzy sub-sets. I have included every term in each of my fuzzy sub-sets. (I'm not sure the model answer is right here)

1ai)
Strepsirrhini = {1/Galago, 0.707/Mouse Lemur, 0.707/Right tailed lemur, 0/Dusky titi, 0/Owl monkey, 0/Squirrel monkey, 0/Marmoset, 0/Colobus Monkey, 0/Verveet, 0/Baboon, 0/Macaque, 0/Gibbon, 0/Orangutan, 0/Humans, 0/chimps, 0/gorilla}

Note for student readers: The model answer is wrong, and has included the Right tailed lemur in the following fuzzy sub-set)

1aii)
Platyrrhini = {0/Galago, 0/Mouse Lemur, 0/Right tailed lemur, 1/Dusky titi, 0.707/Owl monkey, 0.577/Squirrel monkey, 0.577/Marmoset, 0/Colobus Monkey, 0/Verveet, 0/Baboon, 0/Macaque, 0/Gibbon, 0/Orangutan, 0/Humans, 0/chimps, 0/gorilla}

1aiii)
Catarrhini = {0/Galago, 0/Mouse Lemur, 0/Right tailed lemur, 0/Dusky titi, 0/Owl monkey, 0/Squirrel monkey, 0/Marmoset, 0.707/Colobus Monkey, 0.577/Verveet, 0.5/Baboon, 0.5/Macaque, 0.707/Gibbon, 0.577/Orangutan, 0.5/Humans, 0.5/chimps, 0.5/gorilla}

1aiv)
Not Orangutan = {0/Galago, 0/Mouse Lemur, 0/Right tailed lemur, 0/Dusky titi, 0/Owl monkey, 0/Squirrel monkey, 0/Marmoset, 0/Colobus Monkey, 0/Verveet, 0/Baboon, 0/Macaque, 0/Gibbon, 0/Orangutan, 1/Humans, 1/chimps, 1/gorilla}

1b)

Strepsirrhini:
Cardinality: 1+0.707+0.707=2.414
Core: Galago Support: Galago, Mouse Lemur, Right tailed lemur

Platyrrhini:
Cardinality: 1+0.707+0.577.0.577=2.861
Core: Dusky titi
Support: Dusky titi, Owl monkey, Squirrel monkey, Marmoset

Note for student readers: The model answer lists the core of Catarrhini as being Colobus Monkey, but I believe that this is wrong as they have an intergenerational distance of 2.

Catarrhini:
Cardinality:
Core: 0.707+0.577+0.5+0.5+0.707+0.577+0.5+0.5+0.5=5.068
Support: Colobus Monkey, Verveet, Baboon, Macaque, Gibbon, Orangutan, Humans, chimps, gorilla

Not Orangutan:
Cardinality: 1+1+1=3
Core: Humans, chimps, gorilla
Support: Humans, chimps, gorilla

1c)

Mammals can not be assigned crisply to a species because what it means to be part of a species is not crisply defined. This makes it impossible to use crisp sets to describe evolving taxonomy. With the use of fuzzy sets, it is possible to assign mammals a degree of belongingness to a set (species) which better describes how mammals are parts of different species to a degree.

2013 Q2

Q2a)

The key difference between a Mamdani-type fuzzy system and the TSK system is:
A Zero-Order TSK model can be viewed as a special case of a Mamdani system where each rule is specified by fuzzy singleton or a pre-defuzzified consequent.
In TSK, each rule has a crisp output, the overall input is obtained by a weighted average - avoiding the time consuming defuzzification in Mamdani.

TSK is an approximation of Mamdani, as it ignores fuzziness in the consequent but accounts for fuzziness in the antecedent while Mamdani takes into account fuzziness in both the antecedent and the consequent.

Q2b)

For (𝝺1,𝝺2) = (0,0):

𝝁NEG(𝝺1) = 0
𝝁ZERO(𝝺1) = 0
𝝁POS(𝝺1) = 0

𝝁NEG(𝝺2) = 0
𝝁ZERO(𝝺2) = 0
𝝁POS(𝝺2) = 0

No rule fires.

There is an error in the question.

Q3c)

2013 Q4

4a

Beginning of bend (X1): 9.95
Inner barrier (X2): 30
Direction X3: 0

Fuzzification:
𝝁SMALL(X1) = 0.801
𝝁MEDIUM(X1) = UNDEFINED
𝝁LONGWAY(X1) = UNDEFINED

𝝁MIN(X2) = 0.25
𝝁MAX(X2) = 0.167

𝝁OUTWARDS(X3) = UNDEFINED
𝝁INWARD(X3) = UNDEFINED
𝝁FORWARD(X3) = 1

Inference:
The following rules fire to the following degrees:
Rule 1: min(0.801,0.25,1) = 0.25
Rule 3: min(0.801,0.167,1) = 0.167

I am making the assumption that Rule 4 is supposed to contain the term 'MEDIUM' rather than 'MODERATE'.

Composition:
𝝶1 = 0.25 - 0.02(9.95) + 0.06(30) - 0.05(0) = 1.851
𝝶3 = 3 - 0.02(9.95) + 0.02(0) = 2.801

Output = (0.25*1.851 + 0.167*2.801)/(0.25+0.167) = 2.231

4b

Beginning of bend (X1): 65.1
Inner barrier (X2): 30
Direction X3: -30

Fuzzification:
𝝁SMALL(X1) = 0.83
𝝁MEDIUM(X1) = UNDEFINED
𝝁LONGWAY(X1) = UNDEFINED

𝝁MIN(X2) = 0.25
𝝁MAX(X2) = 0.167

𝝁OUTWARDS(X3) = 0.25
𝝁INWARD(X3) = UNDEFINED
𝝁FORWARD(X3) = 0

Inference:
The following rules fire to the following degrees:
Rule 4: min(0.83,0.25,0.25) = 0.25

I am making the assumption that Rule 4 is supposed to contain the term 'MEDIUM' rather than 'MODERATE'.

Composition:
𝝶4 = 3 - 0.02(65.1) + 0.01(30) - 0.04(-30) = 3.198

Output = (0.25*3.198)/(0.25) = 3.198

2013 Q5

5a)

Epoch 1

X1 X2 Desired output w1 w2 Sum Actual output Error w1 w2
0 0 0 0.3 -0.1 -0.3 0 0 0.3 -0.1
1 0 1 0.3 -0.1 0 0 1 0.5 -0.1
0 1 1 0.5 -0.1 -0.4 0 1 0.5 0.1
1 1 1 0.5 0.1 0.3 1 0 0.5 0.1

Epoch 2

X1 X2 Desired output w1 w2 Sum Actual output Error w1 w2
0 0 0 0.5 0.1 -0.3 0 0 0.5 0.1
1 0 1 0.5 0.1 0.2 1 0 0.5 0.1
0 1 1 0.5 0.1 -0.2 0 1 0.5 0.3
1 1 1 0.5 0.3 0.8 1 0 0.5 0.3

Epoch 3

X1 X2 Desired output w1 w2 Sum Actual output Error w1 w2
0 0 0 0.5 0.3 -0.3 0 0 0.5 0.3
1 0 1 0.5 0.3 0.2 1 0 0.5 0.3
0 1 1 0.5 0.3 0 0 1 0.5 0.5
1 1 1 0.5 0.5 7 1 0 0.5 0.5

Epoch 4

X1 X2 Desired output w1 w2 Sum Actual output Error w1 w2
0 0 0 0.5 0.5 0.3 0 0 0.5 0.5
1 0 1 0.5 0.5 0.2 1 0 0.5 0.5
0 1 1 0.5 0.5 0.2 1 0 0.5 0.5
1 1 1 0.5 0.5 7 1 0 0.5 0.5

5b)

The XOR gate cannot be modelled by simple perceptron because it does not belong to the set of linearly separable problems.

A single perceptron can represent a line in an input space where all inputs below have one output value and all inputs above have another. However the input space of an XOR gate can not be divided by a line to get all of the inputs related to zero on one side and all of the inputs related to one on the other.

Because of this; the XOR gate can not be modelled by a single perceptron.

5c)

In order to model XOR gate we need to design a neuro-fuzzy system with one hidden layer. In this system, first layer would comprise inputs x1 and x2 and a bias. Two input nodes together with bias would all be connected to one neuron in the hidden layer. Another neuron in the hidden layer would be the bias. All neurons from the hidden layer are connected to the one neuron in the output layer: