Fuzzy math. Relationships and wolf tails

The parameters and principles of operation of various systems can be connected by a selected attribute among themselves with various kinds of relationships. If, let’s say, we are interested in the effect of the price of a service on its demand, then this relationship can be described by a relationship of the type “influences”, “strongly influences”, “weakly influences”, etc. In this case, quite “discrete” objects for description may not be enough. For many applied problems of the theory of automata, pattern recognition, decision making, etc. it makes sense to generalize the concept of the relationship between objects to a fuzzy case. In this case, the model, quite possibly, will more adequately describe the system, allowing a qualitative analysis of systems without loss of threshold information, in connection with the emergence of new types of relationships: similarity, similarity, dissimilarity, ...


The concept of fuzzy relationships (connections, associations, relationships, relationships are synonyms), along with the concept of fuzzy sets, refers to the fundamental foundations of the whole theory of fuzzy sets. In addition to the fact that they themselves have applied value, on their basis a number of additional concepts are determined that are used to build fuzzy models of more complex systems.


Fuzzy relationship



(sorry)

Definition


As in the case of fuzzy sets (HMs), fuzzy relationships generalize the concept of the usual relationship we are familiar with in (naive) set theory. And many concepts introduced below for relations will be similar to the corresponding concepts for NM.


We introduce the concepts of fuzzy relationship and consider its properties.


Fuzzy 2-ary (binary) ratio Ron the universal set U=U1×U2U1×U2, μR(x,y):U1×U2[0,1],xU1,yU2. :


R=(x,y)U1×U2μR(x,y)/(x,y)


n- Rn- .


, [0,1]- ( , ..). [0,1]. μR(x,y)(x,y)xRy(x,y)R. , n- .


.


  • ;
  • (xi,yj)μR(xi,yj);
  • ||μR(xi,yj)||;
  • G~=(U~,V~), U~={un},nN— , V~={μR~(ui,uj)/(ui,uj),μR~(ui,uj)>0}— . ( , . , , , xD)

.



U=1,3,5,7,9R« » ( x>>y ). :







R,SU1×U2,xU1,yU2


RUU1×U2:

supp(R)={(x,y):μR(x,y)>0,(x,y)U1×U2}


RS,

(x,y)μR(x,y)μS(x,y)


( ) :

μR(1)(x,y)=maxy(μR(x,y))


:

μR(2)(x,y)=maxx(μR(x,y))


h(R):

h(R)=maxx(maxy(μR(x,y)))=maxy(maxx(μR(x,y)))


, h(R)=1, — .


RR¯, :

μR¯(x,y)=1μR(x,y)


