Draw a turing machine that decides the language of all words

Assignment Help Theory of Computation
Reference no: EM131766922

Context-free Languages and Turing Machines

Question 1.(a) Consider the language

{aibkcm |i ≥ 0, k ≥ 0, m ≥ 0, k = i + m}

Give a word that is in the language and a word that is not in the language.

(b) Give a context-free grammar for the language above.

(c) Use the Cocke-Younger-Kasami algorithm to determine whether abbaa is a word of the language of the following grammar. Give the table. State in one sentence whether the word is a word of the language of the grammar and how you obtain this conclusion from the table.

S → AX | BY | SS | BA

X → AS

Y → BS

A → a

B → b

(d) Give a parse tree for the word aaba with respect to the grammar above (for part (c)).

(e) What is FIRST( SS) with respect to the grammar above (for part (c)).

Question 2. Consider the following two context-free grammars:

G1 : S → SaS | SbS | c

G2 : S → DAd
A → aS | ε

B → bD | ε

D → cB

(a) Draw two different parse trees for the word cacbc and the grammar G1.

(b) Give the LOOKAHEAD set for every rule of grammar G2.

(c) Is the grammar G2 LL(1) ?

(d) Give the set of nullable nonterminals for the grammar G2.

(e) Give the context-free grammar that you obtain from replacing all ε-rules in gram-mar G2

Question 3. (a) Consider the following Turing machine with input alphabet {a, b} and tape al- phabet {a, b, _}:

2105_turing machine.jpg

Give computations for the words ab and bb. State for each word whether the machine accepts it, rejects it or loops. If the machine loops, then give the first five configurations of the computation.

(b) Draw a Turing machine that decides the language of all words over the alphabet {a, b} that have an odd number of a's and an odd number of b's.

Reference no: EM131766922

Questions Cloud

Calculate the net income reported by afm company : Calculate the net income reported by AFM Company last year
Reflect on the leadership and economic models : Reflect on the personal knowledge and skills gained.Reflect on the Leadership and economic models .
Calculate the mean of the random variable : Watching TV (6.1, 7.3) Choose a young person (aged 19 to 25) at random and ask, "In the past seven days, how many days did you watch television?"
Calculate the inflation level if the monetary authorities : Calculate the inflation level if the monetary authorities allow the money supply to grow at a rate of 6 percent in an economy that is growing by 2 percent.
Draw a turing machine that decides the language of all words : Draw two different parse trees for the word cacbc and the grammar - Give the set of nullable nonterminals for the grammar
Specializes in producing commemorative shirts : Quick-Screen is a clothing manufacturing company that specializes in producing commemorative shirts immediately following major sporting events
Argument against the neoclassical assumption : Alchian (1950) quotes Tintner who advanced the most powerful argument against the neoclassical assumption of highly rational
Determining precise discount versus range of discounts : The figure below shows the mean ratings for the eight treatments formed from the two factors. Based on these results, write a careful description.
How can an administrator respond to reluctance to comply : How can an administrator in a health care organization influence others in the organization to use data legally and ethically?

Reviews

len1766922

12/15/2017 12:54:25 AM

Hi am struggling with a theory of computation assignment due in tomorrow () at 23:30 UK time zone. Can some please help me? This assessment is built from past exam papers. So if you want to practice for the exam, you should do this assessment in ca. 90 minutes. Please submit your solution as a single PDF file on Moodle. The PDF file may be generated in various different ways; for example, you may use Word to write your solution or you may scan a hand-written solution.

Write a Review

Theory of Computation Questions & Answers

  Finite-state machine design

Create a finite-state machine design to turn your FPGA development board into a simple programmable music box.

  Redundant sequence identi cation

Redundant sequence identi cation

  Compute a shortest superstring

Dynamic programming algorithm to compute a shortest superstring.

  Propositional and predicate logic

Write down a structural induction principle for the PlayTree free type

  Design a syntactic analyzer

Design a syntactic analyzer for the language specified by the grammar

  Design unambiguous grammar to parse expressions

Write a program would read two numbers and then print all numbers between the first and the second, inclusive. Design unambiguous grammar to parse expressions

  Consider a logic function with three outputs

Consider a logic function with three outputs,  A ,  B , and  C , and three inputs,  D ,  E , and  F . The function is defined as follows:  A  is true if at least one input is true,  B  is true

  Considering a single programmed operating system

Considering a single programmed operating system, what is the minimal total time required to complete executions of the two processes? You should explain your answer with a diagram.

  How to construct an nfa

Give a construction that assumes you are given a DFA for L and show how to construct an NFA (with or without ε-moves) to recognize sort(L).

  Equivalence classes to construct minimal dfa for language

How many equivalence classes does this relation have and what are they? Use these equivalence classes to construct the minimal DFA for the language.

  Impact of moore-s law on data center costs

Discuss the impact of Moore's law on data center costs on such things as servers and communications equipment. List at least 3 steps or recommendations your data center can take to offset some or all of the effect of Moore's law.

  Problem encountered in statements in predicate logic

How the problem would be encountered in attempting to represent the following statements in Predicate logic. it should be possible to: John only likes to see French movies.

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