To facilitate the promotion of CT education in K-12 schools, it is necessary to conduct a comprehensive review of literature to identify the evaluation components and methods of CT for young learners. To achieve the aim of this study, two research questions are raised: (1) What evaluation components should be included in the CT concepts, practices and perspectives dimensions according to the CT framework proposed by Brennan and Resnick (2012) in K-12? (2) What methods are appropriate for evaluating the CT components in each dimension in this context? As each study has put forth its own components and methods for evaluating learners' CT development, this study used information from previous studies to identify the essential components and methods for evaluation. This review of the literature from 2010 to the present aimed to identify every study related to programming and CT evaluation to contribute to the proposal of appropriate evaluation components and methods for senior primary school education. Table 8.1 summarises the 24 studies reviewed in this study.

**Table 8.1** List of 24 studies reviewed in this study

aThe numbers refer to the dimensions discussed in the reviewed literature, according to the CT framework proposed by Brennan and Resnick (2012). '1' refers to CT concepts, '2' refers to CT practices and '3' refers to CT perspectives

#### **8.4 Results and Discussion Based on Literature Review**

Grover et al. (2015, p. 199) wrote that 'a system of assessments is beneficial to get a comprehensive picture of learners' CT learning.' In other words, there is no single evaluation component or method that can entirely measure learners' CT achievements. Researchers, therefore, strive to develop both quantitative and qualitative approaches to evaluate learners' learning outcomes. This section sheds light on the essential evaluation components and assessment methods of each of the three dimensions proposed by Brennan and Resnick (2012): CT concepts, CT practices and CT perspectives.

#### *8.4.1 CT Concepts*

#### **<IP_ADDRESS> Literature Review Results**

The 14 studies on evaluating programming concepts in block-based environments provided 9 CT concepts to be included: (1) repetition/loops/iteration, (2) conditionals, (3) data structures, (4) sequences, (5) parallelism/concurrency, (6) mathematical operators, functions and Boolean logic, (7) event handling, (8) procedures and (9) initialisation. Table 8.2 summarises components of CT concepts that were evaluated by past studies and the tabulated results were sorted according to the frequency with which they were discussed.

Brennan and Resnick (2012) pointed out that the first seven concepts in Table 8.2 were useful in the Scratch programming environment and stated that learners should be able to transfer these CT concepts to other programming and non-programming contexts. The reviewed studies generally concurred on the importance of these seven components, in particular, all 14 studies agreed that repetition (or loops or iteration) is an essential component in evaluating CT concepts. Conditionals were identified by 11 studies as a core component of CT concepts. Ten studies put forth data as a key programming concept, which includes important knowledge such as variables and lists. The concept of sequences and parallelism (or concurrency), including sending or passing messages and handling coordination, was mentioned in eight studies. Eight studies also suggested that learners should understand the concepts of mathematical operators such as 'addition, subtraction, multiplication, division, as well as functions like sine and exponents' (Brennan & Resnick, 2012, pp. 5–6) and Boolean logic operations such as 'AND, OR, NOT'. Six studies investigated learners' ability to handle events in programming. In addition, the ability to apply procedures in programming tasks was identified as a component of CT concepts in two studies. It helps to avoid the repetition of codes and duplication of commands (Marji, 2014). One study attempted to evaluate learners' ability to deal with initialisation.

The 14 evaluation studies used both quantitative and qualitative methods to measure learners' understanding of CT concepts. Table 8.3 summarises the methods

**Table 8.2** Components of CT concepts in past studies

**Table 8.3** Methods used by studies to evaluate CT concepts

by studies used to evaluate CT concepts. The tabulated results are sorted according to the frequencies with which the methods were used. In terms of quantitative approaches, most of the studies measured learners' understanding of CT concepts using test items, most of which were designed with multiple choice questions in the programming context (Ericson & McKlin, 2012; Ruf, Mühling, & Hubwieser, 2014; Zur-Bargury et al., 2013). Task and project rubrics were also commonly used so that teachers could assess learners' project work with scoring guidelines.

Among the studies using qualitative approaches, interviews were the most common method of evaluating CT concepts. Interviews are conducted to understand the CT concepts that learners use to complete programming tasks or projects. Project analysis was another method used to evaluate learners' development in CT concepts. Evaluators used the Scrape tool to analyse the programming blocks of projects. Scrape can provide a record of the CT concepts that the learner utilised in his/her projects (Brennan & Resnick, 2012; Burke, 2012). Studies also observed programming lessons to investigate whether learners could correctly handle the CT concepts in programming activities. One study asked learners to write reflective reports on what kinds of CT concepts they used to complete their programming tasks and projects (Zhong et al., 2016).

#### **<IP_ADDRESS> Proposed Evaluation Components and Methods**

Duncan and Bell (2015) analysed the computing curricula for primary school in England and recommended that key stage 2 learners in the 7–11 year age group acquire

concepts such as loops, conditionals, sequences and variables. One study found that loops, conditionals, variables and operators were the fundamental programming concepts used by children in the Scratch programming environment (Maloney, Peppler, Kafai, Resnick, & Rusk, 2008). Wilson et al. (2012) found that over half of children's game-making projects used concepts such as loops, conditionals, sequences and parallelism. Because event handling is commonly used in block-based programming environments such as Scratch and App Inventor, the concept of event handling should be included (Brennan & Resnick, 2012). Although some may believe that procedure and initialisation are difficult for senior primary learners, they are essential concepts in programming. Procedure can avoid the repetition of codes and duplication of commands (Marji, 2014), and initialisation helps a programme reach its initial state. Therefore, if teachers introduce procedure and initialisation in class, they can consider assessing learners' abilities regarding these two concepts. In line with the above discussion and the results tabulated in Table 8.2, the following CT concepts should be evaluated in the K-12 CT curriculum: (1) loops, (2) conditionals, (3) sequences, (4) parallelism, (5) data structures such as variables and lists, (6) mathematical operators, functions and Boolean operators, (7) event handling, (8) procedures and (9) initialisation. Table 8.4 summarises the proposed CT concepts at the primary school level.

Because CT concepts are made up of different kinds of components, they can be evaluated by an aggregation of learners' achievement across components. Therefore, CT concepts can be evaluated by designing quantitative test instruments with itemised pieces that each evaluates a particular component. Evaluators can use these test instruments to measure the learning outcomes of learners and to administer pre- and post-test designs to measure learners' progression. Evaluators can also assess whether learners apply CT concepts appropriately by looking into their tasks/projects with the rubrics. Quantitative data can thus be obtained by accumulating the scores of learners generated from the rubrics. It is proposed that test designs with multiple choice questions be used to measure learners' progression for large numbers of learners. Evaluators can show programming segments in the test items and ask questions related to the segments, such as finding the output from the programming segment,

**Fig. 8.1** An example of testing the CT concept of conditionals in the form of a multiple choice question

which can demonstrate learners' understanding of CT concepts. Figure 8.1 shows an example of testing conditionals in the form of a multiple choice question.

CT concepts can also be evaluated by qualitative methods such as interviews, project analyses, observations and reflection reports. Researchers found that when learners were asked about how parts of their code work, their explanations showed large conceptual gaps (Grover et al., 2014). Therefore, interviews with learners can show how they explain their work. It is also suggested that evaluators can evaluate learners' CT concepts by using automated tools to analyse 'the number, the range, and the frequency' of different programming blocks being used in their projects (Burke, 2012). These blocks could provide information on learners' development in CT concepts. In addition, classroom observations can enable evaluators to determine how learners use CT concepts to tackle computational tasks. Asking primary school learners to write simple reflective reports on what kinds of CT concepts they used in completing their programming tasks and projects is another alternative. Because qualitative approaches require time and effort to explore learners' learning outcomes, they should be regarded as supplementary for evaluators seeking to comprehend the CT concepts of learners. Table 8.4 summarises the proposed evaluation components of the CT concepts at the primary school level.

**Table 8.5** Components of CT practices proposed by research studies

#### *8.4.2 CT Practices*

#### **<IP_ADDRESS> Literature Review Results**

Fifteen studies in the literature provide seven CT practices: (1) abstraction/abstracting and modelling/abstracting and modularising, (2) algorithmic thinking, (3) testing and debugging, (4) being incremental and iterative, (5) problem decomposition, (6) planning and designing and (7) reusing and remixing. Table 8.5 summarises the components of CT practices identified by past studies, and the tabulated results were sorted according to the frequency with which they were discussed.

Abstraction is one of the most fundamental practices in CT (Wing, 2006). Ten studies are related to learners' ability to think abstractly. Brennan and Resnick (2012, p. 9) suggested that modularisation ability should be merged with abstraction so that learners can avoid complexity and 'build something large by putting together collections of smaller parts'. Modelling, another skill that is often linked with abstracting, allows learners to 'organize data, structure their thoughts, describe relationships, and analyse proposed designs' (Voland, 1999, p. 215). Seven of the studies regarded algorithmic thinking as the foundation of CT practices. Learners are required to define the steps and develop instructions to solve a problem. Seven studies also suggested that testing and debugging are the core of CT practices because it is 'rare for a program to work correctly the first time it is tried, and often several attempts must be made before all errors are eliminated' (Peterson, 2002, p. 93). Four past studies suggested that problem decomposition and the practices of being incremental and iterative are indispensable in the programming process.  Problem decomposition involves breaking down problems into smaller, more manageable tasks (Waller, 2016). Several researchers found that planning and designing were part of CT practices. They were used to investigate whether learners plan their solutions before they write the code or use trial and error during programming. Additionally, researchers noted that the reuse and remix of the works of other programmers are crucial in the online communities of Scratch and Alice (Brennan & Resnick, 2012), and they encouraged novices to produce more complicated creations by building on existing projects or ideas (Brennan & Resnick, 2012).

