COSC 5315 Mid-Term Review
A pushdown automaton M = (Q, Σ, Γ, q0, Z0, A, δ) is deterministic if it satisfies both of the following conditions:
- For every q ε Q, every σ in Σ U {Λ}, and every X ε Γ, the set δ(q, σ, X) has at most one element - For every q ε Q, every σ ε Σ, and every X ε Γ, the two sets δ(q, σ, X) and δ(q, Λ, X) cannot both be nonempty
An expression is mentioned as follows. Figure out number of incorrect notations or symbols, such that a change in those could make the expression correct. L(G)={w in T*|S→*w} a.) 0 errors b.) 1 error c.) 2 errors d.) Invalid Expression
0 errors For the given expression L(G)={w in T*|S→*w}, if G(V, T, P, S) is a CFG, the language of G, denoted by L(G), is the set of terminal strings that have derivations from the start symbol.
The Password to the admins account="administrator" The total number of states required to make a password-pass system using DFA would be: a.) 14 states b.) 13 states c.) 12 states d.) A password pass system cannot be created using DFA
14 states For a string of n characters with no repetitive substrings, the number of states required to pass the string is n+1
Given Language: L= {ab U aba}* If X is the minimum number of states for a DFA and Y is the number of states to construct the NFA, |X-Y|=? a.) 2 b.) 3 c.) 4 d.) 1
2 Construct the DFA and NFA individually, and then attain the difference of states.
The minimum number of productions required to produce a language consisting of palindrome strings over ∑={a,b} is: a.) 3 b.) 7 c.) 5 d.) 6
5 The grammar which produces a palindrome set can be written as: S-> aSa | bSb | e | a | b L={e, a, b, aba, abbbaabbba.....}
The language which is generated by the grammar S → aSa | bSb | a | b over the alphabet {a, b} is the set of: a.) All Palindromes b.) All odd length palindromes c.) Strings that begin and end with the same symbol d.) All even length palindromes
All odd length palindromes The strings accepted by language are {a, b, aaa, bbb, aba, bab, ...} All of these are odd length palindromes.
Which of the following is not a notion of Context free grammars? a.) Recursive Inference b.) Derivations c.) Sentential Forms d.) All of the above
All of the above
The entity which generate Language is termed as: a.) Automata b.) Tokens c.) Grammar d.) Data
Grammar The entity which accepts a language is termed as Automata, while the one which generates it is called Grammar.
A CFG is not closed under a.) Dot operation b.) Union Operation c.) Concatenation d.) Iteration
Iteration The closure property of a context free grammar does not include iteration or Kleene or star operation.
Consider the following languages: L1 = {anbmcn : m, n >= 1} L2 = {anbnc2n : n >= 1} Which one of the following is TRUE? a.) Both L1 and L2 are context-free b.) L1 is context-free while L2 is not context-free c.) L2 is context-free while L1 is not context-free d.) Neither L1 nor L2 is context-free
L1 is context-free while L2 is not context-free L1 = {anbmcn |m, n ≥ 1} is context free language because it is derived by the following CFG: S− > aSc|aBc B− > bB|b L2 = {anbnc2n |n ≥ 1} is not a context free language, this can be proved using pumping lemma. Intuitively, a pushdown automaton can't remember number of as for the third set of characters coming, i.e. c. This language is very similar to {anbncn |n ≥ 1} which is known to be a non-CFL.
A Language for which no DFA exist is a: a.) Regular Language b.) Non-Regular Language c.) May be Regular d.) Cannot be said
Non-Regular Language A language for which there is no existence of a deterministic finite automata is always Non-Regular and methods like Pumping Lemma can be used to prove the same.
Which of the following strings is not generated by the following grammar? S → SaSbS|ε a.) aabb b.) abab c.) abaabb d.) None of the above
None of the above
Which of the following is not part of the 5-tuple finite automata? a.) Input alphabet b.) Transition Function c.) Initial State d.) Output Alphabet
Output Alphabet
A pushdown automaton is a 7-tuple M = (Q, Σ, Γ, q0, Z0, A, δ), where:
Q = A finite set of states Σ = A finite set of input signals Γ = A finite Stack alphabet q0 = The start state Z0 = The starting stack symbol A = The set of final / accepting states δ = The transition function
The Grammar can be defined as: G=(V, ∑, p, S) In the given definition, what does S represent? a.) Accepting State b.) Starting Variable c.) Sensitive Grammar d.) None of the above
Starting Variable G=(V, ∑, p, S), here V=Finite set of variables, ∑= set of terminals, p= finite productions, S= Starting Variable.
Pushdown automata are, by default, nondeterministic. Unlike finite Automata (FA's), the nondeterminism cannot always be removed
The pushdown automata are equivalent to context-free grammars, as long as it is non-deterministic
¬ (p ↔ q) is logically equivalent to: a.) q↔p b.) p↔¬q c.) ¬p↔¬q d.) ¬q↔¬p
p↔¬q ¬(p↔q)↔(p↔¬q) is tautology
Which of the following is not a set of letters of word PRINCIPAL? a.) {P,R,I,N,C,A,L} b.) {C,A,P,I,N,R,L} c.) {P,R,I,N,C,I,P,A,L} d.) {L,N,I,P,C,A,R}
{P,R,I,N,C,I,P,A,L} A set has all unique elements. So the set which contain all the elements of the word PRINCIPAL and no letter is repeated.
Give a production grammar that specified language L = {a^i b^2i >= 1} a.) {S->aSbb,S->abb} b.) {S->aSb, S->b} c.) {S->aA,S->b,A->b} d.) None of the above
{S->aSbb,S->abb}