RatMath ShelfCourse guide

University: upper level

Theory of computation

Use the left and right arrow keys to turn pages.

Course summary

Where RatMath helps

75%

30 of 40 focal problems use RatMath for a calculation or a substantive step.

Direct calculation
27 · 67.5%
Assisted
3 · 7.5%
Worked by hand
10 · 25%

Using the packages

Automata and bounded simulations give immediate witnesses on small inputs. A terminating trace cannot establish universality, a pumping argument or an asymptotic bound.

Calculator interface

Provide a state-diagram editor, a synchronized tape or stack trace and a product-automaton view that can display a distinguishing word. Mark the step limit on simulations.

Packages used in the lessons

@ratmath/logic (23 days) · @ratmath/discrete (6 days) · @ratmath/core (1 days)

How to read the percentages

Each of the 40 focal problems has equal weight. Direct means the displayed package calculation answers the computational question after the inputs are set up. Assisted means it contributes a step and the worked solution supplies essential reasoning, interpretation or selection. Worked by hand means the guide relies on a construction, argument or judgment for that task. The helpful share combines direct and assisted days. Courses and instructors assign different mixes of problems. The percentages describe this syllabus.

Classroom inputs and practical limits

30 of 40 days include a checked executable example. On 12 days the measured size sweep exercises a named API used in the lesson. Each day identifies its tested inputs and the mathematical property checked. Hand-worked days give the input scale and the argument to verify.

Ranges across the five units

Days 1–8 · Finite automata. Two to ten states and one to three alphabet symbols; a determinized NFA can require exponentially more states.

Unit benchmark · logic.regexToNFA / logic.toDFA, literal word length. Largest passing sample 128 (5.46 ms, 78.5 MiB peak process RSS). The runs did not locate a ceiling for this family.

Days 9–16 · Grammars and language families. A small grammar or PDA and words usually of length 0–20; ambiguity, branching and ε-productions affect parsing.

Unit benchmark · logic.regexToNFA / logic.toDFA, literal word length. Largest passing sample 128 (5.46 ms, 78.5 MiB peak process RSS). The runs did not locate a ceiling for this family.

Days 17–24 · Machines and computability. Turing machines with a handful of states, short inputs and an explicit simulation budget. A finite trace cannot establish nontermination.

Unit benchmark · logic.binaryIncrement.run, input bits. Largest passing sample 2,048 (21.81 ms, 75.1 MiB peak process RSS). The runs did not locate a ceiling for this family.

Days 25–32 · Complexity and reductions. Circuits with a few to tens of gates, or symbolic recurrences over an unbounded size n; proof is required for general complexity claims.

Unit benchmark · logic.countModels, Boolean atoms. Largest passing sample 20 (21.16 ms, 97.1 MiB peak process RSS). Library refusal at 24.

Days 33–40 · Counting and verification. Small automata and short words for explicit checking; the number of words grows exponentially with word length.

Unit benchmark · logic.binaryIncrement.run, input bits. Largest passing sample 2,048 (21.81 ms, 75.1 MiB peak process RSS). The runs did not locate a ceiling for this family.

Accuracy notes (1)

Fixed · The 20-atom model count passes. The disjunction of 20 distinct atoms has 2²⁰−1 = 1048575 satisfying assignments. Both runtimes now return that count. Logic also removed the extra bit required by its earlier intermediate mask.

Measurement method, runtime limits and complete workload results

Lecture and problem-set sequence

Days 1–8 Finite automata

Trace transitions, minimize machines and compare languages.

6 direct calculation · 0 assisted · 2 worked by hand

  1. Day 1 Deterministic automata
  2. Day 2 Minimal DFA
  3. Day 3 Subset construction
  4. Day 4 Equivalent regular expressions
  5. Day 5 Product construction
  6. Day 6 From DFA to regular expression
  7. Day 7 Missing transition
  8. Day 8 Closure under reversal
Days 9–16 Grammars and language families

Construct derivations, inspect stack behavior and prove nonregularity.

4 direct calculation · 1 assisted · 3 worked by hand

  1. Day 9 Context-free grammars
  2. Day 10 Chomsky normal form
  3. Day 11 Pushdown automata
  4. Day 12 Pumping lemma
  5. Day 13 Ambiguous grammar
  6. Day 14 Stack invariant
  7. Day 15 Catalan numbers
  8. Day 16 Grammar closure
Days 17–24 Machines and computability

Simulate machines and distinguish total procedures from partial ones.

5 direct calculation · 1 assisted · 2 worked by hand

  1. Day 17 Turing machines
  2. Day 18 Primitive recursion
  3. Day 19 Composition of recursive functions
  4. Day 20 Minimisation
  5. Day 21 The halting problem
  6. Day 22 Satisfiability
  7. Day 23 Recognizer versus decider
  8. Day 24 Diagonal language
Days 25–32 Complexity and reductions

Bound running time, reason about encodings and reduce decision problems.

6 direct calculation · 0 assisted · 2 worked by hand

  1. Day 25 Circuits
  2. Day 26 Ripple-carry adder
  3. Day 27 Master theorem
  4. Day 28 SAT as a decision problem
  5. Day 29 Resolution
  6. Day 30 Counting models
  7. Day 31 Encoding length
  8. Day 32 Reduction direction
Days 33–40 Counting and verification

Count accepted strings, verify certificates and compare growth rates.

6 direct calculation · 1 assisted · 1 worked by hand

  1. Day 33 Counting accepted words
  2. Day 34 Counting walks
  3. Day 35 Linear recurrence
  4. Day 36 Binomial coefficients
  5. Day 37 Entailment
  6. Day 38 Pigeonhole principle
  7. Day 39 Witness length
  8. Day 40 Powerset growth

Start day 1 →