Skip to main content
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
Results tagged with
Search options not deleted user 11632

Questions about properties of the class of regular languages and individual languages.

3 votes
4 answers
2k views

Language where every prefix has almost equal a's and b's

Is the following language regular? $$L = \{x \in \{a, b\}^* \mid \text{in every prefix \(w\) of \(x\), } 0 \le |w|_a − |w|_b \le 2\}$$ If so, give a DFA for it with as few states as possible. If you …
StevenRidlay's user avatar
-1 votes
1 answer
149 views

L is a regular language and w is any word, not necessarily in L. Show that L is regular

$L$ is a regular language and $w$ is any word, not necessarily in $L$. We define the set as $$L/w = \{x \in \Sigma ^* \mid xw \in L\}.$$ Show that $L/w$ is regular. I'm really struggling with this …
StevenRidlay's user avatar
0 votes
1 answer
2k views

Showing Context Free Grammars that are regular if and only if L(G) = Σ∗.

Suppose that G is a context-free grammar. How can I show that “Is L(G) regular?” is undecidable. Also, prove that L is always context-free but is regular if and only if L(G) = Σ∗. This is what I hav …
StevenRidlay's user avatar