Solutions To Set 13
Solutions To Set 13
Solutions To Set 13
SOLUTIONS
1. A minimal DFA accepting the language L = {w⁄w ∈ (0,1)∗ }, the number of a’s, b’s and c’s in
w are divisible by 2, 3 and 4 respectively has ________ number of states
Explanation:
We first consider three DFA’s, F1, F2 and F3 for accepting strings with number of a’s divisible
by 2, number of b’s divisible by 3 and number of c’s divisible by 4 respectively. Each FA has 2,
3 and 4 states respectively. To obtain a DFA which accepts L, we do Cartesian product of F1, F2
and F3 that gives 24 states (2x3x4).
So, the minimized automata which accepts our language contains only 24 states.
(a) Only 1 and 2 statements are true (b) Only 3 and 4 statements are true
(c) Only 1, 2, 3 statements are true (d) Only 1, 2, 4 statements are true
Explanation:
1
(2) The intersection of L1 and L2 i.e., intersection of Regular and context free is context free
language. Statement 2 is true.
(3) L1 – L2 ={apbqcr/p!=r, p,q,r>0} which is clearly cannot be accepted by DFA. Its DCFL.
3. Find the number of states in minimal finite automata which accepts a language of strings
whose length divisible by both ‘5’ and ‘2’ over Σ = {0, 1}
Explanation:
4. Find minimized finite automata which recognizes the below languages, separately by m1 and
m2 over binary strings as input, then find the number of states in each of the following.
L1:L2 is a language, which contains a set of strings which produces a remainder ‘1’, when its
equivalent value is divisible by ‘4’.
L2:L1 is a language it contains a set of strings which are starting with 1010 and the length of the
string is divisible by 4.
Explanation:
2
Given that the input for the finite automata is binary strings i.e., Σ = {0, 1}
L1:L2 is a language which contains a set of strings which produces remainder ‘1’ when its
divisible by 4.
int = 1(mod 4), when any number is divisible by 4 its produces remain 0 (or) 1 (or) 2 (or) 3,
for each remainder we are taking one state i.e., q0, q1, q2, q3
Above is the transition table for our language q0 is the initial state and q1 is final state because its
produces resident.
In the above transition table, the behavior at q0 and q2 is same and q1 and q3 is same
So, we can merge q0 and q2 states because both are non-final states, coming to q1 and q3
merging is not possible because one is final state and the other is non-final
After merging q0 and q2 (i.e. q0 = q2), the transition table and diagram becomes
L2:L1 is a language in which all strings are starting with 1010 and whose length is
divisible by 4
3
The number of states in above automata is 9
5. Construct a minimal finite automata for the language ‘L’, it contains a set of strings, which are
having two consecutive 0’s and the number of 0’s in the same string is divisible by ‘2’.
Explanation:
Minimal finite automata for language L, in which all strings contains two consecutive 0’s and
number of 0’s is divisible by 2.
Consider 𝐿 = 𝐿1 ∩ 𝐿2
4
Is the above table, no state have the same behavior so, we cannot minimize it and q2p0 is the final
state because q2 is final in m1 and po is final in m2. (which recognized the strings both in L1 and
L2 i.e., L1 ∩ L2)
6. Consider the following two machines A and B. Suppose that an input string is processed on A
and then the output string is immediately fed into B (as Input) 2 processed only this second
resultant output is considered that the final output of AB. If the output string is same as the
original input string, we say that AB has identity property symbolically written (A) (B) = identity
(a) (A) (B) = (B) (A) (b) (B) is inverse machine of (A)
5
(c) (A) is inverse machine of (B) (d) All are true
Explanation:
Then output is 1 1 0 1 0
Gives as a input on B
Then output is 0 0 1 0 1
So output of B
Explanation:
6
Consider option (a)
L = {ax bbx ⎸x ≥ 0 }
let x = 2, a2bb2 ∈ L
∴ aabbb
Apply this string in automata, it is not accepted by our automata (it will go to dead state)
∴ option (a) is wrong
L = {ax b ∪ b ⎸ x ≥ 0}
∴ L = {b, ab, aab, aaab, ……….}
If the automata is constructed for only this language, then the strings does not belongs to
L should not be accept
but the string abbb ∈ L is also accepting
So, option (b) is wrong
∴ option (d) is the Right answer
L = {ax bx ∪ b ⎸x ≥ 0}
Consider a string in this language
aabb ∈ L
Apply this string in the given automata it will reject by our automata. So, the given
automata is not for this language
L = {ax b ∪ abx ⎸x ≥ 0}
∴ L = {b, ab, aab, ……., a, ab, abb, abbb……}
7
Above strings are accepted by our given automata
The strings which does not belongs to L i.e., aabb ∉ L is rejected by our automata.
Explanation:
8
(c) (a+ (a + b + c)∗ ∙ ((b + c)∗ ) + (b+ ∙ (a + b + c)∗ ∙ (a + c)∗ ) + (c + ∙ (a + b + c)∗ ∙ (a + b)∗ )
∗ ∗ ∗
(d) (a+ ((b + c)a) ∙ (b + c + ) + (b+ ∙ ((a + c)b) ∙ (a + c)∗ ) + (c + ∙ ((a + b) ∙ c) ∙ (a + b)+ )
Explanation:
The strings in the language does not having starting and ending with same symbol. It
means if any string starts with ‘a’ it should end with ‘b’ (or ) ‘c’ (or) if the string
starts with ‘b’ it should ends with ‘a’ or ‘c’ (or) if the string is starts with ‘c’, it should
end with ‘b’ or ‘c’.
This regular expression may generate ‘a’ and ‘aa’ also, but both the strings are not accepted by
our automata.
9
(a∗ + b∗ + c ∗ ) ∙ ((bc)∗ + (ac)∗ + (ab)∗ ). This regular expression may generate ∈, a, aa, bb, cc
also. These also strings are not accepted by our given automata.
∴ L = {ab, ac, ba, bc, ca, cb, …..aab, aac, bba, bbc, cca, ccb, ….. abab, acac, baba, babc, …….}
The above all strings are accepted by our given automata.
10. Below is the grammar then find the language generated by given grammar
S → ABC Xb → bx
AB → aAx |bAy | ∊ Ya → ay
C→∊ Yb → by
XC → BaC aB → Ba
YC → BbC bB → Bb
Xa → aX
Explanation:
Given grammar is
S → ABC Xb → bx
AB → aAx |bAy | ∊ Ya → ay
10
C→∊ Yb → by
XC → BaC aB → Ba
YC → BbC bB → Bb
Xa → aX
S → ABC
→ aAxC
→ aABaC
→ a∙∊ ∙ a∙∊
→ a∙a
(2) S → ABC
S → aAxC
S → aABaC
→ abAyaC
→ abAayC
→ abAaBbC
→ abABabC
→ ab∊∙ab∙∊
→ ab∙ab
S → ABC
→ bAyC
→ bABbC
→ bbAybC
→ bbAbyC
→ bbAbBbC
→ bbABbbC
→ bbaAxbbC
→ bbaAbxbC
→ bbaAbbxC
→ bbaAbbBbaC
→ bbaAbBbaC
→ bbaABbbaC
→ bba∙∊∙bba∙∊
→ bba∙bba
See above all strings which are generated from out grammar, those are in the form of
11
w ∙ w|w ∈ (a, b)∗
12