Formal languages are studied in computer science and linguistics. They are usually defined using various types of grammars (e.g. regular, context-free) and automata (e.g. deterministic and pushdown automata, Turing machines). There is a hierarchy of formal languages, which is based on the type of ...

learn more… | top users | synonyms

0
votes
1answer
30 views

What are the differences between a collation and a rule of formation?

I'm a beginner in mathematical logic, and currently studying(myself, without any colleague, which is sad and so asking in here) basics of formal system. Before asking a question, I'll introduce my ...
0
votes
3answers
41 views

Formal Notation - A simple example

I'm taking Formal Languages and Automata Theory course and i couldn't understand the notation below. Can someone explain me this please? $\{ d \mid d \in \{ b f \mid b, f \in \{ a, c, e \} \} \}$
0
votes
0answers
13 views

Generating nonsense, but pronounceable words [closed]

Using nonsense, but pronounceable words can be useful sometimes, for example to test search engines, etc. Is using generative grammars, and a random word generator algorithm a good idea for picking a ...
0
votes
1answer
50 views

How do I define a string in formal language by means of a definition of tuple?

I'm constructing mathematical notions and definition from the bottom of the mathematical structure. So whenever I learn, or encounter new concepts, I try to define it step by step, without using any ...
0
votes
0answers
32 views

L={(M,W) | M is a Turing Machine that stops on input W } is not R. E.

