Computational Algorithm and Tools of Fuzzy Arithmetic Based on the Principle of Maximum Entropy

The standard fuzzy arithmetic introduced by Zadeh is not always suitable for solving applied problems in various fields of science, technology and business. Even in the case of a small sequence of arithmetic operations (for example, when calculating forecast estimates of business profits), the support of the resulting fuzzy number becomes very large. It is difficult to make a decision about investing if the maximum and minimum of the expected profit differ several times. Therefore, the authors developed an algorithm which forms the result of an arithmetic operation as a subset of a fuzzy binary relation and which implements the principle of maximum entropy. This algorithm allows performing arithmetic operations on fuzzy numerical sets with an arbitrary form of the membership function. Compared to standard fuzzy arithmetic, the proposed algorithm provides a much smaller increase in the support of the resulting fuzzy number. We implemented the algorithm in an add-in for Microsoft Excel, which readers can download and use for applied calculations for free.


Introduction
The solution of applied problems in different areas is often based on the use of numerical quantities, the values of which can be determined only approximately. The uncertainty of these quantities can have a different nature and can be caused by incomplete data, inaccuracy of the linguistic description, as well as other reasons.
Researchers often describe uncertain numerical quantities using fuzzy numbers, which are fuzzy sets defined on a set of real numbers. The need to use fuzzy numbers is especially relevant in economic problems, where numerical quantities are subjected to multiple arithmetic transformations.
In the general case, as a fuzzy number is called a fuzzy set with a support defined on the set of real numbers: where ( ) is the membership function of . Some researchers also use fuzzy intervals. Fuzzy interval is called (Klir 1997) the standard normal fuzzy set defined on the set of real numbers, for which the support is bounded and -cuts are closed intervals: is a normal fuzzy set if there is closed interval [ , ] such that ( ) = 1 ∀ ∈ [ , ], , ∈ ℝ, ≤ ; -cut of is closed interval = { ∈ ℝ | ( ) ≥ ∈ (0, 1]}; support of is bounded Supp = { ∈ ℝ | ( ) > 0}.
The membership function of the fuzzy interval is expressed as follows: where , , , ∈ ℝ, ≤ ≤ ≤ , (•) is a real-valued function that is increasing and right-continuous, and (•) is a real-valued function that is decreasing and left-continuous.
A fuzzy interval with a one-mode membership function is called a fuzzy number: ( ) = 1 for exactly one ∈ ℝ.
The implementation of any arithmetic operation ⨂ on two fuzzy numbers and is based on the use of the Zadeh's extension principle: where ( ) is the membership function of the result = ⨂ .
It is assumed that arithmetic operations with fuzzy numbers should retain the properties of standard arithmetic, in particular: commutativity, associativity, distributivity, properties of zero, unit and multiplication.
In applied problems, fuzzy quantities cannot always be adequately described by fuzzy numbers with a standard form of the membership function, since the nature of the uncertainty for different quantities, as a rule, is different. Based on this, the main requirements for the algorithm for performing arithmetic operations with fuzzy numbers are as follows: the properties of arithmetic operations with fuzzy numbers should not contradict the properties of standard arithmetic; the form of the membership function of the result must correctly take into account the form of the membership functions of the operands of the arithmetic operation; the result of an arithmetic operation should have as narrow support as possible in order to provide the unambiguity necessary to prevent erroneous solutions; the computational complexity of algorithms should be minimized as much as possible in order to ensure the efficiency of calculations.
The most common algorithms are based on the Zadeh's extension principle and implement arithmetic operations with fuzzy numbers that are approximated by several points on the set of real numbers. In particular, three points are used to describe triangular fuzzy numbers; four points are used to describe trapezoidal fuzzy numbers, and so on. These algorithms are easy to implement, but there are three problematic questions here. Firstly, the approximation of fuzzy quantities leads to errors that may be unacceptable in practice. Secondly, the shape of the resulting fuzzy number is sometimes not related to the shape of the operands of an arithmetic operation, that is, in some cases it is difficult to explain the change in the nature of the result. Thirdly, the use of these algorithms leads to a significant increase in the support of the resulting fuzzy number in the case of multiple transformations. Sometimes the right border of the support of a fuzzy number can be several times larger than the left one. In such conditions, it is very difficult to make an adequate decision. Therefore, we have developed an algorithm that provides the fulfilment of arithmetic operations with fuzzy numbers of arbitrary form and increases the support of the result to a lesser extent than the known algorithms.

