Algebra

Algorithms to Generate Sets

1

Follow the Algorithm

Follow each algorithm to generate the first 5 numbers.

Start at 3, add 4 each time: 3, ___, ___, ___, ___

Start at 100, subtract 7 each time: 100, ___, ___, ___, ___

Start at 2, multiply by 2 each time: 2, ___, ___, ___, ___

2

More Algorithms to Follow

Follow each algorithm to generate the first 5 numbers.

Start at 1, add 6 each time: 1, ___, ___, ___, ___

Start at 500, subtract 50 each time: 500, ___, ___, ___, ___

Start at 1, multiply by 3 each time: 1, ___, ___, ___, ___

Start at 1000, divide by 2 each time: 1000, ___, ___, ___, ___

3

Complete the Algorithm Output

Fill in the missing numbers generated by the algorithm.

5
10
15
25
?
1
3
15
31
?
64
32
8
4
?
4

More Algorithm Outputs

Fill in the missing numbers.

7
14
21
35
?
2
6
18
162
?
1000
100
10
1
?
5

Which Algorithm?

Circle the algorithm that generates each set.

{5, 10, 15, 20, 25}

Start at 5, add 5
Start at 5, multiply by 2
Start at 5, add 10

{2, 4, 8, 16, 32}

Start at 2, add 2
Start at 2, multiply by 2
Start at 2, multiply by 4

{100, 80, 60, 40, 20}

Subtract 10
Subtract 20
Divide by 2
6

Match Algorithm to First 4 Numbers

Draw a line to match each algorithm to its output.

Start at 4, add 3
Start at 1, double
Start at 50, subtract 8
Start at 3, multiply by 3
3, 9, 27, 81
4, 7, 10, 13
50, 42, 34, 26
1, 2, 4, 8
7

Match the Set to the Algorithm

Draw a line to match each set of numbers to the algorithm that generated it.

{4, 8, 12, 16, 20}
{1, 3, 9, 27, 81}
{1000, 100, 10, 1}
{2, 5, 11, 23, 47}
Multiply by 3
Start at 4, add 4
Divide by 10
Double and add 1
8

Write the Algorithm

Look at each set of numbers and write the algorithm (rule) used to generate them.

Set: {6, 12, 18, 24, 30} Algorithm: ___

Set: {1, 4, 13, 40, 121} Algorithm: ___

Set: {500, 450, 400, 350, 300} Algorithm: ___

9

Write More Algorithms

Identify the algorithm for each set.

Set: {3, 7, 15, 31, 63} Algorithm: ___

Set: {10, 25, 55, 115, 235} Algorithm: ___

Set: {256, 128, 64, 32, 16} Algorithm: ___

10

Two-Step Algorithm Check

Circle the correct next number for each two-step algorithm.

Double then add 1: 1, 3, 7, 15, ?

30
31
32

Triple then subtract 1: 1, 2, 5, 14, ?

39
41
43

Add 3 then multiply by 2: 1, 8, 22, ?

44
50
68
11

Flowchart Algorithm

Follow this flowchart algorithm: Start → Input a number → Multiply by 2 → Add 3 → Output. Complete the table.

Input 1 → Output ___

Input 4 → Output ___

Input 7 → Output ___

Input 10 → Output ___

Output is 25 → Input was ___

12

Create Your Own Algorithm

Design your own algorithm and generate the first 6 numbers.

Algorithm: Start at ___, then ___ each time. Numbers: ___, ___, ___, ___, ___, ___

Algorithm: Start at ___, then ___ each time. Numbers: ___, ___, ___, ___, ___, ___

13

Create a Two-Step Algorithm

Design a two-step algorithm and generate the first 5 numbers.

Algorithm: Start at ___, then ___ and then ___ each time. Numbers: ___, ___, ___, ___, ___

Give this algorithm to a partner. Can they find your rule?

14

Algorithm Comparison

Compare two algorithms and answer the questions.

Algorithm A: Start at 1, add 5. Algorithm B: Start at 2, add 3. Which algorithm reaches 20 first? Show the first 8 numbers of each.

Will Algorithm A and Algorithm B ever produce the same number? If so, when?

15

Home Activity: Algorithm Challenge

Create algorithms at home!

  • 1Write an algorithm that generates your times tables (e.g. start at 0, add 7 each time for the 7s).
  • 2Create a 'doubling' algorithm starting from 1. How quickly does it get past 1,000?
  • 3Give a family member a set of numbers and challenge them to find the algorithm.
  • 4Write an algorithm that uses two operations (e.g. multiply by 2 then subtract 1).
  • 5Use a spreadsheet to test your algorithms and generate 20 numbers instantly.
16

Tracing an Algorithm

Trace each algorithm step-by-step for the given starting value.

Algorithm: Start at 5. While number < 100: multiply by 2. List all numbers: ___

