CMPSCI 250: Introduction to Computation

David Mix Barrington

Fall, 2004

Solutions to Practice Final Exam

Exam posted 15 December 2004

Posted Fri 17 December 2004

Actual final will be Mon 20 December 2004

Questions are in black, answers in blue.

There are five 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.

Many of the questions involve the following three regular languages over the alphabet {a,b,c}. The language X is denoted by the regular expression a*b*c*, the language Y is denoted by the regular expression a*b*, and the language Z is denoted by the regular expression a*.

Question 1 (30):

In this problem we will construct, in a roundabout way, a DFA whose language is X.

Question 2 (15): These questions involve the language Q = {aibjci+j: i,j ≥ 0}.

Question 3 (20): Prove the following statements, carefully explaining your use of quantified proof rules. The languages Y and Z are defined above. The type of variables u, v, and w is "string over {a,b,c}" and the type of the variable n is "natural".

Question 4 (20): This question involves certain boolean statements. For any positive natural n, we define a compound statement Pn using the boolean variables x1,...,xn. P1 is the statement "1" or "true". For n>1, Pn is defined recursively, as Pn-1∧ (xn-1→xn).

Question 5 (20): Let f(n) be the number of strings of length n in the language X defined above. Let g(n) be the number of strings of length n in Y, and let h(n) be the number of strings of length n in Z.

Last modified 17 December 2004