Let A = {s∈ {a,b}∗ | sis a palindrome} and let B = {s∈ {a,b}∗ | the number of as in s equals the number of bs ins}. Prove that A∩B is not context-free.
Let PALINDROME DFA = { <M> | M is a DFA, and for all s E L(M), s is a palindrome }. Show that PALINDROME DFA E P by providing an algorithm for it that runs in polynomial time.
2. If S:= {1/n - 1/min, me N}, find inf S and sup S. 4. Let S be a nonempty bounded set in R. (a) Let a > 0, and let aS := {as : S ES). Prove that inf(as) = a infs, sup(as) = a sup S. (b) Let b <0 and let b = {bs : S € S}. Prove that inf(bs) = b supS, sup(bs) = b inf S. 6. Let X be a nonempty set and...
Give a context free grammar for the language L where L = {a"bam I n>:O and there exists k>-o such that m=2"k+n) 3. Give a nondeterministic pushdown automata that recognizes the set of strings in L from question 3 above. Acceptance should be by accept state. 4. 5 Give a context-free grammar for the set (abc il j or j -k) ie, the set of strings of a's followed by b's followed by c's, such that there are either a...
41. (10 points) EXTRA CREDIT: Write a function 'palindrome' to determine if an input string s is a palindrome. Let the empty string be (technically) Aba' is not a palindrome. You may not use the "reversed" string function, you may use either palindrome. Be case sensitive, e.g. a looping control flow to solve the problem. recursion or
The following context-free grammar (CFG) generates palindromes. This CFG has the following rules: S → ε, S → a, S → b, ..., S → z, S → aSa, S → bSb, ..., S → zSz. On an example of a palindrome cattac, show, step-by-step, how this palindrome will be generated by this grammar.
1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three types (), and . For example, (OOis in BAL but [) is not. Give a nondeterministic pushdown automata that recognizes the set of strings in BAL as defined in problem 1 above. Acceptance should be by accept state. 2. Give a context free grammar for the language L where L-(a"b'am I n>-o and there exists k>-o such that m-2*ktn) 3. Give a nondeterministic pushdown...
1. (2 marks) Let S 2,3,4,5,6,7,8,9, 10, 11, 12). Let r be the relation on the set S defined as follows: Va,bE S, arb if and only if every prime number that divides a is a factor of b and a S b. The relation T is a partial order relation (you do not need to prove this). Draw the Hasse diagram for T 1. (2 marks) Let S 2,3,4,5,6,7,8,9, 10, 11, 12). Let r be the relation on the...
Number 3. UCD515 IUL NEL 1). JupUSC LIS 15 DALL -ste sis for V: {x1,x2,...,x. Let y = T(x) for i=k+1, k + 2,...,n. Show that {Yk+1, Yt+2, ..., yn) is a basis of image(T). 3. Prove or Disprove: There exists three distinct subspaces U, V and W of Rº such that R =U V and R3 = U W . (Recall, e denotes a direct sum)
6. Let f:A B be a function with domain A and codomain B. Let S and T be subsets of the domain A a) Prove: f(ST)cf(S)n f(T) b) Give an example to show it is possible that f(SOT) f(S)nf (T). Name the domain, codomain, function, and sets S and T c) Let U and V be subsets of the codomain B. Prove: f (Unv)= f"(U)nfV)