# Complexity of Mathematical Expressions and Its Application in Automatic Answer Checking

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Data Format of MACP

`[{`

`"name":"<check item name>",`

`"cmd":"<check command>",`

`"response":"<response list>",`

`"exprs":[{`

`"expr":"<expression name>",`

`"encoding":"<encoding format>",`

`"role":"<expression role>",`

`"value":"<expression itself>",`

`"form":"<required expression form>",`

`"op":"<question operation>",`

`"var":"<variables>"`

`},…]`

`},…]`

`cmd`parameter in the request data is to set answer checking command in each check item. The symbols of

`=`,

`~`,

`&`, and

`|`could be used in the answer checking command to express the logic relationship of expressions. The following is an example of a check rule command.

`(u1=s1 & u2=s2)|(u1=s2 & u2=s1)`

`u1`and

`u2`are two expressions of a user answer and

`s1`and

`s2`are two expressions of a standard answer. The MACP service verifies the equivalence of the user answer and standard answer under the logical sequence of the check rule command. The check rule command in above example could be used in the questions of solving quadratic equations.

`response`parameter lists all of the response data that a client wants to get. It may include MathML, infix, or OpenMath code of any expression. The request data of MACP could contain answer grade rules: the given syntax form or simplest form (see Section 3 for details). The following is an example of the

`response`parameter.

`s1.mmlp,u2.openmath,q1.answer.mmlc,u1.sim`

`s1`, the OpenMath code of expression

`u2`, the MathML content code of the answer expression of question

`q1`, and the result of whether

`u1`being in the simplest form are included in the response data.

`op`parameter could be written in the request data to specify what types of operations should be implemented in order to generate standard answers. Table 1 lists a series of operation types in MACP. The following is a real example of MACP request data that is to check user answers $\frac{-4-\sqrt{80}}{4}$ and $\sqrt{5}-1$ of an equation question 2x

^{2}+ 4x = 8.

**Example**

**1.**

`checkcmd=’[{`

`name:c1,`

`cmd:"[s1,s2]=solve(q1) & ((u1=s1&u2=s2)|(u1=s2&u2=s1))",`

`response:"s1.mmlp,s2.mmlp",`

`exprs:[`

`{expr:u1,encoding:infix,role:usrAnswer,value:"(-4-sqrt(80))/4)"},`

`{expr:u2,encoding:infix,role:usrAnswer,value:"sqrt(5)-1"},`

`{expr:q1,encoding:infix,role:Question,value:"2*x^2+4*x=8"}]}]’;`

`params="checkcmd="+ encodeURIComponent(checkcmd);`

`var murl="http://boar.cs.kent.edu/aacs.php";`

`send_request(murl,params,prca);`

`response`parameter lists every value for each request item.

`[{`

`"name":"<check item name>",`

`"status":"<status>",`

`"correctness":"<correctness>",`

`"details":"<details>",`

`"response":[`

`{`

`"rname":"<response item name>",`

`"value":"<response item value>"`

`},…]`

`},…`

`]`

**Example**

**2.**

`[{`

`"name":"c1",`

`"status":"normal",`

`"correctness":"90%",`

`"details":"<u1> is not simplest",`

`"response":[`

`{"rname":"s1.mmlp",`

`"value":"<math><mrow><mo>-</mo><mn>1</mn><mo>-</mo><msqrt><mn>5</mn></msqrt>`

`</mrow></math>"},`

`{"rname":"s2.mmlp",`

`"value":"<math><mrow><mo>-</mo><mn>1</mn><mo>+</mo><msqrt><mn>5</mn></msqrt>`

`</mrow></math>"`

`}]`

`}]`

## 3. Answer Grade Rule

## 4. Overview of Simplified Form

**Example**

**3.**

- (a)
- $\frac{1}{3}+\frac{2}{5}$
- (b)
- $\frac{(\sqrt{{3}^{2}-3}+1)(\sqrt{3}\ast \sqrt{2}-1)}{(\sqrt{3}+1)(\sqrt{3}-1)}$
- (c)
- $(3{x}^{2}+2x-1)({x}^{3}+5)$

- To assess the ability of students to simplify a mathematical expression. The process of algebra simplification requires various mathematical knowledge and abilities. Otherwise, for learning, mathematics have the particular serial character, and earlier knowledge is required as a prerequisite for a later one. The implicit aim of expression simplification is to assess the mastery of earlier knowledge.
- To put the answer in a form in which it is easier to justify the correctness of the answer. For the simplified form of an answer, it is mostly a canonical form or a simpler form, and it is easy to compare with the standard answer. The amount of possible totally correct answers is less in the simplified form.
- In general, a simplified expression is much easier for human beings to understand and more convenient for human beings to process, such as writing it on the paper and communication with other people. One of important purpose of mathematics itself is to use some easy forms to express complicated problems.

