Complexity Theory Spring 2021


Charles E. Hughes
Computer Science
University of Central Florida


Structure: TR 0900-1015 (9:00AM-10:15AM); Virtual; 28 class periods, each 75 minutes long.

Class Zoom Link:

Go To Week
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
, 15, 16

Instructor: Charles Hughes; Contact:; Use Subject COT6410
Office Hours: Tuesday 10:45AM-11:45AM; Thursday 12:15PM-1:30PM until week of February 22
                         Tuesday/Thursday 10:45-11:45AM from week of February 22 to end of semester
OH Zoom Link:


GTA:  Daniel Daniel Gibney; Contact:; Use Subject COT6410
Office Hours: MW 1:30PM-3:00PM
OH Zoom Link:

Required Reading: All class notes linked from this site.

Recommended Reading

Web Pages:
Base URL:
Notes URL: Introductory Notes; Formal Language and Automata Theory; Computability Theory; Complexity Theory

Assignments: 6 for sure and maybe a seventh; Paper + Video Presentation with Slides

Exams: Midterm and Final.

Exam Dates (Tentative): Mid Term: Thursday, March 11; Withdraw Deadline:Friday, March 26; Spring Break: April 11-18; Final: Thurs., April 29, 7:00AM-9:50AM

Evaluation (Tentative):

  1. Mid Term: 125 points; Final Exam: 125 points (balance between weights will be adjusted in your favor)
  2. Assignments: 75 points;
  3. Individual Paper Reviews and Presentations: 125 points
  4. Extra -- 50 points used to increase weight of best exam,  always to your benefit
  5. Total Available: 500
  6. Grading will be  A >= 90%, B+ >= 85%, B >= 80%, C+ >= 75%, C >= 70%, D >= 50%, F < 50%; minus grades might be used.


Weeks#1: (1/12, 1/14) -- Syllabus; About Me; Preliminaries; Introduction; Formal Languages and Automata Theory
  1. Ground rules
  2. Decision problems
  3. Solving vs checking
  4. Procedures vs algorithms
  5. Introduction to theory of computation
  6. Terminology, goals and some historical perspective
  7. Overview of automata (finite, pushdown, linear bounded, Turing machines)
  8. Overview of formal languages (regular, context free, context sensitive, phrase structured)
  9. Regular Languages
  10. Closure Properties of Regular Languages
  11. Review material created by Prof. Jim Rogers, Earlam College
  12. Review material from Prof. David Workman, UCF Retired

