The aim is to show through play how a sorting algorithm could work. The instructions need to remain simple and they should lead to successful actions.
| Subject | Mathematics, Computer Science |
| Length | 90 minutes (2 x 45 minutes) |
| Pedagogical Approach | Haptic Learning |
| Competences | Algorithms |
| Grades | 3rd-6th grade |
| Technologies | No Technology |
Other Materials Needed
Multiple hula hoops, at least 12 of them. papers with different numbers on them. The order or size of the numbers does not matter. This exercise requires a lot of space. It could be considered to have the class in a gymnasium or outside.
The Goal Competences of the Exercise
- the students learn what an algorithm means
- The students learn that there are different ways to arrange numbers and that it is not very easy, when their number increases.
- The students learn basic principles of programming
- The students learn to use the programming-related if statement in practice
Description
The assignment needs an even number o students. They pick up numbers from the teacher’s bag. The students follow the instructions and at the end of the assignment, they should be sorted into numerical order.
Introduction
The principle of algorithms is explained to the students (attachment 1) and how the algorithms follow certain instructions to always provide a solution regardless of the data that is given to them. The students can be reminded of the human robot exercise and they are advised to closely follow the provided instructions.
Αctivity 1
First, the teacher shows the idea of the exercise with only one pair. The students pick up a number from a bag and they are requested to stand next to one another. The students step in to the hula hoop and compare their numbers. Numbers can only be compared by two persons inside a hula hoop. The person who has a smaller number moves on the left side and the person with the greater number to the right. Now, the pair can step out of the hula hoop and they are arranged in numerical order.

Αctivity 2
Next, the exercise is practiced with four students. The hula hoops are placed on the floor according to the picture below (1st line: 2 hoops; 2nd line: 2 hoops; 3rd line: 1 hoop. The same setup is repeated, the students are given numbers and they are assigned to stand next to one another. The students enter hula hoops pairwise and compare their numbers with their pair. Both members of the pair move to the next line of hula hoops: the holder of the smaller number moves to the hoop on the left and the holder of the greater number moves to the hoop on the right. In the second row, the numbers are compared again, and students arrange accordingly within the hula hoops. However, this time the leftmost and rightmost persons in the row step forwards out of their hoops, while the remaining persons step into the next hula hoop to compare their numbers. Finally, all the students step forwards and should be in numerical order.

Discussion: When the exercise has been tried out with all of the students, it is time for discussion. How many comparisons were there in the first exercise? What about the second one? How many comparioson would there be with six students?
Activity 3
Let’s try the sorting with a group of six people. The starting arrangement is the same, students are given number and they stand next to one another (see the bottom of the picture). Students step into the hula hoops pairwise and compare there numbers inside the hula hoop. The person with the smaller number moves to the left side and the person with the greater number moves to the right side. The person with the smaller number will always move to the hula hoop on the left. When there is no hulahoop, they will simply step out of the hoop and remain in their position. When all the hoops have been covered, the students should be in numerical order.

Final Discussion: When the students have arranged themselves enough, there will be a final discussion. Is it possible to sort 10 students this way? What about 100 students? One million students? How does the amount of numbers, that need to be compared, grow? The efficiency of an algorithm can be defined by considering how many comparisons it has to do with a data set of certain magnitude. The sorting algorithm used during this exercise can be derived from the bubble sort algorithm, which is one of the algorithms with poorest performance. However, it is one of the easiest algorithms to understand.
Attachment 1
Algorithms are sets of instructions that enable achieving a desired outcome. Basically, these instructions can be any kind of instructions, for example the ones that we can see in cook books. However, usually when algorithms are discussed, we often refer to mathematical instructions or instructions that are meant for a computer to understand. The binary search that we practice here is a search algorithm. Many search and ordering algorithms are used in information technology, but also for example in targeting commercials to people using the Internet.
