Computational Thinking Education pp 167-181 | Cite as

# Teaching Computational Thinking Using Mathematics Gamification in Computer Science Game Tournaments

## Abstract

One of the key foundations in computer science is abstract algebra. Ideas of abstract algebra can be introduced to students at middle or pre-college schools to cultivate their capacity for logical thinking and problem-solving skills as well as gaining mathematical competency required in computer science. In this book chapter, we introduce ideas of mathematics gamification and a mobile app game, Algebra Game, richly rooted in abstract algebra and first proposed by the mathematician Tao (Gamifying algebra, 2012a, Software mock-up of algebra game 2012b). The Algebra Game teaches elementary algebra seemingly on the surface, and yet the game-play design possesses interesting abstract algebra ideas and mathematics gamification potential. We define mathematics gamification as the process of embedding mathematical concepts and their logical manipulations in a puzzle game-like setting aided by computers. We describe several mathematics gamification instances to enrich the Algebra Game play. Finally, we evaluate the learning efficacy of the Algebra Game mobile app software in computer science game tournaments modeled after eSports-like computer games in order to scale up the number of students who can learn the Algebra Game mathematics.

## Keywords

Mathematics education Mathematics gamification Mobile app games Pedagogy Personalized learning K-12 mathematics Computer science## 10.1 Introduction

Marvin Minsky, in his 1970 Turing Award Lecture, asserted that “*The computer scientist thus has a responsibility to education…how to help the children to debug their own problem*-*solving processes.*” (Minsky 1970). Minsky pointed out that cultivating the capacity for logical thinking and problem-solving skills of students, while they are young, to learn foundational subjects such as mathematics is of the essence. The emphasis is on the tools and motivations for students to acquire problem-solving skills in lifelong learning of mathematics. Computer science and its software technologies might just offer an intriguing way for students to persist and persevere in learning mathematics. We described a preliminary pedagogical study on learning K-12 mathematics through mathematics gamification ideas and tested it at a computer science tournament in Hong Kong.

We define *mathematics gamification* as the process of embedding mathematical concepts into puzzle game-like instantiations that are aided by computing technologies. We focus on the software development for typical computing technologies run on a mobile device of the learner. Game playing is essentially the manipulative of mathematical objects or structures in a logical manner such to acquire useful mathematical insights that otherwise are not obvious or taught in traditional classrooms. Also, the engaging game-like nature can potentially motivate students and serve as instructional tools for regular practice to gain proficiency in mathematics and numeracy. There are several ways to implement ideas of mathematics gamification in software that can be delivered to the students. We have chosen to deliver them by mobile app software that presents potentially strong opportunities for students to learn advanced mathematics in a systematic manner and at their own pace.

Any form of personalized learning technologies should provide a way to teach for mastery, where students are allowed to progressively move on to other challenging topics only after they have fully grasped the topic at hand. This approach requires a personalized approach that caters for individual student learning pace that can also complement with traditional classroom teaching. Our mathematics gamification technology leverages the ubiquitous availability of personal computing devices such as mobile devices like smartphones and tablets, offering students the opportunity to personalize their mathematics learning experience, allowing students to learn new knowledge or perform self-assessments at their own pace, and therefore maximizing the efficiency of learning in order to “teach for mastery”. Another unique advantage of our mathematics gamification technology is its ability to offer students instant feedback as they play, which is a crucial part of “debugging” their thinking process. In traditional classroom learning, students’ answers often are graded and then returned weeks later. On the contrary, personalized learning technologies such as our mathematics games (namely, Algebra Game and Algebra Maze, which we will present in details in the following) enable students to get instant visual feedback as they play, so that they can reconsider the situation and correct their moves, which is an example of “thinking process debugging” on the go and in real time.

## 10.2 Algebra Gamification

Elementary algebra—the first cornerstone of K-12 mathematics—has been highlighted by the National Academy of Engineering (Lavernia & VanderGheynst, 2013) as a critical area to improve in K-12 mathematics learning (in fact, touted as an *Algebra Challenge*). How should the *Algebra Challenge* be addressed from teaching computational thinking skills with an aim to underpin the foundation of learning mathematics? Can this complement traditional classroom learning? It has been recently recognized (among them are mathematicians like Keith Devlin from Stanford University) that game-playing activities allow players to grasp mathematical concepts and foster a sense of motivation that leads to numeracy proficiency, especially when the game is designed to embed abstracted mathematical subjects (Devlin, 2011; Pope & Mangram, 2015; Shapiro, 2013; Mackay, 2013; Novotney, 2015).

*how to think (about learning mathematics) at multiple levels of abstraction*—