## 5. The Complexity of a Mathematical Expression

**Definition**

**1.**

## 6. Representation Complexity

#### 6.1. Kolmogorov Complexity and Binary Lambda Calculus

**Definition**

**2.**

#### 6.2. Calculation Method of Representation Complexity

**M**a bit string $\langle \mathbf{M}\rangle $. If

**M**is a Turing machine, which, on input w outputs string x, then the concatenated string $\langle \mathbf{M}\rangle w$ is a description of x. One of the important directions of this calculation method is to crush the expression object into pieces that are as small as possible.

## 7. Computation Complexity

**Theorem**

**1.**

## 8. Answer and Score

**Definition**

**3.**

- $m\left(E\right)\in \xi $,
- if $E\sim 0$, $m\left(E\right)\equiv 0$, and
- for all ${E}_{1}\in \xi $ and ${E}_{2}\in \xi $, $m\left({E}_{1}\right)\equiv m\left({E}_{2}\right)$.

**Definition**

**4.**

## 9. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Brown, K.; Lally, V. Rhetorical relationships with students: A higher education case study of perceptions of online assessment in mathematics. Res. Comp. Int. Educ.
**2018**, 13, 7–26. [Google Scholar] [CrossRef] [Green Version] - Erabadda, B.; Ranathunga, S.; Dias, G. Computer aided evaluation of multi-step answers to algebra questions. In Proceedings of the 2016 IEEE 16th International Conference on Advanced Learning Technologies, Austin, TX, USA, 25–28 July 2016; pp. 199–201. [Google Scholar]
- Hoogland, K.; Tout, D. Computer-based assessment of mathematics into the twenty-first century: Pressures and tensions. ZDM Math. Educ.
**2018**, 675–686. [Google Scholar] [CrossRef] - Ruijter, M.K.; Draaijer, S. Digital exams in engineering education. In Technology Enhanced Assessment; Springer: Cham, Switzerland, 2018; pp. 140–164. [Google Scholar]
- Wang, P.; Mikusa, M.; Al-shomrani, S.; Chiu, D.; Lai, X.; Zou, X. Features and advantages of wme: A web-based mathematics education system. In Proceedings of the IEEE SoutheastCon, Ft. Lauderdale, FL, USA, 8–10 April 2005. [Google Scholar]
- Helen, S.A.; Cliff, E.B.; Athol, A.K.; Martin, A.Y. Incorporating partial credit in computer aided assessment of mathematics in secondary education. Br. J. Educ. Technol.
**2006**, 37, 93–119. [Google Scholar] - Chaachoua, H.; Nicaud, J.F.; Bronner, A.; Bouhineau, D. APLUSIX, A learning environment for algebra, actual use and benefits. In Proceedings of the International Congress on Mathematics Education, Copenhagen, Denmark, 4–11 July 2004. [Google Scholar]
- Christopher, J.S. Assessing elementary algebra with stack. Int. J. Math. Educ. Sci. Technol.
**2007**, 38, 987–1002. [Google Scholar] - Christopher, J.S. Implementing computer algebra enabled questions for the assessment and learning of mathematics. Int. J. Technol. Math. Educ.
**2008**, 15, 3–18. [Google Scholar] - Genemo, H.; Miah, S.J.; McAndrew, A. A design science research methodology for developing a computer-aided assessment approach using method marking concept. Educ. Inf. Technol.
**2016**, 21, 1769–1784. [Google Scholar] [CrossRef] - Ashton, H.; Wood, C. Use of online assessment to enhance teaching and learning: The pass-it project. Eur. Educ. Res. J.
**2006**, 5, 122–130. [Google Scholar] [CrossRef] - Nicaud, J.; Bouhineau, D.; Chaachoua, H. Mixing microworld and cas features in building computer systems that help students learn algebra. Int. J. Comput. Math. Learn.
**2004**, 9, 169–211. [Google Scholar] [CrossRef] - Su, W.; Li, L.; Cai, C.; Wang, P.S. An intelligent mathematics assessment system. In Proceedings of the 2009 International Conference on Computational Intelligence and Software Engineering, Wuhan, China, 11–13 December 2009; pp. 1–4. [Google Scholar]
- Wang, P.S. On automatic mathematical answer checking. In Presentation in ECCAD; Shepherd University: Shepherdstown, WV, USA, 2008. [Google Scholar]
- Su, W.; Wang, P.S.; Li, L. An on-line mathML editing tool for web applications. In Proceedings of the International Multi-Symposiums on Computer and Computational Sciences, Iowa City, IA, USA, 13–15 August 2007. [Google Scholar]
- Christopher, J.S.; Nadine, K. Automation of mathematics examinations. Comput. Educ.
**2016**, 94, 215–227. [Google Scholar] - Sangwin, C.J. Practice and practise in university: What defines success and how does online assessment support achieving this. In Success in Higher Education; Springer: Singapore, 2017; pp. 111–130. [Google Scholar]
- Buchberger, B.; Collins, G.E.; Loos, R.; Albrecht, R. Computer algebra symbolic and algebraic computation. ACM SIGSAM Bull.
**1982**, 16, 11–44. [Google Scholar] [CrossRef] - Caviness, B.F. On canonical forms and simplification. J. Assoc. Comput. Mach.
**1970**, 17, 385–396. [Google Scholar] [CrossRef] [Green Version] - Fitch, J.P. On algebraic simplification. Algebr. Simpl.
**1973**, 16, 23–27. [Google Scholar] [CrossRef] [Green Version] - Carette, J. Understanding expression simplification. In Proceedings of the 2004 International Symposium on Symbolic and Algebraic Computation, Santander, Spain, 4–7 July 2004; pp. 72–79. [Google Scholar]
- Moses, J. Algebraic simplification a guide for the perplexed. In Proceedings of the Second ACM Symposium on Symbolic and Algebraic Manipulation, New York, NY, USA; 1971; pp. 282–304. [Google Scholar]
- Fenichel, R.R. An On-Line System for Algebraic Manipulation. Ph.D. Thesis, Harvard University, Cambridge, MA, USA, 2008. MAC-TR-35. [Google Scholar]
- Billing, J.; Wehmeier, S. Rule-Based Simplification of Expressions. mathPAD Band. 2002, pp. 36–43. Available online: http://msdl.cs.mcgill.ca/people/indrani/mupad_doc.pdf (accessed on 24 January 2021).
- Awde, A.; Bellik, Y.; Tadj, C. Complexity of mathematical expressions in adaptive multimodal multimedia system ensuring access to mathematics for visually impaired users. Int. J. Comput. Inf. Sci. Eng.
**2008**, 2, 152–195. [Google Scholar] - Li, M.; Vitanyi, P. An Introduction to Kolmogorov Complexity and Its Applications; Springer: Cham, Switzerland, 2019. [Google Scholar]
- Tromp, J. Binary lambda calculus and combinatory logic. In Randomness and Complexity, From Leibniz to Chaitin; University of Auckland: Auckland, New Zealand, 2007; pp. 237–260. Available online: https://www.worldscientific.com/worldscibooks/10.1142/6577 (accessed on 24 January 2021).
- Henk, B. The lambda calculus: Its syntax and semantics. In Studies in Logic and the Foundations of Mathematics; North-Holland: Amsterdam, The Netherlands, 1984. [Google Scholar]
- Henk, B. Lambda calculi with types. In Handbook of Logic in Computer Science; Oxford University Press: Oxford, UK, 2008; Volume II. [Google Scholar]
- de Bruijn, N.G. Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the church-rosser theorem. In Studies in Logic and the Foundations of Mathematics; North-Holland: Amsterdam, The Netherlands, 1994; Volume 133, pp. 375–388. [Google Scholar]
- Vereshchagin, N.; Vitanyi, P. Kolmogorov structure function with an application to the foundations of model selection. In Proceedings of the 47th IEEE Symposium on Foundations of Computer Science, Vancouver, BC, Canada, 19 November 2002; IEEE: New York, NY, USA, 2002; pp. 751–760. [Google Scholar]
- Liu, Y. Computational symmetry. Symmetry 2000
**2002**, 80, 231–245. [Google Scholar]

