Construct a regular expression

Assignment Help Theory of Computation
Reference no: EM132896654

COMP 3722 Theory and Practice of Computing - Flinders University

1. Finite State Automata and Regular Languages

Use the construction given in the lecture handouts (and also in Theorem 1.45 of Sipser) to give the state diagram for a nondeterministic finite-state automaton that recognizes the union of the following two languages over the alphabet {0, 1}:

a. {w | every pair of 0's in w has at least one 1 between them}
b. {w | the symbol in every odd position of w is a 1}

2. Pumping Lemma ( answer either Part A or Part B)

Part A: Regular Languages (answer either this part or Part B)

Let Σ = {0, 1, +, = } and ADD = {x=y+z | x, y, z are binary integers, and x is the sum of y and z}.
For example, 110=101+1 is in ADD.
Use the pumping lemma for regular languages to show that ADD is not regular.

Hint: It may be helpful to choose s = 1p=0+1p.

Part B: Context-free Languages (answer either this part or Part A)

Let Σ = {1, 2, 3, 4} and C = {w ∈ Σ* | the number of 1s in w equals the number of 2s, and the number of 3s in w equals the number of 4s}.

For example, 14332124 is in C.
Use the pumping lemma for context-free languages to show that C is not context-free.

Hint: It may be helpful to choose s = 1p3p2p4p.

3. Decidability

A string s is a proper prefix of a string t if t starts with s but is not equal to s (i.e. t is equal to s followed by one or more additional symbols). A language is prefix-free if it does not contain any string that is a proper prefix of any other string in the language. Let PREFIX-FREEREX = {R | R is a regular expression where L(R) is prefix-free}.

Show that PREFIX-FREEREX is decidable.

You may use (without proof) the fact that regular languages are closed under the operations of
• Star
• Concatenation
• Union
• Intersection
• Complement

and that each of the following languages is decidable:
• ADFA = {<D, w> | D is a DFA and D accepts w}
• ANFA = {<N, w> | N is a NFA and N accepts w}
• APDA = {<P, w> | P is a PDA and P accepts w}
• AREX = {<R, w> | R is a regular expression and R generates w}
• EDFA = {<D> | D is a DFA and L(D) = Ø}
• EQDFA = {<D, E> | D and E are DFAs and L(D) = L(E)}
• ACFG = {<G, w> | A is a CFG and A generates w}
• ECFG = {<G, w> | E is a CFG and L(E) = Ø }
• any regular language
• any context-free language.

Hint: Given a particular regular expression R over the alphabet Σ, construct a regular expression R′ for: the language of all strings that consist of a string from L(R) followed by some additional symbols. The language L(R′) is the language of all strings that have some string from L(R) as a prefix. Consider what relationship should hold between L(R) and L(R′) in order for L(R) to be prefix-free.

4. Non-computability using a reduction from an undecidable language MAXIMUM_STEPS(k)

For this problem, we first define a computable function as follows: For a particular alphabet Σ, a function f: Σ*→ Σ*, i.e. a function that takes in the input string x and produces the output string y, so that f (x) = y, is computable if there exists a Turing machine that, when started with any string x as the input string on its tape, will halt with the output string y = f (x) on its tape.

Secondly, we describe a function called MAXIMUM_STEPS that takes a whole number as input and produces a whole number as output. This problem will ask you to show that MAXIMUM_STEPS is not computable.

Recall that, for a deterministic Turing Machine with a particular tape alphabet, the transition function tells us what the next step of execution is at any point. Given a current state and current tape symbol, a step is defined as: writing a symbol onto the tape, changing to a particular state, and moving either right or left.

We consider only Turing machines with a fixed number of k states. For any value of k, there are a finite number of Turing machines with k states. This is because a Turing machine is entirely determined by its transition function, and there are only finitely many such possible transition functions for a fixed number of k states.

Still considering the set of k-state Turing Machines, therefore, there are only a limited number of things that these machines can do on a particular input. For the purpose of this problem, we restrict our attention to the case where the input string is the empty string (for any Turing machine we can define the transitions to be made when faced with a blank symbol, so that an empty input string does not restrict the computations that the Turing machine can perform).

Because there are only finitely many Turing machines with k states, there are finitely many Turing machines with k states that halt (and finitely many that do not halt).
Therefore, there is a k-state Turing machine T, that halts on the empty string as input, such that no other Turing machine with k states takes longer (a larger number of steps) than T to halt. The function MAXIMUM_STEPS is equal to the number of steps that T takes to halt.

The function MAXIMUM_STEPS(k) is defined as follows:
For any whole number k > 0, MAXIMUM_STEPS(k) is the size of the longest sequence of steps that any Turing machine with k states can perform when started with the empty string on the input tape before halting. (This function gives one output value for a particular value of k, i.e. it considers all k-state machines together, and picks the running time of one that runs for the longest time before halting).

Show that the function MAXIMUM_STEPS(k) is not computable, i.e. that there is no TM that starts with a tape input of k (written in an appropriate format, e.g. as a string of k 1s) and writes as output the maximum number of steps that a k-state TM, starting with the input of an empty tape, can take before halting.

Hints for a solution: Suppose that, on the contrary, MAXIMUM_STEPS(k) is computable, i.e. that there exists a Turing machine MMS that computes it. Show that, in that case, you can use MMS to construct a decider for ATM, i.e. a Turing machine that can decide whether or not a particular Turing machine M will terminate on any input w or not.

Note that MMS does not itself necessarily contain k states; it is not itself the machine that takes the maximum number of steps for a given k. Instead MMS is a Turing machine that takes in any k as input and produces MAXIMUM_STEPS(k) as output.

Also note that, for a particular M and w, we can always construct a TM Mw, such that Mw ignores its own input, and just simulates the action of that particular M on that particular w, accepting/rejecting if M accepts/rejects, and looping if M loops.
Therefore, Mw will simulate M on w when started with the blank tape. You can make use of the machine Mw in your answer if you wish.

5. Undecidability using Rice's Theorem

Use Rice's Theorem to show that the language ALLTM is undecidable, where
ALLTM = {<M> | M is a TM and L(M) = Σ*}.

(Show that both conditions for applying the theorem are true.)

Attachment:- Theory and Practice of Computing.rar

Reference no: EM132896654

Questions Cloud

How the change proposal for the new technology : Describe how the change proposal for the new technology will be measured to assess the impact of your change and be communicated to staff and implemented
Crowdfunding and crowd funding : Search for both "crowdfunding" and "crowd funding" to get a wider variety of topics.
Evaluate pathophysiologic alterations : Evaluate pathophysiologic alterations that affect the neurologic and respiratory systems. J.S. is a 42-year-old man who lives in the Midwest
What is a short sale of stock : FIN 100 Principles of Finance Assignment - Investments Activity - Strayer University, USA - What is a short sale of stock? Provide an example in your own words
Construct a regular expression : Construct a regular expression R' for: the language of all strings that consist of a string from L(R) followed by some additional symbols.
Explain the etiology of the hematologic disorder : Using the concept map, select a hematologic disorder and complete the fields included on the map. Explain the etiology of the hematologic disorder
Effective communication strategy : Social media can be an effective communication strategy, but you need to use the right media channels for your specific audience.
What inference can make regarding the importance of ethics : What inference can you make regarding the importance of the ethics committee on patient rights based on this question-answer dyad?
COMP 3722 Theory and Practice of Computing Assignment : COMP 3722 Theory and Practice of Computing Assignment Help and Solution, Flinders University - Assessment Writing Service

Reviews

len2896654

5/25/2021 12:31:34 AM

I want this Assignment on Saturday and please let me know if you need any help. I am waiting to hear that you can do it

Write a Review

Theory of Computation Questions & Answers

  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).

  Create a method that perform a division operation

