2quiz8 - Theory of Algorithms Spring 2000 Section 2 Quiz 8...

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

View Full Document Right Arrow Icon
SOLUTIONS. (1) Let G be the following context-free grammar, with V = { S, A } , T = { a, b } . S ASb | Ab A a | λ (a) Find an npda M such that L ( M )= L ( G ). SOLUTION: F = { q f } . δ ( q 0 ,λ,z )= { ( q 1 ,Sz ) } δ ( q 1 ,λ,S )= { ( q 1 ,ASb ) , ( q 1 ,Ab ) } δ ( q 1 ,λ,A )= { ( q 1 ,a ) , ( q 1 ) } δ ( q 1 ,a,a )= { ( q 1 ) } δ ( q 1 ,b,b )= { ( q 1 ) } δ ( q 1 ,λ,z )= { ( q f ) } (b) Give a left-most derivation from G of the string: abbb . (WARNING: Make sure your derivation is left-most.) SOLUTION: S ASb aSb aASbb aSbb aAbbb abbb . (c) Give the corresponding sequence of instantaneous descriptions for M . SOLUTION: ( q 0 , abbb, z ) ( q 1 , abbb, Sz ) ( q 1 , abbb, ASbz ) ( q 1 , abbb, aSbz ) ( q 1 , bbb, Sbz ) ( q 1 , bbb, ASbbz ) ( q 1 , bbb, Sbbz ) ( q 1 , bbb, Abbbz ) ( q 1 , bbb, bbbz ) ( q 1 , bb, bbz ) ( q
Background image of page 1

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

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

This note was uploaded on 07/17/2011 for the course MAD 3512 taught by Professor Staff during the Spring '07 term at University of Florida.

Page1 / 2

2quiz8 - Theory of Algorithms Spring 2000 Section 2 Quiz 8...

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