Sunteți pe pagina 1din 10

1.

For the given Fuzzy Set

A= { 1/1.0+ 0.65/1.5+0.4/2.0+ 0.35/2.5+0/3.0}


B= { 0/1.0+0.25/1.5+0.6/2.0+0.25/2.5+1/30}
C= { 0.5/1.0+0.25/1.5+0/2.0+0.25/2.5+0.5/3.0}

Prove the associative and the distributive property for the above
given sets

To prove associative property

1. AU(BUC) = (AUB)UC

L.H.S AU(BUC)

(BUC) = { 0.5/1.0+0.25/1.5+0.6/2.0+0.25/2.5+1/30}

AU(BUC) = { 1/1.0+ 0.65/1.5+ 0.6/2.0+ 0.35/2.5+1/30}

R.H.S (AUB)UC

(AUB)={1/1.0+0.65/1.5+0.6/2.0+0.35/2.5+1/30}

(AUB)UC = {1/1.0+0.65/1.5+0.6/2.0+0.35/2.5+1/3.0}
To Prove Distribute Property

(A ∩(B ∪ C)) = (A ∩ B) U (A ∩ C) 

L.H.S (A ∩(B ∪ C)

(B ∪ C) = {0.5/1.5+0.25/1.5+0.6/2.0+0.25/2.5+1/30 }
(A ∩(B ∪ C)= {0.5/1.0+0.25/1.5+0.4/2.0+0.25/2.5+0/3.0}

R.H.S (A ∩ B) U (A ∩ C) 

(A ∩ B) ={0/1.0+0.25/1.5+0.4/2.0+0.25/2.5+0/3.0}

(A ∩ C) ={0.5/1.0+0.25/1.5+0/2.0+0.25/2.5+0/3.0}

(A ∩ B) U (A ∩ C) =={0.5/1.0+0.25/1.5+0.4/2.0+0.25/2.5+0/3.0}

Q-2 ) X = {a, b, c, d}

Y = {1, 2, 3, 4}

A = {(a, 0.0),(b, 0.8),(c, 0.6),(d, 1.0)}

B = {(1, 0.2),(2, 1.0),(3, 0.8),(4, 0.0)}

C = {(1, 0),(2, 0.4),(3, 1.0),(4, 0.8)}

Determine the implication relation

: If x is A then y is B else y is C

Here, A × B = [ 1 2 3 4]

A 0 0 0 0

B 0.2 0.8 0.8 0

C 0.2 0.6 0.6 0

D 0.2 1.0 0.8 0


and A × C = [ 1 2 3 4]

a 0 0.4 1.0 0.8

b 0 0.2 0.2 0.2

c 0 0.4 0.4 0.4

d 0 0 0 0

R= [1 2 3 4]

A 0 0.4 1.0 0.8

B 0.2 0.8 0.8 0.2

C 0.2 0.6 0.6 0.4

D 0.2 1.0 0.8 0


If x is A then y is B

If x is A then y is B else y is C
Q-3) Consider the problem of finding the shortest route through several
cities, such that each city is visited only once and in the end return to the
starting city (the Travelling Salesman problem). Suppose that in order to
solve this problem we use a genetic algorithm, in which genes represent
links between pairs of cities. For example, a link between London and
Paris is represented by a single gene ‘LP’. Let also assume that the
direction in which we travel is not important, so that LP = P L
.a) How many genes will be used in a chromosome of each individual if
the number of cities is 10?
Answer: Each chromosome will consist of 10 genes. Each gene
representing the path between a pair of cities in the tour.

b) How many genes will be in the alphabet of the algorithm?


Answer: The alphabet will consist of 45 genes.
Indeed, each of the 10 cities can be connected with 9 remaining.
Thus, 10 × 9 = 90 is the number of ways in which 10 cities can be
grouped in pairs. However, because the direction is not important (i.e.
London–Paris is the same as Paris–London) the number must be divided
by 2.
So, we shall need 90/2 = 45 genes in order to encode all pairs.
In general the formula for n cities is:
n(n − 1) 2
Q-4) Consider a GA with chromosomes consisting of six genes xi =
abcdef, and each gene is a number between 0 and 9. Suppose we have
the following population of four chromosomes:
x1 = 4 3 5 2 1 6 x2 = 1 7 3 9 6 5
x3 = 2 4 8 0 1 2 x4 = 9 0 8 1 2 3
and let the fitness function be f(x) = (a + c + e) − (b + d + f).
1. Sort the chromosomes by their fitness
2. Do one–point crossover in the middle between the 1st and 2nd fittest,
and two–points crossover (points 2, 4) for the 2nd and 3rd.

3. Calculate the fitness of all the offspring


SOLUTION 1

Apply the fitness function f(x) = (a + c + e) − (b + d + f):

f(x1) = (4 + 5 + 1) − (3 + 2 + 6) = −1

f(x2) = (1 + 3 + 6) − (7 + 9 + 5) = −11

f(x3) = (2 + 8 + 1) − (4 + 0 + 2) = 5

f(x4) = (9 + 8 + 2) − (0 + 1 + 3) = 15

So, the order is x4, x3, x1 and x2.


SOLUTION 2

One–point crossover in the middle between x4 and x3:

x4 = 9 0 8| 1 2 3 O1 = 9 0 8| 0 1 2


x3 = 2 4 8| 0 1 2 O2 = 2 4 8| 1 2 3

Two–point crossover at points 2 and 4 between x3 and x1:

x3 = 2 4 8| 0 1 2 O3 = 2 4 5| 2 1 2


x1 = 4 3 5 |2 1 6 O4 = 4 3 8| 0 1 6

SOLUTION 3 Again, apply the fitness function f(x) = (a + c + e) − (b + d +


f):

f(O1) = (9 + 8 + 1) − (0 + 0 + 2) = 16

f(O2) = (2 + 8 + 2) − (4 + 1 + 3) = 4

f(O3) = (2 + 5 + 1) − (4 + 2 + 2) = 0

f(O4) = (4 + 8 + 1) − (3 + 0 + 6) = 4

Has the fitness of the new population improved?


Q-5)

X1,W1

X2,W2
V
y = ϕ(v)

X3,W3

Consider the unit shown on Figure 1. Suppose that the weights


corresponding to the three inputs have the following values:

w1=2 w2=-4 w3=1and the activation of the unit is given by the


step-function

:ϕ(v) =1 if v≥0
0 otherwise

Pattern P1 P2 P3 P4
X1 1 0 1 1
X2 0 1 0 1
X3 0 1 1 1
0 otherwise

Calculate what will be the output valueyof the unit for each of the
following input patterns::

Answer : To find the output valueyfor each pattern we have to:

a)Calculate the weighted sum:v = ∑iwixi=w1·x1+w2·x2+w3·x3

b)Apply the activation function to v


The calculations for each input pattern are:

P1:v= 2·1-4·0 + 1·0 = 2,(2>0),y=ϕ(2) = 1


P2:v= 2·0-4·1 + 1·1 =-3,(-3<0),y=ϕ(-3) = 0
P3:v= 2·1-4·0 + 1·1 = 3,(3>0),y=ϕ(3) = 1
P4:v= 2·1-4·1 + 1·1 =-1,(-1<0),y=ϕ(-1) = 0

S-ar putea să vă placă și