For evaluation methods, because of the difficulties in finding out how learners tackle problems during programming, evaluators use both quantitative and qualitative methods to measure learners' CT practices. Table 8.6 summarises the methods adopted by the studies to evaluate CT practices. The tabulated results are sorted by the frequency with which the methods were used. Seven studies used task/project rubrics to evaluate learners' CT practices, as teachers marked the programming outcomes of tasks or projects based on rubrics to evaluate the CT practices of learners. Four projects used tests with task-based questions in coding and non-coding contexts to assess learners' proficiency in CT practices. The qualitative methods proposed are favourable for demonstrating their learning process. Four studies proposed the use of interviews to understand learners' CT practices, as interviews enable teachers to understand learners' thoughts behind the code (Grover & Pea, 2013). Two studies proposed the use of observations: researchers observe in classrooms, take notes and videorecord the entire programming process to understand learners' CT practices (Grover & Pea, 2013). One study used learners' reflection reports to understand their programming practices. Reflection reports are self-assessments that are distributed to learners after they finish a task or a project (Zhong et al., 2016), in which they write out how they accomplished their problem-solving tasks.

#### **<IP_ADDRESS> Proposed Evaluation Components and Methods**

Programming is not a simple process, and it might not have a clear order. However, the components of CT practices can be divided into two categories: design practices and programming practices. In the design practices category, learners design programmes. This category includes three practices: problem decomposition, abstracting and modularising, and algorithmic thinking. Because people often perceive planning as a 'highly specialized skill for solving problems' that requires scarce resources

**Table 8.6** Methods adopted by studies to evaluate CT practices

(Lawler, 1997), planning and designing are not recommended for inclusion in the programming process. Learners are supposed to decompose problems into sub-tasks first (Waller, 2016). The practice of modularising is recommended to be merged with abstracting. Learners will be able to connect the parts of the whole so that they can test and debug different parts of the programme incrementally (Brennan & Resnick, 2012). The Center for Computational Thinking, Carnegie Mellon (2010) asserted that algorithmic thinking is essential, as it helps learners to produce efficient, fair and secure solutions. In sum, in line with the results in Table 8.5, problem decomposition, abstracting and modularising, and algorithmic thinking are essential CT practices for evaluation at this stage.

In the programming practices category, learners implement their designs to produce a concrete programme artefact. This stage includes three practices: reusing and remixing, being iterative and incremental, and testing and debugging. The first practice helps novices create their own programmes by building on others' works and developing their own works incrementally (Brennan & Resnick, 2012). The practice of being iterative and incremental is tied to testing and debugging: programmers have to develop part of the programme and test it to ensure that it works; they then repeat these steps and continue to develop the programme. In sum, in line with the results in Table 8.5, reusing and remixing, being iterative and incremental, and testing and debugging are essential CT practices for evaluation at this stage.

Problem formulating is proposed to be included in the CT practices component in the study of this paper. Although Cuny et al. (2010, p. 1) defined CT as the 'thought processes involved in formulating problems and their solutions', none of the reviewed studies proposed assessing learners' abilities in problem formulation. In the early twentieth century, Einstein argued that raising questions was more important than solving problems. In his classic study, *The Evolution of Physics*, he wrote, 'the formulation of a problem is often more essential than its solution, which may be merely a matter of mathematical or experimental skill. To raise new questions, new possibilities, to regard old problems from a new angle require creative imagina-

tion and marks real advances in science' (Einstein & Infeld, 1938, p. 92). Because learners' creativity can be demonstrated by formulating creative problems, there is a need to add this component to CT practices to produce creative problem-solvers in the digitalised world. The aims of CT practices are thus to develop both creative thinkers and problem-solvers (Brugman, 1991). Therefore, this study proposes to include 'problem formulating' as one of the components of CT practices. Table 8.7 summarises the proposed evaluation components of the CT practices of this study: (1) problem formulating, (2) problem decomposition, (3) abstracting and modularising, (4) algorithmic thinking, (5) reusing and remixing, (6) being iterative and incremental and (7) testing and debugging.

Like CT concepts, CT practices involve several components; these can be measured by an aggregation of learners' achievement across components. One quantitative method to evaluate CT practices is designing rubrics to assess the final programming projects of learners. The criteria of the rubrics are the components of CT practices, and there is a need to design descriptors of performance levels for each CT practice. These rubrics help evaluators to review learners' abilities to formulate and solve problems. In addition to using rubrics to assess the CT practices of learners, SRI International proposed a task-based approach to assess CT practices. SRI International also published a report titled 'Assessment Design Patterns for Computational Thinking Practices in Secondary Computer Science' (Bienkowski, Snow, Rutstein, & Grover, 2015), which presented an overview of four CT practice design patterns and two supporting design patterns. The CT practice design patterns include analysing the effects of developments in computing, designing and implementing creative solutions and artefacts, designing and applying abstractions and models, and supporting design patterns analysing learners' computational work and the work of others. SRI International developed focal knowledge, skills and other attributes for each CT practice, which illustrate the core abilities that learners need to acquire and what should be assessed. Its report provided direction for evaluating CT practices using the task-based approach. In this approach, evaluators' first step is to define the fundamental abilities of each CT practice. The next step is to design tasks that include a scenario and to ask questions about the scenarios to test learners' abilities related to CT practice. Learners need to understand the scenarios and to answer questions about selecting options, organising sequences of activities or performing

#### 8 Components and Methods of Evaluating Computational Thinking … 133

#### *1. Scenario*

An app developer developed a mobile location tracking app that can show the location of a place on a map using latitude and longitude. However, a user reported that the app does not show the location correctly on the map. Please identify the reason(s) why the error occurred.

**Fig. 8.2** An example of testing the CT practice of testing and debugging using a task with a scenario

categorisations to demonstrate their abilities. For example, one of the focal skills of the CT practice of testing and debugging practice is the ability to explain the cause of an error. Figure 8.2 demonstrates an example of testing learners' understanding of testing and debugging using a task with a scenario.

With this approach, tests with sets of task-based questions can be designed to evaluate learners' abilities with the various components of CT practices. Pre- and post-test designs with task-based questions can enable evaluators to identify learners' progression in CT practices.

Measuring learners' CT practices by directly analysing their processes of designing and building programmes requires great effort. Qualitative approaches such as observing learners in designing and building programmes are one such method. Another is to interview them after they formulate, design and build their programmes and to ask them semi-structured questions. It is difficult to ask primary school learners to write detailed reflection reports on how they formulate, design and build their programmes; however, evaluators can ask learners to write simple reflection reports on how they can improve their programmes after solving their computational tasks. These qualitative methods can serve as supplements for evaluators seeking to understand what practices learners used in their programming tasks. Table 8.7 summarises the proposed evaluation components of CT practices at the primary school level.

#### *8.4.3 CT Perspectives*

#### **<IP_ADDRESS> Literature Review Results**

The literature review indicated not only that CT concepts and practices are of paramount importance in measuring learners' CT development, but learners' perspectives on learning programming are also vital. Brennan and Resnick (2012) proposed three kinds of perspectives in the programming process—expressing, connecting and questioning—to investigate learners' understanding of themselves and their relationships to others and the technological world. Based on the literature review, CT perspectives include not only Brennan and Resnick's (2012) suggestions

**Table 8.8** Components of CT perspectives proposed to be evaluated by research studies

(i.e. expressing, connecting and questioning) but also learners' motivation beliefs, namely, value and expectancy (Wigfield & Eccles, 2000; Chiu & Zeng, 2008), in their understanding of themselves. Value refers to learners' intrinsic motivations, such as their attitudes towards and interest in learning programming. Expectancy refers to learners' programming confidence, which includes their programming self-efficacy and self-concept. Programming self-efficacy is 'people's judgments of their capabilities to organize and execute courses of action required to attain designated types of performance' in the context of programming (Bandura, 1986, p. 391; Kong, 2017), while programming self-concept is the belief in one's programming competence (Chiu & Zeng, 2008). Previous studies indicated that researchers investigated both learners' motivation beliefs regarding learning programming and their perspectives on the technological world.

The 10 related studies in the literature identify three components of CT perspectives: (1) attitudes such as interest in programming and computing, (2) confidence in programming and computing, programming self-efficacy and programming competence and (3) expressing, connecting and questioning. Table 8.8 summarises the components of CT perspectives proposed to be evaluated by previous studies. The tabulated results are sorted according to the frequency with which they were discussed.

Most researchers agree that learners' attitudes, such as their interest in programming, should be included in this evaluation dimension. Researchers have focused on learners' programming confidence, self-efficacy and competence, and most have used quantitative instruments to measure learners' CT perspectives, although some have used qualitative data to analyse their attitudes. Table 8.9 summarises the methods adopted by studies to evaluate CT perspectives. Surveys are commonly used, with five-point Likert scales used most frequently (e.g. Ericson & McKlin, 2012; Ruf et al., 2014). Conducting surveys before and after a learning programming might facilitate the investigation of learners' CT perspectives. Qualitative methods such

**Table 8.9** Methods adopted by studies to evaluate CT perspectives

as interviews can provide a more in-depth understanding of learners' perspectives towards programming because programming courses and related activities can be reviewed.

#### **<IP_ADDRESS> Proposed Evaluation Components and Methods**

To fully understand learners' intrinsic values regarding programming, asking whether they like or dislike programming is far from sufficient. Deci and Ryan (1985, p. 34) argued that 'when people are intrinsically motivated, they experience interest and enjoyment, they feel competent and self-determined'. Learners' interest in programming can be assessed by their engagement in programming activities, sense of affiliation and career orientation. In addition to their attitudes, self-actualisation indicates whether learners feel competent after learning programming. These four factors can be used to explore learners' computational identity, which they form through networking and sharing knowledge and experience in programming activities.

Wenger (1998, pp. 4–5) argued that engagement is 'the most immediate relation to a practice-engaging in activities, doing things, working alone or together, talking, using and producing artifacts', and that it creates 'an identity of participation or non-participation'. When learners are more interested in programming tasks, their engagement in activities is deeper. Learners' self-formation through engagement is thus a critical factor that can directly reflect their interest in and enjoyment of learning programming. Measuring learners' sense of affiliation can also indicate whether they have a feeling of belongingness regarding their interest in programming. They can then develop a computational identity by the 'participation of sharing' (Gee, 2000).

It is believed that learners' interests affect their career choices. The construct of career orientation explores learners' motivation to work with people who share the same interests. Learners' self-actualisation is another crucial subcomponent. According to Maslow (1943, p. 382), self-actualisation is 'the desire for self-fulfilment, namely, to the tendency for one to become actualized in what he is potentially'. In other words, it is the development of competencies in knowledge, attitudes, skills and character (Huitt, 2007). In sum, these factors can be used to extensively investigate learners' intrinsic motivation, especially in their programming interest and competence. Thus, computational identity is proposed to be measured as the first