Name | Description |
---|---|

derivative | compute the derivative of the expression |

factor | factor the expression |

simplify | simplify the expression |

logarithm_rewrite | write the expression as a sum or difference of logarithms |

equation | solve equation |

inequality | solve the inequality |

gcd | greatest common divisor |

lcf | lowest common factor |

Rewrite Rule | Complexity |
---|---|

$A\_+0\to A$ | 3 |

$A\_\ast 0\to 0$ | 3 |

$A\_-A\_\to 0$ | 3 |

$A{\_}^{m\_Num}\ast B{\_}^{n\_Num}\to {x}^{m+n}$ | 7 |

$m\_Num\ast x\_+n\_Num\ast x\_\to (m+n)\ast x$ | 8 |

${sin}^{2}(x\_)+{cos}^{2}(x\_)\to 1$ | 6 |

Operation | Expression | Complexity |
---|---|---|

Addition | m + n | $\lceil {log}_{10}x\rceil $ |

(x is the larger of $\left|m\right|$ and $\left|n\right|$) | ||

Subtraction | m − n | $\lceil {log}_{10}x\rceil $ |

(x is the larger of $\left|m\right|$ and $\left|n\right|$) | ||

Multiplication | m × n | $\lceil {log}_{10}(x$×${log}_{2}\left(x\right)$×$\left({log}_{2}{log}_{2}\left(x\right)\right))\rceil $ |

