Question

In: Computer Science

The following language over Σ = {1, #} contains #-separated lists of distinct unary values: A...

The following language over Σ = {1, #} contains #-separated lists of distinct unary values: A = {x1#x2# . . . #xk | k ≥ 0, xi = 1∗ for all i = 1 . . . k, xi 6= xj for all i 6= j} Use the pumping lemma to show A is not regular. In other words, give a string s ∈ A and argue that no matter how you partition s = xyz with |y| > 0, |xy| ≤ p, there exists some i = 0, 2, 3, . . . such that xyi z 6∈ A.

Solutions

Expert Solution

Let the language A be assumed to be regular. Then according to the pumping lemma A must have a pumping length. Let p be the pumping length.

Now, let the string be considered, where is x times 1.This string must belong to A since it agrees to the definition of A.
According to the pumping lemma, the string can be partitioned into such that , and .
Suppose does not contain any and is only made of 's. Then, if the string is considered, it excludes some 's from the segment containing . That would decrease the number of 's in that segment. But on decreasing the number of 's, it will result in a segment which is equal in length to some other segment to the left, as segments of all lengths less than it are present in the string. Thus, .
If there are more than one in , then the string will have at least two segments having equal number of 's. This violates the definition of A and hence .
So, must have one . But in that case, if is pumped multiple times then there will be segments of equal length.

Thus the pumping lemma is violated for A and so A cannot be regular.


Related Solutions

Determine if the language ?={?^?∶?=?^3????????≥0}over Σ={?}is regular.
Determine if the language ?={?^?∶?=?^3????????≥0}over Σ={?}is regular.
Write regular expressions that describes the following language: The language over {0,1,/} that contains all and...
Write regular expressions that describes the following language: The language over {0,1,/} that contains all and only the strings that are base-2 (as above, you can use base-10 if you prefer) representations of rational numbers. Define a representation of a rational number to be either a representation of an integer, or two representations of integers separated by “/”. Leading 0s are allowed this time.
Write regular expressions that describes the following language: The language over {0,1} that contains all and...
Write regular expressions that describes the following language: The language over {0,1} that contains all and only the strings that are base-2 representations of odd positive integers. Do not allow leading 0s. (If you are more comfortable writing bulky regular expressions than you are working in base-2, you may write a regular expression for strings that are base-10 representations of odd integers without leading 0s, using alphabet {0,1,2,3,4,5,6,7,8,9}.)
Consider the language L1 over alphabet Σ = { 0, 1 } where the production rules...
Consider the language L1 over alphabet Σ = { 0, 1 } where the production rules for L1 are as follows: S → TT S → U T → 0T T → T0 T→ 1 U → 0U00 U → 1 Q → λ P → QU Transform this grammar into Chomsky Normal Form, consistent with the CNF specification in the Quick Reference, and using only Variables { S, T, U, V, W, X }. Implement that CNF grammar in...
C++ language or Python. Linked Lists You are given a linked list that contains N integers....
C++ language or Python. Linked Lists You are given a linked list that contains N integers. You are to perform the following reverse operation on the list: Select all the subparts of the list that contain only even integers. For example, if the list is {1,2,8,9,12,16}, then the selected subparts will be {2,8}, {12,16}. Reverse the selected subpart such as {8,2} and {16,12}. The list should now be {1,8,2,9,16,12}. Your node definition should consist of 2 elements: the integer value...
The variable x takes the values ​​from 1 to 100, with these values, create two lists,...
The variable x takes the values ​​from 1 to 100, with these values, create two lists, one where the prime numbers are stored in one, and another where the non-prime numbers are stored, indicate and print the result
(1) Prompt the user for a string that contains two strings separated by a comma. (1...
(1) Prompt the user for a string that contains two strings separated by a comma. (1 pt) Examples of strings that can be accepted: Jill, Allen Jill , Allen Jill,Allen Ex: Enter input string: Jill, Allen (2) Print an error message if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings. (2 pts) Ex: Enter input...
. Let xj , j = 1, . . . n be n distinct values. Let...
. Let xj , j = 1, . . . n be n distinct values. Let yj be any n values. Let p(x) = c1 + c2x + c3x 2 + · · · + cn x ^n−1 be the unique polynomial that interpolates the data (xj , yj ), j = 1, . . . , n (Vandermonde approach). (a) Remember that (xj , yj ), j = 1, . . . , n are given. Derive the n...
(1) Prompt the user for a string that contains two strings separated by a comma.
(In C)(1) Prompt the user for a string that contains two strings separated by a comma. Examples of strings that can be accepted:Jill, AllenJill , AllenJill,AllenEx:Enter input string: Jill, Allen(2) Report an error if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings. Ex:Enter input string: Jill Allen Error: No comma in string. Enter input string: Jill, Allen(3) Extract the two words from the input string and remove any spaces. Store...
For the following schema, provide the following unique/distinct values a) A suitable primary key b) An...
For the following schema, provide the following unique/distinct values a) A suitable primary key b) An example of a different candidate key c) An example of a superkey Accounts(account_id, account_type_code, customer_id, account_name, date_opened, date_closed, current_balance)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT