# P System with Fractional Reduction
## 4 Fractional Simplification P System
### P System for Fraction Simplification in the Division Algorithm
#### 4.3.2 Membrane Rules for Combining the Two Methods  
As can be seen from Section 4.1 of the more phase derogation algorithm P System, if the difference between the numerator and denominator is too large, the number of dynamically generated membranes is too large, and if Section 4.2 of the division algorithm is used, each division is equivalent to multiple subtractions, making the number of subtraction steps too heavy for a membrane System. For this reason, this sub-section discusses in detail the fraction simplification of the P System using a combination of the idea of a more phase derogation algorithm and a division algorithm. The process of fraction simplification using the combination of the two methods consists of finding the sequence \(\{a_{i}\},\{b_{i}\},\{u_{i}\},\{z_{i}\}\), the intermediate values \(m\), \(n\) of the method transformation, the greatest common divisor \(x_{1}\), the result of the reduction of the intermediate values \(k_{1}\), \(l_{1}\), and the sequence \(\{p_{i}\}\), \(\{q_{i}\}\). Combining the design ideas of the two P Systems in Sections 4.1 and 4.2, it can be seen that all membrane structures require only addition and subtraction to complete the calculation of fractional simplification, as shown in Figure 9.  
The following is a specific description of the membrane rules. (1) Calculate the larger value of the partition a and the smaller value of b. The multiset \(a^{x}b^{y}ct\) (here \(x\) is the numerator value and \(y\) is the denominator value) is put into the membrane M\({}_{1}\), and the magnitudes of the numerator and denominator are compared in the membrane M\({}_{1}\). When the numerator is greater than the denominator, the number of objects \(a\) and \(b\) are directly passed into the membrane A\({}_{1}\); otherwise, the rules are executed to convert the object \(b\) to \(a\) and directly passed to the membrane A\({}_{1}\) and swapping the order of numerators and denominators in membrane A\({}_{1}\). At this point,  
Figure 8: Process diagram for solving the example of the rolling phase division P System. there are no other rules to execute in membrane M\({}_{1}\), so we wait for membrane A\({}_{1}\) to finish calculating the intermediate values \(m\),\(n\) and then continue the execution. Now the number of objects \(a\) and \(b\) in each layer of class A membrane is designed as a sequence \(\{a_{i}\}\), \(\{b_{i}\}\). For example, the number of object \(a\) in membrane A\({}_{1}\) is \(a_{1}\), and the number of \(b\) in membrane \(A_{t_{1}}\) is \(b_{t_{1}}\). Figure 9: Flow chart for solving the combined method P System. (**a**) Flow chart for the combination of the two methods to find the intermediate values m, n\({}_{i}\) (**b**) Flow chart for finding the maximum common divisor by the division algorithm; (**c**) Flow chart for the sequence \(\{p_{i}\}\), \(\{q_{i}\}\) by the more phase derogation algorithm. Initialize the membrane A\({}_{1}\) in \(a_{1},b_{1}\). The rules are as follows: \[ \begin{array}{ll}r_{1}:(\text{a}\text{b}\to\text{g},1)&r_{2}:(\text{a}\to\text{ a}2(\text{a}\text{ Num},\text{in all})\mid_{\text{g}},2)\\ r_{3}:(\text{b}\to\text{b}2(\text{a}\text{Num},\text{in all})\mid_{\text{g}},2)&r_{4}:( \text{g}\to(\text{a}\text{ b}\text{ Num},\text{in all}),3)\end{array} \] (i) When \(x>y\), the rules within membrane M\({}_{1}\) are executed in the following order: \(r_{1}\to r_{2}\to r_{4}\). (a) Execution rule \(r_{1}\): objects \(a\) and \(b\) are consumed and the multiset \(a^{y}b^{y}\) generates the multiset \(g^{y}\), with \(a^{x-y}\) remaining.