313W05M - CPSC 313 Midterm Test March 10, 2005 Name:...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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 1-20 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 context-free grammar for all ambiguous context-free grammars. 2. If a language is context-free, 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 context-free 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

Page1 / 13

313W05M - CPSC 313 Midterm Test March 10, 2005 Name:...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online