CMPSCI 250: Introduction to Computation

David Mix Barrington

Fall, 2004

CMPSCI 250 Final Exam

Given Mon 20 December 2004

Posted Tue 21 December 2004

There are six questions for 120 total points.

When your answer to a problem is a particular number, you may use exponents, falling exponents, factorials, and/or the "choose" notation to indicate the number. However, if the answer is less than 100, you must give the number in ordinary decimal notation for full credit.

Question 1 (30): In this problem we will carry out several of our constructions, beginning with an ordinary NFA N. This NFA has alphabet {a,b}, state set {1,2}, start state 1, final state set {2}, and transition relation Δ = {(1,a,1), (1,a,2), (1,b,2)}.

Question 2 (10): Suppose that we are converting a λ-NFA M to an ordinary NFA N, and that (p,a,q) is a letter move of M. Explain what letter moves must be added to N to account for this move of M. Explain why these moves in N account for every possible path in M where (p,a,q) is the only letter move in the path.

Question 3 (20): For any natural n, the undirected graph Kn has n vertices and all possible edges (that is, it has an edge between i and j whenever i ≠ j).

Question 4 (25): Define E to be the set of strings in {a,b}* that have an equal number of a's and b's. For example, the strings in E whose length is at most four are: λ, ab, ba, aabb, abab, abba, baab, baba, and bbaa.

Question 5 (15): This problem deals with some statements in the predicate calculus. The type of the variables is "animal" and we are given four unary predicates: F(x) means "x can fly", G(x) means "x is a gnu", H(x) means "x has hooves", and W(x) means "x has wings".

Question 6 (20): Define a function h(n) from naturals to naturals recursively as follows. If n ≤ 2, then h(n) = n. If n > 2, then h(n) = h(n-1) - h(n-2) + h(n-3).

Last modified 21 December 2004