component of CT perspectives in this study. If learners have positive perceptions regarding these four factors, then they have a strong computational identity.

Concerning expectancy, programming empowerment, the second component of the CT perspectives proposed in this study, can help evaluate learners' programming confidence more comprehensively. Borrowed from the concept of digital empowerment (Makinen, 2006), programming empowerment can be defined as a person's experiences creating and designing programmes that enable them to tackle real-life problems and confidently participate in the digital world. Learners' belief in their competence to acquire the necessary concepts and practices to handle programming tasks is the primary factor that evaluators must measure. Programming empowerment also emphasises the meaningfulness, impact and creativity of programming, where meaningfulness refers to a person's perceived value—that is, the importance of their programming—and impact is a person's perception of the influence of the programming. Because this study proposes evaluation components to foster creative problem-solvers, creativity can be used to measure learners' beliefs in their ability to produce new ideas in the digitalised world through programming and related digital technologies. In sum, learners will contribute confidently in the digital world if they feel empowered concerning their programming experiences.

The third component is a broader horizon that stresses learners' relationships with others and the technological world. It explores how learners use their innovative thinking after learning programming to contribute to society through expressing, connecting and questioning the digitalised world (Brennen & Resnick, 2012). Expressing means learners' abilities to express themselves by creating with programming. Connecting means learners' understanding of the value of creating with and for others by programming, and it highlights the linkage between programming and real life. Questioning means that learners are empowered to ask questions about the technological world based on their programming experiences. It also means that learners are empowered to formulate problems in the computational context. The idea of questioning could also be expanded to formulate problems before programming. Learners are encouraged to think of questions that could be solved computationally.

As mentioned, CT perspectives represent a person's competence in intrapersonal and interpersonal domains. Therefore, this study proposed the evaluation of learners' (1) computational identity, (2) programming empowerment and (3) perspectives of expressing, connecting and questioning. Table 8.10 shows the proposed evaluation components of the CT perspectives of this study.

It is suggested that CT perspectives can be evaluated by well-designed survey instruments. This study proposed the design of survey instruments to measure

#### 8 Components and Methods of Evaluating Computational Thinking … 137

**Fig. 8.3** Sample items of the computational identity, programming empowerment and perspectives of expressing, connecting and questioning survey instruments

(1) computational identity, (2) programming empowerment and (3) perspectives of expressing, connecting and questioning. These surveys should be conducted at different time points to capture the development of learners' CT perspectives. Learners are required to rate their agreement or disagreement with the statements in these instruments, and it is convenient to analyse a large number of learners' replies using quantitative methods. Figure 8.3 shows sample items for the computational identity, programming empowerment and perspectives of expressing, connecting and questioning survey instruments. Qualitative methods such as interviews can be used to obtain more details on learners' perspectives of programming, but these require time and effort.

#### **8.5 Conclusion**

Every country/region requires creative problem-solvers who can contribute to every aspect of life in the digitalised world. CT is a way to cultivate creativity and problemsolving skills in young people. Evaluation is important to facilitate the implementation of CT education in schools because it enables teachers to identify the progress and outcomes of learners and help them attain their learning goals. Based on the literature review, this study proposed nine components of CT concepts, seven components of CT practices and three components of CT perspectives for evaluation.

As the goal of the CT curriculum is to nurture creative problem-solvers, it is essential to evaluate learners' abilities to formulate and solve problems in the computational context. This study has two highlights. First, this study proposed 'problem formulating' as an additional component of evaluating CT practices to encourage learners to raise questions before they programme. Problem formulation is also closely linked with questioning in CT perspectives, which means that learners are empowered to formulate problems in the computational context. In addition, this study discussed the ideas of computational identity and programming empowerment and proposed them as components for evaluating the perspectives of expressing, connecting and questioning proposed by Brennan and Resnick (2012) to capture learners' motivation beliefs in a more comprehensive manner.

Past studies indicated that no single method could effectively measure learners' CT development in the three dimensions; multiple methods are needed to evaluate learning outcomes. To assess a large number of learners' CT development, quantitative methods are more feasible in terms of resources. This study proposed the design of tests with multiple choice questions to evaluate the CT concepts of learners. Evaluators could also assess learners' CT concepts by analysing their programming tasks and projects with rubrics. Qualitative methods such as interviews, project analyses, observations and simple reflection reports can be conducted as supplements to quantitative approaches. CT practices can be evaluated by measuring programming project outcomes with rubrics and the design of tests with task-based questions. Qualitative methods such as interviews, observations and simple reflection reports can be conducted given the in-depth understanding of a number of learners. CT perspectives can be measured by well-designed survey instruments, and qualitative methods such as interviews can be conducted if in-depth understanding is needed.

The future work of evaluating learners' CT development is to design instruments for measuring primary school learners in these three dimensions. Regarding CT concepts and practices, researchers should design programming project rubrics and test instruments to capture learners' learning outcomes in these areas. Regarding CT perspectives, the constructs of computational identity, programming empowerment and perspectives of expressing, connecting and questioning should be further explored and established. Researchers are recommended to develop and validate instruments for measuring learners' computational identity and programming empowerment, and how they express, connect and question in the digitalised world. The proposed evaluation components and methods will be implemented in senior primary schools when these instruments are developed. With appropriate evaluation components and methods, it is believed that schools will be in a better position to motivate and nurture young learners to become creative problem formulators and problem-solvers in the digitalised world.

#### **References**

*Computers in Human Behavior*. Retrieved 22 March, 2017, from http://www.sciencedirect.com/ science/article/pii/S0747563216306185.

**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.

# Part III Computational Thinking and Programming Education in K-12

# **Chapter 9 Learning Composite and Prime Numbers Through Developing an App: An Example of Computational Thinking Development Through Primary Mathematics Learning**

**Siu-Cheung Kong**

**Abstract** Computational Thinking (CT) is a universal competence that young learners should acquire. This study illustrates the development of CT through app development for the learning of composite and prime numbers in primary school mathematics. Learners begin with inquiry activities regarding the meaning of composite numbers and prime numbers, and they are guided to find the factors of a given number by exploring an algorithm that involves the concept of modulo and can be implemented in a programming environment. Learners use a simple app to learn how the operator MOD works and then work in pairs to design an algorithm and devise a programming solution to find the factors of a given number by reusing the code of the simple app. The app will tell the users whether an inputted number is a composite or prime. Learners will make an initial connection with cryptography when large numbers such as 563,879 are explored, and they will obtain a more in-depth understanding of composite and prime numbers when 1 and 0 are tested in the app. In the process of building the app, learners will learn CT concepts such as sequence, loops, conditionals, events, operators and procedures. Learners will experience CT practices like reusing and remixing, being iterative and incremental, testing and debugging, abstracting and modularising and algorithmic thinking in developing the app. Learners will develop CT perspectives in the process of expressing, questioning and connecting with the digital world in developing the app.

S.-C. Kong (B)

Centre for Learning, Teaching and Technology, The Education University of Hong Kong, 10 Lo Ping Road, Tai Po, Hong Kong e-mail<EMAIL_ADDRESS>
**Keywords** App development · Composite numbers · Computational thinking · Primary school mathematics · Prime numbers

#### **9.1 Introduction**

Researchers and practitioners in education advocate the introduction of Computational Thinking (CT) in P-12 education to nurture learners' problem-solving and creativity (Barr & Stephenson, 2011; Grover & Pea, 2013; Lye & Koh, 2014). The goal of CT development is to enable learners to draw on the fundamental concepts of computer science to formulate problems and find computational solutions to real-life problems (Wing, 2011). The usefulness of app development is not limited to the field of computer science, and it can also help students to learn in a wide range of subjects. Computational tools and skill sets are helpful in mathematics and science learning (Eisenberg, 2002; Repenning, Webb, & Ioannidou, 2010; Wilensky 1995; Wilensky, Brady, & Horn, 2014), while mathematics and science offer a meaningful context in which problems can be formulated and CT can be developed (Hambrusch, Hoffmann, Korb, Haugan, & Hosking, 2009; Jona et al., 2014; Wilensky et al., 2014). This reciprocity is the motivation to combine CT and mathematics and science learning. Many P-12 learners have started to learn mathematical concepts through app development (Kahn, Sendova, Sacristán, & Noss, 2011; Wolber, Abelson, & Friedman, 2014; Yadav, Mayfield, Zhou, Hambrusch, & Korb, 2014). To teach novice programmers, block-based programming environments, such as Scratch and App Inventor, are considered appropriate (Meerbaum-Salant, Armoni, & Ben-Ari, 2010; Price & Barnes, 2015). This study, therefore, demonstrates how mathematical concepts can be developed through the creation of an app in App Inventor using an example of learning composite and prime numbers in primary school mathematics. The experience of creating an app helps learners turn abstract pattern recognition into an algorithmic and concrete operational experience.

#### **9.2 Background**

Wing's (2006) article popularised the term 'computational thinking' and defined it as the 'thought processes involved in formulating problems and their solutions so that the solutions are represented in a form that can be effectively carried out by an information-processing agent' (p. 1). Computational thinking relates to design, problem-solving and the understanding of human behaviour and draws on the basic concepts of computer science. Although it originates from computer science, CT is not exclusive to that field, and it goes well beyond computing. It is 'reasoning about the problems in computational terms' (Syslo & Kwiatkowska, 2014, p. 2), which means that learners are able to formulate problems in ways that help to develop computer solutions.

#### *9.2.1 CT Framework*