Related researches
Researchers often use (Akther and Ahmad 2009;Chou 2003 and other) fuzzy numbers with triangular membership functions: In this case, the fulfilment of arithmetic operations is simplified, and the result is calculated using simple algebraic expressions. However, if the membership functions of the operands are represented by asymmetric triangles, the question arises about the shape of the membership function of the result, as shown in figure 1. This example shows that the membership function of the result can have a different shape than the membership functions of both operands. This fact cannot be rationally explained. From the other side, the computational complexity of arithmetic operations with triangular fuzzy numbers is minimal, but in practice, the approximation errors of fuzzy quantities are quite big. Representation of fuzzy numbers by trapezoids (Kumar and Kaur 2011), pentagons (Pathinathan and Santhosh Lee 2018), piecewise linear functions (Coroianu et al. 2014) or nonlinear membership functions (Kechagias and Papadopoulos 2007;Guerra and Stefanini 2005;Kosheleva et al. 1997) reduces these errors, however, the question concerning the shape of the membership function of the result remains. Hanss (1999) notes the loss of information in the case of triangular fuzzy numbers and suggests using discretized fuzzy numbers to solve engineering problems.
With regard to arithmetic operations with fuzzy numbers, research is aimed mainly at ensuring that the properties of standard arithmetic are fulfilled. Dubois and Prade (1978) identified these properties. Note that providing equivalence between properties of fuzzy and standard arithmetic is a problem. In particular, in fuzzy arithmetic, the definition of a fuzzy zero for the summation operation is a problem question, and the definition of a fuzzy unit is a problem question for multiplication and division. These problems are discussed in detail in a study by Mares (1997), which suggests replacing in properties a strict equality relation with a weaker equivalence relation. Other studies, for example Kosinski et al. (2003), to solve the problems of fuzzy arithmetic, in description of fuzzy numbers suggest using additional elements, in particular, their orientation.
However, from the point of view of applied problems, the main negative property of most known approaches to the implementation of arithmetic operations on fuzzy numbers is a sharp increase of the support in the case of many transformations. Many studies, for example (Stefanini et al. 2008;Liu and Guo 2007), note this property of arithmetic operations based on the Zadeh's extension principle. This property becomes an important drawback in applied problems in which the calculation algorithm repeatedly transforms the initial fuzzy quantities.
Consider a simple example. Figure  the summation has the support power |Supp( + )| = 8. If we sum several times the number with the result, then the support power will increase by 4 each time.
After five operations the support power of the result will increase to |Supp( + + + + + )| = 24, that is, six times compared to the initial fuzzy number (see Figure 2). The result uncertainty also increases dramatically. In particular, for this example, the cardinal number (the sum of membership degrees) of the fuzzy number will increase from Card( ) = 2 to Card( + + + + + ) = 12.

