Theory of Computing

CSE 30151 | Spring 2023

TTh 2–3:15pm
127 Hayes-Healy
David Chiang
Discrete Mathematics (CSE 20110) or equivalent. You especially need to be comfortable with sets, tuples, functions, relations, and graphs; and writing proofs by contradiction and by induction.
Data Structures (CSE 20311) is recommended but not required for group programming assignments. If you haven't taken this course or equivalent, you may want to join a group with students who have.
Required text
Michael Sipser, Introduction to the Theory of Computation
3rd International Edition
ISBN: 9781133187813, 9788131525296
Price: usually $15–20 (Amazon)
Why this is legal
Introduction to formal languages and automata, computability theory, and complexity theory with the goal of developing understanding of the power and limits of different computational models. Topics covered include:
  • regular languages and finite automata
  • context-free grammars and pushdown automata
  • Turing machines; undecidable languages
  • the classes P and NP; NP completeness
The following sites will be used in this course:
  • Notes and assignments will be linked from here, but you can also clone the GitHub repository
  • Campuswire for questions and answers
  • Canvas for submitting and grading assignments


David Chiang

Graduate TA
Ruiyang Qin

Undergraduate TA
Jon Abbott

Undergraduate TA
Weike Fang

Undergraduate TA
John Lee

Undergraduate TA
Mark Rumsey

Undergraduate TA
David Simonetti

Undergraduate TA
Alyssa Wilgenbusch

Office hours: Unless otherwise indicated, office hours are in 150M Fitzpatrick.

1–3pm Chiang
179 Fitzpatrick
7–8pm Wilgenbusch 5–7pm Lee 4–6pm Simonetti 1–3pm Chiang
179 Fitzpatrick
6–8pm Qin 8–10pm Abbott 8–10pm Fang 6–8pm Rumsey
9:30–10:30pm Wilgenbusch


Notes are posted as Colab notebooks. You should be able to use them in your browser, but if you want to use them on your own machine, install Tock, clone the Git repository, and run jupyter notebook in your working copy.

Unless otherwise indicated, each assignment is due on Friday at 11:59pm of the week in which it is listed.

This schedule is subject to change.

Unit Date Topic Due
01/17 Welcome
01/19 Proofs
Glossary of math terms (for reference)
LaTeX/TikZ tutorial (optional)
I 01/24 Deterministic finite automata
01/26 NFAs = DFAs
Neural networks (optional)
01/31 Regular expressions to NFAs
02/02 NFAs to regular expressions HW2
02/07 Non-regular languages
02/09 Non-regular languages CP1
II 02/14 Context-free grammars
Pushdown automata
CFGs to PDAs
Deterministic PDAs (optional)
HW3 (due 02/17 5pm)
02/21 PDAs to CFGs
02/23 Non-context-free languages HW4
02/28 Non-context-free languages
03/02 Midterm exam
Study guide
III 03/07 Turing machines
03/09 Turing machine variants CP2
Spring break
03/21 Nondeterministic TMs
RAM machines
03/23 The universal TM HW5
03/28 Undecidability
Are you smarter than a computer? (optional)
03/30 Reducibility HW6
04/04 Rice's Theorem
Holy Thursday
Computation histories CP3 (due 04/06 5pm)
IV 04/11 P and NP
04/13 NP-completeness HW7
04/18 Cook-Levin theorem
04/20 Polynomial reducibility CP4
04/25 Polynomial reducibility
04/27 Polynomial reducibility HW8
05/02 Conclusion
05/12 10:30amFinal exam
Study guide


Component Points
Homework 8 × 30
Programming projects 4 × 30
Midterm exam 90
Final exam 120
Participation 30
Total 600
D 360–419
F 0–359


Throughout the semester, you will implement some of the ideas you've learned in a series of text-processing tools.

  • You can work in teams of up to three. Each team member should contribute a roughly equal amount of work.
  • You can write in C++ (including all standard libraries except <regex>) or Python (including all standard libraries except re). Python is recommended. You can also write in another language with permission from the instructor.

In Project 1, you'll implement nondeterministic finite automata (NFAs). Nondeterminism (essentially, unbounded parallelism) is one of the core concepts in the course, and implementing it will demonstrate how to simulate nondeterminism on deterministic hardware.

In Project 2, you'll write a parser for regular expressions and combine it with NFAs to build a regular expression matcher like grep. Your implementation will be asymptotically much faster than an implementation that uses Perl or Python's built-in regular expressions.

In Project 3, you'll use your regular expression engine to implement a fragment of sed. You'll also show how, in principle, any computer program could be compiled into this fragment of sed.

In Project 4, you'll extend your regular expression matcher to handle backreferences. You'll show how this extended matcher can be used to (slowly) solve the Boolean satisfiability problem and therefore any problem in NP.



Students are expected to attend all classes. Foreseeable unexcused absences should be discussed with the instructor ahead of time.

Late Work

For excused absences (e.g., documented illness, travel for athletics, job interview), coursework submissions will be accepted late by the same number of days as the excused absence.

Otherwise, you may submit some problems on time for full credit, and other problems late for a penalty. No problem can be submitted more than once. The late penalty increases by 10% per day and stops increasing when it reaches 50%; thereafter, it remains at 50% until the final exam date, after which no work may be submitted.


All course materials written by the instructor and published on this website are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, which prohibits reuse for commercial purposes.

All course materials written by the instructor and distributed privately (including through Sakai) should not be redistributed in any way; doing so is a violation of both US copyright law and the University of Notre Dame Honor Code.

Honor Code

Students in this course are expected to abide by the Academic Code of Honor Pledge: “As a member of the Notre Dame community, I will not participate in or tolerate academic dishonesty.”

The following table summarizes how you may work with other students and use printed/online sources:

Resources Solutions
Consulting allowed cite
Copying cite not allowed
See the CSE Guide to the Honor Code for definitions of the above terms.

If an instructor sees behavior that is, in his judgement, academically dishonest, he is required to file either an Honor Code Violation Report or a formal report to the College of Engineering Honesty Committee.

Students with Disabilities

Any student who has a documented disability and is registered with Disability Services should speak with the professor as soon as possible regarding accommodations. Students who are not registered should contact the Office of Disability Services.


Further Reading