This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: a = [1,2,3] # Output = b = a.collect { x “#{x1}!” } puts b 2. (6 pts) Consider the regular expression ab*. Recall * has higher precedence than concatenation. a. (1 pt) Does it accept the string “a”? Circle one: Yes No b. (5 pts) Create a NFA for ab*, using the algorithm discussed in class. 3. (12pts) Consider the following NFA. 1 3 2 & 4 a & a b a. (2 pts) Does it accept the string “aa”? List a possible sequence of state transitions (e.g., 1,3,4) leading to acceptance / rejection of “aa”. b. (10 pts) Convert the NFA to a DFA using the subset construction algorithm discussed in class. Be sure to label each state in the DFA with the corresponding state(s) in the NFA....
View
Full Document
 Fall '08
 staff
 Regular expression, A Closed Book

Click to edit the document details