Teaching loops and efficiency

I love the idea of having them physically get up and do an activity over and over again. I could ask a student to bring me blue crayon, wait until yhey go back to their seat, and then ask for another blue crayon. Repeat. I think it would really drive home the concept.

Being new to teaching coding, I haven’t had to teach loops yet. But I really like the idea of getting the kids up and moving to physically demonstrate how it is easier to use a loop rather than repeat the same instruction 5 times because I think it really gets the point across in a way that isn’t as clear when working on a program like code.org.

This looks like something that could be done with skip counting with younger grades.

I teach high school math - Algebra 1 to 9th grade students. I think that the most straightforward way to introduce the idea of loops to students is to compare it to repeated steps or directions. The first thing that comes to mind to me as it relates to my Algebra 1 curriculum is exponent properties. Exponents are repeated multiplication, so in essence, they are a loop. 4^5 is a more efficient way of writing: 4 x 4 x 4 x 4 x 4. The same operation (multiplication) is being repeated over and over, and that is captured by writing it out as an exponent instead. I think that discussing it in this context would be helpful for students, but I would also want them to come up with their own examples as well of where we see the concepts of loops - either in math class, or in other aspects of their lives.

How would you explain the concept of loops to your students?

I would explain looping as a repetition of steps. I would like the words repeat and loop.

The idea of looping seems pretty cool. I know that my kids are always looking for short-cuts, and I believe looping is a great way to save time and energy when writing the code. I relate this to the “broken record player” comment we used to get a lot when I was in school as a student. Teachers always complained about repeating themselves. So I think I would present this idea as a way of repeating myself without having to plan to do so by writing the thought multiple times. I would just write the idea once and then loop it!

As a first grade teacher, I always like to teach new concepts with tactile learning. When ever my students can be hands-on with manipulatives I see an increase of engagement and on topic discussion. At the beginning of the year we have a review of patterns in math. When ever possible I like to connect their learning to something they have done before. When we practice patterns I take out my shape blocks for students to configure different patterns. As a class, I write out a pattern as a list of instructions. Sometimes the list can be very long. To relate this to looping, I have my students look for shapes or patterns that are repeated. Once we find the repetition, I rewrite the list of instructions with emphasis on the repetitions (i.e. square, square, square vs. 3 squares). Students can visually see the difference of length and time that it takes to recreate the pattern while following the instructions. I then describe how our new/shorter list of instructions is called “looping”. I also allow my students time to practice with a partner for how they can create a new list of instructions to show their own looping.

I love to use physical activity to teach the concept of loops. In first grade, we dance to the electric slide which is easy and fun. The kids are able to see and feel the repetition of the dance steps. We use clapping and the kids are the “teachers” who come up with the loop. Both of these physical activities are fun and one is able to clearly see if the students have mastered the concept.

We have a fitness month and so i would ask the students to choreograph a gym routine in a group, with the exact instructions. Swop with a partner group and identify the loops within that routine. Rewrite the algorithm in a reduced format. Each group gets to teach the class their routine.

I’m a first grade teacher, so I always try and relate larger concepts to everyday life to gain a better understanding. We encounter looping every single day with our daily tasks! Looping exists in the patterns in the way we brush our teeth, comb our hair, etc. But loops also exist in exercises we do! Any time I can get first graders moving to make connections to our learning, the better. I start by taking an activity like jumping jacks. I tell the students they cannot do a move unless I tell them. So I can say something like “Make your arms and legs go out. Make your arms and legs go in. Make your arms and legs go out…” and so on and so forth. It gets silly because it takes so long to do the jumping jacks that way! Once the kids recognize the pattern of “out-in”, we can turn that into a loop, by saying “Make your arms and legs go out and back in 20 times.” Of course after that, you can ask the class to identify other movements or pieces of their daily routines that repeat. Have them pair up, and write the loops that match those activities!

I think teaching the loops through dance and music are the most engaging way for the students . There are so many songs out now that at popular to the students that contain loops and repetition. This lends itself perfectly to teaching this lesson and will be extremely enjoyable for all involved!

I like the idea of linking this to math concepts. My son is going into 2nd grade, but he already has most of his multiplication facts memorized. We were just talking yesterday about how multiplication is just repeated addition.

i teach a multi-age 4/5/6 grade classroom. Since students loop with me all three years, some of them already know some coding concepts. It is important for me to remind students already in the know to give the 4th graders and new students a chance to answer.

I will use the macarena to introduce the idea of loops. I will ask a student to write out the instructions for the dance until they come up with the idea that the steps repeat. Then I will ask students to make up their own looped dances for a partner to try. I will do this in Morning Meeting on the day students will do the My Loopy robotic friends unplugged lesson. Introducing some of the concepts in Morning Meeting makes instruction faster which gives students more time to practice the concept.

I like the idea of having the kids continuing to give them a direction over and over and thinking of a shorter way to say it.

One teacher friend of mine had her students work in partners to create a algorithm of getting from one classroom to the next, then they gave it to another set of partners to try and complete the task based on the directions given. With the the 4 or so groups who came back able to be successful, she had them look to see if they did anything more than once. The students made a note of this and created “shorter” versions of their algorithms that were easier to write down or memorize. She had them look for the “patterns” and explained having seen the patterns, we call that repeating directions.

I would explain we use counting loops when we want to tell the computer to repeat an action a certain number of times. If I want a student to come to me from across the room, do I tell them to keep taking individual steps, or is there an easier way? Such as, come forward 16 steps.