Questions tagged [regular-expressions]
Regular expressions or Regex is a search pattern for strings defined by a sequence of characters.
678 questions
3
votes
1
answer
93
views
Is First-order logic regular?
Suppose that First-order logic sentence is a string described by the following rules :
$[a-z]$ - is a First-order logic sentence
if $\phi, \psi$ are First-order logic sentences, then
$$(\neg \phi) \...
1
vote
0
answers
269
views
Regular expression with no same consecutive characters
Im currently studying for an exam in theoretical computer science. Since I feel that it more belongs to mathematics than to practical computer science, I decided to ask here and not on stackoverflow.
...
1
vote
1
answer
98
views
Is the class of regular languages closed under the following operations?
Is the class of regular languages closed under the following operations?
(a) $A(L) = \{ w \mid \forall i ≥ 0 : w^i ∈ L \} = \{ w \mid w^* ⊆ L \}$
(b) $E(L) = \{ w \mid \exists i ≥ 2 : w^i ∈ L \}$
Can ...
3
votes
0
answers
102
views
writing regular expression for exactly once $111$ in binary strings for finding Generating functions
I am looking for the regular expression for binary strings consisting of $1$ and $0$ and containing $111$ exactly once to find their generating functions. For example, $101100001110,000111000,01010111,...
1
vote
0
answers
56
views
Understunding how to find a regular expresion for a regular language
Let $L:=\{ \omega \in \{0, 1\}^* : |\omega|_0 \in 3\Bbb{Z}\}$ where $|\omega|_0$ denote the number of $0$'s appearing in $\omega$ . Find a regular expression for $L$ .
I am studying Automaton Theory ...
2
votes
1
answer
79
views
The minimum time to evaluate an arithmetic expression.
I have an arithmetic expression and I want to find the minimum time to compute this expression knowing the delay of each operator. The operators are addition, subtraction, multiplication, and ...
4
votes
1
answer
306
views
Generating function for binary strings not containing $0110$ or $11010$ as a substring
Find the generating function for the binary strings that do not contain $0110$ or $11010$ as a substring.
I am familiar with proofs similar to this post, where the 'symbolic method' is used for ...
0
votes
1
answer
160
views
Is the Language $L=\{(ab)^{3n}\:|\:n\in\mathbb N\}$ regular?
Is the language regular?
My application of the pumping lemma suggests: splitting it in $xyz$:
$$
x = \emptyset \mid y= (ab)^{j} \mid z=(ab)^{3n-j}
$$
Pumping up $y$:
$$
xyyz = (ab)^{3n+j} \mid (ab)^{...
2
votes
2
answers
203
views
How to show that only this regular expression solves this equation
Consider the equation
$x=v\cdot x + w$
where $x$ is a variable regular expression, $v, w$ are fixed regular expressions, $v$ has no variables inside it, and $w$ has no $x$ inside it.
It is easy to ...
0
votes
1
answer
102
views
How to get words that belong to the language of this regular expression and four which do not, ((a|baa) ∗ (b|ab))∗ .
In the alphabet {a, b} for both automata and regular expressions, what would be four words
that belong to the language of this regular expression and four which
do not, regular expression = ((a|baa)∗(...
1
vote
1
answer
412
views
DFA and regular expressions
I'm currently working on solving a question that requires determining which of the given regular expressions is equivalent to the language of the DFA provided. However, I'm encountering two primary ...
0
votes
1
answer
54
views
Express a count of an element in period of time [closed]
I want to know if it is possible to represent the count of an element in a set, having different elements collected over a given period of time.
Let's say $A$ is the set with varying elements at a ...
0
votes
0
answers
84
views
Trying to draw a graph from regular expression
I do my homework
My regular expression is
$b^m\,(ab)^na | m,n >= 0$
After several attempts I have this:
The vertex q1 is the entry and q2 is the exit.
Do you think it corresponds to the given ...
0
votes
0
answers
70
views
Regular expression .Find it
Construct a regular expression that defines the language of all words that contain either the aa-substring or the bb-substring but NOT BOTH the aa-substring and the bb-substring in the same
word....
0
votes
1
answer
79
views
Context-free language as regular expression
I want to ask a short question. Can a regular expression expresses a context-free language that is not a regular language?
1
vote
1
answer
60
views
Infinite number of regular exressions for a given language
Took a Theory of Computation exam where one of the questions was :
Is there an infinite amount of regular expressions for the language $L=\{aa,bb\}$ ?
The proof requested was just an informal one.
My ...
0
votes
1
answer
3k
views
A regex that matches strings containing an even number of 0’s or even number of 1’s
I need to write a regex that matches strings containing an even number of 0’s or even number of 1’s. (Alphabet Σ= 0,1)
I have already tried ...
1
vote
2
answers
1k
views
Finding the set of strings over {𝑎,𝑏} that ends with an odd number of "a"s
I need to write a regular expression that identifies the set of all
possible strings over Σ={𝑎,𝑏} that end with an odd number of "a"s.
I'm getting better with regular expressions, but ...
0
votes
1
answer
36
views
Regular expression extraction from alphabet
I have this Alphabet Σ = {k,l} so I do not understand how I can find the words equal bigger than 3
≤3 in L ((k|l)l*), should I use the words with 3 letters always starting with k or somthing else?
3
votes
0
answers
103
views
What is the formal definition of a combinational logic?
Question Background
A finite-state machine can be defined as a 5-tuple as follows (Sipser, pg. 35):
The image below (taken from the Wikipedia article on autamata theory) seems to suggest that ...
0
votes
1
answer
267
views
Create regular expression not contain "aaa"
I have a question about creating regular expression out of the given language.
The language is : 𝐿3 = {𝑤∈{𝑎,𝑏,𝑐}∗|𝑤 𝑑𝑜𝑒𝑠 𝑛𝑜𝑡 𝑐𝑜𝑛𝑡𝑎𝑖𝑛 𝑎𝑎𝑎}
I'...
0
votes
1
answer
83
views
Determine if language is regular
Question.
Determine if the languages are regular:
$L_{1}=\{(ab)^{k}a(ba)^{k}\,|\,k\geq0\}$
$L_{2}=\{(ab)^{k}b(ba)^{k}\,|\,k\geq0\}$
I think both are not regular, I used the Pumping Lemma to prove, ...
0
votes
0
answers
224
views
Find regular expression for a given language $L=\{0^{n}1^{m}\,\,\,|\,\,\,n+m(mod3)\neq0\}$
Question.
Write a regular expression for the language:
$L=\{0^{n}1^{m}\,\,\,|\,\,\,n+m(mod3)\neq0\}$
Attempt.
$r=(000)^* (0(ε+0+1+011)+1(ε+1)) (111)^*$
Is my regular expression correct? If so, is ...
-1
votes
1
answer
44
views
Symbol raised to the power of asterix raise to the power of asterix in regex [closed]
To describe the regex (a*+b+a)* in plain English you would simplify it to (a*)* + (b)* + (a)* . How would you describe (a*)* in English as the rest is just any number of bs or any number of as?
0
votes
0
answers
67
views
Is b*a(a+b)* equivalent to (a+b)*a(a+b)*?
So two regular expressions are equivalent if they are associated, i.e., produce the same regular language, I am curious about this because it is clear that the language produced by $b*a(a+b)*$ is ...