CMPUT-174 · Lesson 1 of 12 · 29 min
What computing science is
Computing science is the study of computation: what can be computed, how to compute it efficiently and correctly, and how to build reliable systems that do it for people. It is not mainly the study of computers, any more than astronomy is the study of telescopes. Computers are the instruments; the subject is the processes they carry out, which computing scientists call algorithms, and the information those processes transform. This first lesson explains what the field covers, introduces the two ideas that run through the whole program, algorithms and abstraction, sketches how the discipline developed, and describes the main areas of study and the careers they lead to. It also explains how this course works: you will write and run small Python programs in every lesson, and each later course in the Computing Science program builds on the habits you form here.
Algorithms: precise recipes for solving problems
An algorithm is a finite, unambiguous sequence of steps that solves a problem for every valid input. A cooking recipe is an informal algorithm, but it leaves much to the cook's judgement: "season to taste" is not something a machine can follow. A computing algorithm must be precise enough that a device with no understanding at all can carry it out. Classic examples are much older than electronic computers. Euclid's algorithm for the greatest common divisor of two whole numbers appears in his Elements, written around 300 BCE, and it is still used inside modern cryptography libraries.
Euclid's idea is simple: the greatest common divisor of two numbers does not change if you replace the larger number by the remainder when it is divided by the smaller. Repeat until the remainder is zero; the last non-zero value is the answer. Here it is in Python, with a line printed at each step so you can watch the algorithm work. You do not need to understand every symbol yet; lessons 4 to 7 explain variables, loops and functions in detail.
def gcd(a, b):
"""Return the greatest common divisor of a and b using Euclid's algorithm."""
step = 0
while b != 0:
step += 1
print(f"step {step}: gcd({a}, {b}) -> remainder {a % b}")
a, b = b, a % b
return a
print("answer:", gcd(1071, 462))step 1: gcd(1071, 462) -> remainder 147 step 2: gcd(462, 147) -> remainder 21 step 3: gcd(147, 21) -> remainder 0 answer: 21
Three properties make this an algorithm rather than a vague procedure. It is definite: every step says exactly what to do. It is finite: the second number gets strictly smaller on every step, so the process must stop. It is correct: a short mathematical argument, which you will meet in CMPUT-272, shows that the greatest common divisor is preserved at every step. Computing scientists care about all three. A procedure that might run forever, or that gives the right answer only for most inputs, is not good enough when a program controls a bank transfer, a medical device or a robot.
Algorithms also differ in efficiency. There is a slower way to find the greatest common divisor: try every number from the smaller input downward until one divides both. For 1071 and 462 it takes 442 tries, counting down from 462 until it reaches 21, while Euclid's method took three steps. For numbers with hundreds of digits, as in cryptography, the slow method would not finish before the sun burns out, while Euclid's method takes a few hundred steps. Choosing and analysing algorithms is the subject of CMPUT-204 and CMPUT-304; in this course you will learn to count steps and notice when an approach grows badly.
def gcd_slow(a, b):
"""Try every candidate from min(a, b) downward; count the tries."""
tries = 0
for d in range(min(a, b), 0, -1):
tries += 1
if a % d == 0 and b % d == 0:
return d, tries
def gcd_fast(a, b):
tries = 0
while b:
tries += 1
a, b = b, a % b
return a, tries
for a, b in [(1071, 462), (123456, 7890), (10**12 + 39, 10**9 + 7)]:
if a < 10**7:
print(f"{a}, {b}: slow {gcd_slow(a, b)}, fast {gcd_fast(a, b)}")
else:
print(f"{a}, {b}: fast {gcd_fast(a, b)} (slow would need up to {min(a, b):,} tries)")1071, 462: slow (21, 442), fast (21, 3) 123456, 7890: slow (6, 7885), fast (6, 7) 1000000000039, 1000000007: fast (1, 10) (slow would need up to 1,000,000,007 tries)
Abstraction: hiding detail so we can think
The second big idea is abstraction: describing something by what it does while hiding how it does it. When you call a friend, you think about the conversation, not about radio waves, packet routing or the voltage on a chip. Computing systems are built as a tower of abstractions. At the bottom, transistors switch on and off. Above them, logic gates combine those switches into operations such as AND and OR. Gates make up circuits that add numbers and store bits; those make up a processor that follows machine instructions; an operating system manages the processor, memory and devices for many programs at once; programming languages such as Python let people write instructions in something close to mathematics and English; and applications sit on top.
Each layer gives the layer above a simpler model to work with, and each can be changed without rewriting everything above it. That is why the same Python program runs on a laptop, a phone and a cloud server with completely different chips. Abstraction is also something you will do yourself in every program you write: when you package a group of steps into a function with a clear name and purpose, as in the gcd example, you create a new abstraction that other code, including your own future code, can use without thinking about its insides. Lesson 7 is about doing this well.
A related idea is decomposition: breaking a large problem into smaller problems that can be solved separately. Writing a program to recommend a study schedule sounds daunting; reading the list of courses, estimating hours, finding free time and printing a schedule are each manageable. Abstraction and decomposition together are how computing scientists build systems with millions of lines of code that no single person could understand in full.
A short history
The idea of mechanical calculation is old, but computing science as a discipline is less than a century old. A few milestones help place what you will learn:
| Period | Development | Why it matters |
|---|---|---|
| c. 300 BCE | Euclid's greatest common divisor algorithm | Algorithms existed long before machines to run them |
| c. 820 | al-Khwarizmi's books on arithmetic and algebra | The word algorithm comes from a Latin form of his name |
| 1840s | Charles Babbage's Analytical Engine design and Ada Lovelace's notes | Lovelace described a program and saw that machines could manipulate symbols, not just numbers |
| 1936 | Alan Turing's paper on computable numbers | Defined what any mechanical procedure can compute, and proved some problems cannot be solved by any algorithm |
| 1940s | Electronic stored-program computers | Programs held in memory like data, the design still used today |
| 1950s to 1970s | High-level languages, operating systems, databases | People could write programs without thinking about machine details |
| 1980s to 1990s | Personal computers, the internet and the web | Computing reached homes and connected the world |
| 2000s to now | Mobile devices, cloud computing, machine learning at scale | Most people carry powerful computers; AI systems learn from data |
Turing's 1936 result deserves a moment. He showed that there are well-defined problems no algorithm can solve, the most famous being the halting problem: no program can correctly decide, for every program and input, whether that program will eventually stop. This is not a limitation of today's hardware; it is a mathematical fact about computation itself. CMPUT-474 explores it in depth. For now, it is enough to know that computing science has hard, proven limits as well as practical ones.
Canada has a notable place in this story. The University of Toronto installed FERUT, one of the first commercially built electronic computers, in 1952. Research groups at Canadian universities later helped found modern machine learning, and Canadian researchers shared the 2018 Turing Award, computing's highest honour, for work on deep neural networks. AI-101 lesson 5 tells that story in more detail.
The fields of computing science
Computing science is broad. A first-year student does not need to choose a specialty, but it helps to see the map. The table lists major areas, the questions they ask, and where they appear in this program.
| Area | Typical questions | Courses in this program |
|---|---|---|
| Algorithms and theory | How fast can this be done? Can it be done at all? | CMPUT-204, 272, 304, 474 |
| Programming languages | How are languages designed, checked and implemented? | CMPUT-274, 325, 415 |
| Systems | How do processors, operating systems and networks work? | CMPUT-229, 313, 379, 450 |
| Data and databases | How is data stored, queried and kept consistent? | CMPUT-291 |
| Software engineering | How do teams build reliable software on time? | CMPUT-301, 401, 499 |
| Artificial intelligence and machine learning | How can programs reason, plan and learn from data? | CMPUT-366, 367, 466; the AI program |
| Security and privacy | How do we protect systems and people? | CMPUT-331 |
| Graphics and human-computer interaction | How do people see and use computing systems? | CMPUT-411, 421 |
| Robotics | How do machines sense and act in the physical world? | The Robotics program, starting with ROB-110 |
These areas overlap constantly. A self-driving delivery robot needs algorithms for planning, machine learning for perception, systems knowledge for real-time control, software engineering to build it as a team, security to stop it being hijacked and human-computer interaction so that pedestrians understand what it will do. That breadth is one reason computing graduates find work in nearly every industry.
How computing scientists work
Whatever the area, computing scientists move between three activities. They design: they take a problem stated in human terms and turn it into a precise specification and an algorithm. They analyse: they reason about correctness and cost, using mathematics and experiments. They build: they write, test and maintain programs, usually with other people. Good work needs all three. A beautiful algorithm that is never implemented helps nobody, and a program written without design or testing will fail in ways nobody predicted.
This course gives you a first, practical taste of each. You will design small algorithms in plain language and pseudocode, analyse them by tracing them by hand and counting their steps, and build them in Python. Python is a good first language because its syntax is short and readable, it is widely used in science, data analysis, web development, robotics and machine learning, and it comes with a large standard library. Later courses introduce other languages chosen for other purposes: C in CMPUT-201 to understand memory and the machine, functional and object-oriented languages in CMPUT-274, and SQL in CMPUT-291.
Worked problem
Recognizing an algorithm
Which of these are algorithms in the computing sense? (a) "Sort the list of names alphabetically, comparing letters left to right." (b) "Pick a good password." (c) "Keep adding 1 to x until x is negative," starting from x = 0. (d) "For each student, add the marks and divide by the number of assessments."
Show solution
- (a) is precise and finite for any finite list: an algorithm, though more detail would be needed for a machine.
- (b) is not definite: "good" is not specified, so different people or machines would do different things.
- (c) is definite but never stops, because x only grows: it is not finite, so it is not an algorithm.
- (d) is definite and finite, but must say what happens for a student with no assessments to avoid dividing by zero.
Answer: (a) and (d) are algorithms, (d) once the zero case is handled; (b) is not definite and (c) does not terminate.
Careers and the profession
Computing is one of the largest professional fields in Canada. Statistics Canada's labour force data consistently show hundreds of thousands of people working as software engineers and designers, computer programmers, information systems specialists and related occupations, and the federal Job Bank lists most of these occupations as having good long-term prospects, though hiring slows in some years. Professional bodies include CIPS, the Canadian association for information technology professionals, which accredits university computing programs and awards the Information Systems Professional (I.S.P.) designation, and the Association for Computing Machinery (ACM), the international society for computing. Software engineers who want the title "engineer" must be licensed by a provincial engineering regulator, which is covered in ENGG-100.
Typical first jobs include software developer, data analyst, quality assurance or test engineer, web developer, systems administrator, security analyst, and research assistant. Many computing graduates work outside the technology industry, in banks, hospitals, governments, energy companies and farms, because almost every organization depends on software. Others go on to graduate study and research. Whatever the path, employers consistently ask for the same foundations: the ability to break problems down, write clear and tested code, explain technical ideas to non-specialists and keep learning as tools change.
The field also has a diversity problem that the profession is working on. Women remain a minority of computing science graduates in both Canada and the United States, earning roughly one in five computing bachelor's degrees in recent North American surveys such as the Computing Research Association's Taulbee Survey, and Indigenous people, Black people and people with disabilities are also under-represented. This matters because software shapes everyone's lives and teams with varied experience build products that work for more people. Lesson 12 returns to responsibility and ethics in computing.
How this course works
Each lesson mixes explanation, worked examples, short programs you can run, and practice questions. The programs use only Python's standard library, the modules that come with every Python installation, so you need nothing else. They were tested with Python 3.13 and are written to work on Python 3.12 or newer. To run them, install Python from python.org or your operating system's package manager, then use any plain editor or a beginner-friendly environment such as IDLE, which comes with Python, or Thonny. Lesson 3 walks through setup and your first programs.
The most important habit to start now is to run things. Reading code is like reading about swimming: useful, but not the same as getting in the water. When you see an example, type it in, run it, then change something and predict what will happen before you run it again. When your prediction is wrong, you have found something worth understanding. Programming is learned by making many small mistakes quickly and cheaply.
Common mistakes
MistakeThinking computing science is mostly about using software or fixing computers.
InsteadComputing science studies algorithms, information and the design of reliable systems; computers are the tools.
MistakeAssuming any step-by-step procedure is an algorithm.
InsteadAn algorithm must be definite, finite and correct for every valid input.
MistakeJudging an algorithm only by whether it gives the right answer.
InsteadEfficiency matters too: two correct algorithms can differ by millions of times in cost.
MistakeBelieving every well-defined problem can be solved by a clever enough program.
InsteadTuring proved some problems, such as the halting problem, cannot be solved by any algorithm.
MistakeReading code examples without running them.
InsteadRun every example, change it, and predict the result before running it again.
MistakeWaiting to choose a specialty before learning the basics.
InsteadAll areas rely on the same foundations of algorithms, abstraction and careful programming.
Summary and key terms
- Computing science studies computation: algorithms, the information they transform and the systems that run them.
- An algorithm is a definite, finite sequence of steps that correctly solves a problem for every valid input.
- Algorithms differ in efficiency; Euclid's method needs a few steps where trial division needs hundreds or billions.
- Abstraction hides detail behind a simpler interface; computing systems are towers of abstraction from transistors to applications.
- Turing showed in 1936 that some problems cannot be solved by any algorithm.
- The field spans theory, languages, systems, data, software engineering, AI, security, graphics and robotics.
- This course teaches design, analysis and building through small, runnable Python programs in every lesson.
- Computing science
- The study of computation, algorithms, information and the systems that process it.
- Algorithm
- A definite, finite sequence of steps that solves a problem for every valid input.
- Abstraction
- Describing something by what it does while hiding how it does it.
- Decomposition
- Breaking a large problem into smaller problems that can be solved separately.
- Program
- An algorithm expressed in a programming language so a computer can carry it out.
- Greatest common divisor
- The largest whole number that divides two given whole numbers exactly.
- Halting problem
- The problem of deciding whether any program stops on a given input; proven unsolvable by any algorithm.
- Efficiency
- How much time, memory or other resource an algorithm uses as its input grows.
- Standard library
- The modules that come with every installation of a programming language.
- Specification
- A precise statement of what a program must do, separate from how it does it.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Use Euclid's algorithm by hand to find gcd(84, 36). Show each step.
Show answer
84 mod 36 = 12; 36 mod 12 = 0; the answer is 12.
Why does Euclid's algorithm always stop?
Show answer
The second number is replaced by a remainder smaller than itself, so it decreases each step and must reach zero.
Give an everyday instruction that is not definite enough to be an algorithm, and rewrite it so it is.
Show answer
"Cook until done" could become "bake at 180 degrees for 25 minutes, then check that the centre reaches 74 degrees."
Name the layers of abstraction between a Python program and transistors.
Show answer
Programming language, operating system, processor and machine code, circuits and memory, logic gates, transistors.
Why can the same Python program run on different kinds of computers?
Show answer
The language and operating system layers hide differences in the hardware below them.
What did Alan Turing prove about the halting problem?
Show answer
That no algorithm can decide, for every program and input, whether the program will eventually stop.
Pick two areas of computing science and give a question each one studies.
Show answer
For example, systems: how does an operating system share a processor; security: how can a password be stored safely.
Break the problem "plan a weekly study schedule" into four smaller problems.
Show answer
Read the courses and deadlines, estimate hours per course, find free time slots, and assign hours to slots and print the schedule.
Why do computing scientists analyse efficiency as well as correctness?
Show answer
Because a correct algorithm can still be too slow or use too much memory for real input sizes.
What should you do every time you see a code example in this course?
Show answer
Run it, change something, predict the result, and run it again.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.