Labs · Part 2 of every class
Math you can run.
Every lecture has a lab. You turn the week’s idea into Python, tests check you instantly, and your score appears on GitHub. The workflow comes from Harvard’s CS50 team: Classroom 50 for assignments and autograding, VS Code in the browser for coding, fast feedback all the way.
The loop
Four steps, every week
-
01
Accept the lab
On classroom50.org, one click creates your own private repository with the starter code, tests and notebook for that week.
classroom50.org
-
02
Open it in Codespaces
VS Code in your browser, the same experience as Harvard’s cs50.dev. Python and the tests are installed for you. Nothing to install on the lab PCs.
Code → Codespaces
-
03
Solve and self-check
Fill in the TODOs. Run the checks as often as you like: :) means correct, :( tells you exactly what is wrong.
python check.py
-
04
Push to submit
Every push is graded by GitHub Actions within a minute or two, and your score is published as a Release in your repository.
git push
Starting without the instructor
You never need to wait. Open the lab page for the week, follow the numbered steps, and ask your neighbor before you ask the instructor. Stuck for more than 10 minutes on the same error? Write it down and move to the next task; we will fix it together.
Deadlines and how labs count
Every lab is due on the Friday of its week at 23:59; late work loses 10% per day, up to five days. Weekly labs are autograded for instant feedback. They are the practice ground for the exams and the project, and completion is tracked. Labs are also where you build the skills for the semester project.
All labs
Lab list
- L01 Truth-Table Engine Write the connectives in Python, generate every row of a truth table, and build a tool that decides tautologies, contradictions and equivalences. week 2 · Mon, Sep 28 · due Fri, Oct 2 · 23:59 · connectives · itertools.product · tautology · equivalence open
- L02 Gates, Adders and Knights & Knaves Build logic gates, check equivalences by brute force, add binary numbers with a ripple-carry adder made of gates, prove that NAND is enough, and write a solver for Knights and Knaves puzzles. week 3 · Mon, Oct 5 · due Fri, Oct 9 · 23:59 · logic gates · equivalence · full adder · NAND · Knights & Knaves · consistency open
- L03 Quantifiers over Real Data Write ∀ and ∃ as loops, find counterexamples and witnesses, answer questions about a class of students with the golden rule, and put De Morgan's laws for quantifiers into code. week 4 · Mon, Oct 12 · due Fri, Oct 16 · 23:59 · ∀ and ∃ as loops · counterexample · witness · golden rule · De Morgan open
- L04 Nested Quantifiers: Checking a Social Network Write the four shapes of a nested statement, find witnesses and counterexamples, check a social network for celebrities and unreturned follows, negate a nested statement in code, and turn a sorting specification into a test. week 5 · Mon, Oct 19 · due Fri, Oct 23 · 23:59 · ∀∃ vs ∃∀ · witnesses · social network · negation · specification open
- L05 A Tiny Inference Engine Implement forward chaining with modus ponens, then use it to answer questions from a rule base. week 6 · Mon, Oct 26 · due Fri, Oct 30 · 23:59 · modus ponens · forward chaining · valid arguments coming soon
- L06 Counterexample Hunting Test famous claims about primes and integers by computer, find counterexamples, and see what a search can and cannot prove. week 7 · Mon, Nov 2 · due Fri, Nov 6 · 23:59 · primes · counterexamples · exhaustive proof coming soon
- L07 Sets and a Mini Recommender Implement power sets and Cartesian products, verify set identities, and recommend courses with Jaccard similarity. week 9 · Mon, Nov 16 · due Fri, Nov 20 · 23:59 · power set · Cartesian product · Jaccard coming soon
- L08 Relation Properties and Hashing Check properties of relations, compute equivalence classes and transitive closure, and measure hash collisions. week 10 · Mon, Nov 23 · due Fri, Nov 27 · 23:59 · reflexive/symmetric/transitive · closure · hash functions coming soon
- L09 Recurrences and Cantor's Diagonal Compute recurrences three ways, check summation formulas, and run Cantor's diagonal argument on a list of binary strings. week 11 · Mon, Nov 30 · due Fri, Dec 4 · 23:59 · recurrences · memoization · diagonalization coming soon
- L10 Recursion and Growth Write recursive functions, check them against induction proofs, and measure running times to see Big-O on a plot. week 12 · Mon, Dec 7 · due Fri, Dec 11 · 23:59 · recursion · induction · timing coming soon
- L11 Counting and the Birthday Paradox Count with itertools, verify formulas, estimate password spaces and simulate the birthday paradox. week 13 · Mon, Dec 14 · due Fri, Dec 18 · 23:59 · itertools · permutations · simulation coming soon
- L12 Graphs from Scratch Build adjacency lists and matrices, verify the handshake theorem, test bipartiteness and compare with networkx. week 14 · Mon, Dec 21 · due Fri, Dec 25 · 23:59 · adjacency list · BFS · bipartite coming soon
- L13 Coloring an Exam Timetable Build the conflict graph of real courses and color it greedily to produce an exam schedule. week 15 · Mon, Dec 28 · due Fri, Jan 1 · 23:59 · greedy coloring · scheduling · trees coming soon