355mt1s09sol

355mt1s09sol - CSE 355 Theory of Computing ID: ___________...

Info iconThis preview shows pages 1–3. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSE 355 Theory of Computing ID: ___________ Spring 2009 - Colbourn Midterm # 1 Page 1 of 8 19 February 2009 NAME Sample Solution ASU ID either 9- or 10-digit is fine You have one hour and 15 minutes to complete the exam. Do not open the exam until instructed to do so. No notes, texts, computers, calculators, or communication devices are permitted. Write all answers on the examination paper itself. BUDGET YOUR TIME WELL! SHOW ALL WORK! Question 1 [15] Question 2 [15] Question 3 [10] Question 4 [10] Question 5 [10] Total [60] 26.8 raw average Sorted Grades out of 60 are 57 56 53 48 46 44 44 43 42 41 38 37 34 31 30 30 30 29 27 27 27 27 26 26 26 25 25 25 25 24 24 24 22 22 21 21 20 20 20 18 17 17 16 16 16 15 15 14 13 12 11 11 10 9 8. This midterm is worth 15% of your final grade. These grades will be scaled upwards as follows to determine what you get out of 15. If you received g/60, then compute 5 + (g/5) to get the grade out of 15. The new average is then 10.36/15 = 69.1%. The grade distribution out of 15 becomes 6.6 6.8 7 7.2 7.2 7.4 7.6 7.8 8 8 8.2 8.2 8.4 8.4 8.6 9 9 9.2 9.2 9.4 9.4 9.8 9.8 9.8 10 10 10 10 10.2 10.2 10.4 10.4 10.4 10.4 10.8 11 11 11 11.2 11.8 12.4 12.6 13.2 13.4 13.6 13.8 13.8 14.2 14.6 15.6 16.2 16.4 CSE 355 Theory of Computing ID: ___________ Spring 2009 - Colbourn Midterm # 1 Page 2 of 8 Question 1. [15 marks total] Let G be the grammar S | aSb | SS | aAb A | aAb | S (a) [3 marks] Give two leftmost derivations to show that G is ambiguous. S SS S S These are two leftmost derivations of the same string in the language. Note that we must start with the start variable, and end with no variables (just terminals). (a) [7 marks] Give an unambiguous grammar that is equivalent to G. S | E E T | TE T ab | aEb Alternatively here is an even more compact solution that one student found: S | aSbS If we think of a as `(` and b as `)`, the language is the set of all strings with balanced parentheses....
View Full Document

Page1 / 6

355mt1s09sol - CSE 355 Theory of Computing ID: ___________...

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

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