Brennan and Resnick developed a CT framework (2012) that was structured in three dimensions: CT concepts that learners engage with in programming, CT practices that learners develop when solving computational problems and CT perspectives that learners gain when interacting with technologies and relate to their experience with the digital world. Regarding CT concepts, learners are expected to learn the basic ingredients of programming such as sequences, conditionals, loops, events, operators and data handling. When tackling computational problems, learners experience CT practices such as reusing and remixing, being incremental and iterative, abstracting and modularising, testing and debugging, and algorithmic thinking. In the programming process, learners have opportunities to develop CT perspectives such as expressing, questioning and connecting with the digital world. Expressing refers to learners' opportunities to use programming as a medium for self-expression. Questioning is the ability to ask questions about and with technology. Connecting is the process by which learners create with and for others in programming. It helps learners to experience working with other people and can lead to more accomplishments resulting from discussions and collaborations. Creating for others enables learners to experience positive and negative feedbacks in authentic contexts when their creations are appreciated (or not appreciated) by other people. Connecting is the most important component of CT perspectives, as it enables learners to connect CT practices with the digital world so that they feel empowered and have an identity in the digital world. All three dimensions of CT are essential for implementing CT in school education.

#### *9.2.2 Block-Based Programming Environments*

Inspired by LogoBlocks (Begel, 1996), block-based environments allow learners to create apps by dragging and dropping blocks into a scripting pane with minimal effort spent dealing with programming syntax. It minimises syntax errors because the blocks can only fit together when the code makes sense. In addition, feedback is immediate, as the results of the code blocks that the learners build are shown right in front of them when the program is executed. Such a user-friendly programming environment enables novice programmers to be more engaged in thinking about the programming process in a more systematic manner as they build the code block by block. Scratch (Maloney, Resnick, Rusk, Silverman, & Eastmond, 2010) and App Inventor (Wolber, Abelson, Spertus, & Looney, 2011) are the most common blockbased programming environments used by novice programmers (Price & Barnes, 2015). This study illustrates how App Inventor was used to design an app for learning primary mathematics and CT development.

#### *9.2.3 Mathematics Learning and CT Development*

Learners can develop CT in learning mathematics when programming is introduced as pedagogy. Learners can develop CT in learning a variety of subjects, including mathematics, science, social studies and language studies (Barr & Stephenson, 2011). CT and mathematics are particularly closely related. This study connects CT and mathematics learning explicitly to show that learners can develop both CT and mathematical concepts holistically. The National Research Council (NRC) suggested that mathematics and CT should be essential practices for the scientific and engineering aspect of the Framework for K-12 Science Education (NRC, 2012). Programming is pedagogically helpful in mathematics learning (Eisenberg, 2002; Repenning, Webb, & Ioannidou, 2010; Wilensky, 1995; Wilensky, Brady, & Horn, 2014). Syslo and Kwiatkowska (2014) advocated that traditional topics in school mathematics should be extended and enriched through the application of programming to build solutions. The literature review conducted by Lye and Koh (2014) revealed that learners learn mathematics well with the help of programming (e.g. Kahn, Sendova, Sacristán, & Noss, 2011). The study conducted by Yadav et al. (2014) found that teachers favoured the implementation of CT into as many subjects as possible. Mathematics is most preferred as CT always involves problem-solving with mathematics, such as design algorithms and heuristics in the solving process. Research studies have documented that the immersion of CT in mathematics learning can be successfully achieved by building apps. In the study conducted by Morelli et al. (2010), participating teachers and learners developed a learning app to promote the immersion of CT in traditional subjects, such as mathematics. In Ke's study (2014), a group of secondary school learners used Scratch to design mathematics games that successfully enhanced their mathematics learning outcomes. The study by Foerster (2016) documented similar outcomes in a high school that integrated programming into its mathematics curriculum by combining Scratch and geometry learning in Grades 6 and 7. Long-term assessments indicated that these education initiatives resulted in significant improvements in their learners' performance. Hsu and Hu (2017) conducted a study in which Grade 6 learners were guided by teachers to apply CT to write a block program in Scratch to solve daily-life mathematic problems. It was proved successful in enhancing learners' mathematics learning effectiveness. Evidence indicates that CT can be integrated into meaningful mathematics learning through app development. This study demonstrates how programming can serve as pedagogy in the learning and teaching of primary school mathematics for better mathematics learning and CT development.

## *9.2.4 Learning Composite and Prime Numbers in Primary School Mathematics*

One of the traditional methods of learning composite and prime numbers is through the sieve of Eratosthenes.While it is generally taught at the tertiary level, its simplified version is introduced in primary school: 'sifting out the composite numbers, leaving only the primes' (Maletsky et al., 2004). Ploger and Hecht (2009) suggested using the software Chartworld to introduce the sieve of Eratosthenes to primary learners in a visualised and interactive way. Chartworld colours all multiples of a number when that number is selected. For instance, after selecting the number 3, all multiples of 3 except 3 will be highlighted. After selecting the numbers from 2 to 10, all of their multiples will be highlighted. The remaining un-highlighted numbers are prime numbers, except 1. Although this method enables young learners to learn about composite and prime numbers, it is limited in finding prime numbers in a given range. In this regard, there is a need to explore an alternative way to teach primary school learners so that they can explore larger composite and prime numbers. This study proposes an innovative pedagogy to guide primary school learners to make an app that can find the factors of an inputted number.

# **9.3 Developing an App as Pedagogy for Supporting the Conceptual Understanding of Composite and Prime Numbers**

In traditional mathematics lessons, senior primary school learners are taught that prime numbers are only be divisible by 1 and themselves, while composite numbers have factors other than 1 and themselves. Yet mere rote memorisation of these definitions is not encouraged, as learners will not truly understand the concepts of composite and prime numbers. This study introduces an inquiry pedagogical approach to guide learners to develop these mathematics concepts together with the development of an app. Learners will be initially introduced to examples of and ideas underlying composite and prime numbers. Learners will then develop an app that finds the factors of an inputted number and tests whether they can distinguish between composite and prime numbers. The programming process helps learners to think more deeply about the meaning of composite and prime numbers.

#### *9.3.1 Inquiry Activities About Composite and Prime Numbers*

This study introduces the concepts of composite and prime numbers using an inquiry approach, which is a learning process whereby 'students are involved in their learning, formulate questions, investigate widely and then build new understandings, meanings

**Fig. 9.1** Find all factors of 8 by listing out all factorisations of 8

and knowledge' (Alberta Learning, 2004, p. 1). In this activity, learners will be asked what a composite number and a prime number are. Teachers will then explain the concepts with examples. Numbers with more than two factors are composite numbers, while numbers with only two factors—1 and themselves—are prime numbers. When finding the factors of a number, learners are reminded of the commutative properties of multiplication. For instance, 8 can be expressed as '1 × 8 - 8', '2 × 4 - 8', '4 × 2 - 8' and '8 × 1 - 8'. Because the products are the same irrespective of the order of the factors, learners know that '4 × 2 - 8' and '8 × 1 - 8' are equivalent to '2 × 4 - 8' and '1 × 8 - 8', respectively. When finding all of the factors of 8, learners only need to explore '1 × 8 - 8', '2 × 4 - 8' and do not need to consider '4 × 2 - 8' and '8 × 1 - 8'. The order of operation is not important in finding the factors of a number, and this is the commutative property of multiplication. This study encourages learners to generalise composite and prime numbers from examples. The concepts of composite and prime numbers can also be better understood by asking young learners to explore the factors of a number through visualisation activities, such as exploring with the online activity 'Find the factorisations of the number' in the Illumination Project (National Council of Teachers of Mathematics [NCTM], n.d.). By choosing a particular number, such as 8, learners are invited to represent all of the factorisations of 8 by selecting the appropriate rectangular planes.

Learners are guided to conclude that composite numbers can be represented by more than one rectangular plane, while prime numbers can only be represented by a single rectangular plane. This indicates that composite numbers have more than one pair of factorisations, while prime numbers have only a single pair of factors: 1 and themselves. Figure 9.1 shows a way to find all of the factors of 8 by listing all of its factorisations. Using this form of representation, young primary school learners can be easily guided to categorise numbers as composite or prime by counting the factors of a selected number. Figure 9.2 lists examples of numbers that have only two factors and numbers that have more than two factors in a range from 2 to 12.

#### *9.3.2 Developing an App as Pedagogy*

After introducing composite and prime numbers by counting the number of factors of a number, teachers can guide learners to develop an algorithm to generalise a method

**Fig. 9.2** Categorising composite and prime numbers by counting the number of factors of a number in the range from 2 to 12

**Fig. 9.3** The sample screens display the results of testing the inputted number 16 when **a** the 'Prime Number' button is pressed and **b** the 'Composite Number' button is pressed

to differentiate whether a number is composite or prime. Learners can input any integral numbers greater than or equal to one and ask the program to identify and list all factors of the given number. Learners are asked to decide whether it is composite or prime based on the number of factors found and listed by the app. They can check the answer by pressing the 'Composite Number' button or the 'Prime Number' button. They are asked to explore with the app by inputting different numbers before starting the programming task. Figure 9.3 shows sample screens displaying the results of testing an inputted number 16 when (a) the 'Prime Number' button is pressed and (b) the 'Composite Number' button is pressed.

#### *9.3.3 Problem Decomposition and Algorithmic Thinking*

There is a need to guide learners to figure out the sub-tasks in building the app. Decomposing the problems into sub-tasks is a high-level abstraction process. The four sub-tasks are finding the factors of the inputted number, showing the factors on the screen, deciding whether the number is a prime number and deciding whether the number is a composite number. Figure 9.4 shows the high-level abstraction involved in decomposing the problem into sub-tasks.

The most challenging task is to facilitate learners to find ways to check whether a number is a factor of an inputted number. The use of examples is the best way to guide learners. For example, learners can be asked to fill in the columns 'Modulo' and 'Factor of 8?' to check whether 1, 2, 3, 4, 5, 6, 7 and 8 are factors of 8 when it is divided by 1, 2, 3, 4, 5, 6, 7 and 8, respectively, as listed in Table 9.1. Table 9.1 shows all of the results in columns 'Modulo' and 'Factor of eight?' when eight is divided by 1, 2, 3, 4, 5, 6, 7 and 8, respectively. Learners are encouraged to discuss in pairs to identify the pattern of zero modulo in identifying the factors of the given number.

The operator of modulo in programming needs to be introduced to learners to prepare them to find an algorithm to check whether a number is a factor of a given

**Fig. 9.4** A high-level abstraction of decomposing the problem into four sub-tasks

**Table 9.1** A table with columns 'Modulo' and 'Factor of 8?' to be filled in by learners identifying patterns to find the factors of a given number