(x is the larger of $\left|m\right|$ and $\left|n\right|$) | ||

Division | $m/n$ | $\lceil {log}_{10}\left({n}^{2}\right)\rceil $ |

(x is the larger of $\left|m\right|$ and $\left|n\right|$) | ||

Square Root | $\sqrt{m}$ | $\lceil {log}_{10}\left({m}^{2}\right)\rceil $ |

Exponent | ${m}^{n}$ | $\lceil 1+{log}_{10}\left({m}^{n}\right)\rceil $ |

Root | $\sqrt[n]{m}$ | $\lceil 1+{log}_{10}\left({m}^{n}\right)\rceil $ |

① $\frac{\frac{1}{\mathit{y}+7}-\frac{1}{\mathit{y}}}{\frac{1}{\mathit{y}}}$ | ② $\frac{\frac{\mathit{y}-(\mathit{y}+7)}{\mathit{y}\ast (\mathit{y}+7)}}{\frac{1}{\mathit{y}}}$ | ③ $\frac{\frac{1}{\mathit{y}+7}}{\frac{1}{\mathit{y}}}-\frac{\frac{1}{\mathit{y}}}{\frac{1}{\mathit{y}}}$ | ④ $\frac{\mathit{y}(\frac{1}{\mathit{y}+7}-\frac{1}{\mathit{y}})}{1}$ |

⑤ $\frac{\frac{y}{y+7}-\frac{y}{y}}{1}$ | ⑥ $y(\frac{1}{y+7}-\frac{1}{y})$ | ⑦ $\frac{y(y-(y+7\left)\right)}{y(y+7)}$ | ⑧ $\frac{\frac{y-y-7}{y(y+7)}}{\frac{1}{y}}$ |

⑨$\frac{y}{y+7}-\frac{\frac{1}{y}}{\frac{1}{y}}$ | ⑩ $\frac{\frac{1}{y+7}}{\frac{1}{y}}-1$ | ⑪ $\frac{\frac{y}{y+7}-1}{1}$ | ⑫ $\frac{y}{y+7}-\frac{y}{y}$ |

⑬ $\frac{y(y-y-7)}{y(y+7)}$ | ⑭ $\frac{y-(y+7)}{y+7}$ | ⑮ $\frac{\frac{-7}{y(y+7)}}{\frac{1}{y}}$ | ⑯ $\frac{y}{y+7}-1$ |

⑰ $\frac{y(-7)}{y(y+7)}$ | ⑱ $\frac{y-y-7}{y+7}$ | ⑲ $\frac{-7}{y+7}$ |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Su, W.; Cai, C.; Wang, P.S.; Li, H.; Huang, Z.; Huang, Q.
Complexity of Mathematical Expressions and Its Application in Automatic Answer Checking. *Symmetry* **2021**, *13*, 188.
https://doi.org/10.3390/sym13020188

**AMA Style**

Su W, Cai C, Wang PS, Li H, Huang Z, Huang Q.
Complexity of Mathematical Expressions and Its Application in Automatic Answer Checking. *Symmetry*. 2021; 13(2):188.
https://doi.org/10.3390/sym13020188

**Chicago/Turabian Style**

Su, Wei, Chuan Cai, Paul S. Wang, Hengjie Li, Zhen Huang, and Qiang Huang.
2021. "Complexity of Mathematical Expressions and Its Application in Automatic Answer Checking" *Symmetry* 13, no. 2: 188.
https://doi.org/10.3390/sym13020188