Articles of formal languages

In Context of Chomskhy classification of formal languages

Is it possible that an ambiguous context free language also be a liner context free. I have doubt regarding scope of ambiguous language in below Venn-diagram.

Is $L=\{o^{i}1^{i}o^{j}1^{i} | i,j>0\}$ a context free language?

I need to find and to prove (by the pumping lemma or by building a grammar) if $L=\{o^{i}1^{i}o^{j}1^{i} | i,j>0\}$ is a context free language. I would like to get some help. thanks!

Greibach normal form conversion

I’m trying to convert this into GNF: $S \rightarrow ASaa | bab$ $A \rightarrow Ba | bAB$ $B \rightarrow abba$ So I’m getting this, but I’m not sure understanding and applying correctly the concept of where exactly the variables and terminals should be in this format: $S \rightarrow a A_0 S_0 | b A B […]

Why is it hard to parse unambiguous context-free grammar in linear time?

From this question, I gather that whether unambiguous CF grammar can be parsed in linear time is an open problem. I’d like to know what the major roadblocks to achieve this are. That is, what made the attempts to produce such a parser fail ?

NFA from grammar productions

Based on this grammar: \begin{align} G = (\{S,A,B\}, \{a,b, c\}, S, P) \end{align} \begin{matrix} \\P: \\S → abaS | cA \\A → bA | cB | aa \\B → bB | cA | bb \end{matrix} I created this NFA: I’m not sure about $q1 \to q2$ and $q1 \to q3$, if maybe someone can clarify […]

Count the number of strings containing $ac$ or $ca$ for a fixed length over ternary alphabet $A = \{a,b,c\}$ using rational series

This question is a continuation the one asked here, and which already received good answers. Here I am asking for a solution using rational series of formal languages as suggested by the user J. E. Pin in the other thread. Denote by $A = \{a, b, c \}$ a ternary alphabet, also denote by $|u|_{ac}$ […]

Does $\pi$ have infinitely many prime prefixes?

This is inspired by this question. Does $\pi$ have infinitely many prime prefixes (in base $10$)? That is, is the sequence A005042 infinite? It says on the OEIS that a naïve probabilistic argument suggests that the sequence of such primes is infinite. What argument would that be? Such primes would be examples of pi-primes.

Why can't we use memoization to parse unambiguous context-free grammars in linear time?

This is a follow-up question to Why is it hard to parse unambiguous context-free grammar in linear time? I know that Parsing Expression Grammars (PEG) can be parsed in linear time using a packrat parser. Those parser use memoization to accomplish the linear time complexity: basically each non-terminal can be “expanded” at most once at […]

Finding an appropriate value to contradict the pumping lemma.

I am trying to prove that $L=${$a^mb^n | n=m^2$} is not a CFL with the help of the pumping lemma for CFL’s. I chose $w=a^mb^{m^2}$ = $a^{m-S}a^Sb^Tb^{m^2-T}$ $\in L$ And now in order to contradict the pumping lemma assumption I am looking for $i$ such that $a^{m-S}a^{S^i}b^{T^i}b^{m^2-T}$ $\notin L$ for $i>=0$. Is it possible to […]

Prove the following language is not regular

The set of strings of 0’s and 1’s, beginning with a 1, such that when interpreted as an integer, that integer is prime. I’m assuming the best way to move forward is to use the pumping lemma. I’m having difficulty developing a contradiction in this case because typically the membership criteria of the language involves […]