9 Learning Composite and Prime Numbers Through Developing an App … 153

**Fig. 9.5** The interface and code for learners to understand the operator of modulo in the programming environment

Input an InputNumber

**Fig. 9.6** An algorithm for finding all of the factors of an inputted number

number. Figure 9.5 shows the interface and the code for learners to understand the operator of modulo in the programming environment.

Learners are then asked to work in pairs to design an algorithm to find all factors of an inputted number. Figure 9.6 shows an algorithm for finding all factors of an inputted number.

## *9.3.4 Reusing Code from a Simple App to Build an App to Find Factors*

Following the algorithmic design, learners can start to build an app to find all of the factors of a given number by using the operator of modulo. Figure 9.7 shows the code of a program for finding all of the factors of a positive integral number inputted by a learner.

Figure 9.8 shows the code executed when the 'Prime Number' button and the 'Composite Number' button are clicked, respectively. The code in 'primeButton' and 'compButton' counts the number of factors of the input number to check whether it is a prime or composite number.

**Fig. 9.7** The code of a program for finding all of the factors of a positive integral number

**Fig. 9.8** The code executed when the 'Prime Number' button and the 'Composite Number' button are clicked, respectively

# *9.3.5 Testing the App and Connecting the Tasks with the Digital World*

Learners can then test the program by checking whether the input number is a prime number or a composite number. The possible answers are 'This is a prime number' or 'This is not a prime number' when the 'Prime Number' button is clicked and 'This is a composite number' or 'This is not a composite number' when the 'Composite Number' button is pressed. Figure 9.9 shows the sample screens displaying the results

**Fig. 9.9** Sample screens displaying the results of testing the inputted number 953 when **a** the 'Composite Number' button and **b** the 'Prime Number' button are pressed

of testing the inputted number 953 when (a) the 'Composite Number' button and (b) the 'Prime Number' button are pressed, respectively.

This app enables learners to test whether large positive numbers are prime or composite numbers, and they will thus come to understand the importance of the application of such testing in cryptography. This mathematical topic is selected as the theme of this computational task because of the significant role of prime numbers in cryptography. Email communication, instant messaging and satellite television, which are ubiquitous in everyday life, often require data encryption for the safe delivery of information. Encryption methodologies such as RSA use trapdoor oneway functions to encrypt messages. These functions are easy to compute in the forward direction, but difficult to compute in reverse without special information. RSA utilises some properties of prime number multiplication to design a function that satisfies the definition of the trapdoor one-way function (Salomaa, 1996). To enable learners to experience a one-way function, multiplication and factorisation are used as examples in this study to demonstrate the forward and reverse operations, respectively. The app developed in this study enables learners to test whether a large positive number is a composite or prime number. For example, the app can provide the factors of a relatively large number, such as 563,879, from the perspective of

**Fig. 9.10** The factors of a relatively large number are displayed after a time gap

young primary learners. As shown in Fig. 9.10, the factors of 563879 are 569 and 991, which are prime. Learners have to wait several minutes before they can see the outcomes, during which time they can discuss and connect the function with the work of encryption. The larger the number, the more time will be needed to identify its factors. It is important for us to find sufficiently large numbers for the encryption work so that our messages can be transmitted safely in all digital communications.

## *9.3.6 Using '1' and '0' to Trigger In-depth Discussion of Composite and Prime Numbers*

Learners are then guided to find the number of factors of the number 1, which is one. The outcomes will be 'This is not a prime number' and 'This is not a composite number'. At this stage, teachers can emphasise the definition of a prime number and explain why 1 is not considered prime, which is rarely discussed in teaching. This app can thus help teachers to trigger discussion among learners in classrooms. Figure 9.11 shows the sample screens displaying the results of testing an inputted number 1 when (a) the 'Composite Number' button and (b) the 'Prime Number' button are pressed.

Learners are then asked to find number of factors of the number 0. The app will return an empty list of factors because it is not designed to handle this case. There are infinitely many factors for 0 when it is checked by the rule 'the inputted number can be divided by a positive integer and it is a factor when the modulo is zero'. When 0 is divided by 1, the modulo is 0. Similarly, when 0 is divided by 2 or any

**Fig. 9.11** The sample screens displaying the results of testing an inputted number 1 when **a** the 'Composite Number' button and **b** the 'Prime Number' button are pressed

other positive number, the modulo is 0. Therefore, 0 has infinitely many factors, and the app will report 'There are infinitely many factors' when 0 is inputted for testing. Thus, learners can understand the limitations of the computer program regarding this case, which is worthy of discussion among learning peers and teachers. Figure 9.12 shows the message after clicking the 'Show All Factors of the Number' button when 0 is inputted.

## *9.3.7 Adding a Conditional Statement to the App to Handle the Case of Inputting 0*

Learners are then asked to write a conditional statement to respond to the input of 0. Figure 9.13 shows the conditional statement for handling the special case when 0 is inputted. This is an opportunity for learners to understand program debugging. Learners will know that programming an app is an iterative process and that the program needs to be completed incrementally. Learners can reuse the code for the 'findFactors' function shown in Fig. 9.13 to search for factors.

With the categorisation of composite and prime numbers taking place in the above manner, this study proposed four categories of numbers: composite numbers, prime

**Fig. 9.12** The message 'There are infinitely many factors' after clicking the 'Show All Factors of the Number' button when 0 is inputted

**Fig. 9.13** The conditional statement for handling the case in which 0 is inputted in this app

numbers, 1 and 0. In this regard, the definition of a composite number should be revised from the original definition, 'a number with more than two factors', to 'a number with more than two factors but a finite number of factors'.

#### **9.4 Computational Thinking Development**

#### *9.4.1 CT Concepts Development*

In the process of building the app, learners learn CT concepts such as sequence, loops, conditionals, events, operators, data handling and procedures (see Fig. 9.14). The concept of sequences can be developed in building the 'when showButton.Click' program. Learners need to think carefully about the order of finding the factors after considering the special case of 0. When building the 'when showButton.Click' program, learners will first consider whether the input number is 0. If so, the app should tell users that it has an infinite number of factors instead of listing all of its factors. If the input number is not 0, the program should call the 'findFactors' procedure, as all numbers except 0 have a finite number of factors. Learners will thus understand the concept of sequence in greater depth in this case if they understand that the order of instructions for finding factors or assigning the message 'There are infinitely many factors' to the factorList should always come before showing the factors or the message. The concept of repetition is also developed when building the 'findFactors' codes. Using the 'for each from to' block, the program repeatedly runs the blocks in the do section, testing the numbers ranging from 1 to the input number in finding all of the factors. Learners can understand the concept of events when using the 'when showButton.Click' block. They will observe when an event occurs (i.e. clicking the 'show' button), and the app will trigger a series of tasks for execution until completion. They can also learn the concept of naming/variables when they create a factor list with the 'initialise global name to' block. The concept of conditionals is embedded in the use of modulo to find the factors of the input number. Using the 'if-then' block, the program will add the number to the factor list if the modulo is 0 after the input number is divided by the number. Learners can also develop the concept of operators when using the modulo to check the remainders of the divisions and using 'greater than' and 'equals' blocks in the 'when primeButton.Click' and 'when compButton.Click' programs. The concept of data is introduced in the use of lists. After the program finds the factors by the modulo, learners need to store all of the factors in the list before showing them. Learners can also understand the use of procedures in a complex computational task like this one. After the 'findFactors' program is built, the app will show the list of factors on the screen. Therefore, a procedure that shows factors should be created. To show the factor list, the 'showButton' is made. When the 'showButton' is clicked, the program calls the 'findFactors' and 'showFactors' procedures that were created previously. Learners thus know that using procedures can avoid bulky programs.

**Fig. 9.14** The CT concept learned from the factor app

#### *9.4.2 CT Practices Development*

Learners can also experience CT practices, such as reusing and remixing, being iterative and incremental, testing and debugging, abstracting and modularising, and algorithmic thinking, in developing the app. They experience the practice of reusing and remixing when they use the code block of the modulo from the simple app (see Fig. 9.5) to create the 'findFactor' program (see Fig. 9.15). To reuse the code block of the modulo from the simple app in making the Factor app, learners can save the code in the backpack, and it can then be extracted when building the 'findFactors' program. The backpack is a copy-and-paste feature in App Inventor that allows users to copy blocks from a previous workspace and paste them into the current workspace.

Learners can also experience the practice of being incremental and iterative in the process of app development (see Fig. 9.16). Learners can be guided to initially build a program that finds and shows the factors of an input number and then put the program into testing and debugging. Learners can develop the program further to check whether the inputted number is a prime or a composite number. Thus, learners can experience the process of developing the app incrementally and iteratively.

Learners learn also about testing and debugging throughout the app development process in this example. One particular point concerns the testing of the case of inputting 1 and 0 in this example. When the user presses either of the buttons to test whether 1 is a prime or composite number, the app will give no response (see Fig. 9.17), as the original app only functions when the inputted number has two or more factors. When the inadequacy is identified, learners have to modify the program

**Fig. 9.16** Learners develop the app incrementally and iteratively

to handle the special case of inputting 1. Moreover, an error will be found if 0 is input. Because 0 has an infinite number of factors, the app cannot list them; thus, the app needs to be enhanced to inform the user that 0 has an unlimited number of factors, as shown in Fig. 9.17. From these examples, learners will understand the importance of testing and debugging in app development.

It is not realistic to expect primary school learners are able to conduct high-level abstraction in programming design; however, this app development exposes learners to the high-level abstraction process. The four main sub-tasks highlighted at the beginning of programming design (i.e. finding factors and showing factors of the input number, checking whether the input number is a prime number and checking whether the input number is a composite number) can be shown to learners if they are unable to generate the idea after discussion. Teachers should not be frustrated if learners are unable to decompose problems into sub-tasks at this stage, but they should expose them to this process so that they appreciate that it is an important part of the programming process. Before building the code, learners should be motivated to conduct an algorithmic design that delineates the detailed instructions required to solve the problem. This process facilitates the development of algorithmic thinking, which is an essential cognitive skill in CT development (Angeli et al., 2016; Barr & Stephenson, 2011; Wing, 2006). Again, we should not expect learners to be able to work this out on their own; however, they should be guided and exposed to this process so that the seeds are sown for later development and growth. Individuals with algorithmic thinking skills can help them to precisely state a problem, divide the problem into well-defined sub-tasks and work out a step-by-step solution to tackle 9 Learning Composite and Prime Numbers Through Developing an App … 163

