Draw an automaton that recognizes precisely

Assignment Help Computer Engineering
Reference no: EM131417211

1a-f) Multiple Choice: Select the best answer and write it on the blank. Also provide the specification for the language.

Which specification technique would be the weakest(least powerful; we talked about the layers of specification power)that is capable of describe this language?

a)  strings of  three or more g's 

A.  regular expression    C.  pseudorational grammar

B.  context free grammar             D.  language expression

b)  expressions consisting only of single digits separated by +  such as      

A.  regular expression    C.  pseudorational grammar

B.  context free grammar             D.  language expression

c)  lists of digits such as

A.  regular expression    C.  pseudorational grammar

B.  context free grammar             D.  language expression

d)  ambn  : strings with m a's followed by n b's  , m, n ≥ 1

A.  regular expression    C.  pseudorational grammar

B.  context free grammar             D.  language expression

e)  anbn  : strings with some number of a's followed by same number of b's  , n ≥ 1

A.  regular expression    C.  pseudorational grammar

B.  context free grammar             D.  language expression

f)  strings of 1's of an even length, containing only 1's

A.  regular expression    C.  pseudorational grammar

B.  context free grammar             D.  language expression

g)  binary strings containing an even number of 1's ( at least one 1 )

A.  regular expression    C.  pseudorational grammar

B.  context free grammar             D.  language expression

2a-l) True or False: Write a T or F in the blank

___ a) Automata is just another name for a graph

___ b) YACC is a tool that is used to build a parser

___ c) It is called a 'finite' state automata because it will only work for finite languages

___ d) The only way to represent an automata is the nodes/edges graphical diagram

___ e) Regular grammar just means that the grammar is correctly written

___ f) A context free grammar is also a regular grammar

___ g) A regular grammar is also a context free grammar

___h) BNF rules are used as the production rules in a context free grammar

___ i) Regular Expression (a | b)(c | d) generates a finite language

___j) RE's (a | b)(c | d) and (c | d)(a | b) denote different languages {set of words}

___ k) RE's (a | b)(c | d) and (b | a)(c | d) denote different languages

___ l) RG's can be used to replace any context free grammar

3) Draw an automaton that recognizes precisely the following language: strings, from the alphabet {a, b}, which contain a substring with at least 2 consecutive b's.

4) Consider the language over alphabet {a, b} that contains all strings that have a length of at least 2 and also start and end with the same letter - for example ( abaa ).  Provide the following for this language (a) Regular Expression  (b) DFA (c) Context Free Grammar [ give the CFG some thought to not make it twice as long as necessary ]

5) For each string, indicate if it will be accepted by the DFA.

2042_Figure.png

String

Yes

No

0 1 0 1

 

 

0 1 0 1 0

 

 

0 1 1 1 1

 

 

0 0 1 0 1

 

 

 

 

 

6) Indicate with Yes or No: Is the word in the language defined by the specification rules? Circle Y or N   for each word and each language. (or delete the wrong answer )

Word

Is In

A àAa
A
à b

 

Word

Is In

( a | b )*

ab

Y      N

 

ab

Y      N

aab

Y      N

 

aab

Y      N

baa

Y      N

 

baa

Y      N

Word

Is In

A àAA
A
à ab

 

Word

Is In

(ab)*

ab

Y      N

 

ab

Y      N

aab

Y      N

 

aab

Y      N

baa

Y      N

 

baa

Y      N

Word

Is In

A àa B
B
àb | x | a

 

Word

Is In

a*b*

ab

Y      N

 

ab

Y      N

aab

Y      N

 

aab

Y      N

baa

Y      N

 

baa

Y      N

7a-b) Consider a language of all nonempty sequences of @ symbols.

a) Write a regular expression for this language

b) Write a context free grammar for this language

8) Draw a parse tree for aaa as produced by grammars G3 and then G4.

Grammar : G3

 

Grammar : G4

S = a S

S = a

 

S = S a

S = a

9 a-b) Consider our standard Expression grammar as a guide for correctly formed expressions.

