a.)
a pushdown automaton (PDA) is a finiteautomation that can make use of a stack containingdata.
A PDA is formally defined as a7-tuple:
where
isa finite set of states
isa finite set which is called the inputalphabet
isa finite set which is called the stackalphabet
isa finite subset of
,the transition relation.
isthe start state
isthe initial stack symbol
isthe set of accepting statesPushdown automata differ fromfinite state machines in two ways:
Pushdown automata choose atransition by indexing a table by input signal, current state, andthe symbol at the top of the stack. This means that those threeparameters completely determine the transition path that is chosen.Finite state machines just look at the input signal and the currentstate: they have no stack to work with. Pushdown automata add thestack as a parameter for choice.
Pushdown automata can alsomanipulate the stack, as part of performing a transition. Finitestate machines choose a new state, the result of following thetransition. The manipulation can be to push a particular symbol tothe top of the stack, or to pop off the top of the stack. Theautomaton can alternatively ignore the stack, and leave it as itis. The choice of manipulation (or no manipulation) is determinedby the transition table.
Put together: Given an inputsignal, current state, and stack symbol, the automaton can follow atransition to another state, and optionally manipulate (push orpop) the stack
QUESTION TWO a. Explain a Push Down Automata (10 Marks) b. Suppose a file consists of...
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.
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)
() Question 1: Construct a push down automata that recognizes palindromes of both even and odd length. (You may use non-determinism.)
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
Question 3: (10 marks total - 2.5 marks each part) (a) Illustrate and explain with diagrams the difference between demand-pull and cost-push inflation; (2.5 marks for the diagram and 2.5 marks for the explanation); (b) Provide (describe) two (2) causes of each type of inflation (2.5 marks for 2 demand-pull causes and 2.5 marks for 2 cost-push causes)
QUESTION 1 (10 Marks) a) State two assumptions for the Bernoulli equation and explain why that assumptions been made. (2 marks) b) Analyze the venturi meter in Fig 1 for flow rate of the air jet coming out from the throat as shown. State all your assumptions in doing so. Assume the air density is 1.28 kg/m² [6 marks) c) If the water level is only 1 cm, how much would Vichange? Justify your answer. No calculation needed. [2 marks]...
Question 9 [13 marks] A file called tanks.dat consists of the width, height and depth values for a number of water tanks. The values are all floating point and the units are metres. A typical file is shown below: 10 2.0 2.0 1.0 3.0 0.5 1.5 1.0 2.5 0.5 1.0 1.0 0.25 0.5 0.25 0.25 5.0 1.2 1.3 2.5 1.1 0.6 0.8 0.8 0.8 0.7 0.7 0.6 0.5 0.3 0.2 The first row of the file contains the number of...
CE2711-FM.pdf O file://C/Users/Sachin/Desktop/Past%20papers/Eng/CE2 711-FM.pdf - (25 marks) Question 02 Explain momentum and write down the basic formula to find the momentum in mechanics. a) (05 marks) e bave to consider when we apply the momentum b) What the two most important factors that principle. (05 marks) c) A water jet from a nozzle is deflected through an angle 60° from its original dircction by a curved vane which it enters tangentially (see Figure 2.1) without shock with a mean velocity...
Explain why.
Tutorial question. This question consists of two independent parts, A and B. Consider a plane wave of monochromatic light, which is shone on two identical narrow slits (the widths of the slits are much less than the wavelength of the light). The slits are separated by a distance d. The interference pattern at right is observed on a distant screen. i. If point P marks the center of the screen, what is the path-length-difference between the light from...
Could you please help me with this question? Consider the language C = { w ∈ {a, b} ∗| w contains at least as many as as bs } For example, ǫ, aaa, aba, and bbaababaa are all in C, but bbb and bbaaabb are not. a. Construct a 3-state push-down automaton to recognise C. Provide the solution as a transition diagram. b. Prove formally that the following context-free grammar G generates C S → ǫ | a | a...