Third model of computation, Theory of Computation

Assignment Help:

Computer has a single LIFO stack containing ?xed precision unsigned integers (so each integer is subject to over?ow problems) but which has unbounded depth (so the stack itself never over?ows).

In your program you should limit yourself to accessing this with methods like push(i), top(), pop(), and a predicate like empty?(). These will push a value into the stack, return the value stored in the top of the stack (the most recent value pushed), discard the top of stack,
and test the stack for empty, respectively. Don't forget that you have no storage outside of the stack, so you need to work directly with the values in the stack-you can't pull a value out of the stack and assign it to some other variable. Similarly, while you can call input() as
often as you wish, the only way to store the value of the input is to push it directly into the stack (e.g., push(input())).

(a) Sketch an algorithm to recognize the language of strings of the form wcwr where w is any sequence of ‘a's and ‘b's and wr is exactly the same sequence of ‘a's and ‘b's in reverse order, so these are all palindromes over the alphabet {a, b, c} in which 'c' occurs only as the middle symbol. It includes strings like:

abbbcabbb aca ababacababa c

(In the last example there are no ‘a's or ‘b's, the "re?ected" string is empty.)

(b) What is your intuition about recognizing this language within the second model (i.e., using just a single counter)?

(c) What is your intuition about the possibility of recognizing the language of strings of the form wcw, where w is an arbitrary string of ‘a's and ‘b's? This is the set of strings made up of any sequence of ‘a's and ‘b's followed by a 'c' and then exactly the same sequence of ‘a's and ‘b's in exactly the same order; it's referred to as the (deterministic) copy language.


Related Discussions:- Third model of computation

Pendulum Swings, how many pendulum swings will it take to walk across the c...

how many pendulum swings will it take to walk across the classroom?

Computation of an automaton, The computation of an SL 2 automaton A = ( Σ,...

The computation of an SL 2 automaton A = ( Σ, T) on a string w is the maximal sequence of IDs in which each sequential pair of IDs is related by |- A and which starts with the in

Chomsky normal form, s->0A0|1B1|BB A->C B->S|A C->S|null find useless symbo...

s->0A0|1B1|BB A->C B->S|A C->S|null find useless symbol?

Computer Simulation, Generate 100 random numbers with the exponential distr...

Generate 100 random numbers with the exponential distribution lambda=5.0.What is the probability that the largest of them is less than 1.0?

Non-determinism - recognizable language, Our DFAs are required to have exac...

Our DFAs are required to have exactly one edge incident from each state for each input symbol so there is a unique next state for every current state and input symbol. Thus, the ne

REGULAR GRAMMAR, Find the Regular Grammar for the following Regular Express...

Find the Regular Grammar for the following Regular Expression: a(a+b)*(ab*+ba*)b.

Computer achitecture, what is a bus and draw a single bus structure

what is a bus and draw a single bus structure

Gastric juice, what are composition and its function of gastric juice

what are composition and its function of gastric juice

Binary form and chomsky normal form, Normal forms are important because the...

Normal forms are important because they give us a 'standard' way of rewriting and allow us to compare two apparently different grammars G1  and G2. The two grammars can be shown to

Write Your Message!

Captcha
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