1) E = E + T

2) E = T

3) T = T * F

4) T = F

5) F = (E)

6) F = num

a) Draw a Parse Tree for the expression for     2 + (5 + 3) * 7

b) Draw an Abstract Syntax Tree for the same expression

c) Show the infix, prefix, and postfix representation for the expression from (a)

10) Lex & YACC implementation. Below include Lex & YACC specification as well as sample output. You can just paste the text of the Lex/YACC/Output rather than screen shots Format it, make it readable. Also indicate the location in account for the code. Sample output to right (15 pts)

Problem: read in a list of numbers; report back the sum & count

  • space separated list of positive integers
  • may be more than 1 digit in a number

1826_Figure1.png


Attachment:- Assignment.rar

Reference no: EM131417211

Questions Cloud

Can you have a us management style in the given countries : Can you have a U.S. management style in these countries? In support of your answer, show how various issues would influence the success of multicultural teamwork.
Compute confidence interval for the population percentage : On the basis of this confidence interval, can we conclude that more than 50% of all students favor more coed dorms? Explain. Can we reject the possibility that the population proportion is .60?
Analyze the fintech industry in chile and australia : Are there any features [historical, political, legal, socio-cultural] of the country that help the companies in THIS INDUSTRY IN THOE COUNTRIES achieve competitive advantage internationally?
Database records information about : The database records information about each customer (name, address, email, and phone). If the customer participates in the loyalty program, loyalty card number is stored. Note that two customers can have the same phone number (e.g., home phone nu..
Draw an automaton that recognizes precisely : Draw an automaton that recognizes precisely the following language: strings, from the alphabet {a, b}, which contain a substring with at least 2 consecutive b's
Definition of strategy according to the macro-power : Q1. What is the definition of strategy according to the Macro-Power strand of the power school and how is macro power strand different from all other schools.
Describe the four types of people that sartre illustrates : Describe the four types of people that Sartre illustrates in Anti-Semite and Jew: The Anti-Semite, The Democrat, The Inauthentic Jew, and the Authentic Jew. Why did the Democrat not really assist th..
Whether proportion is a sample or a population proportion : In each part of given question, explain whether the proportion that is described is a sample proportion or a population proportion.
List at least three ways leaders can work with people : List at least three ways leaders can work with people who are less argumentative and people who are highly argumentative to enhance work communication.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Creating a source documents on access 2010

Explain how to generate a source documents on the access 2010 with the information to involve the password, user ID, name, telephone, address, item number, e-mail address, bid offered, and method of payment.

  Octal and binary the mayan number

Convert to base hex, decimal, octal and binary the Mayan number (base 20) J7GE.I8H (all done in arithmetic in decimal)

  Identify types of input control and explain function of each

Identify four types of input control and explain the function of each. Provide an example of a data integrity error that could occur if each of these types of input control were not in place.

  Write design objective of memory hierarchy

Write a design objective of memory hierarchy in parallel processing system and multiprogrammed uniprocessor system.

  What are the errors

What are the errors

  Explaining arp command

The arp command: arp -s InetAddr EtherAddr enables you to manually add an entry to ARP cache which resolves the IP address InetAddr to the physical address EtherAddr.

  Explain the role of signature analysis in computer forensics

Discuss one of the general set of procedures that an enterprise should follow to preserve digital evidence when faced with a suspected insider breach if information security?

  Write a program to simulate the authentication process

The user would enter 23113 instead of 12345. This doesn't divulge the password even if an attacker intercepts the entry because 23113 could correspond to other PIN numbers.

  How many register windows would be available

How many registers would be available for use by output parameters - How many register windows would be available for use?

  Display the miles per gallon obtained for each tankful

Display the miles per gallon obtained for each tankful

  Describe why you think it is important for an organization

write 4-6 paragraphs...define the terms and discuss their implementation.use examples to reinforce your ideas.several

  Questionassume we have three classes alarmclock beeper and

questionassume we have three classes alarmclock beeper and alarmwindow. in following you see an interaction showing an

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd