This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CPSC 313 — Midterm Test March 10, 2005 Name: Lecture Section: Lab Section: Please DO NOT write your ID number on this page. Instructions: Answer all multiple choice questions in part A on the score card using pencil . Answer all questions in part B in the space provided. No Aids Allowed. There are a total of 53 marks available on this exam. The exam will be marked out of 50. Duration: 120 minutes ID Number: Section Question Score Possible score A 120 20 B 1 5 2 5 3 5 4 5 5 8 6 5 Total: 50 (+ 3 bonus marks) 1 ID Number: Part B  Multiple Choice Questions Answer all multiple choice questions on the score card using pencil . Each question is worth 1 marks. True/False Questions Answer true or false for the following statements. On the bubble sheet, indicate ’true’ by filling in the bubble for ’a’ and ’false’ by filling the bubble for ’b’. 1. There is an algorithm that allows us to create an unambiguous contextfree grammar for all ambiguous contextfree grammars. 2. If a language is contextfree, it must also be regular. 3. If a language L is regular, then its complement ¯ L is also regular. 4. The pumping lemma for regular languages is useful for proving that a language is regular. 5. A decision problem is a problem where the output or response is either yes or no. 6. All languages can be restated as decision problems. 7. The set of languages accepted by nondeterministic finite automata (NFAs) is the same as the set of languages accepted by epsilon nondeterministic finite automata ( NFAs.) 8. A contextfree grammar that contains the rule A → aa is not in Chomsky Normal Form. Multiple Choices For the following questions choose the best answer. 9. Which of the following decision problems matches the language L = { a n b m c n  n,m ≥ } ? The input in each case is some string w ∈ { a,b } * . (a) Output: Yes, if w starts with some a ’s followed by some b ’s followed by some c ’s (b) Output: Yes, if the length of w is greater than or equal to zero and w starts with some number of a ’s followed by the some number of b ’s followed by some number of c ’s and the number of a ’s and c ’s in w is the same. (c) Output: Yes, if w contains the same number of a ’s and c ’s. (d) Output: Yes, if w contain the same number of a ’s and b ’s and c ’s....
View
Full
Document
This note was uploaded on 10/19/2008 for the course CPSC 313 taught by Professor Na during the Spring '08 term at University of Calgary.
 Spring '08
 NA

Click to edit the document details