Fig. 2
Increasing the support of the resulting fuzzy number and changing the shape of the membership function when summing two triangular fuzzy numbers It is obvious that a wide variation of the possible values of the fuzzy quantity makes calculations with fuzzy numbers unsuitable for decision-making in applied problems. If we assume that in the above example, the result describes the predict profit of a business project, then the range from 6 to 30 monetary units is not suitable to conclude that the project is expedient, since this estimate is almost equivalent to complete uncertainty.
To limit the increase in the support of a fuzzy number Klir (1997) suggested using additional information that standard fuzzy arithmetic (Zadeh 1975) does not take into account. He presented this information in the form of "necessary constraints" that arise from the meaning of operands. For example, an equality constraint should be taken into account when both operands are states of the same linguistic variable whose the base variable cannot have two different values at the same time. Klir suggested adding to the standard fuzzy arithmetic the constraints in the form of a relation defined on the Cartesian product of two fuzzy intervals. Then the standard expression (2) is written as follows: where R is a crisp or fuzzy binary relation on the set × .
Note that the constraints for arithmetic expressions that contain fuzzy numbers should be formulated as -dimensional relations.  3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 A B A+B+B +B+B+B Using this approach allows you to limit the increase in the support of fuzzy numbers. But when solving applied problems, difficulties arise. Since the necessary constraints flow from the meaning of the operands, it is difficult to develop a computational algorithm that would be universal for all applied problems. In each case, the set of constraints should be different. In addition, the software implementation of the algorithm calculates the result of arithmetic expressions sequentially, in accordance with the priority of arithmetic operations. This makes it difficult to implement the mentioned -dimensional relations. Based on this, in the universal computational algorithm, it is possible to realize, perhaps, only one necessary constraint -the equality constraint. However, as noted in the study (Klir 1997), the use of the equality constraint does not allow to limit the result carrier in the case of summation.
Thus, many of the approaches mentioned above strive to strictly fulfill the properties of arithmetic operations and at the same time decrease to computational complexity by representing membership function with the help of various approximations. In our opinion, it is important to accurately describe both expert judgments and their correct transformations. One of the main disadvantages that make it difficult to use the known approaches in practice is a sharp increase in the result support in the case of multiple arithmetic transformations.
Therefore, our task is to build an algorithm that should correctly fulfill arithmetic operations with discretized fuzzy numbers and provide a moderate growth of the support of the resulting fuzzy number, as well as the possibility of a clear explanation of changes in the shape of the membership function.

Proposed algorithm
For implementation in software, we offer a new computational algorithm of arithmetic operations on fuzzy numbers that have an arbitrary, not necessarily convex membership function. Such fuzzy numbers we will call numerical fuzzy sets (NFS). NFS are discretized along the abscissa axis and are represented by pairs (3). As shown in (Dubois and Prade 1980), arithmetic operations can be successfully implemented for the case when fuzzy numbers are presented in discretized form.
As shown in the study (Hanss 1999), discretization can be realized by dividing into equal intervals either the abscissa axis (support of a fuzzy number) or the ordinate axis (membership function). In the first case, a fuzzy number is represented as a set of pairs: where is the number of discrete (segments), and , is the lower and upper boundaries of the support of the fuzzy number .
In the second case, a fuzzy number is also represented by many pairs: Hanss (1999) notes that the first case is unsuitable due to possible information losses if the intervals are chosen sufficiently large. However, we can see that the second way also turns out to be unsuitable if the membership function has several extrema. Therefore, to use discretization of the ordinate axis, a fuzzy number must be approximated only by a convex membership function. But by this we will introduce errors in expert judgment. In our opinion, the best solution is the discretization of the abscissa axis, subject to the Kotelnikov theorem (Kotelnikov 1933). This representation increases computational complexity, but in most cases, modern computers provide the necessary speed of calculations.
The proposed algorithm is based on representing the result of an arithmetic operation in the form of a fuzzy binary relation of two NFS and choosing from this relation a conditional projection that has a maximal membership function and a maximal degree of uncertainty. Consider this algorithm.
Step 1. Entering discretized NFS and according to (3) Step 2. Obtaining a fuzzy binary relation on Cartesian product = × satisfying the condition: , ⨂ is designation of an arithmetic operation.
Step 3. Scanning all the elements and composing the set of indexes pairs for which the membership function is maximal: Step 4. Obtaining of the set E of potential solutions of the arithmetic operation ⨂.
Step 5. Calculating the uncertainty degree of each potential solution.
Step 6. The choice of the solution of the arithmetic operation ⨂ from the set with a maximal degree uncertainty: This step implements the well-known principle of maximum entropy.
In the proposed algorithm, the following operations are computationally complex: calculation of the membership function ∈ [0,1] of each element of the fuzzy binary relation ; scanning of all elements of the fuzzy binary relation to determine the maximums of the membership function and their indices ( , ); calculating the uncertainty degree ( ) of each potential solution .
However, in practice, the speed of modern computers allows, without any tangible delay, to calculate a sufficiently large number of arithmetic expressions when solving applied problems.

