quiz1-fall09

quiz1-fall09 - a = [1,2,3 ] a[4] = 5 # OUTPUT = a.each{ |x|...

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

View Full Document Right Arrow Icon
CMSC330 Fall 2009 Quiz #1 Name Discussion Time (circle one): 10am 11am 12pm 1pm 2pm 3pm Do not start this exam until you are told to do so! Instructions You have 15 minutes for this quiz. This is a closed book exam. No notes or other aids are allowed. Answer essay questions concisely using 2-3 sentences. Longer answers are not necessary and a penalty may be applied. For partial credit, show all of your work and clearly indicate your answers. Write neatly. Credit cannot be given for illegible answers. 1. (4 pts) What is the output (if any) of the following Ruby program? Write FAIL if code does not execute.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a = [1,2,3 ] a[4] = 5 # OUTPUT = a.each{ |x| puts #{x} } 2. (4 pts) Is it true that every DFA is a NFA? Explain your answer. 3. (4 pts) Write a DFA that accepts the language 1(00|1)*. You do not need to use the algorithms described in class. 4. (8 pts) Begin converting the following NFA into a DFA by applying the subset construction algorithm discussed in class. You do not need to produce the entire DFA. Create at least 2 DFA states (starting state & additional state) and the transition (with label) connecting them. Be sure to list the NFA states represented by each DFA state. 1 3 a b 4 5 2 6...
View Full Document

Page1 / 2

quiz1-fall09 - a = [1,2,3 ] a[4] = 5 # OUTPUT = a.each{ |x|...

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

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