**Fig. 9.17** Learners experience testing and debugging after 1 and 0 are inputted

each sub-task (Cooper, Dann, & Pausch, 2000). Figure 9.6 shows the algorithm for finding the factors with modulo.

As mentioned in Chap. 8, problem formulation is an essential component of CT practices. With the experience gained from developing the factor app, learners should be encouraged to formulate problems using their pattern recognition experience. Learners can be guided to reflect again on the pattern-identifying factors of a number by considering the outcome of the modulo when the number is divided by a divisor (Table 9.1). Teachers can ask learners to look for other patterns for formulating problems, for instance, learners may be able to discover patterns such as those shown in Table 9.2, which presents a pattern of identifying odd numbers using a similar strategy to that in Table 9.1.

#### *9.4.3 CT Perspectives Development*

In the process of developing the app, learners have opportunities to develop their CT perspectives, expressing themselves and connecting with and questioning the digital world. An important issue in the digital world is the security of data transmission. To encode and decode messages in real-life protocols, two sufficiently large prime numbers are used to compose a composite number. This app enables learners to obtain an initial idea of the speed of computing when they use the app to test whether a given relatively large number is a prime number or not. Through the app development, learners cannot only express what they understand about prime and composite numbers in the coding process, but also connect these mathematical concepts with encryption technology in the digital world and to think of different ways to encrypt messages. This encourages them to learn more mathematical concepts for encryption. Learners will be better able to raise questions about the digital world and privacy issues. Are the messages that they send in the digital world safe? Are there any other methods for data encryption? Should they learn more about programming in the digital world? They will also gain a sense of programming empowerment and will feel autonomous and competent in contributing to society by developing apps that can help them learn. We hope that in the long term, with the accumulation of more programming experience, learners will develop their computational identity and regard themselves as members of the computational community.

#### **9.5 Conclusion**

This study demonstrates how primary school learners develop an in-depth understanding of composite and prime numbers by building an app using App Inventor that uses the number of factors to formulate the concepts of composite and prime numbers. Learners can develop their CT concepts and experience CT practices in a series of programming tasks, including high-level planning to find and show factors and ground-level implementation of the modularised blocks to find and show the factors and to check whether the input number is a prime or composite number. They can also experience logical thinking and gain an in-depth understanding of composite and prime numbers in the process of building and testing the app. This example shows that building an app cannot only deepen their mathematics understanding but also develop their CT in terms of concepts, practices and perspectives. Future work is to evaluate the effectiveness of this pedagogy in classroom teaching. CT should not be limited to programming lessons, but should be developed in young learners in other subjects. It is also necessary to extend this pedagogy to other subjects such as science, language learning and visual arts.

# **References**

**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.

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

**Chee Wei Tan, Pei-Duo Yu and Ling Lin**

**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 eSportslike 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

C. W. Tan (B)

C. W. Tan · P.-D. Yu · L. Lin

L. Lin e-mail<EMAIL_ADDRESS>
The Institute for Pure and Applied Mathematics, Los Angeles, USA e-mail<EMAIL_ADDRESS>
Nautilus Software Technologies Limited, Department of Computer Science, City University of Hong Kong, Kowloon Tong, Hong Kong e-mail<EMAIL_ADDRESS>
P.-D. Yu Department of Electrical Engineering, Princeton University, Princeton, USA

#### **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).

Algebra gamification is a pedagogical approach to learning elementary algebra. This approach is particularly useful when used at an early stage of K-12 education to give students a heads up on learning an advanced topic that might only be encountered later in classroom teaching. In this paper, we report on how this idea of mathematics gamification can be designed as mobile game apps that are suitable for middle school students when the mobile apps are deployed in mathematics-related game tournaments and then to analyze the preliminary efficacy of learning behavior based on collected data. Put simply, this teaches students *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.

Tao's insightful remarks aptly highlight two key facts, namely, that (i) certain kinds of K-12 mathematics are amenable to game design that can motivate student to learn and (ii) problem-solving skills can be cultivated through this gamifying process as a means to learning the mathematical subject. In other words, there are several ways to solve elementary algebra—strategizing moves in a mathematical puzzle game is one of them. With the aid of computing technologies, this introduces novel perspectives to learn elementary algebra for young students. Also, Tao (2012a, b) developed a software mock-up of the game as shown in Fig. 10.1.

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,

**Fig. 10.1** Terence Tao's software mock-up of his algebra game in 2012

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 gameplay 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.).

In Algebra Maze, we combine maze-solving elements and single-variable algebra equation solving together as shown in Fig. 10.2, which is the game-play screenshot of Algebra Maze. The goal is to move the purple avatar toward the treasure (i.e., equivalently solving the linear equation). Each movement of the avatar corresponds to a mathematical operation on the equation given below the maze. For example, the button "**+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

**Fig. 10.2** Algebra maze mobile app game with maze-like gamification design and freely available for download at iTunes app store and Google play store

**Fig. 10.3** Four different game designs of algebra maze

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.

Another way to increase the difficulty of Algebra Maze is to create "fake paths" in the maze (Figs. 10.3 and 10.4). We define a "fake path" as a path that seems to be a possible path to the treasure box, but it will, in fact, lead the player to a dead end. In the following, we give illustrative examples on how to combine the fake path and the "trap" together and to design four mazes in which their topology structures look similar but actually possess different difficulty levels. All of these four mazes are with clues {+ 2, −1, +1x, −2x}. The starting point marked as dark blue, and the treasure box marked as yellow, and the orange squares represent the walls and obstacles, respectively.

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

**Fig. 10.4** Four different game designs of algebra maze with difficulty levels ordered from easy to hard: Maze 1, Maze 2, Maze 3, and Maze 4

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**

In Algebra Game, unlike the Algebra Maze, we split the clues into two parts, one part is the mathematical operators, i.e., addition "+", subtraction "−", multiplication "\*", division "÷", and the other part is the operand such as the x-term or the number as shown in Fig. 10.5. Hence, the combination of the clues is more general than the original design. The goal in Algebra Game is the same as Tao's algebra game: To reduce a given linear algebra equation to "x numerical\_solution" through a selection of a finite number of given clues. As shown in the right-hand side of Fig. 10.5, if the player "drags" the division button "÷" and "drops" it on the button "2", then the equation will be divided by two on both sides. Algebra Game is not only about solving a linear equation but it also contains other mathematical insights. For example, consider an equation "x − 23 -2" with the clues "+, −" and "2,

**Fig. 10.5** A puzzle instance in the algebra game mobile app game that challenges students to find the right combinations of prime number factors for the number 105 in order to solve the puzzle. Important mathematical results such as the fundamental theorem of arithmetic can be displayed as hint to facilitate a deeper understanding of mathematics for the game players

3", then this is equivalent to ask if we are able to use 2 and 3 to construct 23. The players can develop their number sense through playing this game. Let us use another example, consider an equation "24x - 48" with the clues "\*, ÷" and "2, 3", then this is equivalent to asking the players to factorize 24 by using 2 and 3 (prime numbers). Other than the factorization concept, there are many instances of mathematical manipulations that can be embedded in the Algebra Game such as the Frobenius's problem (also known as the coin problem) in the form of making up a number from two given clues. In essence, given the available clues at each level, the player can only perform a limited number of operations, and this restriction helps to stimulate computational thinking in finding the shortest sequence of moves to solve the problem. If the player is familiar with the mathematical analysis underpinning the difficulty level design in the Algebra Game, the player can even further develop mathematical insights and intuition while playing the 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**

The Computer Science Challenge (CS Challenge) is a tournament organized by the Department of Computer Science at City University of Hong Kong starting since 2016 for both primary and secondary school students in Hong Kong ("CS Challenge", n.d.). The CS Challenge is modeled after eSports-like computer game tournament. A pair of students forms a team, and there were altogether 32 teams from 19 primary schools, and 53 teams from 33 secondary schools, making a total of 170 students in May 2016. One of the computer game in the CS Challenge is the *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

**Fig. 10.6** Primary school student tournament of algebra maze at the computer science challenge in May 2016

participants beforehand as they were posted online only after the CS Challenge was over (Fig. 10.8).

We describe next the learning efficacy of the first task of Algebra Game and Algebra Maze based on analysis of the data collected in the tournament. We analyze the performance evaluation of learning efficacy based on the time spent at each level, each move that a user has taken, and the number of "redo" times at each level. The difficulty at each level is calibrated based on our mathematical analysis of the game (from easy to hard), and we expect to have a reasonable difficulty curve so that players gain confidence instead of frustration at early levels. Let us evaluate Algebra Game first. In Fig. 10.10, we see that the number of students who have completed the corresponding level has observable reduction at higher levels, e.g., about 20 percent, from Level 9 to Level 10 which can also be observed in Fig. 10.9, the time spent at Level 10 almost doubled that at Level 9. In fact, the number of moves needed at Level 10 is also almost double that at Level 9 as shown in Table 10.1. We conclude that the total number of moves needed at each level is a crucial factor in the difficulty-level calibration design of the game.

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

**Fig. 10.7** Secondary school student tournament of algebra game at the computer science challenge in May 2016

**Fig. 10.8** Percentage of the number of students versus the total number of completed levels of algebra game with an unlimited number of levels a priori designed in the algebra game during the 20-min duration for the game tournament

**Fig. 10.9** The average time a player spent at each level of the algebra game

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**

From Fig. 10.9, we observe that the average time that students spent on a level in the Algebra Game increases with the level of progression (except for the first level, where students are just getting familiar with the game and learning the rules on how to play the game and thus the time spent is relatively higher). From a game design perspective, an extension is to adapt difficulty levels that are fine-tuned according to the skill or knowledge of the player. In addition, how to classify the difficulty level of the Algebra Game and to integrate that with player's learning curve is an interesting direction that we will address in the future release versions of Algebra Game and

**Fig. 10.10** Percentage of number of students versus the total number of completed levels of algebra maze with a total of 45 levels a priori designed during the 20-min duration of the game tournament

