Regular Expressions
Non-Regular Languages
CS 133 : Automata Theory and Computability Regular Languages and Finite Automata Henry N. Adorna Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science University of the Philippines, Diliman {hnadorna,nshernandez}@dcs.upd.edu.ph
LEC 3
Regular Expressions
Non-Regular Languages
Regular Languages and Finite Automata
Regular Expressions Converting Regular Languages to Regular Expressions Converting Regular Expressions to Finite Automata
Non-Regular Languages
Regular Expressions
Non-Regular Languages
Regular Languages and Finite Automata
Regular Expressions Converting Regular Languages to Regular Expressions Converting Regular Expressions to Finite Automata
Non-Regular Languages
Regular Expressions
Non-Regular Languages
Regular Expressions
Definition R is a regular expression if R is 1. a for some a in the alphabet Σ 2. ε 3. ∅ 4. (R1 ∪ R2 ), where R1 and R2 are regular expressions 5. (R1 ◦ R2 ), where R1 and R2 are regular expressions 6. (R1∗ ), where R1 is a regular expression
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗
Non-Regular Languages
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}.
Non-Regular Languages
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗
Non-Regular Languages
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}.
Non-Regular Languages
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗
Non-Regular Languages
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ .
Non-Regular Languages
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗
Non-Regular Languages
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }.
Non-Regular Languages
Regular Expressions
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }. 5. 1(01+ )∗
Non-Regular Languages
Regular Expressions
Non-Regular Languages
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }. 5. 1(01+ )∗ = {w|w begins with 1 and every 0 in w is followed by at least one 1}.
Regular Expressions
Non-Regular Languages
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }. 5. 1(01+ )∗ = {w|w begins with 1 and every 0 in w is followed by at least one 1}. 6. (1 ∪ ε)0∗
Regular Expressions
Non-Regular Languages
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }. 5. 1(01+ )∗ = {w|w begins with 1 and every 0 in w is followed by at least one 1}. 6. (1 ∪ ε)0∗ = 10∗ ∪ 0∗ .
Regular Expressions
Non-Regular Languages
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }. 5. 1(01+ )∗ = {w|w begins with 1 and every 0 in w is followed by at least one 1}. 6. (1 ∪ ε)0∗ = 10∗ ∪ 0∗ . 7. ∅∗
Regular Expressions
Non-Regular Languages
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }. 5. 1(01+ )∗ = {w|w begins with 1 and every 0 in w is followed by at least one 1}. 6. (1 ∪ ε)0∗ = 10∗ ∪ 0∗ . 7. ∅∗ = {ε}.
Regular Expressions
Non-Regular Languages
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }. 5. 1(01+ )∗ = {w|w begins with 1 and every 0 in w is followed by at least one 1}. 6. (1 ∪ ε)0∗ = 10∗ ∪ 0∗ . 7. ∅∗ = {ε}. 8. 1∗ ∅
Regular Expressions
Non-Regular Languages
Example (Let Σ = {0, 1}) 1. 1∗ 01∗ = {w|w contains a single 0}. 2. Σ∗ 0Σ∗ = {w|w has at least one 0}. 3. ΣΣ∗ = {w|w is a string over Σ excluding ε} = Σ+ . 4. (ΣΣ)∗ = {w|w is a string of even length }. 5. 1(01+ )∗ = {w|w begins with 1 and every 0 in w is followed by at least one 1}. 6. (1 ∪ ε)0∗ = 10∗ ∪ 0∗ . 7. ∅∗ = {ε}. 8. 1∗ ∅ = ∅.
Regular Expressions
Non-Regular Languages
Theorem A language is regular if and only if some regular expression describes it.
Regular Expressions
Non-Regular Languages
Theorem A language is regular if and only if some regular expression describes it.
Lemma If a language is described by a regular expression, then it is regular.
Regular Expressions
Non-Regular Languages
Theorem A language is regular if and only if some regular expression describes it.
Lemma If a language is described by a regular expression, then it is regular.
Lemma If a language is regular, then it is described by a regular expression.
Regular Expressions
Non-Regular Languages
Generalized Nondeterministic Finite Automaton
Definition A generalized nondeterministic finite automaton(GNFA) is a 5-tuple (Q, Σ, δ, qstart , qaccept ), where 1. Q is the finite set of states, 2. Σ is the input alphabet, 3. δ : (Q − {qaccept }) × R → (Q − {qstart }) is the transition function, 4. qstart is the start state, and 5. qaccept is the final state.
Regular Expressions
Non-Regular Languages
Generalized Nondeterministic Finite Automaton
Definition A generalized nondeterministic finite automaton(GNFA) is a 5-tuple (Q, Σ, δ, qstart , qaccept ), where 1. Q is the finite set of states, 2. Σ is the input alphabet, 3. δ : (Q − {qaccept }) × R → (Q − {qstart }) is the transition function, 4. qstart is the start state, and 5. qaccept is the final state.
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example1: Step1
a start
1
2
a b
a
b 3
b
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example1: Step1
a start
1
2
a b
b
a
b 3 b a start
s
ε
1
ε
2
a b
ε
a
b 3
a
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example1: Step2
b a start
s
ε
1
b b
ε
2
a
ε
a 3
a
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example1: Step2
b a start
s
ε
1
ε
2
a b
ε
a
b
a
3 aa ∪ b
start
a
s
b
ε
2 a ∪ ba
ab
3
a
ε bb
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example1: Step3
aa ∪ b
start
s
a
2
ba ∪ ba
ε
a
ab ε 3
bb
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example1: Step3
aa ∪ b
start
s
a
2
ba ∪ ba
ε
a
ab ε 3
bb a(aa ∪ b)∗
start
s
b ∪ a(aa ∪ b)∗ ab
(a ∪ ba)(aa ∪ b)∗ ∪ ε
3
bb ∪ (a ∪ ba)(aa ∪ b)∗ ab
a
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example1: Step4
a(aa ∪ b)∗
start
s
b ∪ a(aa ∪ b)∗ ab
(a ∪ ba)(aa ∪ b)∗ ∪ ε
3
bb ∪ (a ∪ ba)(aa ∪ b)∗ ab
a
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example1: Step4
a(aa ∪ b)∗
start
s
b ∪ a(aa ∪ b)∗ ab
(a ∪ ba)(aa ∪ b)∗ ∪ ε
3
a
bb ∪ (a ∪ ba)(aa ∪ b)∗ ab
(a(aa ∪ b)∗ ) ∪ (b ∪ a(aa ∪ b)∗ ab)(bb ∪ (a ∪ ba)(aa ∪ b)∗ ab)∗ ((a ∪ ba)(aa ∪ b)∗ ∪ ε)
start
s
a
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example2: Step1
start
b
1
a
2 Îľ
a,b
a 3
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example2: Step1
start
b
1
a
2 ε
a,b
a 3 start
ε
s
b
1
ε
ε a
a
2 a∪b
a 3
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example2: Step2
start
ε
s
b
1
ε
ε a
a
2 a∪b
a 3
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example2: Step2
start
ε
s
b
1
ε
ε a
a∪b
a 3
start
b
s
ε
a
2
a
a
a∪b
ab
ε
3
a
2
a
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example2: Step3
start
b
s
ε
a
2
a∪b
ab
ε
a
a
3
a
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example2: Step3
start
b
s
ε
a start
a∪b
ab
ε
a
a
2
3
a
s ε ∪ ba∗ (a ∪ b)
ε
a
a
3
a ∪ aba∗ (a ∪ b)
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example2: Step4
start
s ε ∪ ba∗ (a ∪ b)
ε a
a
3
a ∪ aba∗ (a ∪ b)
Regular Expressions
Non-Regular Languages
Regular Language → Regular Expression Example2: Step4
start
s ε ∪ ba∗ (a ∪ b)
ε a
start
s
a
3
a ∪ aba∗ (a ∪ b)
ε ∪ ((ε ∪ ba∗ (a ∪ b))(a ∪ aba∗ (a ∪ b))∗ a)
a
Regular Expressions
Non-Regular Languages
Convert the following finite automata to regular expressions. start
a
1
start
a,b
1
a
2
b b
b 2 (a)
a
b 3
a (b)
Regular Expressions
Non-Regular Languages
Convert the following finite automata to regular expressions. a b
start
start
a
1
2
2 a
a
b
b
b
a
a,b 3
(c)
b
1
3
a (d)
4
b
Regular Expressions
Non-Regular Languages
Algebraic Laws for Regular Expressions • Commutativity
B for Union • Associativity
B for Union B for Concatenation • Identity (is a value such that when the operator is applied to it
and some other value, the result is the other value) B ∅ is the identity for union. B ε is the identity for concatenation. • Annihilator (is a value such that when the operator is applied to
it and some other value, the result is the annihilator) B ∅ is the annihilator for concatenation. • Distributivity B of Concatenation over Union • L(M ∪ N ) = LM ∪ LN • (M ∪ N )L = M L ∪ N L
Regular Expressions
Non-Regular Languages
Algebraic Laws for Regular Expressions • Idempotence
B for Union • Laws involving ∗
B B B B B
(L∗ )∗ = L∗ ∅∗ = ε ε∗ = ε LL∗ = L∗ L = L+ L∗ = L+ ∪ ε
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε 3. ∅
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε 3. ∅
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε 3. ∅ 4. (R1 ∪ R2 )
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε 3. ∅ 4. (R1 ∪ R2 )
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε 3. ∅ 4. (R1 ∪ R2 )
5. (R1 ◦ R2 )
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε 3. ∅ 4. (R1 ∪ R2 )
5. (R1 ◦ R2 )
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε 3. ∅ 4. (R1 ∪ R2 )
5. (R1 ◦ R2 )
6. (R1∗ )
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata R is a regular expression if R is 1. a, for some a in the alphabet Σ 2. ε 3. ∅ 4. (R1 ∪ R2 )
5. (R1 ◦ R2 )
6. (R1∗ )
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (ab ∪ a)∗ to an NFA:
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (ab ∪ a)∗ to an NFA:
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (ab ∪ a)∗ to an NFA:
Note that this has an equivalent NFA with only 2 states. Can you find it?
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (a ∪ b)∗ aba to an NFA:
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (a ∪ b)∗ aba to an NFA:
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (a ∪ b)∗ aba to an NFA:
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (a ∪ b)∗ aba to an NFA:
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (a ∪ b)∗ aba to an NFA:
Regular Expressions
Non-Regular Languages
Regular Expression → Finite Automata Convert the regular expression (a ∪ b)∗ aba to an NFA:
Regular Expressions
Non-Regular Languages
Regular Languages and Finite Automata
Regular Expressions Converting Regular Languages to Regular Expressions Converting Regular Expressions to Finite Automata
Non-Regular Languages
Regular Expressions
Non-Regular Languages
Is B = {0n 1n |n ≼ 0} regular?
Regular Expressions
Non-Regular Languages
Pumping Lemma for Regular Languages
Theorem (Pumping Lemma) If A is a regular language, then there is a number p (the pumping length) where, if s is any string in A of length at least p, then s may be divided into three pieces, s = xyz, satisfying the following conditions:
Regular Expressions
Non-Regular Languages
Pumping Lemma for Regular Languages
Theorem (Pumping Lemma) If A is a regular language, then there is a number p (the pumping length) where, if s is any string in A of length at least p, then s may be divided into three pieces, s = xyz, satisfying the following conditions: 1. for each i ≼ 0, xy i z ∈ A,
Regular Expressions
Non-Regular Languages
Pumping Lemma for Regular Languages
Theorem (Pumping Lemma) If A is a regular language, then there is a number p (the pumping length) where, if s is any string in A of length at least p, then s may be divided into three pieces, s = xyz, satisfying the following conditions: 1. for each i ≼ 0, xy i z ∈ A, 2. |y| > 0, and
Regular Expressions
Non-Regular Languages
Pumping Lemma for Regular Languages
Theorem (Pumping Lemma) If A is a regular language, then there is a number p (the pumping length) where, if s is any string in A of length at least p, then s may be divided into three pieces, s = xyz, satisfying the following conditions: 1. for each i ≥ 0, xy i z ∈ A, 2. |y| > 0, and 3. |xy| ≤ p.
Regular Expressions
Non-Regular Languages
Proof: Let M = (Q, Σ, δ, q1 , F ) be a DFA recognizing A and p be the number of states of M . Let s = s1 s2 · · · sn be a string in A of length n, where n ≥ p. Let r1 , · · · , rn+1 be the sequence of states that M enters while processing s, so ri+1 = δ(ri , si ) for 1 ≤ i ≤ n. This sequence has length n + 1, which is at least p + 1. Among the first p + 1 elements in the sequence, 2 must be of the same state, by the pigeonhole principle. We call the first of these rj and the second rl , we have l ≤ p + 1. Now let x = s1 · · · sj−1 , y = sj · · · sl−1 , z = sl · · · sn . As x takes M from r1 to rj , y takes M from rj to rj , and z takes M from rj to rn+1 , which is an accept state, M must accept xy i z for i ≥ 0. We know that j 6= l, so |y| > 0; and l ≤ p + 1, so |xy| ≤ p. Thus we have satisfied all the conditions of the pumping lemma.
Regular Expressions
Non-Regular Languages
Proof: Let M = (Q, Σ, δ, q1 , F ) be a DFA recognizing A and p be the number of states of M . Let s = s1 s2 · · · sn be a string in A of length n, where n ≥ p. Let r1 , · · · , rn+1 be the sequence of states that M enters while processing s, so ri+1 = δ(ri , si ) for 1 ≤ i ≤ n. This sequence has length n + 1, which is at least p + 1. Among the first p + 1 elements in the sequence, 2 must be of the same state, by the pigeonhole principle. We call the first of these rj and the second rl , we have l ≤ p + 1. Now let x = s1 · · · sj−1 , y = sj · · · sl−1 , z = sl · · · sn . As x takes M from r1 to rj , y takes M from rj to rj , and z takes M from rj to rn+1 , which is an accept state, M must accept xy i z for i ≥ 0. We know that j 6= l, so |y| > 0; and l ≤ p + 1, so |xy| ≤ p. Thus we have satisfied all the conditions of the pumping lemma. Note: If no strings in A are at least p then the theorem becomes vacuously true. Obviously the 3 conditions hold for all strings of length at least p if there are no such strings.
Regular Expressions
Non-Regular Languages
We use the pumping lemma to prove that a language L is not regular. (How???)
Regular Expressions
Non-Regular Languages
We use the pumping lemma to prove that a language L is not regular. (How???) ♣ Proof by contradiction:
Regular Expressions
Non-Regular Languages
We use the pumping lemma to prove that a language L is not regular. (How???) ♣ Proof by contradiction: • Assume that L is regular.
Regular Expressions
Non-Regular Languages
We use the pumping lemma to prove that a language L is not regular. (How???) ♣ Proof by contradiction: • Assume that L is regular.
B the pumping lemma guarantee the existence of a pumping length p such that all strings of length p or greater in L can be pumped.
Regular Expressions
Non-Regular Languages
We use the pumping lemma to prove that a language L is not regular. (How???) ♣ Proof by contradiction: • Assume that L is regular.
B the pumping lemma guarantee the existence of a pumping length p such that all strings of length p or greater in L can be pumped. • Find a string s in L that has length p or greater but that cannot be pumped.
Regular Expressions
Non-Regular Languages
We use the pumping lemma to prove that a language L is not regular. (How???) ♣ Proof by contradiction: • Assume that L is regular.
B the pumping lemma guarantee the existence of a pumping length p such that all strings of length p or greater in L can be pumped. • Find a string s in L that has length p or greater but that cannot be pumped. B involves grouping the various ways of dividing s into several cases and analyzing them individually.
Regular Expressions
Non-Regular Languages
We use the pumping lemma to prove that a language L is not regular. (How???) ♣ Proof by contradiction: • Assume that L is regular.
B the pumping lemma guarantee the existence of a pumping length p such that all strings of length p or greater in L can be pumped. • Find a string s in L that has length p or greater but that cannot be pumped. B involves grouping the various ways of dividing s into several cases and analyzing them individually. • The existence of s contradicts the pumping lemma if L were
regular.
Regular Expressions
Non-Regular Languages
We use the pumping lemma to prove that a language L is not regular. (How???) ♣ Proof by contradiction: • Assume that L is regular.
B the pumping lemma guarantee the existence of a pumping length p such that all strings of length p or greater in L can be pumped. • Find a string s in L that has length p or greater but that cannot be pumped. B involves grouping the various ways of dividing s into several cases and analyzing them individually. • The existence of s contradicts the pumping lemma if L were
regular. • Hence L is not regular.
Regular Expressions
Non-Regular Languages
Some Non-Regular Languages
Example 1. B = {0n 1n |n ≼ 0}
Regular Expressions
Non-Regular Languages
Some Non-Regular Languages
Example 1. B = {0n 1n |n ≼ 0} 2. C = {w|w has an equal number of 0s and 1s }
Regular Expressions
Non-Regular Languages
Some Non-Regular Languages
Example 1. B = {0n 1n |n ≥ 0} 2. C = {w|w has an equal number of 0s and 1s } 3. F = {ww|w ∈ {0, 1}∗ }
Regular Expressions
Non-Regular Languages
Some Non-Regular Languages
Example 1. B = {0n 1n |n ≥ 0} 2. C = {w|w has an equal number of 0s and 1s } 3. F = {ww|w ∈ {0, 1}∗ } 2
4. G = {1n |n ≥ 0}
Regular Expressions
Non-Regular Languages
Some Non-Regular Languages
Example 1. B = {0n 1n |n ≥ 0} 2. C = {w|w has an equal number of 0s and 1s } 3. F = {ww|w ∈ {0, 1}∗ } 2
4. G = {1n |n ≥ 0} 5. E = {0i 1j |i > j}
Regular Expressions
Non-Regular Languages
Questions? See you next meeting!