Question 7. Let Σ = {a}, and consider the language
L = {a^n : n is a prime number} = {a 2 , a3 , a5 , a7 , a11 , . . .}.
Is L a regular language? Why or why not?
(Hint: L contains a 11 , a 17 , a 23 , a 29, but not a 77 since 77 is divisible by 11. . . )
A regular language is language for which a regular expression can be written and a finite automata can be created.
A language is a set of strings over a predefined alphabets or symbols.
In the given language only those strings can be accepted which contains a's and its length is a prime number.
The given language is not a regular language as there is no proper pattern formed between the length of the strings of the language( the lengths are not in arithmatic progression). So regular expression can not be written for this language and finite automata cannot be created for it.
By pumping lemma for regular language a string w belongs to language L such that |w|<=n, for some positive integer n, then w can be decomposed into three strings w=xyz such that
But in the given language L={aa, aaa, aaaaa, aaaaaaa..........}, the string y can not be found which can produce all the strings that contains a's and its length is a prime number. So the language is not regular.
Question 7. Let Σ = {a}, and consider the language L = {a^n : n is...
7. Let Σ = {a}, and consider the language L = {a n : n is a prime number} = {a 2 , a3 , a5 , a7 , a11 , . . .}. Is L a regular language? Why or why not? (Hint: L contains a 11 , a 17 , a 23 , a 29, but not a 77 since 77 is divisible by 11. . . ) 8. Design a Turing machine that calculates the sum of...
Let Σ = { a } , and consider the language L = { a n : n is a prime number } = { a 2 , a 3 , a 5 , a 7 , a 11 , . . . } . Is L a regular language? Why or why not? (Hint: L contains a 11 , a 17 , a 23 , a 29 , but not a 77 since 77 is divisible by 11. ....
Question 1. Let Σ = {a, b}, and consider the language L = {w ∈ Σ ∗ : w contains at least one b and an even number of a’s}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 2. Let L be the language given below. L = {a n b 2n : n ≥ 0} = {λ, abb, aabbbb, aaabbbbbb, . . .} Find production rules for a grammar that generates L.
Question 1. Let Σ = {a, b}, and consider the language L = {w ∈ Σ ∗ : w contains at least one b and an even number of a’s}. Draw a graph representing a DFA (not NFA) that accepts this language.
Question 5. Let Σ = {a, b}, and consider the language L = {a^n : n is even} ∪ {b^n : n is odd}. Draw a graph representing a DFA (not NFA) that accepts this language.
. Let Σ = { a, b } , and consider the language L = { w ∈ Σ ∗ : w contains at least one b and an even number of a’s } . Draw a graph representing a DFA (not NFA) that accepts this language.
Question 5. Let Σ = {a, b}, and consider the language L = {a n : n is even} ∪ {b n : n is odd}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 6. Give a brief description of the language generated by the following production rules. S → abc S → aXbc Xb → bX Xc → Ybcc bY → Yb aY → aa aY → aaX
Let Σ = { a, b } , and consider the language L = { a n : n is even } ∪ { b n : n is odd } . Draw a graph representing a DFA (not NFA) that accepts this language.
Question 1. Let S = {a,b}, and consider the language L = {w E E* : w contains at least one b and an even number of a's}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 2. Let L be the language given below. L = {a”62m : n > 0} = {1, abb, aabbbb, aaabbbbbb, ...} Find production rules for a grammar that generates L.
Question 5. Let S = {a,b}, and consider the language L = {a" : n is even} U{b" : n is odd}. Draw a graph representing a DFA (not NFA) that accepts this language.