Computer science songs

Songs about binary, algorithms and how the internet moves data. There are 12 computer science songs, each with synced lyrics, the key facts and a visualization.

  1. 01
    Ones and Zeros Binary numbers
    Electronic Computer science Ages 10–16
  2. 02
    Step by Step Algorithms
    Hip-hop Computer science Ages 10–14
  3. 03
    Packets on the Move How the internet works
    Funk Computer science Ages 11–14
  4. 04
    Round and Round Variables and loops
    Pop Computer science Ages 10–14
  5. 05
    Fetch, Decode, Execute CPU, memory and storage
    Jazz Computer science Ages 12–16
  6. 06
    How It Scales Big O notation
    Hip-hop Computer science College
  7. 07
    Lock and Key How encryption works
    Hip-hop Computer science Adults
  8. 08
    Guess and Adjust How AI learns
    Electronic Computer science Adults
  9. 09
    Sort It Out Sorting algorithms
    Hip-hop Computer science College
  10. 10
    Don’t Take the Bait How to spot phishing
    R&B Computer science Adults
  11. 11
    Input, Output Parts of a computer
    Pop Computer science Ages 7–11
  12. 12
    Base Case Recursion
    Hip-hop Computer science College

What each song teaches

Ones and Zeros Binary numbers
Binary is the base-2 number system computers use. Each digit (bit) is 0 or 1, and place values double from right to left: 1, 2, 4, 8, 16, 32, 64, 128. Eight bits make a byte, which can store 256 different values (0–255).
Step by Step Algorithms
An algorithm is a precise, step-by-step set of instructions for solving a problem or completing a task. Every algorithm can be built from three building blocks: sequence (steps in order), selection (if/else choices) and iteration (loops). Algorithms take inputs and turn them into outputs.
Packets on the Move How the internet works
The internet works by splitting data into small packets that travel across a global network of connected computers. Each device has an IP address, routers forward packets along whatever route is available, and the packets are reassembled when they arrive. TCP checks that every packet got there, DNS turns domain names into IP addresses, and HTTPS encrypts web traffic.
Round and Round Variables and loops
A variable is a named place in a program that stores a value, like a labelled box, and assignment puts a new value into it. A loop repeats a block of code: a for loop repeats a set number of times, and a while loop keeps repeating as long as its condition is true, stopping when it becomes false. If the condition never becomes false, the program is stuck in an infinite loop.
Fetch, Decode, Execute CPU, memory and storage
The CPU (central processing unit) is the processor that runs a computer’s programs by repeating the fetch-decode-execute cycle billions of times a second. RAM is fast, temporary memory that holds the programs and data in use and is wiped when the power goes off, while storage such as an SSD or hard drive keeps files even when the computer is switched off. Underneath, all instructions and data are stored in binary, as ones and zeros.
How It Scales Big O notation
Big O notation describes how an algorithm’s running time or memory use grows as the size of its input, n, grows, and it is most often used to state the worst case. It keeps only the fastest-growing term and drops constant factors, so an algorithm that takes 3n² + n + 5 steps is O(n²). Common classes, from slowest-growing to fastest-growing, are O(1) constant time, O(log n) such as binary search on a sorted list, O(n) such as linear search, O(n log n) such as merge sort, O(n²) such as nested loops or bubble sort, and O(2ⁿ) such as checking every subset of n items. Big O tells you how an algorithm scales, not its exact speed on a particular machine.
Lock and Key How encryption works
Encryption works by using a mathematical algorithm and a secret key to scramble readable data, called plaintext, into unreadable ciphertext that only someone with the right key can turn back. Symmetric encryption, such as AES, uses the same key to encrypt and decrypt, and it is fast, but both sides must already share that key. Public-key (asymmetric) encryption, such as RSA, uses a key pair: a public key that anyone can use to encrypt a message and a private key, kept by its owner, that decrypts it. HTTPS, the padlock in your browser, uses TLS, which relies on public-key methods to set up a shared secret key and then fast symmetric encryption for the data itself. Longer keys are harder to crack by brute force, because each extra bit doubles the number of possible keys.
Guess and Adjust How AI learns
AI systems built with machine learning learn by finding patterns in large numbers of examples, rather than by following rules a programmer wrote out by hand. Many of today’s systems are neural networks: layers of simple artificial neurons, each of which multiplies its inputs by adjustable numbers called weights, adds them up and passes the result on to the next layer. In training, the network makes a prediction, a loss function measures how wrong it was, and backpropagation works out how each weight contributed to the error so gradient descent can nudge every weight a little in the direction that reduces it, repeated over a huge number of examples. Once training is finished the model is used as it is; large language models, the systems behind chatbots, generate text by repeatedly predicting the next token, a word or piece of a word. Because they learn from data, models can be confidently wrong and can repeat biases in the data they were trained on.
Sort It Out Sorting algorithms
A sorting algorithm puts a list of items in order, and the classic ones differ in how their running time grows with the number of items n, how much extra memory they need and whether they are stable. Bubble sort, insertion sort and selection sort are simple but take O(n²) time in the worst case, because they compare items pair by pair over many passes. Merge sort uses divide and conquer: it splits the list in half repeatedly, sorts the halves and merges them back, taking O(n log n) time in every case; it is stable but needs O(n) extra memory. Quicksort picks a pivot and partitions the list into smaller and larger items, averaging O(n log n) and sorting in place, but it degrades to O(n²) when the pivots are consistently bad. No comparison-based sort can beat O(n log n) comparisons in the worst case.
Don’t Take the Bait How to spot phishing
Phishing is a scam in which criminals pose as a trusted company or person to trick you into handing over passwords, payment details or one-time codes, and you can usually spot it by a few warning signs. Watch for pressure to act immediately, a sender address or link that doesn’t match the organization it claims to be, requests for passwords, codes or payment, and prizes, refunds or fees you weren’t expecting. Before you click a link, hover over it (or press and hold on a phone) to see where it really goes. Phishing also arrives by text (smishing) and phone call (vishing), and good spelling no longer proves a message is real. If in doubt, contact the organization a way you already trust, such as the number on your card or by typing its web address yourself, and report the message.
Input, Output Parts of a computer
The main parts of a computer are input devices, the CPU, memory, storage and output devices. Input devices such as a keyboard, mouse or microphone send information into the computer, and output devices such as a screen, speakers or a printer show or play the results. The CPU, or central processing unit, is the computer’s “brain”: it carries out the instructions in programs, billions of them every second. RAM is the memory a computer uses while it is working, and it is wiped when the power goes off, while storage such as a hard drive or SSD keeps your files even when the computer is switched off. Hardware is the parts you can touch; software is the programs that tell the hardware what to do.
Base Case Recursion
Recursion is when a function solves a problem by calling itself on a smaller version of the same problem. Every recursive function needs a base case, which returns an answer directly without another call, and a recursive case, which moves the input closer to that base case. Each call gets its own frame on the call stack; when the base case is reached, the calls return one by one and their frames are popped off. If the base case is missing or never reached, the calls keep piling up and the program usually crashes with a stack overflow. Classic examples are factorial, walking through trees, and divide-and-conquer algorithms such as merge sort.

Computer science song questions

Still wondering about something? Ask us and we’ll reply within two working days.

What computer science topics do the songs cover?

The computer science songs cover binary numbers, algorithms, how the internet works, variables and loops, CPU, memory and storage, Big O notation, how encryption works, how AI learns, sorting algorithms, how to spot phishing, parts of a computer and recursion.

What age are the computer science songs for?

They are written for ages 10–16, ages 10–14, ages 11–14, ages 12–16, college, adults, ages 7–11, and adults refreshing the subject use them too. Each song page lists its level.

Other categories

Welcome to BrainBeats

Sign in or create your free account

No password needed. Pick Google, or we’ll email you a sign-in link.

Continue with Google

or

Part of BrainBeats Plus

Unlock this song

Start your free week

7 days free, then $5.99/month billed yearly. Cancel anytime.

or

Play a free song