Activity

Butterfly Algorithms

Grades K-2
Subjects: Computational Thinking

Overview

This computational thinking activity aims to engage students in analyzing and understanding the life cycle of a butterfly using computational concepts and algorithms. By developing and applying conditionals within an algorithm, students will gain a deeper understanding of the butterfly’s life cycle and demonstrate their knowledge through the implementation and testing of a computer program.
 

NB Curricular Connections

Science (Grade 6)

Strand: Scientific Literacy – Big Idea: Investigation

What you’ll need

Instructions

Frame the activity
  1. Frame the activity by asking students what they know about the life cycle of a butterfly. Ask questions such as: what changes does a butterfly go through or where do you see other life cycles in nature?
  2. Introduce the topic of computational thinking. Ask students if they have heard of computational thinking before. If not, allow them to discuss or draw out ideas of what it might mean. After some time, define computational thinking as: a way to solve problems that uses logic and thinking that a computer can understand. We use these same ways of solving problems in our everyday life too.
  3. Explain to students that for this activity they are going to focus on one computational thinking element: algorithms. Share the definition and the real-world example so that they can see how they already use algorithms every day.
Introduce the activity
  1. Review the design scenario to make a real world connection for students. A suggestion might be saying something along the lines of: Today we will be teams of computer scientists and entomologists (scientists that study insects). We are working together to study and explain the life cycle of a butterfly. First we’ll be using computational thinking to organize the life of a butterfly. Then we’ll create a computer model that people can use at a museum to learn about a butterfly’s life cycle.
  2. The activity is outlined as a design problem, with desired features and limitations here. Explain it to students and address any questions they might have.
  3. Place students in pairs and provide the pre-filled Life Cycle and Phase Cards or blank note cards/sticky notes. • If you did not pre-cut materials, give students a few minutes to cut the cards before beginning the activity.

Creating Algorithms
  1. Students should discuss what they know about butterflies and life cycles with their partner. If you provided the blank set of cards instead of pre-filled cards, have students draw the different stages at this time. As they discuss, students should organize the images and numbers in the correct order (1- egg, 2- pupae, 3- cocoon, 4- butterfly)
  2. Once most groups have their images sorted, ask for a couple of volunteers to share their algorithm or sequence and the reasons for why they chose that order. Encourage students to use the following sentence frames when sharing:
    • During phase one it’s a ________ because________.
    • During phase two it’s a ________. I know this because _______.

Computational Thinking and Programming Concepts

  1. Next, explain that students will have to think like computers and use the language a computer would need to understand the algorithm. This will require them to use something called conditionals: something that needs to happen in order for something else to happen.
  2. Show students how they can add conditionals to their algorithm using if/then cards
    • If Phase # Then Image
  3. Ask students how they were able to successfully create their algorithm, as well as what theirs looks like. Encourage conversation about how they might use if/then phrases in their everyday life (E.g., if it’s a hot day, then I will wear shorts).
Scratch Activity
  1. Run the Butterfly Algorithms Scratch program by clicking the green flag, then the space bar and advancing through the phases on the slider bar. Ask students:
    1. What did you notice about the computer program?
    2. Was there anything missing?
    3. Students should realize that 2 phases are missing.
  2. Click “See inside” to show students the code behind the program, then click on the Life Cycle sprite, and focus on the “If/Then” conditionals in the code.
  3. Call on different pairs of students to provide you with directions for how to complete the code so that the phases will change when the slider bar is moved. Have students reference and use their algorithm to determine the “code” (blocks) that are missing.
  4. After each “if then” conditional has been added, test the program to ensure that it works as expected. Click the green flag, then press the space bar, and drag the slider bar to see if the images change for each phase.
  5. Continue coding the remaining conditionals and test after each addition until the program displays the butterfly life cycle.
Programming Concepts
  1. Help students make connections between the skills they used during this activity and those of computer scientists. Encourage students to share what they remember about the programming concepts used including algorithms and conditionals.
  2. Go through the code and ask students to identify where the conditionals are. They should be able to identify 4 in total, one for each phase.
  3. Encourage conversation about what might change if:
    • We changed the number
    • We changed the costume
    • We added a phase
  4. To deepen the understanding of code ask: Why do you think we need the “forever” block? The answer is: the forever block allows the user to go back and forth and see the different stages of the cycle instead of only seeing them once. Try removing it and see what happens.

Attachment

Complete instructions, including debrief, available here

Extension Ideas

 

Digital Literacy Framework

 

Reflection Activity

*coming soon