Assume that Σ = {0,1,2,9}. Consider the language L = {00,11,22,99,0000,1111,2222,9999,000000,111111,222222,777777,...}. Give a recursive definition of L.
Recursive Definition
00 ∈ L
11 ∈ L
22 ∈ L
33 ∈ L
if x ∈ L and x ∈ {0}* then x00 ∈ L
if x ∈ L and x ∈ {1}* then x11 ∈ L
if x ∈ L and x ∈ {2}* then x22 ∈ L
if x ∈ L and x ∈ {9}* then x99 ∈ L
Assume that Σ = {0,1,2,9}. Consider the language L = {00,11,22,99,0000,1111,2222,9999,000000,111111,222222,777777,...}. Give a recursive definition of L.
(a) Consider the alphabet Σ = {a, b, c}. Give a recursive definition for the set of strings over Σ that contain exactly one c. (b) Give a recursive definition for the set S = {x | x ∈ Z≥0 and b x 4 c is even}
Let Σ = {0, 1). (a) Give a recursive definition of Σ., the set of strings from the alphabet Σ. (b) Prove that for every n E N there are 2" strings of length n in '. (c) Give a recursive definition of I(s), the length of a string s E Σ For a bitstring s, let O(s) and I(s) be number of zeroes and ones, respectively, that occur in s. So for example if s = 01001, then 0(s)...
. 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.
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 } , 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. 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}. Consider the language L over Σ that contains Λ and all words whose length is divisible by 6. Build a transition graph that accepts L.
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...