Numeric Examples
Example 1. Summation of two NFSs with symmetric membership functions. Table 1 shows the two operands and as well as the fuzzy binary relation on Cartesian product and two potential solutions (in bold). The relation has only one element with a maximal degree of membership 6,6 = (9,1.0). The set consists of two potential solutions: 1 = { 6, , = 1, } and 2 = { ,6 , = 1, } which have uncertainty degrees ( 1 ) = 2, ( 2 ) = 1. In accordance with the proposed algorithm, the summation result = {( 6 , 6 ), = 1, } is located in the row and has the support power |S | = 4.
The result of standard fuzzy arithmetic. The summation result , calculated according to the Zadeh's extension principle, is located on the diagonal of the fuzzy relation . The uncertainty degree of this solution is ( ) = 3, and the support power is |Supp | = 6.
As we can see, the proposed algorithm chose the operand with the maximum degree of uncertainty as a solution. However, the support of the resulting NFS is 33% smaller than the support of the result obtained using standard fuzzy arithmetic.
Example 2. Summation of two NFSs with asymmetric membership functions. Table 2 shows the two operands and as well as two potential solutions of their summation. To be able to compare the result with known approaches, the NFSs are taken the same as the NFSs in Fig. 1. This example shows that in some cases the proposed algorithm requires additional conditions for choosing a solution from .
As we see, two NFSs from the set of potential solutions have the same support power; their membership functions are asymmetric with respect to their own maximums, but symmetric with respect to each other. These two decisions have an equal degree of uncertainty: ( 1 ) = ( 2 ) = 2.08, that is, any of these solutions can be the result. What decision the algorithm chooses will depend only on its implementation in the software.
Note that the shape of the membership function in 1 corresponds to operand , and in 2 to operand . Therefore, the membership function of the result will repeat the membership function of one of the operands. If the operands have different support power, the membership function will take the shape of the operand, which has a great degree of uncertainty. This operand contains more information and absorbs operand with a less uncertainty, what can be considered natural from the view-point of the principle of maximum entropy. In other words, the proposed algorithm selects a solution with a maximal degree of uncertainty and at the same time seeks to preserve information about the shape of the membership function of the initial NFSs.
The result of standard fuzzy arithmetic. From the view-point of the principle of maximum entropy, in contrast to the proposed algorithm, standard fuzzy arithmetic preserves the uncertainty of the original operands by increasing the support power, but loses information about the shape of the membership function of the operands. This can be seen in figure 3, where the operand is more flat on the right, the operand is more flat on the left and more uncertain (since Card > Card ). However, the result ( + ) took the form of a fuzzy number with less uncertainty, what defies rational explanation.
In our opinion, the proposed algorithm forms a better solution based on the measurement of uncertainty. Let us consider a change in the support of the NFS as a result of executing several arithmetic operations on the discretized NFSs and shown in Fig. 2. Discretization will not affect the considering, since we are interested in the support, which is presented accurately. Table 3 shows the summation result ( + + + + + ). The result of standard fuzzy arithmetic. As shown above (see Fig. 2), the support of the result |Supp( + + + + )| = 24 is much larger than in our algorithm. In practice, the proposed algorithm allows us to obtain a result suitable for decision making.