Algorithm: Start at 1000. While number > 1: divide by 4. List all numbers: ___

17

Which Numbers Does the Algorithm Generate?

Circle the correct output.

Start at 7, add 6 each time (first 4 terms):

7,13,19,25
7,13,20,27
7,14,21,28

Start at 2, multiply by 3 (first 4 terms):

2,5,8,11
2,6,18,54
2,4,6,8

Start at 81, divide by 3 (first 5 terms):

81,27,9,3,1
81,72,63,54,45
81,54,27,0,-27
18

Comparing Algorithm Outputs

Run both algorithms and compare their outputs.

Algo A: Start at 5, add 5. Algo B: Start at 2, multiply by 2. First 6 terms each. A: ___ B: ___

Which gives bigger numbers by the 10th term? ___

19

Inverse Algorithms

Work backwards through each algorithm to find the starting value.

Algorithm: Add 5 each time. 5th term is 35. Starting value: ___

Algorithm: Multiply by 2 each time. 4th term is 48. Starting value: ___

Algorithm: Subtract 8 each time. 6th term is -10. Starting value: ___

20

Match Starting Value to Sequence

Draw a line to match each algorithm + starting value to its output.

Start 3, ×2 each time
Start 100, −15 each time
Start 1, +7 each time
Start 256, ÷4 each time
1, 8, 15, 22, 29
100, 85, 70, 55
256, 64, 16, 4, 1
3, 6, 12, 24, 48
21

Conditional Algorithms

Follow these conditional algorithms.

Start at 1. If even, add 4. If odd, multiply by 3. Apply 5 times. Sequence: ___

Start at 50. If > 40, subtract 7. If ≤ 40, add 3. Apply until the number is between 35 and 45: ___

22

Sort Algorithm Steps

Put these algorithm steps in the correct order.

Output the number
Start with n = 1
Check if n > 100
Multiply n by 2
Step 1
Step 2
Step 3
Step 4
23

Generate Sets Using Formulas

Generate the first 6 terms of each set using the formula.

Set A: {n² + 1} for n = 1, 2, 3, 4, 5, 6. Set: ___

Set B: {2n − 1} for n = 1, 2, 3, 4, 5, 6. Set: ___

Set C: {3n} for n = 1, 2, 3, 4, 5, 6. Set: ___

24

Finding the Algorithm from Output

Study each output and write the algorithm that generates it.

{8, 11, 14, 17, 20}. Algorithm: ___

{1, 2, 4, 7, 11, 16}. Algorithm: ___

{3, 9, 81, 6561}. Algorithm: ___

25

Algorithm Debugging

An algorithm says 'start at 4, add 3'. A student got: 4, 7, 10, 14, 17. Spot the error.

The error is at which term?

3rd
4th
5th

The correct 4th term should be:

13
14
15

What might have caused the error?

Added 4 instead of 3
Added 3 then 4
Subtracted 3
26

Algorithm Output Comparison

Two algorithms ran for 5 steps. Each icon = 1 unit of output. Answer the questions.

Algo A: +5 each step
Algo B: ×2 each step
Algo C: +3 then ×2
1

Which algorithm produces the largest 5th term?

2

At what step does B's output first exceed A's?

3

If Algo A starts at 10, list the first 5 outputs.

27

Even and Odd Algorithm Outputs

Run the algorithm 'start at 3, add 4' for 10 terms. Tally even and odd outputs.

ItemTallyTotal
Even numbers
Odd numbers
28

Real-World Algorithms

Write an algorithm for each real-world situation.

Algorithm for calculating 10% GST on a price: ___

Algorithm for converting km to m: ___

Algorithm for finding if a number is prime: ___

29

Algorithm Efficiency

Compare two ways to find the same result.

To find 12% of $250: Method A (use 1%×12) vs Method B (use 10%+2%). Show both: ___

Which method is more efficient? Why? ___

30

Spreadsheet Thinking

Imagine you are using a spreadsheet to run an algorithm. Describe the steps.

Write a formula that would calculate the 10th term of 'start at 1, multiply by 2': ___

What column headings would you use to display results? ___

How would you extend the algorithm to find the first term that exceeds 1,000? ___

31

Identifying Missing Steps

Each algorithm has a missing step. Identify and fill it in.

Algorithm: Start → ??? → Add 3 → Output. Produces: 5, 8, 11... Starting input was 2. Missing step: ___

Algorithm: Input → Multiply by 2 → ??? → Output. Produces: 3, 5, 7 (inputs 1, 2, 3). Missing step: ___

32

Algorithm Design Challenge

Design an algorithm that meets each requirement.

Design an algorithm where the 5th term is exactly 100: ___

Design an algorithm that generates only prime numbers (first 5): ___

Design an algorithm that generates a decreasing sequence never going below 0: ___