Activity 1: Introducing the Programming Each Other Challenge This activity sets the goal for the Challenge. In it, students are asked to learn about programming because an author is writing a book to introduce young children to the idea of programming. The book is about an absent-minded programmer and the funny things that happen when a robot he is programming is given poorly thought-out instructions. The challenge for students comes from the publisher, CodeWorks Publishing. They are looking for students to write sample “absent-minded” programs and companion well-thought-out programs to be included at the end of the book.
The challenge day ends with the teacher providing an example program they tried: sorting his socks. The sorting-socks challenge will run throughout the unit, with complexity added each activity to scaffold basic programming concepts. The programmer sent along a pile of his clean socks to have students begin to think about how to program a robot to sort them. The teacher will describe the task and give students some play time to start experimenting and documenting their process.
Activity 2: Writing Instructions In this activity, students review the everyday challenge of sorting socks. They will start by breaking down the simplest form of the task—where they have a fixed number of identical socks—into component steps. In teams, they will write instructions for sorting a pile of socks and then test their instructions. Afterwards, they will share their instructions and discuss ways in which their instructions might be misinterpreted, and then they will think about ways to correct those misinterpretations.
In the second part of the activity, students will look at a new task—performing a magic card trick—and write instructions for performing their trick. Several demonstrations of kids performing tricks are available on YouTube (we will provide links to a sample of them).
Activity 3: Looping Loops In this activity, students will review their instructions from yesterday’s activities. The teacher will increase the complexity of the task by challenging students to solve the problem for a large number (or even unspecified number) of socks. The goal of this activity is to introduce the concept of loops in programming—identifying a pattern of steps and encapsulating them into a short set of instructions that are set off with an overarching instruction to repeat those steps some number of times. [Note that some students in advanced classes may have already incorporated loops in Activity 2.]
In the second part of the activity, students will think about taking an everyday task (such as making a sandwich) and carefully writing out the steps so other students can follow them. Students can be challenged to look for unclear statements (and purposefully do the wrong thing) to prompt the writer to be clear and specific.
Activity 4: If… Then… What? This activity introduces the concept of conditionals—programming instructions that require a decision based on input. The sock challenge further complicates it by introducing a second color of socks, so their robot will have to perform a different task if they have two socks that match versus one of each color. They will also formalize end conditions to loops introduced in Activity 3 using statements such as “do these steps 10 times” or “until there are no socks are left.”
In the second part of the activity, students will continue with their everyday task, this time thinking of how they would change their code to account for performing the task multiple times. (For instance, making 10 sandwiches instead of only 1.)
In the second part of the activity, students will sort themselves by height. Assuming they are lined up in random order, they will provide instructions for what comparisons need to be made and how students will move to ultimately be lined up from shortest to tallest.
Activity 6: Breaking Down the Problem This activity will focus on breaking down a larger problem into smaller subtasks. Students will start with a laundry bag that contains some number of socks but only of three colors. Students will explore several options for how to break down the task (for instance, separate all socks into like piles first then pair from within the pile, or pick one sock then search until a match is found and pair them) and discuss how each solution is different and under which conditions one algorithm may be more efficient than the other. Students can then consider what would happen to their task if they could have three robots working on sorting instead of one, and whether that would change their decision as to which method would take less time. This exploration will highlight the concept of parallelization in programming—breaking down a problem so that different tasks can be done by different robots (or processors, or people) at the same time, reducing the overall time that the entire project would take.
In the second part of the activity, students will be tasked to break down the process for making cookies for a school event. Different sets of constraints can be assigned (number of ovens, bowls, measuring equipment, people available to help) that will alter the optimal breakdown of the overall task. For instance, if there are 3 bakers, 3 ovens, and 3 sets of tools, is it more efficient for each baker to bake a third of the required cookies, or to have one baker mix the dough, one put the dough on the cookie sheets, and the third attend to the cookies coming out of the oven? How does that change if there is only one baker? one oven?
Activity 7: Programming Our Absent-Minded Task In this activity, students will choose their programming task and begin to decompose the problem. They will develop a set of initial instructions for carrying out their task and “debug” their program—looking for places that their code is imprecise or incorrect. In this session, they will develop their “absent-minded” program by combining the various “bugs” they’ve found in the work they have done in this activity.
Activity 8: Making Our Program Work! Students spend this session developing a working program for their task. They look back at the work they did in Activity 7 and explore the ways in which their original work was imprecise or inefficient and try to create the best possible program for their task. Activity 9: Preparing Our Presentations Teams develop presentations for their programming ideas. As part of the development, the teacher familiarizes students with a rubric that informs them of the items for which they will be assessed and what a Level-4 response looks like.
Activity 10: Presenting Our Programs Student teams share their absent-minded and well-thought-out programs with the class and, ideally, invited guests. Each team first presents its absent-minded program, complete with explanation of how the program can go wrong, and then their companion program with an explanation of why this program will complete the task correctly and efficiently. Audience members may ask questions of any team member concerning their programs. Students reflect on how their understanding of programming has grown since they began the challenge and complete a unit assessment. They also turn in their completed science notebooks.