Discussion
The use of the proposed algorithm is associated with two questions that require discussion.
Question 1. On the need to observe the properties of standard arithmetic. Judging by the number of publications, many authors consider it necessary to strictly observe the properties of standard arithmetic of real numbers when executing arithmetic operations with fuzzy numbers. However, as was shown above, the effectiveness of standard arithmetic in practice is doubtful due to a sharp increase in uncertainty. These doubts are the motive for revising the requirements for the properties of fuzzy arithmetic and raise a conceptual question: why should fuzzy arithmetic adhere to the rules that were introduced in standard arithmetic? Let's try to answer this question.
Fuzzy sets are an extension of traditional sets. In particular, the concept of fuzzy sets made it possible to use an extended range of values to measure the membership of elements in a set, and also made it possible to present standard sets as a special case of fuzzy sets.
But extension does not mean that the constraints of the original concept remain relevant. On the contrary, it is natural to assume that a special case is produced from a general case by introducing additional constraints that narrow the original concept. Therefore, in our opinion, the desire to extend the properties of arithmetic of real numbers to fuzzy arithmetic is doubtful. This assumption raises the following question: how to change the properties of arithmetic of real numbers?
In our opinion, the answer should flow from the nature of uncertainty as a generalization of certainty. We can agree with the opinion of the study (Mares 1997) regarding the replacement of the relation of strict equivalence by the relation of additive and multiplicative (that is, weak) equivalence. Since fuzzy numerical quantities can be represented as a generalization of standard numerical quantities, it is natural and logical to present the properties of arithmetic operations on fuzzy numbers as a generalization of the properties of standard arithmetic.
Question 2. About the Zadeh's extension principle. According to this principle, the result of an arithmetic operation is formed by union all elements combinations of the support of both operands in order to prevent information loss. This combination is the reason for a sharp increase in the support power of the resulting NFS when calculating the arithmetic expression.
In the first numerical example, you can see that according to the Zadeh's extension principle, the result of the arithmetic operation is located on the diagonal of the relation . However, this is true only for the case of symmetric membership functions of both operands. If we move the maximum of the membership function of one of the operands, then the result support will remain on the diagonal, but the maximum of the membership function will move to another place. That is, in the relation , the resulting NFS will delaminate. Using the supremum operation avoids the influence of this effect, however, because of this, it is difficult to explain the change in the shape of the membership function.
The result calculated on the basis of the Zadeh's extension principle is similar to the diagonal projection of a fuzzy binary relation, which is obtained by convolution using the supremum: Then, the proposed algorithm can be considered as an algorithm for calculating a conditional projection of the same relation , where as the condition is the maximum of the membership function (4). In other words, the proposed algorithm obtains a solution not by convolution of the elements of the relation, but by choosing one of the conditional projections.
Returning to question 1 discussed above, the following can be noted. Since the proposed algorithm uses an additional condition which narrows the generalized solution, the solutions of this algorithm will be more constrained, but preserve the properties of the generalized concept. Table 1 demonstrates the preservation of the properties of traditional fuzzy arithmetic in the proposed algorithm. Screenshots were obtained using the Fuzzy for Excel add-in.

Implementation of the proposed algorithm in Microsoft Excel
Many researchers did not consider the developed algorithms only as scientific advances. They implemented these algorithms with the help of special software packages, such as "Mathematica", and used them to solve applied problems (Chen S-M 1996;Kosheleva et al. 1998;Zimmermann and Zysno 1983;Kochegurova and Martynova 2020). Sometimes researchers themselves developed special programs (Koleśnik et al. 2004;Gagolewski and Caha 2018;Marin et al. 2016). However, these programs have not become widespread due to the narrow specialization or complexity of the user interface. In other words, the problem of the availability of fuzzy arithmetic for a wide range of engineers and analysts remains relevant.
Therefore, the authors developed the "Fuzzy for Excel" add-in for Microsoft Excel office software, which is widely used to solve applied problems in various fields of science, technology and business. This add-in can be downloaded for free from the link: https://www.dropbox.com/s/2qre4sfuo3jawie/Fuzzy%20for%20Excel%2064 bit.zip?dl=0.
Installation of the add-in does not require special knowledge and is performed in accordance with the guide.
To simplify in the add-in numerical fuzzy sets are called as fuzzy numbers. They are represented in the form of discretized fuzzy sets, which have 21 pairs (support value / membership function value). The add-in implements many tools and functions that provide the creation, processing and analysis of numerical fuzzy sets. The add-in also contains several functions for describing and processing uncertainty using fuzzy Sugeno measures (Sugeno 1974) and fuzzy integrals. The basics of using the add-in, as well as descriptions of tools and functions, are contained in the help system.

Conclusion
The proposed algorithm for fulfiling arithmetic operations preserves the uncertainty nature of operands and does not contradict the basic properties of standard fuzzy arithmetic. The algorithm limits the increase in the support of the resulting NFS, what allows to improve the data quality for decision-making in applied problems. This is especially important when executing a large number of arithmetic operations. The proposed algorithm has great computational complexity, but this is not an obstacle to the implementation of the algorithm in software, given the speed of modern computers.

Declarations
Compliance with Ethical Standards: Funding. The authors did not receive support from any organization for the submitted work.
Financial and non-financial interests. All authors certify that they have no affiliations with or involvement in any organization or entity with any financial interest or non-financial interest in the subject matter or materials discussed in this manuscript.
Research involving Human Participants and/or Animals: This article does not contain any studies with human participants or animals performed by any of the authors.
Informed consent: not required