*the goal of teaching computational thinking*(Wing, 2006). The particular instance of gamifying algebra in this paper is due to Terence Tao, a mathematician at the University of California, Los Angeles, who remarked in his online blog article (Tao, 2012a, b) on “Gamifying Algebra” that:

The set of problem-solving skills needed to solve algebra problems (and, to some extent, calculus problems also) is somewhat similar to the set of skills needed to solve puzzle type computer games, in which a certain limited set of moves must be applied in a certain order to achieve a desired result one could then try to teach the strategy component of algebraic problem-solving via such a game, which could automate mechanical tasks such as gathering terms and performing arithmetic in order to reduce some of the more frustrating aspects of algebra… Here, the focus is not so much on being able to supply the correct answer, but on being able to select an effective problem-solving strategy.

The idea of Tao’s algebra game is to reduce a given linear algebra equation to a form with only “x” and a numerical value on the left-hand and right-hand sides, respectively, through a selection of a finite number of given clues. In the following, we give an example using a screenshot of the game as shown in Fig. 10.1. Initially, the puzzle state is the algebra equation “5x + 3 = x + 11”, and the given clues are the three possibilities “Subtract 1”, “Divide by 2”, and “Subtract x”. The player chooses one of the three possibilities by clicking on the avatar icon. Say, suppose the player chooses “Subtract 1”, the algebra equation (correspondingly, the puzzle state) then changes to “5x + 2 = x + 10” (since both sides of the original equation “5x + 3 = x + 11” get subtracted by one).

One possible “solution” to the puzzle given in Fig. 10.1 is the sequence of “Subtract 1” then “Subtract x” then “Divide by 2” then “Subtract 1” and then finally “Divide by 2” to yield “x = 2”. This requires a total of five moves to reach the desired state. It is important to note that what matters is not the final value of x, but it is rather *the inquisitive problem*-*solving process while playing that is valuable*.

The benefit to computational thinking is obvious: students learn a foundational subject (e.g., mastering algebra) while playing. With regard to the game-play design, there are several intriguing questions: first, how to engineer the difficulty level of the game automatically? Second, how does a computer (not human player) solve a given puzzle efficiently, i.e., with the fewest number of moves? And, third, how to engage the human players in an entertaining manner so that they keep on playing it and, unknowingly, develop a better number sense or mathematical intuition and that such an improvement can be measured? These questions were explored in The Algebra Game Project founded by the first author (“The Algebra Game Project”, n.d.), and detailed answers to these questions along with the software development will be published in other venues.

## 10.3 Mathematics Gamification of Algebra Maze

In this and the next section, we describe the mathematics gamification building on Tao (2012a, b) algebra game and the software implementation of our mobile apps called the Algebra Game and the Algebra Maze, and the mobile app software are freely available to download at the Apple iOS Store or Google Play Store (“The Algebra Game Project”, n.d.).

**+1x**” corresponds to the avatar moving one unit upward, and the button “

**+2**” corresponds to the avatar moving rightward two units. Hence, the operation on x is an up–down movement, and the operation on the constant is a left–right movement of the avatar. With the rules above, we can deduce that the position of the avatar also has an algebraic meaning, i.e., each position in the maze represents a different equation having different coefficients or constant values.

In the initial levels of Algebra Maze, the treasure is made visible, and then at subsequent levels, the treasure is rendered invisible, i.e., hidden from the player as shown in the right-hand side of Fig. 10.2. Hence, the player needs to make use of the “information” in the given equation to deduce the location of the treasure. In some levels, the player has to first get a key, which is in a certain position of the maze, before opening a locked door located nearby to the treasure. This setting is equivalent to asking the player to reach to a certain equation first before they solve this equation. Finally, when the avatar locates the (potentially hidden) treasure, the algebra equation will be in the desired form “x = numerical_solution”, i.e., the puzzle is solved.

In order to make Algebra Game more challenging, such that players can learn thoroughly, we add more new features in subsequent higher levels. One of the features is “traps”, once the player steps on the trap features, the buttons for movement control will toggle, either from left–right to up–down or from up–down to left–right. For example, the player can only perform “+s” or “−t”, to the given equation initially, and after the player has stepped on the “traps”, the operation will change from or “−t” to “+ux” or “−vx” which is the operation related to the x-term where s, t, u, and v are four constants. In Fig. 10.2, there are only left–right buttons, “+2” and “−1”, in the left most screenshot. After the character steps on the trap, which are the green buttons, the left–right buttons will then be changed into up–down buttons, “+1x” and “−2x”, which is shown in the middle screenshot of Fig. 10.2.