Financial Aid (Assignment#1)

Survey at Webcourses
Due: Friday, January 15 at 11:59 PM

Week#2: (1/19, 1/21) -- Formal Languages and Automata Theory
  1. Continue Automata/Formal Languages Review
  2. State minimization using O(| Q | 2) table. Note alphabet is constant size.
  3. More closure properties
  4. Closure under min and max and discussions of various Reaching Algorithms (Depth-First Search)
  5. Pumping Lemma for Regular Languages (Pigeon Hole Principle)
  6. Myhill-Nerode Theorem
  7. Myhill-Nerode as proof of min DFA uniqueness
  8. Myhill-Nerode as a tool to show languages are not regular.
  9. The chosen language is
    L = { an bm | n is not equal to m}.
    This can be shown easily in an indirect manner by showing its complement is not regular. A direct approach is using right invariant equivalence classes as it is not amenable to the Pumping Lemma.
  10. Finite State Machines (Transducers): Mealy versus Moore Model
  11. Decision Problems for Regular Languages
  12. Introduction to Grammars (Regular and CFG mainly)
  13. Regular Grammars and Regular Languages


Week#3: (1/26, 1/28) -- Formal Languages and Automata Theory
  1. Context Free Grammars (A x where x (V ΣΣ)* )
  2. Use of context free grammars in parsing and notion of Ambiguity
  3. Review of reduced CFGs
  4. Chomsky Normal Form (CNF)
  5. The use of CNF in the Cocke-Kasami-Younger O(N3) parsing of CFLs generated by CNFs
  6. Pumping Lemma for CFLs
  7. Show L1 = { an bn cn | n i> 0 } and {L2 = { ww | w is in {a,b}+ } are not CFLs
  8. CSG for L
  9. Non-closure of CFLs under intersection and complement
  10. CFG for the complement of L
    { xy | |x| = |y| but x is not the same as y }
    can be first viewed as
    {x1 a x2 y1 b y2 | |x1|=|x2|, |y1|=|y2|} Union
      {x1 b x2 y1 a y2 | |x1|=|x2|, |y1|=|y2|}.
    But this can also be seen as
    {x1 a y1 x2 b y2 | |x1|=|x2|, |y1|=|y2|} Union
      {x1 b y1 x2 a y2 | |x1|=|x2|, |y1|=|y2|}.
    The above is easy to show as a CFL. We then union this with odd length strings and we have L1 complement.
  11. Decision problems for CFLs: is L(G) empty or finite/infinite are fine
Assignment #2

See Webcourses (Assignment # 2) for description
Sample of Similar Problems with Solutions

Due: 2/9 (Key)

Week#4: (2/2, 2/4) -- Computability Theory
  1. Closure of CFLs under substitution and intersection with Regular
  2. Checking ambiguity, equality to Sigma*,  equivalence and non-empty intersection with another CFL are nasty
  3. Very Basic Material on Context Sensitive Grammars (CSG) and Linear Bounded Automata (LBA)
  4. Show L1 = { an bn cn | n i> 0 } and L2 = { ww | w is in {a,b}+ } are CSLs
  5. Insights from intro to computability material
  6. Basic notions of computability and complexity
  7. Existence of unsolvable problems (counting and diagonalization)
  8. Solved, solvable (decidable, recursive), unsolved, unsolvable, re, non-re
  9. Hilbert's Tenth
  10. Undecidable problems made a bit more concrete
  11. Lots about problems and their complexity
  12. Halting Problem (HALT) is re, not decidable
  13. Set of algorithms (TOT) is non-re
  14. Halting Problem seen as fun
  15. Some consequences of non-re nature of algorithms

Week#5: (2/9, 2/11) -- Computability Theory
  1. Models of computation
  2. Systems related to FRS (Petri Nets, Vector Addition, Abelian Semi-Groups)
  3. RM simulated by Ordered FRS
  4. Primitive Recursive Functions (prf)
  5. Initial functions
  6. Closure under composition and recursion
  7. Primitive recursive functions SNAP, TERM, STP and VALUE
  8. Primitive Recursive Function in detail
  9. Addition and multiplication examples
  10. Sample functions and predicates
  11. Closure under cases
  12. Bounded minimization
  13. Arithmetic fuctions that use bounded search
  14. Pairing functions
  15. Limitations of primitive recursive
  16. mu-recursion and the partial recursive functions
  17. Notions of instantaneous descriptions
  18. Encodings
  19. Equivalence of models
  20. TMs to Register Machines
  21. RM to Factor Replacement Systems
  22. Factor Replacement to Recursive Functions
  23. Gory details on FRS to REC
  24. Universal machines
  25. Recursive Functions to TMs
  26. Consequences of equivalence
    Assignment #3

    See Webcourses (Assignment # 3) for description
    Sample of Similar Problems with Solutions

    Due: 2/23 (Key)

Week#6: (2/16, 2/18) -- Computability Theory
  1. Review Undecidability (Halting Problem, shown by diagonalization)
  2. RE sets and semidecidability
  3. Enumeration Theorem: The set of all re sets W0, W1, W2, ...
  4. The set K = { n | n is in the n-th re set } = { n | n is in Wn } is re, non-recursive
  5. The set K0 = HALT = { <n,x> | x is in the n-th re set }
  6. Alternative characterizations of re sets
  7. Parameter Theorem (aka Sm,n Theorem)
  8. Quantification and re sets
  9. Quantification and Co-re sets
  10. Reduction
  11. Classic sets Ko (Lu), NON-EMPTY (Lne), EMPTY (Le)
  12. Reduction from Ko that shows undecidability of K, HasZero, IsNonEmpty
  13. Complete re set (K and K0 as examples)
  14. Note: To be re-complete a set must be re
  15. Reduction from Ko that shows undecidability of K, HasIndentity, TOTAL, IsZero, IsEmpty, IsIdentity
  16. Equivalence of certain re sets (K, HasZero, IsNonEmpty, HasIndentity) to Ko
  17. Equivalence of certain non-re sets (IsZero, IsEmpty, IsIdentity) to TOTAL
  18. Quantification of Non-re, Non-Co-re sets
  19. Reducibility and degrees (many-one, one-one, Turing)
  20. Hierarchy or RE equivalence class (m-1 and 1-1 degrees)
  21. Rice's Theorem

        Assignment #4

    See Webcourses (Assignment # 4) for description
    Sample with key

        Due: 3/2 (Key)

Week#7: (2/23, 2/25) -- Computability Theory
  1. "Picture" proofs for Rice's Theorem
  2. Constant Time and Mortal Machines
  3. Introduction to rewriting systems (Thue, Post)
  4. Union, intersection, complement for recursive, re and non-re sets (can be, cannot be)
  5. Rewriting systems
  6. Post Canonical Forms
  7. Thue and Semi-Thue systems (relation to group theory)
  8. Word problems (Semi-Thue and Thue) and equivalence problems (Thue)
  9. Simulating Turing Machine by Semi-Thue System
  10. Simulating Turing Machines by Thue Systems
  11. Grammars and re sets
  12. Brief introduction to Post Correspondence Systems and Relation to Semi-Thue Systems
  13. Post Correspondence Problem (in detail)
  14. Unsolvable problems related to context-free grammars/languages
  15. Ambiguity of CFGs
  16. Non-Emptiness of CFL Intersections
  17. Context-Sensitive Grammars and Unsolvability Results
  18. Valid (CSL) and Invalid Traces (CFL)
  19. EFFECTIVE THIS WEEK, Thursday office hours start at 10:45 not 12:15
    Thus, OH: Tuesday/Thursday: 10:45-11:45 and by appointment.


Week#8: (3/2, 3/4) -- Computability Theory
  1. Details on Valid (CSL) and Invalid Traces (CFL)
  2. Intersection of CFLs revisited
  3. Quotients of CFLs
  4. Type 0 grammars and Traces
  5. L =  Sigma*  for L a Regular or CFL
  6. L = L^2 for L a CFL
  7. Summary of Grammar Results
  8. Review session and sample exams
  9. Exam Topics
  10. Sample exam1; Sample exam1 key
  11. Sample exam2; Sample exam2 key
  12. Key to Samples from Notes
  13. Yet Other Examples (Focused on Formal Languages and Automata Theory)
  14. Yet Other Examples key (Focused on Formal Languages and Automata Theory)
  15. Midterm Legal Cheat Sheet

Week#9: (3/9, 3/11) -- Midterm Review and Exam

  1. Review (Tuesday)
  2. Midterm (Thursday)
  3. Midterm Key

Week#10 (3/16, 3/18: Complexity Theory

  1. Basics of Complexity Theory
  2. Decision vs Optimization Problems (achieving a goal vs achieving min cost)
  3. Polynomial == Easy; Exponential == Hard
  4. Polynomial reducibility
  5. Verifiers versus solvers
  6. P as solvable in deterministic polynomial time
  7. NP as solvable in non-deterministic polynomial time
  8. NP as verifiable in deterministic polynomial time
  9. Concepts of NP-Complete and NP-Hard
  10. Canonical NP-Complete problem: SAT (Satisfiability)
  11. Some NP problems that do not appear to be in P: Graph Coloring, Vertex Cover, SubsetSum
  12. Million dollar question: P = NP ?
  13. Boolean expressions: Tautologies, Satisfiability, Truth Tables
  14. Axiomatic Systems for propositional logic: Substitution and modus ponens versus refutation/resolution
  15. Unsolvability of deducibility in fragments of propositional calculus
  16. Construction that maps every problem solvable in non-deterministic polynomial time on TM to SAT

Week#11: (3/23, 3/25, (3/26 is Withdrawal Deadline)) -- Complexity Theory
  1. SAT is polynomial reducible to (<=P) 3SAT
  2. 3SAT as a second NP-Complete problem
  3. Integer Linear Programming
  4. Note: 3/26 is the Withdraw Deadline
  5. 3SAT <=P SubsetSum
  6. SubsetSum <=P Partition
  7. Partition equivalence to SubsetSum
  8. Discussion of group presentations
  9. Reduction of 3SAT to k-Vertex Cover
  10. 3-SAT to 3-Coloring
  11. Isomophism of k-Coloring with k-Register Allocation of live variables
  12. Scheduling problems introduced 
  13. Scheduling on multiprocessor systems
  14. Scheduling problems (fixed number of processors, minimize final finishing time)
  15. N processors, M tasks, no constraints
  16. Partition and scheduling problems
  17. Greedy heuristics
  18. 2-processor scheduling -- greedy based on list, sorted long to short, sorted short to long, optimal. Tradeoffs.
  19. You will each, individually, develop a paper and a presentation, based on an existing research paper, just as if you had to present to your peers and advisors. In addition to presenting the results and the way in which these were proven, you should comment on the paper's importance, readability, and replicability, and even its validity if you question that, just as if you were a journal or conference reviewer. Your report must be a tutorial on the topic of the paper so those with less time to delve into the paper can get a strong sense of the results and the context of those results. Specifying new open problems that you see as interesting is also a goal, but may not be attainable for some of these. The length of your paper is 6 to 12 pages double-spaced, 1" margins all around, using either Times Roman or Calibri 11 point, or Arial 10-point. The references are in addition to the narrative and appear on separate pages that do not count against the 6 to 12-page limit. Images may be used but if the total number of images exceeds a page, then all past that one-page aggregate will lead to a requirement for additional text. The presentation slides must be designed to support your 8 to 10-minute video. This means that there are likely 10 to 15 slides.
  20. Towards the end of the semester you give a presentation to a small group of other studesnt and they to you. This will be done in a breakout Zoom session where your presentation and any questions/answers are captured. You may, if you wish, create the presentation in advance and share a video, but you need to be there to participate in the Q&A and to hear other students' presentations. To do this, I assume you all have access to a webcam and use Zoom or a similar tool that captures your slides and you in one extended screen. Let me know if you lack a webcam. Note that you will be asked to provide some brief feedback to me on the papers of your fellow students taking part in teh same breakout.
  21. I have placed about 65 sample papers out there at SampleTopics. You may choose from any of these except for ones that have already been taken. You may also choose your own separate from these with permission from me. In general, the minimum page length in IEEE 2-column format is 8 pages or 10 pages in single column, single-spaced layout. The prefix CLAIMED_NAME means NAME has already chosen that. Please send me an email to assure you succeed in making your "claim."
  22. Realize that many of these suggested papers will be from arXiv and, while arXiv is a fantastic source, it is not refereed so if you question the validity of some result, that is actually a reasonable outcome so long as you present their approach and your counterarguments just as if you were a reviewer.
  23. This folder contains some examples (papers and presentations) from past semesters.

              Final Paper and PowerPoint

                   Read above. Its weight is 125 points. The split is nominally 75 for the paper and 50 for your presentation
                   and feedback on other's presentations you provide.

              Due: 4/23

    Assignment #5

            See Webcourses (Assignment # 5) for description
            Sample with Key

  24.  Due: 4/6 (Key)

Week#12: (3/30, 4/1) -- Complexity Theory
  1. Precedences (lists, delays, preemption)
  2. Anomalies (reducing precedence, increasing processors, reducing times)
  3. Unit Execution Time: Trees, forest, anti forests
  4. UET: DAGs and m=2
  5. Hamiltonian Path
  6. Traveling Salesman
  7. Knapsack (relation to SubsetSum), Dynamic Programming Pseudo-polynomial Solution
  8. Bin packing (fixed capacity, minimize number of bins)
  9. Pseudo polynomial-time solution for Knapsack using dynamic programming with changed parameters,
    n*W versus 2^n but W = 2^log(W). This kind of problem is called Weak NP Complete. I'll chat about that later.
  10. Tiling the plane and Bounded Tiling
  11. Bounded PCP
  12. Co-NP
  13. Reduction techniques
  14. P = co-P ; P contained in intersection of NP and co-NP
  15. NP-Hard
  16. QSAT as an example of NP-Hard, possibly not NP
  17. NP-Hard problems are in general functional not necessarily decision problems
  18. NP-Complete are decision problems as they are in NP
  19. NP-Easy -- these are problems that are polynomial when using an NP oracle
  20. NP-Equivalent is the class of NP-Easy and NP-Hard problems
  21. Optimization versions of SubsetSum and K-Color
  22. Validity of SubsetSum optimization reduction to SubsetSum Decision Problem Oracle

            Assignment #6

                 See Webcourses (Assignment # 6) for description
                 Sample with Key

            Due: 4/20 (Key)

Week#13: (4/6, 4/8) -- Complexity Theory, More Notes
  1. 2SAT (linear time complexity)
  2. Uniform Min-1 is NP Equivalent
  3. Triangle Strip versus Triangle List
  4. Weqkly versus Strongly NP-Hard/NP-Complete
  7. ATM (Alternating NDTM)
  8. QSAT, Petri Nets, Presburger
  9. Why does PSPACE = NPSPACE? Key is Savitch's Theorem
  10. FP is functional equivalent to P; R(x,y) in FP if can provide value y for input x via deterministic polynomial time algorithm
  11. FNP is functional equivalent to NP; R(x,y) in FNP if can verify any pair (x,y) via deterministic polynomial time algorithm
  12. TFNP is the subset of FNP where a solution always exists, i.e., there is a y for each x such that R(x,y).
  13. Factoring is in TFNP, but is it in FP?
  14. P = (NP intersect Co-NP) is interesting analogue to intersection of RE and co-RE but may not hold here
  15. It appears that TFNP does not have any complete problems!!!
  16. Khot's Conjecture and its implications

Week#14:  Spring Break


Week#15: (4/20, 4/22)

  1. Review for exam
  2. On 4/22 we will have the breakout sessions in which you give your presentations and hear those of a few other of your fellow students (typically five or six per breakout room). These will be set up prior to the 22nd.
  3. Final Exam Topics
  4. More stuff for final
  5. Sample Final Exam (Key)


Week#16:  (4/29 -- Final Exam)

  1. I will run  a help session on Tuesday, 4/27 at the normal class time
  2. All Project Videos, Papers, and Presentations are Due on Tuesday, 4/23 by midnight
  3. Final Exam is Thursday April 29; 7:00AM to 9:50AM; There may also be a take home component


UCF (Charles E. Hughes)  -- Last Modified 4/25/2021