Algebra Maze. This will allow the game-playing experience to be adaptive to the personalized learning goal of mastering arithmetical and numeracy skills in algebra manipulations (Fig. 10.10).

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.

**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.

# **Chapter 11 Mathematics Learning: Perceptions Toward the Design of a Website Based on a Fun Computational Thinking-Based Knowledge Management Framework**

#### **Chien-Sing Lee and Pei-Yee Chan**

**Abstract** Mathematics is core to many scientific disciplines as it trains the mind in representation, logic, and various data manipulations. Mathematics is thus the power of reasoning, creativity, problem-solving, and effective communication skills. Mathematics can, however, be difficult to learn if interest and teaching–learning approaches do not link theory with real-world problems. Hence, the goal of this study is to enhance the learning of Mathematics using a multi-stakeholder, fun Computational Thinking (CT)–Knowledge Management (KM) framework. We hypothesize that this framework will help improve stakeholders' perceptions toward the learning of Mathematics and CT as elements of fun can transform knowledge more productively. Brennan and Resnick's (2012) CT involves three aspects: computational perspective, computational practice, and computational concepts. These are implemented in different ways to suit different contexts and needs. Furthermore, KM encourages knowledge creation and sharing in order to produce more innovative outcomes. The findings of this study indicate that there is an increased positive perception toward the Website's objectives, usefulness, and ease of use. We hope that by enabling students to create, share, and discuss fun-based problems for others to solve, they will gain confidence in their own understanding of and creativity in problem-solving.

**Keywords** Computational thinking · Computational perspective · Computational practice · Computational concepts · Fun knowledge management framework

# **11.1 Introduction**

The application of computational thinking (CT) can be found in most institutions and agencies today. Wing (2006) defines CT as "a universally applicable *attitude* and *skill set* everyone, not just computer scientists, would be eager to learn and use." With

C.-S. Lee · P.-Y. Chan (B)

Department of Computing and Information Systems, Sunway University, Petaling Jaya, Malaysia e-mail<EMAIL_ADDRESS><EMAIL_ADDRESS>
C.-S. Lee

e-mail<EMAIL_ADDRESS><EMAIL_ADDRESS>
<sup>©</sup> The Author(s) 2019 S.-C. Kong and H. Abelson (eds.), *Computational Thinking Education*, https://doi.org/10.1007/978-981-13-6528-7\_11

regard to attitude, CT encourages an open mindset challenging boundaries and pursuing refinements. An open mindset corresponds with (a) reformulating a seemingly difficult problem into one solution familiar to us, either by reduction, transformation, or simulation; (b) choosing an appropriate representation of a problem or modeling the relevant aspects of a problem; (c) thinking recursively; and (d) processing alternatives and constraints simultaneously. These further point toward two key computer science concepts, i.e., decomposition and abstraction. Consequently, CT enables better identification of data patterns, better understanding and solving of problems, systems and human behavior, and more effective analysis.

Brennan and Resnick (2012) aim to reach out to the masses, through CT. Hence, they have simplified CT into three aspects: (a) computational perspectives, (b) computational practice, and (c) computational concepts. The Computational Thinking (CT) course website (2017) supports Wing's (2006) and Brennan and Resnick's (2012) propositions, and regards CT as comprising of four components: (a) decomposition, (b) pattern recognition, (c) algorithmic thinking, and (d) generalization.

To us, CT is a means to an end, whereby it can help make the teaching of programming more effective. CT is also an end in itself due to the progressive developmental nature of learning. We adopt the four CT components at the CT course website for this study as the website integrates propositions by eminent founders and practitioners.

#### *11.1.1 Problem*

Knowledge of Mathematics is essential in everyday life. From the moment, we wake up in the morning to the minute we go to bed, we depend on our understanding of and capability to perform simple Mathematics-based tasks. Mathematics hones the power of reasoning and problem-solving, leading to better clarity in communication skills and higher creative possibility (Chan, 2010; Snalune, 2015; Biswas, 2015; Kong, 2019).

Our research interest focuses on the use of Mathematics to teach CT skills in a fun way. Mathematics is closely linked to CT as it involves a *pattern recognition* of a problem structure and variables that can be instantiated with different values, such as *decomposition*, to enable modularity and easier problem-solving; *algorithm design*, due to its emphasis on logical reasoning; and *generalization*, i.e., from multiple examples to formulation of principles. Thus, if CT can be used to find the best means of solving problems, then more creative solutions can be ideated and found to overcome difficulties.

Furthermore, increasingly, children are spending much time on the Internet and video games, even violent ones. The American Academy of Child and Adolescent Psychiatry (2015) points out that video game addiction can cause mental health and social problems to children since most of their time will be spent indoors playing online/video games. Furthermore, playing video games for long hours can affect academic performance since students will have problems focusing in class and interacting with others. Christopher (2015) confirms that even when interacting with others, they tend to only discuss video games. As time passes, their social communication will cease and they will have problems communicating with members of society in general.

Considering the benefits of learning Mathematics and CT skills, it is proposed that children's interest should be diverted from unhealthy video games to more educational, Mathematics-based games. Furthermore, if we can make learning more fun and enjoyable, we can incorporate Knowledge Management to enhance collaborative learning.

#### *11.1.2 Objectives*

An earlier study by Lee, Wong, and Ee (2017) use an object-oriented gamification approach to improve students' Mathematical and CT skills. The target students in the study are those studying in university. In this study, our framework adopts an inquiry-based student-centered learning framework, with primary school students (Primary 1–3) as the target users.

Student-centered learning (Table 11.1) supports the use of inquiry approaches such as games. Knowledge Management (KM) approaches complement such inquiry as KM involves knowledge acquisition, sharing, creation, and dissemination. These provide a structure to knowledge-building and collaborative learning.

Moreover, in Kong's (2019) 11 case studies on teacher professional development, he found that for scalability of teaching practices, content and teacher development models need to be developed from the perspective of a multi-stakeholder partnership. Subsequently, principles can serve as top-down strategies to be tested in classrooms, where successful patterns of e-learning can be identified in the long run to enrich students' and teachers' theoretical and practical understanding. Hence, a community approach is adopted in this study, involving parents, community members, and young children, since Primary 1–3 students are still very young and need motivation and support from their parents and peers/community.

In addition, elements of fun are crucial to the very young. Abelson's (2012) reconstructible computational media is one of the early works of fun visual programming. Eventually, fun-based Scratch (Resnick, 2007) came about. Fun in this study is game-based and refers to Koster's (2004) theory of fun for game design. Koster notes that game design requires pattern recognition, and variations from these patterns and inherent game mechanics will pose interesting challenges/inquiries to players.

As such, in this study, we enable students to tinker with Mathematical concepts and practice in various ways to refine their computational perspectives. We hypothesize that designing using Brennan and Resnick's (2012) CT, Ventakesh and Davis' (2000) Technology Acceptance Model, and *a fun KM approach* will improve stakeholders' perception toward (a) the importance of learning mathematical concepts; (b) the mastery of Mathematical (curricular) knowledge and skills; (c) the mastery of critical thinking and communication skills; and (d) online learning.

**Table 11.1** Characteristics of student-centered learning which supports the KM approach

*Source* Ertmer, Ottenbreit-Leftwich, Sadik, Sendurur, and Sendurur (2012)

This chapter is presented in the following order: literature review, methodology, game design, user testing, findings, significance, and finally conclusions.

## **11.2 Literature Review**

#### *11.2.1 Computational Thinking (CT)*

Computing involves not only programming and practicing computing skills but also recursive thinking, model matching, and compositional reasoning. These will enhance algorithmic thinking, parallel thinking, and practical thinking as well. As a result, through CT, the learner develops problem-solving processes and dispositions. These are very important to the advancement of computer systems and functions, especially analysis and design as well as justifications to problems and solutions (Togyer & Wing, 2017).

CT shows how individual knowledge and skills gained from computing subjects can bring positive impact to society. The CT course website (2017) provides some examples. In Economics, one can find cycle patterns in the rise and fall of a country's economy; in Mathematics, the steps to solve a calculus problem; in Chemistry, the principles for ionization. Hence, people who understand and have knowledge of CT in their studies will see the correlation between theoretical subjects and the environment (between indoor/formal learning and outdoor/informal learning).

Abelson (2012) further points out that for CT to grow beyond re-constructible computational media, it needs to be complemented by computational values which promote open access. This has partly led to the popularity of open-source movements. Consequently, CT's objective of building individual capability and creativity (Weintrop, Holbert, Horn, & Wilensky, 2016) and the open-source movements have influenced many professions and computer science curricula in developing countries.

#### *11.2.2 Game-Based Learning and Gamification*

According to Kazimoglu, Kiernan, Bacon, and MacKinnon (2012), digital gameplay involves thinking of the correct solution for the players to move on to the next level. This motivation has driven the video gaming industry to constantly move forward. According to the global game-based learning market, the world profits for gamebased learning products reached \$2.6 billion in 2013 and are expected to gain a profit of \$7.3 billion by 2021. In 2016, a total of \$99.6 billion in revenue was earned from worldwide games, which led to an 8.5% increment compared to the revenue earned in 2015 (Adkins, 2016).

There are different types of games including educational games, adventure games, action games, and role-playing games. Table 11.2 presents some of the benefits of these games mentioned in prior literature.

#### *11.2.3 Knowledge Management*

KM revolves around knowledge acquisition, sharing, translation/transformation, and dissemination (Nonaka & Takeuchi, 1991; Frappaolo, 2006; Maier, 2010; Jashapara, 2011). This approach is chosen as we would like the students to follow the KM cycle and finally create their own games using Scratch.

#### **11.3 Methodology**

First of all, the Software Development Life Cycle (SDLC) is used to design the game and to ensure the quality of the online game portal. For user requirements, we have carried out a questionnaire to survey students and parents' opinion and preferences with regard to our objectives and the proposed Website portal. Next, we have designed and developed the Website according to their opinion and preferences

**Table 11.2** Summary matrix of conference and journal article reviews