I've been thinking about how to show this but I'm stuck. on Computability, Complexity, and Languages, Second Edition: Fundamentals of Theoretical Computer Science (Computer Science and Scientific ...
3
votes
2answers
32 views

Is my proof of 2 languages equality correct?

I started to self-study the formal languages theory, and tried to solve the following problem: Problem Prove, that these 2 languages are equivalent: $$ \Sigma = \{a,b,c\}\\ L_1 = \{(abc)^na | n \ge ...
-1
votes
1answer
21 views

Context Free-Language [closed]

Is it true that if L1 are CFLs and L1 subset of L subset of L2, then L must be context-free? if not true, give a counterexample. Otherwise, explain intuitively why
4
votes
2answers
80 views

Mathematical concept for formal languages

A formal language is defined as a subset of finite-length strings over an alphabet. It is similar to the mathematical concept "relation", but the lengths of its strings are not fixed. Since the name ...
0
votes
0answers
14 views

Is this set $L$-distinguishable $M = \{a^i b^k a^j \mid i\#k\#j\}$? Why (not)?

Is set $M$ $L$-distinguishable? Why (not)? Here $L$ is the language that accepts the $bababaa$ string, so $L = \{a,b\}^*\{bababaa\}\{a,b\}^*$, and $M = \{a^i b^k a^j \mid i\#k\#j\}$. Please would ...
0
votes
1answer
22 views

w such that contains at most two 1s, CFG idea

this is my first time that I did a CFG and I ask if it's correct or not. My idea is the follow: A -> 0A | 1B B -> 0B | 1C C -> 0C As the CFG has to ...
0
votes
0answers
30 views

Pumping lemma for $a^n b^{2n}$

I have this question and i am not sure and trying to solve in both way that is through diagram and expression: Question : Prove that $a^nb^{2n}$ is not regular. contradiction: ...
1
vote
1answer
28 views

How to get all permutations of a variable-length word

I need to find all permutations of a set of letters (word) with following parameters: Word lengths $\ell = [1, 20]$ Alphabet $A = \{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t\} \Rightarrow \lvert ...
1
vote
1answer
45 views

Context free grammar $L=\{a^ib^jc^k|j=i+k-2\}$

$L=\{a^ib^jc^k|j=i+k-2\}$ This expression surprise me a lot and put me into deep thinking. what i am doing by solving the expressions: ...
1
vote
1answer
32 views

Deterministic Push-Down Automata

Does there exist Deterministic Push-Down Automata for the language below. Any kind of answer will be highly appreciated! $$L =ba^nb^n U bba^nb^{2n}$$
1
vote
0answers
35 views

Proving irregularity using Myhill-Nerode theorem

I'm trying to prove that the following language is irregular using the Myhill-Nerode theorem $$ L = \{ w\space\epsilon \{a,b,c\}^* | \#_b(w) > (\#_a(w) + \#_c(w))! \} $$ While it's completely ...
1
vote
2answers
58 views

pumping lemma: ww^R not regular

I'm trying to prove that $L = \{ww^R : w \in \{a,b\}^*\}$ ($w^R$ is the reverse of $w$) is not regular using the pumping lemma. Let $p$ be the pumping length and $s = a^pbba^p$. $x = \epsilon$, $y = ...
2
votes
0answers
15 views

Collapsing adjacent states in a grammar

I am trying to write a program which can induce a grammar from an example of the code(really more of a corpus than an example). I'm ignoring the decision problem, because I am doing two things that ...
0
votes
0answers
38 views

Describe the language generated by the grammar $G = \{\Sigma, \Delta\ S, I \} $

I need to describe the language generated by the grammar $G = \{\Sigma, \Delta\ S, I \} $, where $$\Sigma=\{0,1\epsilon \}, \Delta = \{S,X,Y,Z\}$$ and $$I = \{S \to0X|1Y, x \to1Y|1Z, Y \to0X|0Z, Z ...
1
vote
0answers
24 views

Checking my CFG to CNF answer

I attempted to transform the given CFG into CNF. $$S → ASA|A$$ $$A→aa|ε$$ Here are my steps: $$S→X$$ $$X→XA|AX|A$$ $$A→aa$$ $$S→X$$ $$X→XA|AX|YY$$ $$A→YY$$ $$Y→a$$ $$S→XA|AX|YY$$ ...
0
votes
1answer
28 views

Find the language of $\sum^*$

For the alphabet $\sum = \{0,1\}$, let $A,B,C \subseteq \sum^*$ be the languages below. $i. A = \{1, 0, 00, 11, 000, 111, 0000, 1111\}$ $ii. B = \{w \in \sum^*|||w|| \ge 2 \}$ $ii. C = \{w \in ...
0
votes
1answer
22 views

Grammar extraction using pre-existing grammars.

Given a set of strings $s_1, \dots, s_n$ over $\Sigma$ it isn't clear what a good generalization of the strings would be using a regular language, that extends the set infinitely. This comes from the ...
0
votes
0answers
12 views

Two languages proof by Induction [duplicate]

I have a question that states - Using proof by induction, prove formally that L(R*) = L((R*)*) -- Where R is a regular expression over a non-empty alphabet. I have am struggling to relate it back to ...
0
votes
0answers
19 views

Proof the 1 language is contained in another

Does anyone know what the best method is to prove that the intersection of Language1 and Language 2 = Language1? Where both languages are over alphabet {a,b,c}.
0
votes
0answers
25 views

Proof by Induction on two languages [duplicate]

I have a question that states - Using proof by induction, prove formally that L(R*) = L((R*)*) -- Where R is a regular expression over a non-empty alphabet. I have am struggling to relate it back to ...
1
vote
1answer
271 views

induction proof for kleene star

i am going through some past exam paper questions on regular languages for some revision, and i am having a bit of trouble with converting general ideas into formal mathematical proofs. the question ...
0
votes
0answers
22 views

CFG Convertion to GNF

I have a very simple CFG that I am trying to convert into GNF. The CFG is: S -> aSbS S -> epsilon I looked at the CFG and I think I can just do the ...
0
votes
1answer
18 views

Which is true about this NFA?

Let $M$ be an NFA with alphabet {0,1} that accepts every binary string. Which of the following is true? a) Every state of $M$ must be an accept state b) $M$ does not have any accept state c) The ...
0
votes
1answer
20 views

Backus-Naur Form with automata

Parsers & compilers usually utilize deterministic finite automata to parse input. It's very easy to implement a generic DFA tool, that simulates any DFA table for example to validate input. ...
0
votes
1answer
42 views

Determine the languages for the given alphabet

For the alphabet $\sum = \{0,1\}, let A,B,C \subseteq \sum^*$ be the languages below. $i. A = \{1, 0, 00, 11, 000, 111, 0000, 1111\}$ $ii. B = \{w \in \sum^*|||w|| \ge 2 \}$ $ii. C = \{w \in ...
2
votes
0answers
40 views

Maths, esp. Godel, and poetry

At the risk of being an interloper: I'm a poet with a bit of mathematical training. Right now I've got a grant from the Arts Council of Northern Ireland to write a collection (loosely) based on the ...
0
votes
1answer
23 views

Are there known patterns among minimal expressions?

Let $R = F[z_1, z_2, \dots]$ be the finite-degree polynomials in a countable number of variables. Let $\mathcal{E}(R)$ be the set of all expressions of polynomials. Note that there could be an ...
0
votes
1answer
17 views

not understanding the part of the answer for drawn turing machine

Could someone please tell me what does capital B mean here ? of course I know R and L stands for right and left... and also I know for example if we have a,b,R (which tells you if you have an a , ...
0
votes
0answers
45 views

My notes on $\Bbb{Z}/p\Bbb{Z}$-theoretic computational complexity

(Question at the very bottom) Def 1. Let $F = \Bbb{Z}_p$ be a finite field. Then an $F^k$-machine is a machine with $k$ input / output memory slots. All computations are done in the field $F$ and ...
2
votes
2answers
41 views

Regular Expressions Help [duplicate]

I need a little help with Regular Expressions. The allowed operations are obviously + (union) , * (Kleene star) and concatenation. I have to write Regex for the following 2 examples. I have tried a ...
0
votes
1answer
60 views

how to a draw a turing machine that has the same number of a's ,b's and c's

how to a draw a turing machine that has the same number of a's ,b's and c's SOMELANGUAGE = {abc acb bac bca cab cba aabbcc aabcbc}
0
votes
2answers
31 views

DFA Construction with three strings in language

Draw DFA that recognizes the following language, with the alphabet {0, 1} {0011, 11, 0101} I'm having a lot of trouble with this, because I know DFA have to have a determined path from each state ...
-1
votes
1answer
48 views

Finding the CFG (Context Free Grammar) of a language

Can we write a CFG (Context Free Grammar) for the set of all non-empty string whose length are multiple of 3 on the alphabet $ \Sigma = \{A,R,G,C\} $
1
vote
1answer
35 views

Constructing PDA for a language

I want to prove or disprove that for a given two PDA's (Pushdown Automata) $M_1$ and $M_2$, we can build a PDA $M$ such that $$L(M) = \{w \in L(M_1) \mid w\text{ contains some string in ...
0
votes
0answers
21 views

Show L is not context free using the CFL pumping lemma

I am trying to use the pumping lemma to show this language is not context free: $L = a^nb^{n+1}c^{2n} : n \ge 0$ So I took $z = a^mb^{m+1}c^{2m}$ where $|z| = 4m+1 > m$. We can decompose $z = ...
8
votes
4answers
578 views

Why isn't there a pumping lemma for recursively enumerable languages?

I'm studying the theory of computation, and I know there are pumping lemmas for regular and context-free languages, but why not for recursively enumerable languages? Is there something about a Turing ...
1
vote
0answers
49 views

If $P=NP$, prove that $L' \in NP$

I think I'm overthinking this problem and need some hints in the right direction. The goal of this question is to show that if $P=NP$ then for every language $L \in NP$ via a polynomial time verifier ...
0
votes
0answers
19 views

(L1* ∩ L2*) = (L1 ∩ L2)* for all languages L1 and L2 over the alpabet Σ={A,B} Is it true or false and why?

plz answer me Determine whether each of the following statements is true or false. If a statement is false, give a counterexample..... 1- $(L_{1}^{*} \cap L_{2}^{*}) = (L_{1} \cap L_{2})^{*}$ for ...
0
votes
1answer
27 views

Are these statements concerning formal languages true or false, and why?

Please answer the following question and give me the reasoning. Are the following statements true or false? If a statement is false, give a counterexample. $uv=vu$ for all strings $u ≠ λ$ and $v ≠ ...
0
votes
1answer
27 views

Prove a language is Context Free

I am working on the following problem and I do make a little progress. Let me state the question first: Prove that the set of strings consisting of $a$'s and $b$'s with an equal number of $a$'s and ...
2
votes
1answer
62 views

Prove 2-HamiltonianCycle $\in \textbf{NP}$

Just want to verify that I have the right idea here with this hamiltonian cycle question. $HC$ = $\{\langle G \rangle$ | $G=(V,E)$ is an undirected graph such that there is a simple cycle (no vertex ...
2
votes
0answers
62 views

Determine the language that corresponds to the following automata.

I want to determine that language that corresponds to the following automata Note: $q_{6}$ have arrow to $a$ to himself. I started with the minimal words: $aaabb$ $aaba$ $aaaba$ $bababa$ the ...
0
votes
0answers
15 views

What is the correct notation for A∆B?

For the alphabet Σ = {0, 1}, let A, B, C ⊆ Σ∗ be the languages below. i. A={1,0,00,11,000,111,0000,1111} ii. B={w∈Σ∗|||w||≥2} iii. C = {w ∈ Σ∗|||w|| ≤ 2} Note: ||w|| denotes the length of the word ...
0
votes
1answer
36 views

Determine the following languages of Σ∗

For the alphabet Σ = {0, 1}, let A, B, C ⊆ Σ∗ be the languages below. i. A={1,0,00,11,000,111,0000,1111} ii. B={w∈Σ∗|||w||≥2} iii. C = {w ∈ Σ∗|||w|| ≤ 2} Note: ||w|| denotes the length of the ...
1
vote
1answer
32 views

There is a sequence of operations on grammars of a string that strictly decreases the size of grammars down to the smallest grammer.

I'm trying to figure out the smallest grammar problem, which yes I know is impossible since it's such a hard problem, but humor me for a sec. Let $g$ be a smallest grammar for the string $s$ over the ...
1
vote
1answer
36 views

Name for grammars with rules $A \to uA$

Recall that a right-linear grammar is a grammar that consists of rules of the form $A\to uB$, where $A$ and $B$ are non-terminals and $u$ is a (possibly empty) word of terminals. Similarly for ...