In Maze 1, which is the easiest one, there are two possible paths (red path and green path) that the player can take in order to reach the treasure box. In Maze 2, we limit the number of paths that the player can take by adding some obstacles, which are indicated by the light blue square in the second figure, and now the player can only reach to the treasure box along the red line. In this example, the original green path in Maze 2 is a “fake path”.

This is one possible way to enhance game-play design such that the difficulty of Maze 2 is higher than that of Maze 1. In Maze 3, we have added some traps to the maze, and the difficulty level will then further increase. Players need to think carefully how to overcome obstacles in order to reach the treasure box. The circles in the third figure represent the traps (the green button in the screenshot). At the beginning, there are only two movement control buttons, namely, the go-leftward and go-rightward buttons. When the player steps on the traps, the movement control buttons will then toggle to upward and downward buttons. In Maze 4, the difficulty level can then be further increased by adding a dead end in the map. This means that, when the player reaches the dead end, he/she will be trapped in that position and cannot move further anymore. In such a case, the player either loses the game or can retry it. The dead end is highlighted in light blue in the fourth figure. By leveling up the maze gradually from Maze 1 to Maze 4, the Algebra Maze will become more challenging and requires the player to think deeply before making a move. These four examples also point out that the elements in the clue set are strongly related to the difficulty-level design. For example, we can leverage the Euclid Algorithm with the clue set design. Students can even get to know and learn important foundational computer science knowledge such as how the Euclid Algorithm works. In addition, the positions of the traps limit the players’ moves (e.g., the dead end) and also need to be considered when designing the clue set.

## 10.4 Mathematics Gamification of Algebra Game

The mathematics gamification process also requires analyzing the scoring rule at each puzzle game level that can be evaluated according to different reasonable design criteria. For example, scoring rules can be evaluated in terms of the number of moves needed or the speed to solve each level in the case of the Algebra Game and the number of “redo” on hitting obstacles or the speed to locate the hidden treasures in the case of the Algebra Maze. A well-designed scoring system can improve the design of the difficulty level at each level for improving students learning experience. Furthermore, concrete mathematics can be purposefully interleaved at certain levels of the games. For example, after a consecutive sequence of games involving factorization in the Algebra Game, the mathematical statement of *The Fundamental Theorem of Arithmetic* (stating that all natural numbers are uniquely composed of prime numbers) can be displayed to the player in order to highlight game features (e.g., the prime numbers as clues) with the mathematical rudiment. In this way, the players learn about fundamental mathematical knowledge (such as *The Fundamental Theorem of Arithmetic* in Euclid’s Elements that is not typically taught in the classroom). For example, Fig. 10.5 shows an example of the puzzle. In summary, we find that the Algebra Maze and the Algebra Game can provide players with new perspectives to gaining new mathematical insights while training their individual number sense and problem-solving skills that are critical to developing their capacity to view mathematics at multiple abstract levels.

## 10.5 Case Study of Computer Science Challenge Game Tournament

*Algebra Game Challenge*, in which the Algebra Maze and Algebra Game are used for the primary school students (as shown in Fig. 10.6) and the secondary school students (as shown in Fig. 10.7), respectively. The Algebra Game Challenge lasts for a fixed duration of 20 min. We experiment with a pedagogical initiative of teaching computational thinking to the participants as follows: a workshop for all participants was held a month before the CS Challenge, whereby participants were introduced to basic computer science knowledge and the mathematics behind the games. On the day of the CS Challenge, however, participants used the mobile app software described in Sect. 3 that allows more diverse game-playing dynamics and also enables the use of data collection and data analytics to capture the users’ game-playing behavior. The mobile apps in (“The Algebra Game Project”, n.d.) were not available to the participants beforehand as they were posted online only after the CS Challenge was over (Fig. 10.8).

Table of average moves taken by players in each level of the algebra game

Level | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|

Average moves | 3 | 2.65 | 3.84 | 3 | 5 | 5 |

Level | 7 | 8 | 9 | 10 | 11 | 12 |

Average moves | 4 | 5 | 4.77 | 10.1 | 20.1 | 8.8 |

Interestingly, the average number of moves needed at Level 12 is around 8.8, and yet the time spent at Level 12 is the highest. This implies that the total number of moves needed is not the only factor that may affect the difficulty of the game for human players. Finally, the reason for the longer time spent at Level 1 is that students are initially warming up (as they get familiar with the game interface and rules). If we omit the information at Level 1 and proceed to compute the correlation coefficient between the time spent and the average number of moves taken, then we have a correlation coefficient that is 0.807 which reveals that they are highly correlated for the 12 levels being analyzed.