and the KM cycle. Stakeholders' involvement is critical and as such, their feedback weighed heavily on our design and development. Consequently, we have adopted agile methodology to design and develop incrementally to cater to user feedback. For design and analysis, ease of use and usefulness, the two key assessment metrics of the Technology Acceptance Model (Ventakesh & Davis, 2000) are also applied in alpha and beta testings.

# *11.3.1 Website Component Design Based on Computational Thinking (CT)*

We designed the Website portal based on the recommendations of Wing (2006), Brennan and Resnick (2012), and the CT course website based on the four main CT concepts: (a) dividing the processes into parts (decomposition); (b) knowing and finding the correct patterns for problem-solving (pattern recognition); (c) writing algorithms for the user to solve problems (algorithm design); and (d) determining the rules and principles of a particular subject (abstraction/generalization).

The mapping of the Website components to the CT concepts is in Fig. 11.1.

Website aims at progressive and incremental improvement, corresponding to Bloom's taxonomy. The most basic Mathematics concept is number counting. Hence, the initial level is to present odd and even numbers to familiarize students with numeric values, and at the higher level is the concept of interval.

From numeric values, *pattern recognition* is developed by progressing through (a) multiple examples in worksheets and (b) Scratch programming. The worksheets,

**Fig. 11.1** Mapping of website components to CT concepts

which are of different difficulty levels, enable students to not only go through the steps for each concept exercise but also to inductively realize that many problems are similar. In Scratch programming, building blocks can be reused and remixed for different fun outcomes.

Next is *algorithm design* and later, *abstraction*. For solution steps (*algorithm design*), diverse formulas/methods of solving problems can lead to the same answer. We choose a Mathematics crossword puzzle because it enables students to identify different solutions to the same problem. This leads to *generalizing*.

Due to the iterative nature of agile-based SDLC methodology, the sections below present the progression/iterative design process and user testings, which have led to the subsequent versions of the Website.

#### **11.4 Pilot Test: Preliminary Design and Analysis**

In the pilot test, a total of 27 responses from different age groups are gathered through a questionnaire to identify their opinion and preferences. Questions are scored on a range of one (not important) to five (most important).  The five different age groups are categorized as such to derive a more holistic understanding of factors, which would sustain both learning and future system development.

Young adults make up 40.7% of the sample, whereas adults only make up 7.4%. There are 18.6% more female respondents compared to male respondents. During

**Fig. 11.2** Website's wireframe (main page)

the pilot test, the participants are shown the Website's main page in wireframe format (Fig. 11.2), followed by the survey questions.

A summary of the responses received from the participants is presented in Table 11.3. The feedback obtained is used to further refine the proposed Website portal.

**Table 11.3** Summary of the responses from pilot test participants

## **11.5 Alpha Testing: Design and Development**

The purpose of the alpha testing is twofold: (a) to ensure that all functions in the Website portal are working; and (b) to obtain user feedback to refine the system. Users can have an overview of the Website portal on the homepage (Fig. 11.3). They can also access the Mathematics test to determine and improve their level of Mathematics.

Worksheets are divided according to the students' age group to help narrow down the worksheets to the targeted age group:

Answer sheets are provided for each worksheet so that users can check their performance and see different methods of solving a problem. Figures 11.4, 11.5, and 11.6 are sample screenshots of the questions and answers.

A forum page for parents and students is also included in the Website to enable discussion, information sharing, and knowledge exchange. Moreover, the forum can be used to help users improve their social skills. The game created using Scratch is found in "Fun Time".

**Fig. 11.3** Website homepage

**Fig. 11.4** Primary 1 sample worksheet (numeric value, comparison)

**Fig. 11.5** Primary 2 sample worksheet (number value, pattern recognition with regard to numbers, numeric value, and operators)

#### *11.5.1 Alpha User Testing*

For the alpha user testing, a total of 31 responses from different age groups are collected. Similar to the pilot test, there are five categories of respondents. For the question regarding the *importance of understanding Mathematics in the real word*, 35.5% of them said that it is important. From the range of one (not important) to five (most important), none of them said that Mathematics is not important.

As for the *overall rating* of the Website, 16.1% of the respondents rate it as average, while most users (61.3%) give it a rating of 4. To further elicit user requirements/expectations, user feedback is compiled (Table 11.4) and considered for further testings.

**Fig. 11.6** Primary 3 sample worksheet (numeric value, pattern recognition with regard to numbers, numeric value, operators, and algorithm design)

**Table 11.4** User's expectations

#### **11.6 Beta Testing**

For the final evaluation process, the design is based on the alpha users' perceptions and experience. We first present the design for the game and then the Website. Users can select to start the game or to understand the game instructions. The voice narration for the game is downloaded from the Watson text-to-speech demo.

Once users start the game, a brief introduction is presented. There are four stages in this game. The first and second stages of the game require users to select all the colored balls containing even and odd numbers in order to proceed to the next level. As they proceed with the game, they would get points if they manage to answer the given questions correctly. Once users manage to complete all the stages, they are required to purchase the "tickets" with their points to watch the space videos as a reward. The reward can demonstrate to users that masteringMathematical skills is key to earning points. Knowledge translation is involved when users apply Mathematical skills that they have learnt to identify the correct answers.

**Fig. 11.7 a** Even number game (number value), **b** even number clip (number value)

**Fig. 11.8** Hide-and-seek code (object-orientation, decomposition, variables, behavior, values)

If users do not know what even and odd numbers are, they can watch a short clip explaining and teaching them what these numbers are. Figure 11.7a, b is sample screenshots of the even number game and clip.

Next is the game and/or reward using Scratch (Fig. 11.8). Students can manipulate the actions, variables, and values for different outcomes.

Figure 11.8 shows a hide-and-seek game developed in Scratch. The seeker is given 90s to find the hider, who can hide at any random position. This game will be repeated until the time runs out. After a couple of seconds, the seeker will show up and start seeking the hider. If the seeker finds the hider at the x- and y-coordinates (e.g., −167, −111), then the hider will be revealed and the user score will increase by 1 point. The word "Congratulations" will then be displayed to let the user feel a sense of achievement.

The variability in values enables users to manipulate the pace of the game, as well as the kinds of encouragement and sound effects they would like to include in the game. Water drop in this example may not be appropriate. So it may be the first value to be changed.

Finally, a Mathematics crossword puzzle enables users to click on the empty boxes within the crossword to fill in the answers. The purpose of the crossword is to show users that similar Mathematical functions such as addition and subtraction can

**Fig. 11.9** Mathematics crossword puzzle

be found in different Mathematical equations, and that there are different components/methods to arrive at a solution. In Fig. 11.9, users have to think of the solution from multiple perspectives, simulating higher level algorithm design. For example, there are two ways to arrive at the total 10. We hope that with practice, users will understand the link between algorithm design and numeric value, operators, and problem-solving.

Since we are trying to encourage learning in a community, a blog site enables posting of updates regarding the subject matter. The forum enables them to share ideas, knowledge, and problem-solving among users and their parents.

#### **11.7 Comparison Between Alpha–Beta User Testings**

For beta testing, a total of 30 responses from five different age groups are collected. The age groups include children (6 years old to 12 years old), teenagers (13 years old to 19 years old), young adults (20 years old to 35 years old), adults (36 years old to 59 years old), and senior citizens (60 years old and above). 56.7% of the respondents comprises the young adults and 26.7% of them are adults.

Table 11.5 shows the comparisons between the alpha- and beta testing results, while Table 11.6 presents user expectations for the future Website and game development. The Likert scale ranges from 1 (least important) to 5 (most important).

Although the perception outcomes are consistent and positive, the stakeholders mainly prefer simple designs and manageable exercises and games. Furthermore, users may find it challenging to find the solutions to problems all by themselves. Hence, adaptations in the sequence and choice of activities would be necessary.

**Table 11.6** Expectations for future *Website and Game* development

#### **11.8 Significance**

The role of technology in inquiry-based, student-centered learning is not always easy. The crux of student-centered learning framework is the derivation of principles, and this is more likely to happen if teachers themselves teach using a principle-based approach. Various studies such as Song and Looi (2012) and Kong and Song's (2013) studies have confirmed this reasoning.

The significance of our study lies in:

#### **11.9 Conclusion**

Parents should start introducing Mathematical concepts to their children from young. In order to attract their attention to learning, methods of teaching and learning should be fun as it might be difficult to gain their interest once they have lost it.

The design of this study has incorporated Brennan and Resnick's (2012) computational perspective, computational practice, computational concepts, and KM approaches. CT-based Mathematics provides a direct link to principles. Hence, it is important to develop such skills. Our fun Computational Thinking-Knowledge Management (CT-KM) design and approach follow an inquiry-student-centered learning framework. The role of technology in terms of exploration, construction as well as communication in inquiry-student-centered learning parallels that of KM's knowledge acquisition, sharing, creation, and dissemination.

To validate our designs for the learning of Mathematics and CT, the opinions and feedback of users from different age groups are obtained through user testings and questionnaires. Although the target users of the Website are primary school students, comments from young adults, adults, and senior citizens are taken into consideration as they are the stakeholders who will influence and encourage the younger children.

Our findings indicate that the perceptions of different stakeholders toward CTbased Mathematics learning have improved as the Website provides different ways of learning to suit different contexts and needs. It is our hope that schools in Malaysia will also see more creative outcomes to problems. Furthermore, we hope that by enabling students to create, share, and discuss fun-based problems for others to solve, they would feel encouraged to create and share knowledge, and eventually, have a greater appreciation of Mathematics and CT.

**Acknowledgements** The first author would like to thank Prof. Tak-Wai Chan for his question *what is Mathematics learning?* while she was a Faculty at the Graduate Institute of Network Technology, National Central University, Taiwan, ROC. Thanks also to MIT's Scratch for paving the way, the 2017 Computational Thinking conference for highlighting what CT is and Dr. K. Daniel Wong for prior collaboration on design thinking and CT.

#### **References**

Weintrop, D., Holbert, N. S., Horn, M., & Wilensky, U. (2016). Computational thinking in constructionist video games. *International Journal of Game-Based Learning, 6*(1), 1–17. Retrieved November 2, 2017 from http://ccl.northwestern.edu/2016/WeintropHolbertHornWilensky2016. pdf.

Wing, J. (2006). Computational thinking. *Communications of the ACM, 49*(3), 33–35.