Course Test · University: upper level
Theory of computation: test
A DFA for parity, the minimal DFA for words ending in 01, the subset construction for ((a|b)^*abb), equivalence of regular expressions, intersecting languages with a product automaton, a regular expression from a DFA, the grammar and PDA for (a^nb^n), Chomsky normal form, a Turing machine adding one in binary, primitive recursive and (mu)-recursive functions, the pumping lemma and the halting problem (where no computation can stand in for the proof), a full adder, and the master theorem.
Twenty exercises of the kind this course sets. Answers are on the independent answers page; the same exercises done with RatMath are on the RatMath answers page.
- 1.Deterministic automataDesign a DFA over accepting words with an even number of 1s. Does it accept 1011? 1001?
- 2.Minimal DFAHow many states does the minimal DFA for binary words ending in 01 have?
- 3.Subset constructionConvert to a DFA and minimise it. How many states? Does it accept and ?
- 4.Equivalent regular expressionsAre and equivalent?
- 5.Product constructionBuild an automaton for words over with an even number of s and an odd number of s. Test and .
- 6.From DFA to regular expressionGive a regular expression for binary words with an even number of 1s.
- 7.Context-free grammarsGive a grammar for . Does it generate ? ? List its words of length at most 6.
- 8.Chomsky normal formConvert to Chomsky normal form.
- 9.Pushdown automataRun a PDA for (push on , pop on ) on and .
- 10.Pumping lemmaProve that is not regular.
- 11.Turing machinesRun a Turing machine that adds one to a binary number on the input 1011.
- 12.Primitive recursionUsing only primitive recursive building blocks, compute , and .
- 13.Composition of recursive functionsDefine by composing addition with projections, and evaluate .
- 14.MinimisationUse the operator to compute the integer square root of 30: the least with .
- 15.The halting problemIs there an algorithm that decides, for every program and input, whether the program halts?
- 16.CircuitsA full adder adds bits and a carry . What are the sum and carry for ?
- 17.Ripple-carry adderHow many gates and what depth does a ripple-carry adder for 4-bit numbers have, built from full adders of 5 gates and depth 3?
- 18.Master theoremSolve and asymptotically.
- 19.SAT as a decision problemIs satisfiable? Give a satisfying assignment.
- 20.Counting accepted wordsHow many binary words of length 4 have an even number of 1s?