Bringing Computational Thinking to the Classroom

Younes Benkarroum and Mohammad Azhar, Computer Information Systems and Elizabeth Wissinger, Social Sciences, Human Services and Criminal Justice

Computational thinking (CT) is a problem-solving process that can be used in a variety of content areas by everyone, not just by computer scientists. CT describes the mental activity of formulating a problem to admit a computational solution that can be realized by a human or a machine, or more generally, by combinations of humans and machines (Wing, 2010). This approach allows us to break problems down into separate parts (decomposition), look for similarities or common differences (pattern recognition), filter out information that is not necessary to solve the problems (abstraction), and develop step-by-step instructions for solving problems (algorithms) [Thorson, 2018]. Some scholars argue that computational thinking is as fundamental as basic skills in reading, writing, and arithmetic (Wing, 2006). Even for non-STEM people, embracing CT will be of substantial benefit in their professional careers and in day-to-day life. So how can we help our students learn to use it, and benefit from having done so? 

In Fall 2021 and Winter 2022, as part of our NSF-funded project “Bridging the Gap: Designing a Technology Learning Community Integrating Computational Thinking to Improve STEM Engagement across Disciplines,” we designed four Computational Thinking Activities for students from both STEM and non-STEM disciplines to practice and refine their computational thinking skills (CT). We conducted this particular activity as part of our larger project, designed to seek ways to help students across disciplines become more comfortable with STEM activities, and begin to see STEM as a possible career. A part of the research aims to incorporate CT into formal classroom learning settings, and then invite students from those classrooms to engage in less formal project based learning environments, including a Hackathon and Makeathon, to see whether and how they embraced CT. 

The activity described here sought to test out a method for teaching CT in the classroom. We chose students from the introductory courses CSC 101 (Principles in Information Technology and Computation, STEM) and BUS 104 (Introduction to Business, non-STEM) to expose students to CT who may lack understanding of computing concepts.[1]

Introducing CT in the classroom

We tasked students with the problem of finding the shortest path between multiple cities on a road map. When traveling from one place to another, there are several factors to consider; unless the intent is to visit some points and landmarks in a specific order, people are often interested in the most efficient way to get somewhere. In our activities, students used CT to experiment with different ways of creating paths between multiple points to effectively travel through cities in a region. This problem is also known as the Traveling Salesman Problem (TSP) where the salesman must take the shortest path that passes through each city exactly once, and returns back to the start.  

This is the problem they considered: 

Given a list of cities in South Africa, the goal is to reduce the cost for a vendor whose duty is to distribute the COVID-19 vaccines in those cities. The problem is therefore to find the shortest possible route that starts from Cape Town and visits each city exactly once.

Employing CT, the students were encouraged to follow these steps: 

Decomposition– 

Applying the decomposition element to our problem lead to the following sub-tasks:

  • Given the list of cities, determine their geographic coordinates (i.e. latitude and longitude) to find their exact positions on the map.
  • Find the distances between each pair of cities in the list.
  • Find the shortest path that passes through each city exactly once.

The first two sub-tasks were quite straightforward and easy to accomplish using the available online maps and their geographic tools, but the last sub-task was the main section of our activity. 

Pattern recognition–

Recognizing if a pattern exists and determining its sequence can simplify the path to finding any solution. For the task at hand, we noticed that the problem could be solved recursively as follows.

  • Let the letter O (Origin) be the label of the departure city (Cape Town).
    • If we only need to visit two cities (A and B), then the strategy we use to determine the shortest path will choose either the path O-A-B or the path O-B-A. Thus, the number of possible paths to choose from is 2.
    • If the number of cities to visit is three (A, B, and C), then the first city to be visited can be either O-A, O-B or O-C, then the remaining two cities must be visited. Note that from the previous case, the strategy knows how to determine the shortest path when visiting two cities, so the number of possible paths in this case is 3 x 2 = 6.
    • In general, if the number of cities to visit is n, then the number of possible paths to choose from is n x P(n-1), where P(n-1) is the number of possible paths when visiting n-1 cities.

Abstraction–

Stepping back from the specific details of a given problem and focusing on the big picture allowed students to create a more generic solution. Applying this CT element in our case required students to analyze the problem and leave out unnecessary information such as the mode of transportation chosen, the purpose of the trip, the time needed to visit all cities, whether the vendor is traveling with coworkers, etc. Once done, they were able to  start brainstorming a solution to the problem. The important details to focus on are the list of cities, their exact locations, and the distances between them.

Algorithms–

