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

  Questionfollowing narrative summarizes an interview with an

questionfollowing narrative summarizes an interview with an accounts clerk working for eyetunes club. members of club

  How to use hexadecimal or octal nowadays

What kinds of data formats are there? Why are there so many? Can you tell from looking at a string of bits exactly what the data represents?

  Organizational structure in large public sector organization

However, is it possible that in many countries, taller organizational structures are preferred as they allow more checks and balances to be put in place, to inhibit public-sector corruption and other undesirable practices.

  Make a class named student

design a class named ShowStudent that instantiates a Student object from th eclass and then display all the vlaues associated with the Student. Save as ShowStudent.java

  How you would access a file as either a database or a

how you would access a file as either a database or a sequential file. describe in your code the differences between

  Describe the methodology behind constructing one

Define a work breakdown structure and describe the methodology behind constructing one. Contains at least five main tasks, one for each of the PMBOK process areas.

  Complexity and crafting a solution

You're faced with an extremely complex problem that will require a lengthy solution. How would you go about addressed the complexity and crafting a solution?

  The primary function of the steering committee

What do you find one of the most interesting advances in health care informatics and why.

  You are working with php a general-purpose server-side

you are working with php a general-purpose server-side scripting language that allows you to add a lot of function

  Compare the role and impact of a computing technology

information on understanding an inner workings of digital downloads and digital compression. I need to follow the outline below. I'm running out of information. I need to compare the role and impact of a computing technology on society.

  Define differences between little-endian and big-endian

Who makes the base file structure? The Network Administrator or, the research scientist? And why. What are the differences between little-endian and big-endian?

  Java program that allows a user to enter three words

design a Java program that allows a user to enter three words, and displays the appropriate three-letter acronym (constructed from the input) in all uppercase letters. If user enters more than three words, ignore the extra words.

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