Find a course

Module 1: Computing, Information and BitsLesson 1 of 1212 min

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.

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:

  1. Remember the first number as the largest so far.
  2. Look at each remaining number in turn.
  3. If it's bigger than the largest so far, remember it instead.
  4. 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.

  1. If it is bigger than the largest so far, remember it instead
  2. Remember the first number as the largest so far
  3. Repeat until every number has been checked
  4. Report the largest so far
  5. 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.

Find the largest number, as a flowProcess diagram: Largest = first number → Look at the next number → Bigger? Replace largest → More numbers? Go back → Output largest.Largest = firstnumberLook at the nextnumberBigger? ReplacelargestMore numbers? GobackOutput largest

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

  1. 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.

  2. 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.

  3. 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.

  4. 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:

  1. Physics: electrons moving through silicon.
  2. Transistors: tiny switches that are either on or off.
  3. Logic gates: circuits that combine switches to compute AND, OR and NOT.
  4. Processor: gates arranged to add numbers, compare them and follow instructions.
  5. Machine code: binary instructions the processor understands.
  6. Programming languages: readable code that gets translated into machine code.
  7. 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).

  1. Decomposition
  2. Pattern recognition
  3. Abstraction
  4. Algorithm design

Step 9 of 15Note

Step 10 of 15Timeline

From ideas to machines

  1. 1843
    Lovelace writes an algorithm for a machine

    Her notes on Babbage's Analytical Engine described computing Bernoulli numbers.

  2. 1936
    Turing describes his imaginary machine

    A model of computation that is still used to define what is computable.

  3. 1945
    ENIAC runs

    An early general-purpose electronic computer with about 18,000 vacuum tubes.

  4. 1947
    The transistor is invented

    A tiny, reliable switch that replaced vacuum tubes.

  5. 1958
    Integrated circuit

    Many transistors on one piece of material.

  6. 1969
    ARPANET sends its first message

    The network that grew into the internet.

  7. 1971
    First commercial microprocessor

    The Intel 4004 put a whole CPU on one chip.

  8. 1991
    The 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

Some branches of computer scienceHierarchy diagram: Computer science, Theory, Algorithms, Systems, Operating systems, Networking, Cybersecurity, Applications, Artificial intelligence, Graphics, Databases, Human-computer interaction.Computer scienceTheoryAlgorithmsSystemsOperating systemsNetworkingCybersecurityApplicationsArtificial intelligenceGraphicsDatabasesHuman-computer interaction

Tap a shape with to see more.

One simplified way to group the field; many areas overlap.
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?