# P System with Fractional Reduction
## 4 Fractional Simplification P System
### P System for Fraction Simplification in the Division Algorithm
#### 4.2.3 Example of Fraction Simplification by the Division Algorithm  
In this subsection, we will give an example to describe in detail how to implement fractional simplification using the division algorithm P System. For example, the reduction process for \(6/15\) is shown in Figure 7:  
The following details the execution process of rules in this P System. (1) Initial pattern  
As shown in Figure 7a, the initial multiset \(m^{6}n^{15}ct\) of this System is first put into the membrane M\({}_{1}\), and the membrane A\({}_{1}\) has the initial object \(c\) and the object _CreateSubMem_. The object \(n\) is used to represent the denominator of the fractional equation with the number of \(15\), and the object \(m\) is used to represent the numerator of the fractional equation with the number of \(6\). First execute the rule r\({}_{1}\) six times, and the multi-set \(m^{6}n^{6}\) is completely consumed to generate the object \(g^{6}\); then execute the rule r\({}_{3}\) nine times under the condition of having the object \(g\). The remaining object \(n^{9}\) evolves into \(b^{9}\) and generates the objects \(a^{9}\) and \(Num^{9}\) into the membrane A\({}_{1}\), while \(g^{6}\) generates the multi-set \(a^{6}b^{6}\) and passes \(a^{6}b^{6}Num^{6}\) to the membrane A\({}_{1}\). At this time, there is no other executable rule in the membrane M\({}_{1}\), so wait for the end of the execution of the membrane of class A to continue the execution. The initialized multiset in membrane A\({}_{1}\) is \(a^{15}b^{6}cNum^{15}CreateSubMem\). (2) Calculate the maximum common divisor x\({}_{1}\) (i) Execute rules in the following order: \(\{\texttt{r}_{1},\texttt{r}_{7}\}\rightarrow\{\texttt{r}_{2},\texttt{r}_{14 }\}\rightarrow\texttt{r}_{3}\rightarrow\texttt{r}_{4}\). In membrane A\({}_{1}\), execute rule r\({}_{1}\) 6 times to generate object \(x^{6}\), while executing rule r\({}_{7}\), under the condition of having b directly consume _CreateSubMem_ and a \(Num\) to generate submembrane A\({}_{2}\) for backup. The existing object in Membrane A\({}_{1}\) is \(a^{9}x^{6}c\). Execute rule r\({}_{2}\) to evolve object \(c\) to \(y\) under the condition that object \(x\) exists, while executing r\({}_{14}\) to pass the remaining Num value into submembrane A\({}_{2}\). At this point, only the rule r\({}_{3}\) can be executed, in the role of catalyst \(a\) object \(y\) evolved to \(d\); according to the conditions of the implementation of the rule r\({}_{4}\), the object \(x^{6}\) evolved to \(b^{6}\); implementation of the rule r\({}_{5}\), the object \(d\) evolved to \(c\); at this time, the r\({}_{1}\) condition is met again, and the multiset in the membrane A\({}_{1}\) is \(a^{3}b^{6}c\), after the rules are executed in the order of \(\texttt{r}_{1}\to\texttt{r}_{2}\to\texttt{r}_{3}\to \texttt{r}_{4}\). (ii) At this time a \(<\) b, the rules are executed in the order of \(\texttt{r}_{1}\to\texttt{r}_{2}\to\texttt{r}_{6}\rightarrow\{\texttt{r}_{7}, \texttt{r}_{8}\}\rightarrow\{\texttt{r}_{9},\texttt{r}_{10},\texttt{r}_{11}\}\); execute the rule r\({}_{1}\) three times to generate the multiset \(x^{3}\); execute the rule r\({}_{2}\), and the object \(c\) evolves into the object \(y\); thus, at this time the multiset in the membrane A\({}_{1}\) is \(x^{3}b^{3}y\); this case can only execute the rule r\({}_{6}\), converting the multiset \(b\) and \(y\) to the multiset \(b\)_e_g_; then execute the rule r\({}_{8}\), converting the object \(g\) to \(h\) ; under the condition that \(h\) exists at the same time, execute the rules r\({}_{9},\texttt{r}_{10},\texttt{r}_{11}\), generating \(a^{3}b^{3}c\) passed to membrane A\({}_{2}\).