34 views

Uploaded by Jonathan Ng

455 exam2

- Multi Objective Criteria for Selection of Manufacturing Method Using NLP Parser
- Compiler CFG Slides of PowerPoint
- Rich Automata Solns-copy
- Weird Machines Exploitability
- Compiler Design
- CS6503-Theory of Computation
- LectureNote15_StatechartDiagrams
- Cmsc141 Converted
- SEM 5 MC0082 1 Theory of Computer Science
- Compiler Lab Viva Quetions and Answers
- Compiler
- Topic 3: Domain Interfaces and Heterogeneous MoCs
- 4th Sem Syallbus
- n Language Processing
- yamaha 01v.txt
- 05 4 Semantic AnalysisIV
- 18-vietlaicau
- ComputerScience&Engineering
- Natural Language C Cross Compiler
- Clasa a v 3 Si 4

You are on page 1of 3

Spring 2016

Mid Semester Exam.

Wednesday, March 30, 2016

Closed Book - Closed Notes

This exam has three pages

Dont forget to write your name or ID and pledge on the exam sheet.

1. (8 points) Consider the following context-free grammars and languages. In

each grammar, S is the start symbol, capital letters are nonterminals, lower

case letters are terminals, and e is the empty string. Match up the grammars

with the languages they generate. Include the letter of the language after

each grammar. A given language may be used for more than one grammar.

Each grammar should match one language.

Grammars:

1.1.) S aSb, S e.

1.2.) S SaS, S b.

1.3.) S aSa, S b.

1.4.) S aSa, S bSb, S e.

1.5.) S aS, S bS, S Sa, S Sb, S e.

1.6.) S aSb, S bSa, S SS, S e.

1.7.) S aSbS, S bSaS, S e.

1.8.) S aSb, S bSa, S aSa, S bSb, S e.

Languages:

A. {a, b}

B. Strings over {a, b} of even length.

C. Strings over {a, b} with the same number of as as bs.

D. {an bn : n 0}

E. (ba) b

F. {wwR : w {a, b} }

G. {an ban : n 0}

2. (6 points) Consider the push-down automaton M = (K, , , , s, F )

where K = {s, f }, = {a, b}, = {a, b}, F = {f }, and consists of the

following transitions:

((s, a, e), (s, b)), ((s, b, e), (s, a)), ((s, e, e), (f, e)), ((f, a, a), (f, e)), ((f, b, b), (f, e)).

Which of the following strings are in L(M )? Write the letters of all strings

that are in L(M ) here:

1

a)

b)

c)

d)

e)

f)

ba

bbbaaabbb

aabaabb

aabb

abaaba

abab

{Q, R, S, T }, input alphabet {0, 1}, start state Q, accepting states Q and S,

and with the following transitions:

Q

0,1

1

0,1

T

3.1) (3 points) How many states are there in an equivalent minimal nite

state automaton?

3.2) (3 points) How many accepting states are there in an equivalent minimal

nite state automaton?

3.3) (2 points) Which of the following regular expressions describes the language recognized by this automaton? (a) (0 1) (b) ((0 1)(0 1)) (c)

0 1 (d) 1 0 (e) (01) (f) (10) (g) None of these.

For the following question, choose the best answer.

4. (4 points) The language {an bm : m = 2n} is

a) nite

b) regular

c) context-free but not regular

d) not context free

5. (4 points) Which of the following is a method for showing that a language

L is not regular?

a) Constructing a nite state automaton recognizing L

b) Showing that the relation L has innitely many equivalence classes.

c) Constructing a push-down automaton recognizing L

d) Showing that the opponent can always win the regular expression game

for L.

2

is {S, A, B, a, b, c}, is {a, b, c}, and R consists of the following rules:

S A A AB B S

Bb Aa

Is this grammar ambiguous? Justify your answer.

7. (6 points) Consider the language L = {(aa)m c(bb)n : m, n 0}. This language contains the strings c, aacbb, aaaacbb, et cetera. Consider the following

theorem and proof:

Theorem: L is not regular.

Proof: We show that in the regular expression game, A (the opponent)

can always win. Suppose A picks the integer N = 50, B picks any string

(aa)m c(bb)n of length larger than 50, then if m 1 A picks x = e, y = aa,

z = (aa)m1 c(bb)n . Now whatever value of i B picks, the string xy i z is in L

because xy i z is (aa)i (aa)m1 c(bb)n . If m = 0 then (because the string has

length larger than 50), n 1 and A picks x = c, y = bb, and z = (bb)n1 .

This is possible because n 1. Whatever value of i B picks, the string xy i z

is in L because xy i z is c(bb)i (bb)n1 . Therefore the opponent (A) can always

win, so L is not regular.

Is the proof correct? Justify your answer.

8. (4 points) Among the following statements, write the letters of all correct

statements here:

a) The language {am bn cp dq : m + n = p + q} is context-free.

b) The union of innitely many context-free languages is context-free.

c) The language {am bcn : m = n} is regular.

d) The language {ai bj ck dck bj ai : i, j, k 0} is context free.

9. EXTRA CREDIT (5 points) Consider the language L = {x {a, b, c} :

x has at least three as, three bs, and three cs}. How many states are there

in a minimal deterministic nite automaton recognizing L? If you think L is

not regular, answer 0 (zero).

3