Create a method that will perform a division operation on the numbers passed to it in two variables and outputs the results. Use a try catch pair to output an error message if the illegal operation of divide through zero occurs.

  Convert this english statement into logic statement

Translate the subsequent English statement in terms of L(x; y), P(x; y), quantiers and logical connectives.

  Give a table of combinations for the boolean function

Consider the Boolean algebra of four elements {o, 1, a, b} specified lby the following operation tables and the Boolean functionj(x,y) = ax + by where a and b are two of the elements in the Boolean algebra .Writej(x,y) in a sum-of-minterms form.

  Prove using the pumping lemma and closure properties

Prove using the pumping lemma and closure properties that the languages below are not regular. You can use the game argument provided in class.

  The challenges of antonios wayfive basic goals often

the challenges of antonios wayfive basic goals often referred to as the backbone of antonios way were posted in

  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.

  Computes the function for every nonnegative integer n

Construct a Turing machine that computes the function f (n) = n mod 3 for every nonnegative integer n.

  What is the complexity

A javascript program to demonstrate computational complexity. Using the wikipedia article; a computer program that calculates the number of moves necessary to solve Tower of Hanoi given a number of disks. Calculated by going through the recursive ..

  Derive a state table for the circuit

A Mealy sequential circuit has one input (x) and one output (z).z can be 1when the fourth, eighth, twelfth, etc.inputs are present, and z = 1 if and only if the most recent input combined with the preceding three inputs was not a valid BCD encodin..

  Discuss the backus-naur form of a type-two grammar

Given the Backus-Naur form of a type 2 grammar, find all strings that are generated using twenty or fewer applications of the rules defining it.

  Show language consisting bit strings that are palindromes

Suppose that L is a subset of I * and for some positive integer n there are n strings in I * such that every two of these strings are distinguishable.

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