## 10.6 Further Discussions

As part of classifying the difficulty level of the Algebra Game, we will address the automatic generation of games in the Algebra Game and Algebra Maze so that high-quality levels can be generated at real time. There are several ways to classify difficulty levels of the Algebra Game and Algebra Maze. One possibility is a machine learning approach to quantify automatically the difficulty level in the Algebra Game of the puzzle. We can treat this as a simple regression problem in machine learning: the input is the puzzle parameter of an Algebra Game level (initial equation, number of moves allowed, set of allowed operations, etc.), and the output is a numeric value measuring the difficulty of the given level. We can train this model by feeding it with the puzzles we used in the game tournaments, e.g., the Computer Science Challenge, and their corresponding difficulty measures derived from the average time spent by human players. After the training, we can use the generated model to predict the difficulty level of a particular generated level of Algebra Game. This can, in turn, be presented to general users in the form of automatically generated Algebra Game puzzles with increasing difficulties.

Another enhancement we are currently making to the algebra gamification system is a personalized puzzle recommendation system, where the backend server can push auto-generated personalized Algebra Game/Algebra Maze puzzles to each individual student’s device. We call it “personalized” because the system will determine a specific student’s need (e.g., a student might need more practice in factorization of numbers, which can be seen from her past playing record in the system) and push the most suitable puzzles to the student. Once we finish the difficulty level classification task, the system can also push puzzles at different difficulty levels to suitable student groups, so all students from different skill levels can find the game challenging.

## 10.7 Conclusions

We described preliminary ideas of mathematics gamification and their application to teach computational thinking by cultivating the capacity for logical thinking and problem-solving skills of students using mobile app game software. Through gamifying elementary algebra learning, we described how the logical manipulatives of the mathematical puzzle games, Algebra Game and Algebra Maze are embedded within puzzle game-like instantiations in a logical flow to catalyze the development of mathematical intuitions and insights related to abstract algebra. Through competitive game playing in a Computer Science Challenge tournament, we studied the learning efficacy of the algebra gamification software and also experimented with scaling up mathematics learning using mobile app software. In our future work, we are exploring the possibility of extending the ideas mentioned in this book chapter to gamification of other advanced mathematics and computer science subjects in a single mobile app—The Polymath App (“The Algebra Game Project”, n.d.).

## References

- Computer Science Challenge Game Tournament in Hong Kong. http://cschallenge.cs.cityu.edu.hk.
- Devlin, K. (2011).
*Mathematics education for a new era: Video games as a medium for learning*(1^{st}edn.). A. K. Peters, Ltd.: Natick, MA, USA.Google Scholar - Lavernia, E. J., Vander Gheynst, J. S. (2013).
*The algebra challenge. The bridge*(Vol. 43, No. 2). The United States of America National Academy of Engineering. https://www.nae.edu/File.aspx?id=88638. - Mackay, R. F. (2013, March 1).
*Playing to learn: Can gaming transform education?*Graduate School of Education, Stanford University. https://ed.stanford.edu/news/playing-learn-can-gaming-transform-education. - Minsky, M. (1970). Form and content in computer science—1970 ACM turing award lecture.
*Journal of the Association for Computing Machinery,**17*(2), 1970.CrossRefGoogle Scholar - Novotney, A. (2015). Gaming to learn.
*Monitor on Psychology, 46*(4), p. 46. http://www.apa.org/monitor/2015/04/gaming.aspx. - Pope, H., & Mangram, C. (2015). Wuzzit trouble: The influence of math game on student number sense
*. International Journal of Serious Games, 2*(4), 5. http://documents.brainquake.com/backed-by-science/Stanford-Pope-Mangram.pdf. - Shapiro, J. (2013, August 29).
*Video games are the perfect way to teach math, says Stanford Mathematician*,*Forbes magazine*. https://www.forbes.com/sites/jordanshapiro/2013/08/29/video-games-are-the-perfect-way-to-teach-math-says-stanford-mathematician/#7e90367a385b. - Tao, T. (2012a).
*Gamifying algebra.*Terence Tao’s Wordpress blog article. https://terrytao.wordpress.com/2012/04/15/gamifying-algebra - Tao. T. (2012b).
*Software mockup of algebra game*. https://scratch.mit.edu/projects/2477436 (main Page, n.d.). - The Algebra Game Project. https://algebragame.app.
- Wing, J. M. (2006). Computational thinking.
*Communications of the ACM,**49*(3), 33–35.CrossRefGoogle Scholar

## Copyright information

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.