ALGORITHM AND WEB APPLICATION FOR AUTOMATIC GENERATION OF ALGEBRAIC EQUATIONS FOR COGNITIVE TRAINING

Main Article Content

Oleksandr LYSENKO
Yevgeny TATARCHUK

Abstract

Introduction. In modern society, maintaining cognitive functions has become
increasingly important. Older people face gradual memory decline and reduced thinking speed, while
younger generations tend to lose mental arithmetic skills due to excessive reliance on calculators and
digital technologies. Existing games for cognitive stimulation (Math Puzzle, Math Fight,
Mathemagics) demonstrate the potential of this approach, but share common limitations: no web
versions, overloaded interfaces, or strict paid-use conditions, which reduce their accessibility for a
wide range of users.
Purpose. The aim of this work is to analyze existing games for cognitive stimulation, to develop
a proprietary cross-platform web application, and to describe a custom library for automatic
generation and verification of algebraic equations based on an Abstract Syntax Tree (AST) parser.
Results. Three well-known cognitive training games were analyzed and their advantages and
disadvantages identified. Based on this analysis, a web application was developed with cross-platform
and mobile-adaptive support, a REST API architecture, a level system with gradually increasing
difficulty, and an ad-free interface. The core of the application is a proprietary algorithm for
generating all valid algebraic equations from a given number, implemented using a recursive AST
parser with progressive reduction of operator precedence. To optimize performance, the library was
compiled from Python to a C extension using MyPyc. A comparative RAM consumption analysis using
the Tracemalloc library demonstrated that the built-in Python eval function produces excessive
memory allocations when processing large sets of equations, whereas the custom library maintains a
significantly more stable memory profile.
Conclusion. A web application for cognitive training was developed with adaptation for mobile
devices. A custom algorithm and library for generating and verifying algebraic equations were
implemented and tested. The proprietary AST-based parser outperforms the built-in eval function in
memory efficiency when handling large equation arrays. The practical value of the work lies in its
applicability for supporting and developing cognitive functions in both elderly people and youth. The
theoretical contribution consists in the formalization of an equation-generation method using AST and
the analysis of algorithm efficiency in terms of resource consumption.

Article Details

How to Cite
LYSENKO , O., & TATARCHUK, Y. (2025). ALGORITHM AND WEB APPLICATION FOR AUTOMATIC GENERATION OF ALGEBRAIC EQUATIONS FOR COGNITIVE TRAINING. Cherkasy University Bulletin: Applied Mathematics. Informatics, (1). https://doi.org/10.31651/2076-5886-2025-1-32-45
Section
Прикладна математика
Author Biographies

Oleksandr LYSENKO , Bohdan Khmelnytsky National University of Cherkasy

Student majoring in Applied Physics and Nanomaterials at Bohdan Khmelnytsky National University
of Cherkasy, Ukraine

Yevgeny TATARCHUK, Bohdan Khmelnytsky National University of Cherkasy

Candidate of Physical and Mathematical Sciences, Associate Professor of the Department of Physics,
Bohdan Khmelnytsky National University of Cherkasy, Ukraine

References

The Impact of Action Video Game Training on Mathematical Abilities in Adults. [Electronic resource] –

Access mode: https://journals.sagepub.com/doi/full/10.1177/2332858417740857.

The effects of two digital educational games on cognitive and non-cognitive math and reading outcomes.

[Electronic resource] – Access mode:

https://www.sciencedirect.com/science/article/abs/pii/S0360131519302337.

Influence of game-based learning in mathematics education on the students' cognitive and affective domain:

A systematic review. [Electronic resource] – Access mode:

https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2023.1105806/full

Game-Based Training to Promote Arithmetic Fluency. [Electronic resource] – Access mode:

https://www.frontiersin.org/journals/education/articles/10.3389/feduc.2019.00118/full.

Evaluating the effectiveness of a game-based rational number training - In-game metrics as learning

indicators. [Electronic resource] – Access mode:

https://www.sciencedirect.com/science/article/pii/S0360131518300125.

Python 3.10. [Electronic resource] – Access mode: https://www.python.org/downloads/release/python-

/.

C. [Electronic resource] – Access mode: https://www.c-language.org/.

Mypyc. [Electronic resource] – Access mode: https://mypyc.readthedocs.io/en/latest/introduction.html.

Flask. [Electronic resource] – Access mode: https://flask.palletsprojects.com/en/stable/.

What is REST API? [Electronic resource] – Access mode: https://www.redhat.com/en/topics/api/what-is-arest-api.

JavaScript. [Electronic resource] – Access mode: https://css.in.ua/js/objects.

HTML5. [Electronic resource] – Access mode: https://css.in.ua/article/shcho-take-css_3.

CSS3. [Electronic resource] – Access mode: https://css.in.ua/css/properties.

JSON. [Electronic resource] – Access mode: https://www.json.org/json-en.html.

WebStrom. [Electronic resource] – Access mode: https://www.jetbrains.com/ru-ru/webstorm/.

Math-Equation-lib. [Electronic resource] – Access mode: https://github.com/Sasha376slysenko/MathEquation-lib.

Recursion in Python.. [in Ukrainian] [Electronic resource] – Access mode: https://acode.com.ua/recursionpython/.

Lexical analyzer. [in Ukrainian] [Electronic resource] – Access mode:

https://www.guru99.com/uk/compiler-design-lexical-analysis.html.

Deepsource // AST. [Electronic resource] – Access mode: https://deepsource.com/blog/python-asts-bybuilding-your-own-linter.