Skip to content
Book a Call → mycocoon.life
← Back to Blog Students 9 min read

CS50 Week 0 Explained: Binary, Algorithms and Scratch

Week 0 is the lecture that hooks people. Before any code, it answers a question most of us have never asked: how does a machine that only understands on and off end up showing you photos, emoji and text? Then it introduces the idea the whole course is built on, the algorithm, and has you build something in Scratch, a visual programming language made of drag-and-drop blocks.

🎓
An unofficial study guide. CS50 is Harvard University's Introduction to Computer Science, taught by David J. Malan. The lectures, notes and problem sets linked here belong to Harvard and are shared under CC BY-NC-SA 4.0. This guide is Cocoon's own writing and is not affiliated with or endorsed by Harvard. Take the course itself, free, at cs50.harvard.edu/x. Part of our CS50 study series. Keep track of your progress with our free CS50 Study Tracker.
CS50 Week 0 Explained: Binary, Algorithms and Scratch, pixel-art illustration
CS50 Week 0 Explained: Binary, Algorithms and Scratch
Thumbnail of CS50x 2026, Lecture 0: Scratch
Watch the lecture

CS50x 2026, Lecture 0: Scratch

2 h 1 min · Harvard University · CS50 on YouTube

Jump to the key moments

  1. 2:24Artificial intelligence
  2. 16:06Binary
  3. 29:46ASCII
  4. 40:52Unicode
  5. 44:57Colour
  6. 55:23Algorithms
  7. 1:04:45Pseudocode
  8. 1:14:09Scratch
  9. 1:33:51Abstraction
  10. 1:51:59Ivy's Hardest Game

The big idea: everything is numbers, and numbers are bits

A computer is built from billions of tiny switches that are either off or on, 0 or 1. One of those values is a bit. With a single bit you can count to 1. With more bits, each position is worth twice the one to its right (1, 2, 4, 8, 16 and so on), so eight bits can represent any number from 0 to 255. That's binary, and eight bits make a byte.

Once you have numbers, you can represent anything by agreeing on what the numbers mean:

The same bits can mean different things depending on context. The same three bytes could be a colour or three letters. Programs keep track of which is which.

Algorithms: step-by-step instructions

An algorithm is a precise set of steps for solving a problem. The lecture's famous example is finding a name in a phone book. You could turn one page at a time (correct, but slow), two pages at a time (faster, but you might skip the name), or open the book in the middle, decide which half the name is in, and throw the other half away. The last approach needs only about 10 steps for a 1,000-page book and 11 for a 2,000-page one. Doubling the problem adds just one step. Hold on to that idea: Week 3 formalises it.

Pseudocode is how you write an algorithm down before you code it: short, numbered lines in plain English, using a few building blocks that show up in every programming language:

Scratch: the same ideas with blocks

Scratch lets you write programs by snapping blocks together, so you can focus on logic without worrying about syntax. Every building block above has a Scratch version: "when green flag clicked" to start, "if/else" for conditionals, "forever" and "repeat" for loops, and variables for storing things like a score. The lecture also introduces abstraction: when a group of blocks does one recognisable thing ("meow"), you wrap it in a custom block with a clear name, so the rest of your program reads like a story.

Problem Set 0: what it asks

Starting from Scratch is entirely open: a game, an animation or a story, built at scratch.mit.edu. It has to meet a short list of requirements (at least two sprites, a few scripts, a conditional, a loop, a variable, and a custom block that takes an input), and it should be more ambitious than the small examples in the lecture. Before you start, you also set up the course on Harvard's side with a GitHub account. The problem set page walks you through it.

Where people get stuck

Check yourself

How many different values can 3 bits represent?

Eight (0 to 7). Each extra bit doubles the count: 2 × 2 × 2.

Why was Unicode needed when ASCII already existed?

ASCII only has room for about 128 characters, which is enough for English but not for most of the world's languages or for emoji. Unicode uses more bits per character, so it has room for all of them.

The phone book has 1,024 pages. Roughly how many steps does "split in half" need in the worst case?

About 10, because 210 = 1,024. Page by page could take all 1,024.

What's the point of a custom block in Scratch?

It's abstraction: you give a group of steps a name so you can reuse it and forget how it works inside. Every language you meet later has the same idea, called a function.

Teaching Scratch to a younger learner? Cocoon Kids starts with Scratch too.

See Cocoon Kids →