Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions related to formal languages, grammars, and automata theory
1
vote
Construct a DFA which accepts a string of length 5 with at least 2 0's
The question asks HOW TO DESIGN, you don't have to write the whole DFA, but you can if you want to. Just describe how you would design.
There are 32 strings of length 5. Some of them do not contain a …
2
votes
Set of all countably infinite strings over a finite alphabet >1
Consider an alphabet $\Sigma = \{0,1\}$ and the set of all infinite length strings over $\Sigma$. Then this set is of course infinite, but uncountable which can be easily proved by the diagonalization …
2
votes
Cook-Levin theorem proof's requirement of $\phi_{cell}$
...but I don't understand why the $\phi_{cell}$ formula is required.
The tableau for $N$ in the Sipser's proof represents a single branch of the computation of $N$. The formula $\phi_{cell} \wedg …
0
votes
Accepted
2-tape TM that accepts words from $L := \{bin(n)$#$w \in \Sigma^* | n \in \mathbb N \land w ...
Think over how to convert binary representation of $n$ into unary one using two tapes. The result should be stored on the second tape. For example, if $n=6$ then the unary representation could be $111 …
6
votes
Accepted
Finding $L^*$ when $L=\{a^nb^n | n \geq 1\}$
$L^2 = LL = \{uv | u,v\in L\}$. In words, $L^2$ is a set of all strings that formed by concatenation of all strings from $L$. For instance, if $u=a^kb^k \in L$ and $v=a^tb^t \in L$ then $uv = a^kb^ka^ …
1
vote
Accepted
Find the grammar for the given language
Note that this language excludes all strings of length divisible by 3 but not by 2, i.e., of length $3, 9, 15, 21,\dots$.
Consider languages
$$L_1 = \{w\mid |w|=2k, k\geq 0\}$$ and $$L_2 = \{w\mid …
4
votes
Accepted
What does $k$ mean in regular expressions?
$k$ means that if $w \in R^{k}_{ij}$ then on reading $w$, FA starting from the state $i$ enters the state $j$ and never enters a state $t$ where $t > k$ while reading input $w$. In the book, you learn …
3
votes
Accepted
Is this language countable : $L= \{ w : w \in (1 + 0)^{*} \}$
The language $$L= (0+1)^*$$ (the set of all strings over $0$ and $1$) is countable. Furthermore, any subset of $L$ is also countable. However, the set of all sublanguages of $L$
$$S = P(L) = \{M \mid …
0
votes
Accepted
Find a CFG for univocalic words
Try the following grammar (which can be transformed into a regular grammar):
$S \rightarrow A \mid E \mid I \mid O\mid U$
$A \rightarrow aA \mid bA \mid cA \mid \dots \mid zA \mid \epsilon$ (all con …
2
votes
Accepted
Regular language such that L(r) = L(r₁) L(r) ∪ L(r₂)
Take $r = (r_1 + r_2)^*$. We have to prove
$$(r_1 + r_2)^* = r_1(r_1 + r_2)^* + r_2$$
First note that both $(r_1 + r_2)^*$ and $r_1(r_1 + r_2)^* + r_2$ contain $\epsilon$ since we are given that $\e …
3
votes
Proving union of 2 regular languages is regular
Use De Morgan rule $A\cup B = \overline{\overline{A} \cap \overline{B}}$.
Also you could prove it using DFA for $L_1$ and $L_2$ without using complement and intersection. The latter is systematic an …
1
vote
Does rice theorem applies to languages only or does it apply to machines as well?
The Rice's theorem can also be stated in terms of index sets of TMs.
Lets start with a basic definition of a property of a language. A property of a language is a set of languages. For example $$P_{ …
2
votes
Accepted
Are empty-set languages recursively enumerable?
The empty language is recursive. The TM accepting this language just returns $0$/REJECT on any input. Similarly, the language $\Sigma^*$ is also recursive. Just return $1$/ACCEPT on any input.
Basi …
2
votes
What is the practical purpose of an epsilon NFA?
Given a regular expression constructing an equivalent NFA with epsilon is easier than constructing equivalent DFA. Also given two DFAs you can easily construct NFAs with epsilon moves accept concaten …
2
votes
Language of balanced parentheses; Biconditional proof about parentheses
In fact you are given two languages
$L_1$ defined as a set of strings of balanced parentheses.
$L_2$
defined as a set of strings with equal number of ('s and )'s and
every prefix of w contains at …