Euclid's Algorithm for the Highest Common Factor is a perfect fit for students coding in mathematics. This 2000 year old algorithm finds the highest common factor of two numbers, students can however extend the algorithm to find the highest common factor of a list of numbers with the option to place this new functionality in the calculator's public library.
This activity introduces the WHILE loop, however the activity contains several lessons worth learning. Students also test their program to identify any limitations and extend it beyond the original algorithm to include a list of numbers.
- While - EndWhile
- If - Then - Else - EndIf
About the Lesson
Watch Activity Tutorial
Euclid's algorithm for finding the highest common factor is a very simple routine for students to put into a program and serves as a great introduction to the WHILE loop. Students are also required to test their program, a very important part of any coding activity. Finally, students are encouraged to extend their program to include the highest common factor of three numbers or even a list of numbers. The program can then be saved to their public library and become a useful function extending the inbuilt command for the Highest Common Factor. Further to this students gain an understanding of the fact that calculators are not 'intelligent', they contain algorithms and most algorithms have their limitations.