, RR|μR(x,y)={0,μR(x,y)<0.51,μR(x,y)>0.501,μR(x,y)=0.5., 0.5 0.


RR1, μR1(x,y)=μR(y,x).R1R.



:

μRS(x,y)=max(μR(x,y),μS(x,y));μRS(x,y)=min(μR(x,y),μS(x,y))

. The set of all fuzzy relations forms a distributive lattice in relation to the operations of union and intersection; and from the fulfillment of the identities of idempotency, commutativity, associativity, absorption and distributivity for the latticeL=[0;1] the fulfillment of these identities for all relations follows.

In logic based on the theory of ordinary sets, a statement like “the numbers x and y are very close or / and very different” should be reduced to “the numbers x and y are very close or very different”. However, in the theory of fuzzy sets, the first statement is quite logical; it expresses the fact that the connective “and” is interpreted for very small values ​​of the membership function, when it is impossible to say about x and y that they are very close or that they are very different from each other. This example illustrates well the flexibility of utterances inherent in real logic.


: μRS(x,y)=μR(x,y)μS(x,y); : μR+S(x,y)=μR(x,y)+μS(x,y)μR(x,y)μS(x,y).


, . α- . , . - Rα={(x,y):μR(x,y)α}. , α1α2Rα1Rα2.


( ) . RR=maxα(α×Rα).




. , . (Max-*)-. , 3 .


  1. max-min ( ): RS:μRS(x,z)=maxyU(min(μR(x,y),μS(y,z))). .
  2. min-max ( ): RS:μRS(x,z)=minyU(max(μR(x,y),μS(y,z))).
  3. max-• ( ): RS:supyU(μR(x,y)μS(y,z)).

A,BU, . : μA(x,y)=[0.20.60.50.8],μB(x,y)=[0.50.70.31]


:


  1. μAB(x,y)=[0.30.60.50.8];
  2. μAB(x,y)=[0.50.70.50.7];
  3. μAB(x,y)=[0.180.60.250.8].




. :


:μR(x,x)=1,(x,x)U;


: μR(x,y)μR(x,x);


: μR(x,x)=1,μR(x,y)<1;


flexx: μR(x,x)=0,(x,x)U;


: μR(x,y)=μR(y,x);


: μR(x,y)μR(y,x)()μR(x,y)=μR(y,x)=0;


: xy,μR(x,y)>0μR(y,x)=0;


: μR(x,z)maxy(min(μR(x,y),μR(y,z))).


… . .




2 NPC-, K1K2. , . NPC :


K1:, , .


K2:, , — .


, , :


« » =A=(0.8/3;0.4/15;0.3/30).


« » =B=(0.1/0.9;0.5/0.5;0.8/0.1).


« » =C=(0.8/0.9;0.5/0.5;0.3/0.2).


. : NPC ?



, :


def very(arr: List[set]):
    return [(elem[0]**2, elem[1]) for elem in arr]


def no(arr: List[set]):
    return [(1 - elem[0], elem[1]) for elem in arr]


def attitude(a: List[set], b: List[set], func = lambda x, y: min(x, y)):
    return [[func(i[0], j[0]) for j in b] for i in a]


def attitude_unite(a: List[List], b: List[List]):
    return [[max(a[i][j], b[i][j]) for j in range(len(a[i]))] for i in range(len(a))]


def composition(a: List[List], b: List[List]):
    result = [[0 for j in range(len(b[0]))] for i in range(len(a))]

    for x in range(len(a)):
        for z in range(len(b[0])):
            maximum = min(a[x][0], b[0][z])

            for y in range(0, len(a[0])):
                if maximum < min(a[x][y], b[y][z]):
                    maximum = min(a[x][y], b[y][z])
            
            result[x][z] = maximum

    return result


def index_plus(a: List[List]):
    maximum = max([elem[1] for elem in a])
    result = 0
    for i in range(len(a)):
        result += a[i][0] * (a[i][1] + maximum) / 2

    return result


def ranking_index(a: List[List], b: List[List]):
    return index_plus(a) - index_plus(b)

, — -. , , , index_plus ranking_index. . ( ; , ) :

H(A,B)=H+(A)H+(B), H+(X)=01M(X0)dX,M(X0)=(infxX0(x)+supxX0(x))2.


AB— . . :


A = [(0.8, 3), (0.4, 15), (0.3, 30)]
B = [(0.1, 0.9), (0.5, 0.5), (0.8, 0.1)]
C = [(0.8, 0.9), (0.5, 0.5), (0.3, 0.2)]

x— « ».


x = no(very(A))
x = [[elem[0] for elem in x]]

NPC K1R1. R1=A×B  A¯×B¯:


AonB = attitude(A, B)
notAonnotB = attitude(no(A), no(B))
R1 = attitude_unite(AonB, notAonnotB)

y1, ( ) R1.


y1 = composition(x, R1)
print('y1 = ', y1)
# >> y1 =  [[0.63, 0.3599999999999999, 0.3599999999999999]]

:


notAonC = attitude(no(A), C)
AonnotC = attitude(A, no(C))
R2 = attitude_unite(notAonC, AonnotC)
y2 = composition(x, R2)
print('y2 = ', y2)
# >> y2 =  [[0.5599999999999999, 0.3599999999999999, 0.3599999999999999]]

y1y2:


y1 = [(y1[0][i], B[i][1]) for i in range(len(y1[0]))]
y2 = [(y2[0][i], C[i][1]) for i in range(len(y2[0]))]

NPC:


print('index = ', ranking_index(y1, y2))
# >> index =  -0.020000000000000018

A small negative value indicates that K2more loyally accept items and are more likely to count the quest for the player than K1.


And that's all for today.


All Articles