Question
Need help answering these homework questions for a Theory of Computation class. Got them all wrong the first time I attempted them Question 1 Design
Need help answering these homework questions for a Theory of Computation class. Got them all wrong the first time I attempted them
Question 1 |
Design a DFA to recognize a*b* what is the minimum number of states you need?
A | 2 |
B | 3 |
C | 4 |
D | none of the above |
Question 2 |
Let D = {w| w contains an odd number of as and an even number of bs and does not contain the substring ab}. what is the minimum number of states for a DFA that recognizes D.
A | 3 |
B | 4 |
C | 5 |
D | none of the above |
Question 3 |
Which of the following is/are true. (There may be multiple answers)
A | There is unique DFA for every regular language |
B | Every regular language is also a context-free language |
C | If A is regular, then the reverse of A is also regular. |
D | Every subset of a regular language is regular |
Question 4 |
S -> 0S0 | 1S1 | 0 | 1 | epsilon ; The language generated by the above grammar over the alphabet {0,1} is the set of
A | All palindromes |
B | All even length palindromes |
C | All odd length palindromes |
D | Strings that begin and end with the same symbol |
Question 5 |
Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b) as the terminal alphabet, S as the start symbol and the following set of production rules
S --> 1B S --> 0A
B --> 0 A --> 1
B --> 0S A --> 1S
B --> 1BB A --> 0AA
Which of the following strings is generated by the grammar?
A | 100001 |
B | 110000 |
C | 111100 |
D | 110010 |
Question 6 |
Suppose the alphabet is {a, b}, which of the following regular expression accepts accepts all strings that have odd number of a and reject otherwise? (multi-select question)
A | (b*ab*a)*b*ab* |
B | ab*(ab*ab*)* |
C | b*a(b*ab*ab*)* |
D | (b*ab*ab*)*ab* |
Question 7 |
Given the language L = {ab, aa, baa}, which of the following strings are in L*? (Note: this is a multi-select question, you may choose more than one option)
A | abaabaaabaa |
B | aaaabaaaa |
C | baaaaabaaaab |
D | baaaaabaa |
Question 8 |
Which of the following is/are context free? (multi-select question)
A | {0^n1^n} |
B | A language {a^i b^j c^k} such that either i is not equal to j or j is not equal to k. The alphabet is {a, b, c}. That is, the set of strings of as followed by bs followed by cs, such that there are a different number of as and bs or a different number of bs and cs. |
C | the set of strings over 0 and 1 with odd length. |
D | all positive integer numbers |
Question 9 |
Which of the CFL can generate exactly the following language {w: w=w^R}, the alphabet is {0, 1}. (there may be more than one correct answer)
A | S -> 0S0 | 1S1 | 0 | 1 |
B | S -> T T-> 0T0 | 1T1 | 0 | 1 | |
C | S -> 0S0 | 1S1 | 0 | 1 | |
D | S -> 0T0 | 1T1 | T-> 0T0 | 1T1 | 0 | 1 | |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started