Programming should be, above all, fun. In this course, we will use programming to build a range of exciting projects, from an election simulator to a self-replicating automaton, and from a physics engine to an evolutionary Tree of Life for coronaviruses.
Most of the applications of programming that we will cover in this work are modern. After all, “computer science” as its own rigorous discipline arose recently, alongside the advent of modern computers in the middle of the 20th Century. Yet the foundations of computer science, and therefore this work, were laid in the distant past.
This introductory chapter will tell the stories of two problems solved in ancient Greece 2,300 years ago.
- Finding the largest common divisor of two integers.
- Identifying every prime number up to some largest integer.
These problems are not particularly complex, but their solutions are beautiful, and these solutions have become known as two of the world’s first “nontrivial algorithms”. You may be wondering what these two words mean, and so let us begin our journey by delving into the concept of an algorithm.