Spotting a repeating pattern

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Spotting a repeating pattern

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which algorithm has a repeating pattern that could be replaced by a loop?
A Clap, spin, jump, bow, wave, stomp, sit, stand
B Clap, stomp, clap, stomp, clap, stomp, clap, stomp
2. A student draws a square with: forward 10, turn 90, forward 10, turn 90, forward 10, turn 90, forward 10, turn 90. Which loop gives the same result?
A REPEAT 8 times: forward 10, turn 90
B REPEAT 4 times: forward 10, turn 90
3. What is the main reason for replacing a repeating pattern with a loop?
A The algorithm becomes shorter but gives the same result
B The algorithm gives a different result
4. You are setting a table for 5 people: put down a plate, put down a fork, put down a plate, put down a fork, and so on 5 times. What is the repeating pattern?
A Put down a plate, put down a fork
B Put down a spoon
5. Which list of steps does NOT have a repeating pattern?
A Hop, turn, clap, bow, wave
B Hop, turn, hop, turn, hop, turn

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1REPEAT 4 TIMES Clap END REPEAT AThe steps were written out AND put in a loop. This does the pattern twice as often, so the loop should replace the repeated steps, not be added to them.
2Step forward, Step back, Step forward, Step back BThe loop count does not match the original. Spin was written 4 times, so it must be REPEAT 4 TIMES to get the same result.
3Drawing a square has the same two steps four times, so one loop can replace them. CREPEAT 4 TIMES Draw line Turn right 90 END REPEAT
4Setting a table for 3 people repeats the same steps, so one loop makes the algorithm shorter. DOne loop that replaces Clap, Clap, Clap, Clap. It is shorter and gives the same result.
5REPEAT 2 TIMES Spin END REPEAT (original: Spin 4 times) EREPEAT 3 TIMES Put down plate Put down fork END REPEAT
6Draw line, Turn 90, Draw line, Turn 90 REPEAT 2 TIMES Draw line Turn 90 END REPEAT FA repeating pattern: the pair Step forward, Step back appears twice, so a loop could replace it.

Definitions

repeating pattern

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
______ 3 TIMES clap END REPEAT
2.
REPEAT _ TIMES draw line, turn right 90 END REPEAT
3.
REPEAT 4 _____ put plate, put fork END REPEAT
4.
REPEAT _ TIMES hop END REPEAT
5.
REPEAT 3 TIMES draw line, turn right 120 __________

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A REPEAT 3 TIMES
B Move forward 10
C Turn right 90
D END REPEAT
Question 2
A Start the dance
B REPEAT 6 TIMES
C Clap
D Stomp
E END REPEAT
Question 3
A SET people TO 4
B REPEAT 5 TIMES
C Put out a plate
D Put out a fork
E END REPEAT
Question 4
A REPEAT TIMES
B Jump
C Spin
D END REPEAT
Question 5
A Pen down
B REPEAT 4 TIMES
C Forward 20
D Turn right 120
E END REPEAT

Answer Key

Spotting a repeating pattern
Section A: Quick Questions
Q1
B — Clap, stomp, clap, stomp, clap, stomp, clap, stomp
Q2
B — REPEAT 4 times: forward 10, turn 90
Q3
A — The algorithm becomes shorter but gives the same result
Q4
A — Put down a plate, put down a fork
Q5
A — Hop, turn, clap, bow, wave
Section B: Match the Pairs
Q1
REPEAT 4 TIMES Clap END REPEAT → One loop that replaces Clap, Clap, Clap, Clap. It is shorter and gives the same result.
Q2
Step forward, Step back, Step forward, Step back → A repeating pattern: the pair Step forward, Step back appears twice, so a loop could replace it.
Q3
Drawing a square has the same two steps four times, so one loop can replace them. → REPEAT 4 TIMES Draw line Turn right 90 END REPEAT
Q4
Setting a table for 3 people repeats the same steps, so one loop makes the algorithm shorter. → REPEAT 3 TIMES Put down plate Put down fork END REPEAT
Q5
REPEAT 2 TIMES Spin END REPEAT (original: Spin 4 times) → The loop count does not match the original. Spin was written 4 times, so it must be REPEAT 4 TIMES to get the same result.
Q6
Draw line, Turn 90, Draw line, Turn 90 REPEAT 2 TIMES Draw line Turn 90 END REPEAT → The steps were written out AND put in a loop. This does the pattern twice as often, so the loop should replace the repeated steps, not be added to them.
Section C: Definitions
Q1
repeating pattern — Same steps that appear again and again. Replace them with one loop to make the algorithm shorter, with the same result.
Section D: Fill in the Blanks
Q1
REPEAT 3 TIMES clap END REPEAT
Q2
REPEAT 4 TIMES draw line, turn right 90 END REPEAT
Q3
REPEAT 4 TIMES put plate, put fork END REPEAT
Q4
REPEAT 6 TIMES hop END REPEAT
Q5
REPEAT 3 TIMES draw line, turn right 120 END REPEAT
Section E: Spot the Error
Q1
A — A square has 4 equal sides, so the same two steps (move, turn) must repeat 4 times. It should be REPEAT 4 TIMES.
Q2
B — The long dance was clap, stomp done 3 times. REPEAT 6 TIMES would do the pattern twice as often, so the result is different. It should be REPEAT 3 TIMES.
Q3
B — There are 4 people, so the plate and fork steps should repeat 4 times. REPEAT 5 TIMES sets an extra place. It should be REPEAT people TIMES.
Q4
A — A loop needs to say how many times to repeat. The number is missing. It should be REPEAT 5 TIMES.
Q5
B — A triangle has 3 sides, so the pattern of forward and turn repeats 3 times. REPEAT 4 TIMES would draw too much. It should be REPEAT 3 TIMES.