# sampleex02 - procedure described in class Question 4(5...

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

Exam 02 03/22/2007 SE3306 Mathematical Foundations of SE Name : WebCT ID : Instructions : Read through the whole exam first and plan your time. The exam is worth 25 points, with each question valued as indicated. Closed book : Reference to notes, the text or other material is not permitted . Time : You have one hour and fifteen minutes to complete all questions. Write all your answers on this paper. 1

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

View Full Document
Question 1 (5 points) Let Σ = { 0 , 1 , . . ., 9 } . Construct a FSA that will describe L 1 = { x Σ * | the number represented by x is divisible by 3 } . Question 2 (5 points) Let Σ = { a, b, c } . Give a regular expression that describes the set of all odd-length words in Σ * that do not end in b. 2
Question 3 (5 points) Convert the regular expression ( ab b ) * a to a right regular grammar. You must use the

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: procedure described in class. Question 4 (5 points) Classify the following grammars according to Chomsky’s hierarchy. 1. G 1 = ( { A, B, S, T, Z } , { a, b, c } , S, { S → aSBc, S → aTc, T → b, TB → bT, cB → Bc, Z → λ, Z → S } ) 2. G 2 = ( { S, T } , { a, b } , S, { S → aS, S → bT, T → a } ) 3. G 3 = ( { S, T } , { a, b } , S, { S → aSb, S → bTS, T → a } ) 4. G 4 = ( { A, B, S, T, Z } , { a, b, c } , S, { S → aSBc, S → aTc, T → b, TBT → bT, cB → Bc, Z → λ, Z → S } ) 3 Question 5 (5 points) Show that the set of all parenthesized expressions over the alphabet { a, b, + , ( , ) } is not a regular language. 4...
View Full Document

{[ snackBarMessage ]}

### Page1 / 4

sampleex02 - procedure described in class Question 4(5...

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

View Full Document
Ask a homework question - tutors are online