What Is Computer Science?
Discover what computer science really studies, from algorithms and abstraction to computational thinking, and why it is much more than programming.
Welcome back!
Step 1 of 15Learn
A science about problems, not machines
In 1936, before any electronic computer existed, a young mathematician named Alan Turing wrote a paper about an imaginary machine: a device that reads symbols on an endless tape, one at a time, following a short table of rules. He used it to answer a deep question: which problems can be solved by following a mechanical procedure at all? His surprising answer was that some problems can never be solved that way, no matter how fast the machine.
That story captures what computer science is. It's not mainly about laptops or phones. It's the study of information and computation: how information can be represented, how procedures transform it, what can be computed, and how efficiently.
A famous line, often attributed to the computer scientist Edsger Dijkstra, puts it this way: computer science is no more about computers than astronomy is about telescopes. The computer is the instrument. The science is about the ideas.
Of course, those ideas run the modern world. The same principles explain how your phone compresses a photo, how a map app finds the fastest route, how a bank keeps your password secret and how a streaming service recommends a show. In this course you'll learn the core ideas behind all of them.
Step 2 of 15Practice · Choose one
Which statement best describes computer science?
Step 3 of 15Learn
Algorithms: recipes for computation
At the heart of computer science is the algorithm: a precise, finite sequence of steps that solves a problem. You follow algorithms all the time. A recipe, the steps for long division and the instructions for assembling furniture are all algorithms, written for humans.
To count as an algorithm in the computer science sense, a procedure needs a few properties:
- Precise: each step is unambiguous. "Add a pinch of salt" is fine for a cook but too vague for a machine.
- Finite: it finishes after a limited number of steps rather than running forever.
- Input and output: it takes some data in and produces a result.
- Effective: each step can actually be carried out.
Here's an algorithm for finding the largest number in a list:
- Remember the first number as the largest so far.
- Look at each remaining number in turn.
- If it's bigger than the largest so far, remember it instead.
- When you've looked at every number, report the largest so far.
This works for a list of 5 numbers or 5 billion. A program is simply an algorithm written in a language a computer can run, such as Python or JavaScript. Designing the algorithm is usually the hard part; writing it in code comes after.
Step 4 of 15Practice · Put in order
Put the steps of the "find the largest number" algorithm in the correct order.
Drag the items, or use the arrow buttons, to put them in order.
- If it is bigger than the largest so far, remember it instead
- Remember the first number as the largest so far
- Repeat until every number has been checked
- Report the largest so far
- Look at the next number in the list
Step 5 of 15Diagram
Find the largest number, as a flow
The loop runs once per number, so a list of a million numbers takes a million comparisons, but never more.
Tap a shape with to see more.
- Largest = first number
- Look at the next number
- Bigger? Replace largest
This is the only decision in the algorithm.
- More numbers? Go back
The loop: return to "look at the next number" until the list ends.
- Output largest
Step 6 of 15Tap to reveal
Four habits of computational thinking
Decomposition
Break a big problem into smaller parts you can solve one at a time. "Build a weather app" becomes: get the user's location, fetch the forecast, choose an icon, display the result.
Pattern recognition
Notice when parts of a problem resemble each other or a problem you've solved before. Sorting books by title and sorting contacts by name are the same problem in disguise.
Abstraction
Ignore details that don't matter at the current level. A subway map leaves out streets and true distances because riders only need stations and connections.
Algorithm design
Write precise steps that solve the problem, then check that they are correct and efficient.
Step 7 of 15Learn
Abstraction: the most powerful idea
When you tap "send" on a message, you don't think about radio waves, voltages or the billions of transistors switching inside your phone. You think about sending a message. That's abstraction: hiding details so you can work at the level that matters.
Computers are built as a tall stack of abstractions, each layer using the one below without worrying about its internals:
- Physics: electrons moving through silicon.
- Transistors: tiny switches that are either on or off.
- Logic gates: circuits that combine switches to compute AND, OR and NOT.
- Processor: gates arranged to add numbers, compare them and follow instructions.
- Machine code: binary instructions the processor understands.
- Programming languages: readable code that gets translated into machine code.
- Operating system and apps: windows, files, browsers and games.
An app developer doesn't need to understand transistors, and a chip designer doesn't need to know how a social media app works. Each can be an expert at one level. This course climbs the stack from bottom to top: bits, then hardware, then algorithms and code, then networks.
Abstraction also matters when you design your own programs. Good code hides messy details behind simple names, such as a function called calculateTax, so the rest of the program can stay readable.
Step 8 of 15Practice · Match the pairs
Match each computational thinking habit to an example.
Tap an answer, then tap the place where it belongs (or drag it there).
- Decomposition
- Pattern recognition
- Abstraction
- Algorithm design
Step 9 of 15Note
Step 10 of 15Timeline
From ideas to machines
- 1843Lovelace writes an algorithm for a machine
Her notes on Babbage's Analytical Engine described computing Bernoulli numbers.
- 1936Turing describes his imaginary machine
A model of computation that is still used to define what is computable.
- 1945ENIAC runs
An early general-purpose electronic computer with about 18,000 vacuum tubes.
- 1947The transistor is invented
A tiny, reliable switch that replaced vacuum tubes.
- 1958Integrated circuit
Many transistors on one piece of material.
- 1969ARPANET sends its first message
The network that grew into the internet.
- 1971First commercial microprocessor
The Intel 4004 put a whole CPU on one chip.
- 1991The World Wide Web goes public
Tim Berners-Lee's web pages and links, running on top of the internet.
Step 11 of 15Note
Step 12 of 15Diagram
Some branches of computer science
Tap a shape with to see more.
- Computer science
- Theory
What can be computed, and how efficiently.
- Algorithms
- Systems
The machinery that runs programs.
- Operating systems
- Networking
- Cybersecurity
- Applications
Using computation to solve problems in the world.
- Artificial intelligence
- Graphics
- Databases
- Human-computer interaction
Step 13 of 15Practice · Sort into groups
Sort each procedure: is it precise enough to be an algorithm a computer could follow?
Tap an item, then tap its group (or drag it there).
Step 14 of 15Practice · True or false
A procedure that might run forever without producing an answer meets the usual definition of an algorithm.
Step 15 of 15Practice · What would you do?
What would you do?
Maya wants to write a program that recommends a movie to her friends. She opens a code editor and starts typing immediately, but after an hour she has a tangle of half-working code. What would a computer scientist suggest?
Lesson complete!