# Explanation of Air Quality Data Using Takagi-Sugeno Fuzzy Inference System
## 3 Fuzzy Sets and Fuzzy Logic  
Let us introduce the basic ideas of fuzzy sets and fuzzy logic. The first work about these mathematical structures was published in 1965 by [PERSON] (see [4]). Fuzzy sets represent an extension of classical sets. They were designed to mathematically work with the concepts in the natural language. We can start our description with classical sets. We have some domain of elements \(\mathbb{X}\). When using classical sets \(A\), we know that an element \(x\) from \(\mathbb{X}\) uniquely belongs to set \(A\) or uniquely does not belong to set \(A\). Then, by using the so-called characteristic function of set \(A\), which is denoted by \(\chi_{A}\), we assign the value 1 to \begin{table}
\begin{tabular}{c c c} \hline \hline \# & **Input Variables** & **Units** \\ \hline IN1 & Wind direction & Degrees \\ IN2 & Direction of max. wind gust & Degrees \\ IN3 & Average wind speed & Metres per second \\ IN4 & Speed of max. wind gust & Metres per second \\ IN5 & Total rainfall & Millimetre \\ IN6 & Air temperature & Degree Celsius \\ IN7 & Intensity of vehicles & Integer \\ IN8 & Average speed of vehicles & Kilometres per hour \\ IN9 & Day of the week & Integer \\ IN10 & Hour of the day & Integer \\ \hline \multicolumn{2}{c}{**Output Variable**} & **Units** \\ \hline OUT & \(PM_{10}\) value & Microgram per cubic meter \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Used variables, their units and order. the elements that belong to set \(A\) and we assign the value \(0\) to those elements that do not belong to set \(A\). Then, we write:  
\[\chi_{A}:\mathbb{X}\rightarrow\{0,1\},\ \ \chi_{A}(x)= \begin{cases}1,&x\in A,\\ 0,&x\
otin A.\end{cases}  \tag{1}\]  
The characteristic function represents a transition from classical sets to classical logic. Fuzzy sets were designed for working with elements which do not belong to the considered set exactly. In such a case, when we claim that some elements belong to a set to some degree, that is, not unambiguously, it is appropriate to use fuzzy sets. For example, consider _high air temperature in summer_. There is no specific value which divides temperature values into high and low, as this depends on the observer. It is simple to imagine other measurements with the same properties, such as the strength of wind or the intensity of vehicles. For each element from the domain, fuzzy sets assign a certain degree of membership to the set. The function which assigns the degree of membership is called the membership function, it is denoted by \(\mu\), and it maps to the interval \([0,1]\). The utilisation of fuzzy sets is simple, since each fuzzy set is uniquely determined by its membership function. In such a case, when we use fuzzy sets, we assign the value \(1\) to the points that clearly belong to the considered set. We assign the value \(0\) to the points that clearly do not belong to the given set, and to the remaining elements, we assign a value from the interval \((0,1)\), for example by connecting the previous endpoints with a straight line. As an example, Figure 2 displays the membership function modelling the _high temperature in summer_ problem mentioned above. From this figure, we can see that the considered domain for _temperature in summer_ is a set \(\mathbb{X}=[0,50]\). The temperatures from the interval \([30,35]\) surely belong to the set _high temperature in summer_ (they were assigned a value of \(1\)). The temperatures from the intervals \([0,20]\) and \([40,50]\) surely do not belong to the set _high temperature in summer_ (they were assigned a value of \(0\)). The temperature values from the interval \([20,30]\) were assigned a degree of membership to the set _high temperature in summer_ by simply connecting the points \(A[20\;0]\) and \(B[30\;1]\) with a straight line. Similarly, the temperature values from the interval \([35,40]\) were assigned a degree of membership to the set _high temperature in summer_ by simply connecting the points \(C[35\;1]\) and \(D[40\;0]\) with a straight line.