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
State whether the language is in $R$, $RE$, etc. The intuition for the solution
You could start from the fact that the language $HP$ of the Halting problem is r.e. If its complement $\overline{HP}$ were r.e. too then that would mean that $HP$ is recursive (in $R$) which is imposs …
2
votes
Accepted
Is there any difference between these two languages?
Yes there is. $w \in \{ a, b\}$ means that $w$ may be either $a$ or $b$, while $w \in \{ a, b\}^*$ means that $w$ may be a string over $a$ and $b$ including the empty string $\epsilon$. In particular …
1
vote
Accepted
Reduction function from A to its complement
This is true for any recursive language $A$ different from $\emptyset$ and $\Sigma^*$ for some finite alphabet $\Sigma$. Your definition is correct. In general you could define $f$ as following. Let $ …
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
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
Accepted
Show that kleene plus language is a regular language by describing how you build a DFA or NF...
You can use Thompson's construction. It constructs NFA with $\epsilon$ moves. But remove the forward $\epsilon$-transition from the new start state into the new final state since you are interested in …
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_{ …
0
votes
When is the empty word part of $A^+$?
This trivially follows from the definition of the Kleene plus operation. $A^+$ is known as the Kleene plus operation on the set $A$. This operation omits the $A^0=\{\epsilon\}$ in the the Kleene star …
4
votes
Are the regular languages closed against injecting single letters?
This language is regular. Let $M$ be a DFA accepting $L$ and assume it has a single initial and final state. We can construct a NFA accepting $L_2$. We create two copies of $M$: $M_1$ and $M_2$. Let u …
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 …
3
votes
Show that $L = \{1^n w 1^n | n > 0 \text{ and } w ∈ \{0,1\}^*\}$ is regular
My answer is just a hint. The following pattern should lead you to the right answer:
These strings belong to the language:
$w = 11 \Rightarrow 1^1\epsilon 1^1, n=1$
$w = 1011 \Rightarrow 1^1(01) 1^1, …
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 …
6
votes
Why are DCFL not closed under concatenation or Union whereas CFL is?
The fact that is a proper subset does not inherit the global properties in general is common in mathematics and computer science. A proper subset does not have to inherit the global properties of its …
0
votes
DFA accepting strings with at least three occurrences of three consecutive 1's
The problem asks to draw a deterministic finite automaton (DFA), not a pushdown automaton or a Turing machine. If you cannot directly come up with a DFA then you can draw a NFA (or NFA with epsilon mo …
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 …