Let L = {ai bj ck | i, j,k > 0 and (i = j or i = k)}. On the board is the beginning of an NPDA that recognizes the language. Complete the NPDA using just three more states.
Answer-
First method-
L = {ai bj ck | i, j,k > 0 and (i = j or i =
k)}
Grammar for language L
G = (V, Σ, P, S)
where
V = {S, A,B,C,D},
Σ = {a, b, c}; and rules
P={ S → AB | C , A → aAb | ε , B → cB | ε , C → aCc | D , D → bD | ε }
S is the start variable
CFG to PDA -
Let G=(V, Σ, P, S) be a context free grammar, we can design a
PDA corresponding to given CFG as
PDA (A)=({q},∑,δ, Γ,q,Z,F)
q-state
∑-input symbol
δ-transition function
Where δ is defined by the following rules
R1: δ(q, ε,A)={(q,α)|for all A→α is in P}
R2: δ(q, a,a)={(q, ε)} for each terminal a in Σ.
Γ-stack symbols
q-initial state
Z-initial stack symbol
F-final state
Grammar G = (V, Σ, P, S)
where
V = {S, A,B,C,D},
Σ = {a, b, c}; and rules
P={ S → AB | C , A → aAb | ε , B → cB | ε , C → aCc | D , D → bD | ε }
S is the start variable
PDA corresponding to given CFG
PDA(A)=({q1,q2,q3},{a, b, c},δ,{a, b, c,S,
A,B,C,D},{q1},{S},{q3})
where
q0 -{q1}
∑-{a, b, c}
Γ-Stack symbols {a, b, c,S, A,B,C,D}
qf - {q3}
Z-{S}- starting symbol of stack
Where δ is defined by the following rules
R0:δ(q1, ε,ε)={(q2,S$)
R1:δ(q2, ε,S)={(q2,AB),(q2,C)}
R2:δ(q2, ε,A)={(q2,aAb),(q2,ε)}
R3:δ(q2, ε,B)={(q2,cB),(q2,ε)}
R4:δ(q2, ε,C)={(q2,aCc),(q2,D)}
R5:δ(q2, ε,D)={(q2,bD),(q2,ε)}
R6:δ(q2, a,a)={(q2,ε)}
R7: δ(q2, b,b)={(q2, ε)}
R8:δ(q2, c,c)={(q2, ε)}
R9:δ(q2, ε,$)={(q3, ε)}
Second method (Where number of states is more)-
Which of the following languages are regular. Prove (by providing a regular expression) or disprove. a. L1 = {ai bj ck dl | (i + j)mod 2 = (k + l)mod 2 , i, j, k, l ≥ 0} b. L2 = {ai bj ck dl | (i + j) = (k + l), i, j, k, l ≥ 0}
(1point) Let r = xi + yj + zk and a = 4i +4j + 2k. (a) Find VG a). (b) Let C be a path from the origin to the point with position vector ro - ai+bj +ck. Find Jc VG a) df (c) If I I roll = 10, what is the maximum possible value of IV(F. , dF2 (Be sure you can explain why your answer is correct.) maximum value of Jc VG.ã di (1point) Let r...
Design a Turing machine that recognizes the language {a^i b^j c^k | i >= j >= k >= 0}
Transhipment Nodes Let index plants, index markets ai supply at plant i bj demand at market j cij per unit cost of shipping from plant i to market i xij amount to ship between plant i and market j Then Minimize zij cij xij Such that i xij ai for all i i xijbj for all j plus non-negativity Let South Dakota S, Denver -D , New Jersey -N, California-C, Florida-F Minimize 2.5 SN+1.7 SC+ 1,8 SF + 2.5 DN+...
replace ai with Ki if konu K, 16 for i 22 ai-ai-l tai-2 prove that ulan for no using Starp induction
Let L = {aibjbjai:i, j 1}. Examples of strings in L include abbbba and aabbbbbaa. Prove that L is context-free by informally describing a PDA that recognizes this language.
Express Fas a vector in terms of the unit vectors i, j and k (present your answer with 3 significant figures). Please enter your answers in the form of Ai +Bj +Ck. z - F = 60 N 1101 40 50 Dimensions in millimeters Determine the angle in degrees between F and the y- axis. z - F = 60 N 1101 40 50 Dimensions in millimeters 300 mm 150 mm 200 mm Use the vector product treatment to express...
So, unary languages are just sets on integer numbers 10 3 numi - num2< ....j: the empty word c corresponds to 0, the word | to 1, the word || to 2 etc... In other words, an unary language L is an infinite boolean seguence (b(0), b(1),.., b(i), ), where b(i) = 1 iff i E L. An unary language is regular iff there exist numbers i,T such that bj) b(j +T) for all j 2 i. Is it true...
Please answer both part. Thanks. In the power method, let rk d(x(k+1))/ф(z(k)). We know that limk-oo rk Show that the relative errors obey 1- Ai where the numbers ck form a convergent (and hence bounded) sequence. (Continuation) Show that rk +1-λι-(c+&J(rk-A) where Icl < 1 and limn-o0 Sk 0, so that Aitken acceleration is applicable. In the power method, let rk d(x(k+1))/ф(z(k)). We know that limk-oo rk Show that the relative errors obey 1- Ai where the numbers ck form...
Imprecise Counting - Long Runs in Binary Strings Let n=2^k for some positive integer k and consider the set Sn of all n-bit binary strings. Let c be an integer in {0,…,n−k}. Consider any j∈{1,…,n−k−c+1}. How many strings b1,…,bn∈Sn have bj,bj+1,…,bj+k+c−1=00…0? In other words, how many strings in Sn have k+c consecutive zeros beginning at position j? For each j∈{1,…,n−k+c+1}, let Xj be the subset of Sn consisting only of the strings counted in the previous question. Show that (n−k−c+1)∑(j=1)...