
() Question 1: Construct a push down automata that recognizes palindromes of both even and odd...
Draw the state diagram of a Push-down Automata that recognizes the language A = {u#v_R | u, v {0, 1}* and u =v}. In this set, treat u and v as bit strings where v is the bit-complement of v. For example, 0100#1 101 A, 0100#1010 A #1010#1010 A and so on. Let M = (Q, sigma, , delta, q_0, F) be a push-down automata. Describe a push-down
QUESTION THREE a. Construct a Push Down Automata that accepts L= {On In|n20; [10 Marks) b. A finite-state machine can also be used to model a simple automated teller machine (ATM). Construct an FSM for an ATM that accepts deposits and withdrawals [10 Marks)
Construct a Push Down Automata (PDA) that accepts the set of all strings of properly nested parentheses.
QUESTION TWO a. Explain a Push Down Automata (10 Marks) b. Suppose a file consists of as and bs only and the search is for the string "abba". Construct an FSM for doing this search. [10 Marks)
1. Construct a Finite Automata over Σ={0,1} that recognizes the language {w | w ∈ {0,1}* contains a number of 0s divisible by four and exactly three 1s} 2. Construct a Finite Automata that recognizes telephone numbers from strings in the alphabet Σ={1,2,3,4,5,6,7,8,9, ,-,(,),*,#,}. Allow the 1 and area code prefixing a phone number to be optional. Allow for the segments of a number to be separated by spaces (denote with a _ character), no separation, or – symbols.
construct a push down automata that recognises each of the
following languages.
D = {0m1rom+n | m, n >0} b. E = {xc" | x € {a,b}", n > 0, and x has na's or n b’s} Hint: Ę is the union of two simpler context-free languages. IT
Problem 4 (Half-Range Expansions) Compute both the even and odd half-range expansions of the following functions. You may also plot the resulting even and odd half-range expansions (Optional). 1,f(t) = 7 0
Theory of Computation - Push Down Automata (PDA) and Context
Free Grammars (CFG)
Problem 1. From a language description to a PDA Show state diagrams of PDAs for the following languages: a. The set of strings over the alphabet fa, b) with twice as many a's as b's. Hint: in class, we showed a PDA when the number of as is the same as the number of bs, based on the idea of a counter. + Can we use a...
Palindromes A palindrome is a nonempty string over some alphabet that reads the same forward and backward. Examples of palindromes are all strings of length 1, civic, racecar, noon, and aibohphobia (fear of palindromes). You may assume that in the problems below, an input string is given as an array of characters. For example, input string noon is given as an array s[L.4], where s[1] = n, s[2] = o, s[3] = o, and s[4] = n. (a) (15 pts)...
16.43 Lab 13C: Palindromes with Files and Functions Overview This is a demonstration of reading and writing files, along with using user-defined functions. Objectives Be able to read from an input file, perform string manipulation on each line of the file within a function, and write to an output file. Provided input file: A single input file named myinput.txt is provided that contains a few lines of text. bob sees over the moon never odd or even statistics dr awkward...