An algorithm is a step-by-step strategy for solving a problem. It can be written in plain language, with flowcharts, or pseudocode. In our activity, students from CSC 101 and BUS 104 tried four different algorithms and compared their outputs. The algorithms they used were as follows:

  • Longitude sorting algorithm: The task is to sort the cities by their longitudes, then to visit them all in ascending order of this geographic coordinate. By doing so, the path traveled will visit all cities from left to right (from the farthest city in the west to the farthest city in the east). The total route distance is the sum of the distances between each pair of cities on the route.
  • Latitude sorting algorithm: The task now is to sort the cities by their latitudes, and then visit them all in ascending order of that coordinate. In doing so, the path traveled will visit all cities from the farthest city in the south to the farthest city in the north.
  • Nearest neighbor algorithm: The nearest neighbor algorithm starts at Cape Town and connects to the nearest unvisited city. It repeats until every city has been visited.
  • Greedy algorithm: The greedy algorithm is an iterative algorithm that builds a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. In our activity, the edges are the roads between the pairs of cities. All possible edges are sorted by distance in ascending order; then at each iteration we add the shortest edge which will not make a city with more than 2 edges, nor create a cycle.

All algorithms were applied to the list of the given cities from South Africa; the starting point was always Cape Town; then the algorithms produced routes that visit all other cities.

Students from both disciplines did not use any programming skills to determine the shortest routes for each of the four algorithms explored; they manually followed the steps of each algorithm and used only the Google Sheet SUM function to calculate the total distance for each path. Both Longitude and Latitude algorithms CT activities did not require any programming but rather focused on problem-solving aspects

What we found: 

Students seemed engaged with and happy to have been exposed to these ideas and to experiment with using CT to solve a problem. We talked to them after the activity and asked them specifically about their experience with doing the exercise. Here are a few of their observations:

Business (BUS 104) students: 

I always just thought of computational thinking as like strategic thinking—like I didn’t realize that it was like strategic thinking or like problem solving and also like practicality like what’s the most practical.

Not knowing what computational thinking was, I was doing it without even noticing, at work, so I think it will be like way easier for students or like everyone to learn about computational thinking, than say, critical thinking. 

At first I didn’t really understand it, it was like a lot of stuff going on, but now I got it. So, I love it – I’m not a longitude and latitude person either, but this is really great. This is very helpful to us and very informative. 

Do I see it in my future? I really don’t know. Because I’m not gonna lie, at first, like looking into it, it does seem difficult, but after getting, like, an understanding of it, it is pretty kind of, like, fun.

I was really nervous about taking, like I purposely didn’t take any math classes this semester, because I’m like next year is going to be my year of math.  And so I’m still equally as nervous for that. But I think it would be really cool if there was a class, just on computational thinking, or because I don’t know if this is just my first time, so I’m like I’m not sure at, like in what capacity is it’s going to be in my math class or in like my required science class, but I’m like is it all going to be this? Because maybe that’ll be fun! 

CIS (CSC 101)  students:

My high school offered those programs and I tried to join the robotics team….I was kind of really intimidated because the whole class was just male, so I feel like, ah, but you know I know that I was kind of getting older, I kind of learned that in this industry, there’s not that much females, like womans, you know, trying to work in that field and I feel like now that I’m getting into I feel like I’ll have more an advantage.

I started to, you know, develop myself and I said you know what, it’s time I should just go and get my degree in this because this is something that I really want to do, so you know, with the computational thinking also… I noticed that I’m taking a math class right now as well, and it is structured very similar to what we’re doing in this class. So it’s, it’s been really helpful.

I’ve taken a CS course or two in the past, and I’ve really liked what I’ve done, but it still like, can be very intimidating at times. But there’s always like, certain things that I’ll do like this, for example, that will kind of like, remind me what I enjoy about it because I found this like, it wasn’t like, it didn’t feel like, super complicated or anything for me – but it was like, just something like, I enjoyed the process and the problem solving that was involved in it… so I yeah it solidified it for me.

On the whole, students from both disciplines had a positive response to the class activity. They appreciated being exposed to a skill that they will use in the workplace, and some mentioned that they plan to use it in their other classes moving forward. Some found it to be fun, or felt like it was a necessary skill they were grateful to have the chance to practice. 

We wanted to share the description of this activity with the BMCC community in order to let you know that if you are interested in this kind of classroom innovation, our research is designed to provide opportunities for faculty across disciplines to join us. We are excited about the outcomes of our research so far, having seen strong positive feedback from the students. One particular student was very happy. The experience she gained in our project activities were exactly what the interviewer wanted to hear, and this student was hired at a prestigious corporation straight out of school. 

If you are interested in learning about how to conduct this activity in your own classroom, or want to learn more about how to engage students across the disciplines in STEM thinking, in a manner that may equip them with thinking skills that will help them in their careers and lives, please reach out the Professor Mohammad Azhar at mazhar@bmcc.cuny.edu

Acknowledgements

This work was supported by the U.S. National Science Foundation under Award #2122690. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Science Foundation. 

References

  • Thorson, K.  “Early Learning Strategies for Developing Computational Thinking Skills,” in Getting Smart, 2018.
  • Wing, J. “Computational Thinking: What and Why?” in Link Magazine, 2010.
  • Wing, J.  “Computational Thinking,” in Communications of the ACM, vol. 49, 2006, pp. 33-35.

[1] We are grateful to Professor Christian De Rojas Prats for helping his class to participate in this research.

Leave a Reply