Week 1, Monday
January 5, 2026
Canvas: canvas.ubc.ca/courses/182082
Course Website: ubc-cs.github.io/dsci221
| Week | Sunday | M | T | W | Lab | HW/PA | Examlet |
|---|---|---|---|---|---|---|---|
| 1 | 1/4/2026 | 🎉 | 📺 | 🎉 | |||
| 2 | 1/11/2026 | 🎉 | 📺 | 🎉 | 🪄 | ||
| 3 | 1/18/2026 | 🎉 | 📺 | 🎉 | 🪄 | HW1 | |
| 4 | 1/25/2026 | 🎉 | 📺 | 🎉 | 🪄 | 🤩 | |
| 5 | 2/1/2026 | 🎉 | 📺 | 🎉 | 🪄 | PA1 | |
| 6 | 2/8/2026 | 🎉 | 📺 | 🎉 | 🪄 | HW2 | 🤩 |
| 7 | 2/15/2026 | ||||||
| 8 | 2/22/2026 | 🎉 | 📺 | 🎉 | 🪄 | ||
| 9 | 3/1/2026 | 🎉 | 📺 | 🎉 | 🪄 | PA2 | 🤩 |
| 10 | 3/8/2026 | 🎉 | 📺 | 🎉 | 🪄 | ||
| 11 | 3/15/2026 | 🎉 | 📺 | 🎉 | 🪄 | 🤩 | |
| 12 | 3/22/2026 | 🎉 | 📺 | 🎉 | 🪄 | PA3 | |
| 13 | 3/29/2026 | 🎉 | 📺 | 🎉 | 🪄 | 🤩 | |
| 14 | 4/5/2026 | 📺 | 🎉 | HW3 |
Taylor Swift’s Eras Tour, Nashville, TN


What does it mean to analyze an algorithm?
Once we know it’s correct…
3 seconds of audio
100 million songs
less than 1 second
How long to check all songs?
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | … | 99,999,999 |
|---|---|---|---|---|---|---|---|---|---|
| 🎵 | 🎵 | 🎵 | 🎵 | 🎵 | 🎵 | 🎵 | 🎵 | … | 🎵 |
Is this correct?
How long does it take to run?
Work with your neighbor: What factors affect how long find_song_naive takes?
Machine speed
A faster computer runs the same code faster.
Location of song
At the front? Quick!
At the end? Slow.
Not there at all? Slowest.
Size of database
100 songs vs 100 million songs
We want to characterize the algorithm, not the machine or our luck.
Suppose our code requires ~0.001 second per song.
n = 100
100 × 0.001 = 0.1 sec
n = 100,000,000
100M × 0.001 = 27.8 hours
| Database size | Linear search | Hash lookup |
|---|---|---|
| 1,000 | 1 sec | 0.001 sec |
| 1,000,000 | 1000 sec | 0.001 sec |
| 100,000,000 | 27 hours | 0.001 sec |
It’s not just Shazam!
YouTube
800 million videos
Every search: < 0.5 sec
Linear search would take hours
Genomics
Human genome: 3 billion base pairs
Finding a gene sequence
Naive: days → Real tools: seconds
Pandemic response
330 million people
Contact tracing within 2 connections
Relationships grow exponentially
As data grows, bad algorithms become impossible.
Data structures are clever ways to organize data so that algorithms can access it quickly.
| Day | Topic |
|---|---|
| Tuesday | Counting steps, discovering patterns |
| Wednesday | The hierarchy: O(1) to O(2ⁿ) |