Sketch an algorithm to recognize the language, Theory of Computation

First model: Computer has a ?xed number of bits of storage. You will model this by limiting your program to a single ?xed-precision unsigned integer variable, e.g., a single one-byte variable (which, of course, can store only values in the range [0, . . . , 255]), etc. Limityourself, further, to calling input() in just one place in your program. One way of doing this is to call input() in the argument of a multiway branch (e.g., switch) statement. (That statement, of course, will need to be in the scope of some sort of loop, otherwise you would never read more than the ?rst symbol of the input.) The reason for this restriction will become clear in the last part of this question.

(a) Sketch an algorithm to recognize the language: {(ab)i | i ≥ 0} (that is, the set of strings of ‘a's and ‘b's consisting of zero or more repetitions of ab: {ε, ab, abab, ababab, . . .}, where ‘ε' is the empty string, containing no symbols whatsoever).

(b) How many bits do you need for this (how much precision do you need)? Can you do it with a single bit integer?

(c) Sketch an algorithm to recognize the language: {(abbba)i | i ≥ 0} (i.e., {ε, abbba, abbbaabbba, . . .}).

(d) How many bits do you need for this?

(e) Suppose we relax the limitation to calling input() at a single place in the code. Sketch an algorithm for recognizing the language of part (a) using (apparently) no data storage.

[Hint: All you need to do is to verify that the ‘a's and ‘b's occur in the right sequence. If you forget all the restrictions, etc., and just use the simplest program you can think of, you are likely to come up with one that meets these criteria.]

Argue that any algorithm for recognizing this language must store at least one bit of information. Where does your program store it?

Posted Date: 3/20/2013 6:11:52 AM | Location : United States







Related Discussions:- Sketch an algorithm to recognize the language, Assignment Help, Ask Question on Sketch an algorithm to recognize the language, Get Answer, Expert's Help, Sketch an algorithm to recognize the language Discussions

Write discussion on Sketch an algorithm to recognize the language
Your posts are moderated
Related Questions
https://www.google.com/search?q=The+fomula+n%3D%28x%3D0%29%2F%281%3D2%29.The+value+x%3D0+and+is+used+to+stop+the+algerithin.The+calculation+is+reapeated+using+values+of+x%3D0+is+in

The Emptiness Problem is the problem of deciding if a given regular language is empty (= ∅). Theorem 4 (Emptiness) The Emptiness Problem for Regular Languages is decidable. P

design a turing machine that accepts the language which consists of even number of zero''s and even number of one''s?

We'll close our consideration of regular languages by looking at whether (certain) problems about regular languages are algorithmically decidable.

Computer has a single FIFO queue of ?xed precision unsigned integers with the length of the queue unbounded. You can use access methods similar to those in the third model. In this




We represented SLk automata as Myhill graphs, directed graphs in which the nodes were labeled with (k-1)-factors of alphabet symbols (along with a node labeled ‘?' and one labeled

The SL 2 languages are speci?ed with a set of 2-factors in Σ 2 (plus some factors in {?}Σ and some factors in Σ{?} distinguishing symbols that may occur at the beginning and en