Uploaded by Sayed Omar

4

advertisement
Assigment 2
Ahmed Hesham (120170058)
April 17, 2021
Question 1.
All the points will be proven with pumping lemma and in the same way as
point 1.
1. Suppose L is regular and let P is the pumping length of the pumping
lemma, let S = ap bp and then |S| = 2p ≥ p so pumping lemma will
hold. and lets split a into 3 parts: xyz where x = ap/3 , y = ap/3 ,
x = ap/3 bp satisfying the conditions :
(a) xy i z ∈ L for each i ≥ 0
(b) |y| > 0
(c) |xy| ≤ p
and since condition 2 and 3 are satised but condition 1 for i = 3 we
have xy 3 z = a5p/3 bp and this string is not in L and this is a contradictions so L is not regular.
The same proof applies for S = ap bp+2 .
2. As given that n = k ∗ l for k = any integer, we can prove that L is not
regular by pumping lemma where S = an bl for n, l ≥ p and let x = an/3
, y = an/3 , x = an/3 bl
3. Suppose L is regular and let P is the pumping length of the pumping
lemma and l = n, The rest of the prove will be exactly the same
p p
as point 1, let S = a b and then |S| = 2p ≥ p so pumping lemma
will hold. and lets split a into 3 parts: xyz where x = ap/3 , y = ap/3 ,
x = ap/3 bp and for i = 3 we have xy 3 z = a5n/3 bl and this string is not in
L as l doesn't divide n and this is a contradictions so L is not regular.
(a) xy i z ∈ L for each i ≥ 0
1
Ahmed Hesham (120170058)
Assigment 2
(b) |y| > 0
(c) |xy| ≤ p
and since condition 2 and 3 are satised but condition 1 for i = 3 we
have xy 3 z = a5p/3 bp and this string is not in L and this is a contradictions so L is not regular.
and as l is bounded by n and 2n and for the max value of l which is
2n u can use the same prove but with larger i till you will nd that at
some larger i the string s wont be in L.
4. for this point we know that the dierence between l and n is 2 inputs
so the same proof in point 1 will be applied here too.
Question 2.
L0 is regular,As we can create a DFA for L0 .
Create a DFA that accepts the initial string U and then connect the the
accepting state of the DFA for U to the start states of the DFA that accepts
L as we know that w ∈ L and w = uv , then v ∈ L then the DFA that accepts
L will also accepts v and as we can create a DFA for language L0 , then L0 is
regular.
Question 3.
1. L is not regular as you will need a counter for the number of b's to
be more than number of a's and it can be proofed by pumping lemma
where let S = ap bp + k for k equal any integer assume 5 for now and
assume x = ap/3 , y = ap/3 , x = ap/3 bp+5 and for xy 3 z = a5p/3 bp not in
L and so L is not regular
2. As the question the string is innite then it is not regular as we can
apply pumping theorem on the initial segment and it wont be the same.
3. L is regular since we can explain it by RE: ((0|1)(0|1)(0|1))∗
4. This language is not regular as number of a's in u must be equal to
number of b's in v and this can't be done by regular languages as we
prooved before by pumping lemma.
2
Download