- Multi Objective Criteria for Selection of Manufacturing Method Using NLP ParserUploaded byEditor IJRITCC
- Compiler CFG Slides of PowerPointUploaded byKhizra Saleem
- Rich Automata Solns-copyUploaded byAsha
- Weird Machines ExploitabilityUploaded byArthur Merlo
- Compiler DesignUploaded byBalaram Rath
- CS6503-Theory of ComputationUploaded byAnonymous SwS8ipxbd
- LectureNote15_StatechartDiagramsUploaded byapi-26462544
- Cmsc141 ConvertedUploaded byRhoxette Nazi Pedroza
- SEM 5 MC0082 1 Theory of Computer ScienceUploaded byonbsd
- Compiler Lab Viva Quetions and AnswersUploaded byVasu Devan
- CompilerUploaded bySanthini Ka
- Topic 3: Domain Interfaces and Heterogeneous MoCsUploaded byshaniaki
- 4th Sem SyallbusUploaded bySamarjeet Sahoo
- n Language ProcessingUploaded byalmarimekhaled
- yamaha 01v.txtUploaded byalessadro gusi
- 05 4 Semantic AnalysisIVUploaded bySamin Afnan
- 18-vietlaicauUploaded byNguyễn Đức Tiến
- ComputerScience&EngineeringUploaded bysuchayandas
- Natural Language C Cross CompilerUploaded byWellington Tsamasuo
- Clasa a v 3 Si 4Uploaded byMihai Cosmin
- As anyUploaded byΠριγκίπισσα Ηλιάνα
- SPPU TE Computer Engg Syllabus 2015 Course 24th February 2017Uploaded byMadhuri Patil
- Ejercicios CLAD V1.1Uploaded byRay Juarez Saldaña
- Case Studies Rubric 2015Uploaded byPriyank Paliwal
- Test Pre IntermediateUploaded bySnjezana Bijelic Janjetovic
- ANA6ANOUploaded byAna Paula Machado
- Ingles CincoUploaded byGianny Llanos
- Ro NP Chunking Using GGS - CONSILR 2011Uploaded byRadu Simionescu
- Compiler Construction NotesUploaded byvinay
- Evidence Your Next Holiday Destination Laura GarzonUploaded byLaura Garzon

- Pentagram AdaUploaded byAndres Varela
- Pentagram AdaUploaded byAndres Varela
- SanduUploaded byJonathan Ng
- MaladyUploaded byJonathan Ng
- Dreamin on My FeetUploaded byJonathan Ng
- PWAD OutineUploaded byJonathan Ng
- Manuscript Paper1Uploaded byJonathan Ng
- Malady.docxUploaded byJonathan Ng
- Malady.docxUploaded byJonathan Ng
- ENGL 370 ECUploaded byJonathan Ng
- ENGL 370 Midterm PaperUploaded byJonathan Ng
- ENG 370Uploaded byJonathan Ng
- ENG 370Uploaded byJonathan Ng
- The Integral Role of the Jam Session in Bluegrass Performance and CultureUploaded byJonathan Ng
- Concert ReviewUploaded byJonathan Ng
- 431 hwUploaded byJonathan Ng
- Vax PrelimUploaded byJonathan Ng

- Gambar TeknikUploaded byHanoko Suseno Aji
- Installationmanual Fbb500 Fbb250!98!125646-gUploaded byEdwin Nyange
- 325bl_330bl_345bl_uhd(f63)Uploaded byfran jesus
- 6-2009Uploaded byGalaleldin Ali
- Biomechanical Demands of Therapeutic Hatha Yoga PoUploaded byriddhi
- McK on Chemicals an Indian Specialty Chemicals Success StoryUploaded bymanjotsingh657
- 04_WorkBreakdownStructureUploaded byAlexander Uc
- scandic-haaga-helia research reportUploaded byapi-309399817
- A2 ICT G063 Revision GuideUploaded byThomas Roe
- Stages - SlidesUploaded bymiller_girl
- Aug. 13, 2016Uploaded byThe Delphos Herald
- Magazine TermsUploaded bycatherines10
- CVCUploaded byluckytung07
- Peace Corps Language Proficeincy Interview (LPI) tester trainingUploaded byAccessible Journal Media: Peace Corps Documents
- Manjit Ramdular Synopsis NanofluidUploaded byrd yadav
- Mapserver IntroUploaded byOlivia Sherlyta
- Chapter_5Uploaded byFrancisco Zurisaddai Meneses
- UntitledUploaded byapi-251901021
- COMM 494 – Ethical Credo PaperUploaded byAlexDooley
- Matlab Codes for Method of CharacteristicsUploaded byaeroacademic
- Roll-Forward Standby ProcedureUploaded byMohd Yasin
- S7-SCL for S7-300 and S7-400 - ManualUploaded byDavis Medeiros
- Galvanic SeriesUploaded byChayon Mondal
- Sony Hdrxr100Uploaded byTHE MAGICK
- Full Annual Report BurberryUploaded bywalkjumproll
- Dis 4314Uploaded byVo Duc Hoang Vu
- ArmCAD 6 User ManualUploaded byNelu Ioan
- 0601 pixxUploaded byAlexander Wiese
- 2017-02-21-SAOHS-ReportUploaded bysara
- Project Blue BeamUploaded byEyemanProphet