776 views
3 votes
3 votes
Is the following Language, L = {xxxx | x ∈ {0, 1}*} CSL or not? I saw a explanation say that it’s REC, but it didn’t say anything about it not being CSL and I used to think strings like {xx | x ∈ {0, 1}*} are CSL where the same strings keep repeating [like x here].

 

So is it CSL and please do also tell is there a rule to figure that out?

2 Answers

Best answer
4 votes
4 votes

Let $\Sigma$ be any input alphabet.

$L = \{ wwww | w \in \Sigma^* \}$ is CSL, But not CFL.

$L$ can be accepted by a $LBA$.

$LBA$ is a Turing Machine that uses only the (constant multiple of) tape space occupied by the input.

In simple words, $\color{red}{\text{$LBA$ is an Algorithm with $O(|w|)$ space complexity.}}$

Now, How much space do you need to recognize $x = wwww$ type of string??

Definitely, $O(|x|)$ space is all you need to recognize $x.$

So, $L$ is CSL. 

https://www.csa.iisc.ac.in/~deepakd/atc-2016/Seminar-LBA.pdf 

selected by
–1 votes
–1 votes
To summarize, the language L = {xxxx | x ∈ {0, 1}*} is not a context-sensitive language (CSL).

To determine whether a language is context-sensitive, you can try to come up with a linear-bounded automaton (LBA) that recognizes it, or you can try to prove that no such automaton exists. One way to do this is to use the pumping lemma for context-sensitive languages, which states that if a language is context-sensitive, then there exists a constant k such that any string in the language of length at least k can be pumped, or broken down into three substrings xyz such that xy^iz is also in the language for all positive integers i. If you can prove that a language does not satisfy the pumping lemma for context-sensitive languages, then you can conclude that it is not context-sensitive.

Another way to determine whether a language is context-sensitive is to try to come up with a context-sensitive grammar (CSG) that generates it. A CSG is a type of formal grammar that consists of a finite set of terminal symbols, a finite set of nonterminal symbols, a start symbol, and a set of productions. Each production has the form A -> B, where A is a nonterminal symbol and B is a string of terminal and nonterminal symbols. If you can come up with a CSG that generates a language, then you can conclude that the language is context-sensitive.
edited by

Related questions

2 votes
2 votes
0 answers
3
2 votes
2 votes
1 answer
4
Tuhin Dutta asked Dec 4, 2017
706 views
$a) \{\ 0^i\ 1^j\ 2^k\ \ | where\ i\ \neq j\ or\ j\ \neq k\ \}$$b) \{\ 0^i\ 1^j\ 2^k\ \ | where\ i\ \neq j\ and\ j\ \neq k\ \}$a) CFL(union of two OR-ed compa...