Question: Design DPDA to accept language means number of of a and b.
0

$L= { x {a, b}*|N_a(x) >N_b(x) }, N_a(x) >N_b(x)$

Mumbai university > Comp > SEM 4 > TCS

Marks: 10M

Year: Dec 2015

ADD COMMENTlink
modified 3.3 years ago  • written 3.3 years ago by gravatar for Pooja Joshi Pooja Joshi740
0

In DPDA there is only one move in every situation. A DPDA is less powerful than NPDA.

Every context free language cannot be accepted by a DPDA

Logic:

L = { x {a, b}* | Na(x) > Nb(x) }, Na(x) > Nb(x) means number of a's and b’s.

Implementation:

$ M = (Q, Σ, Ґ, δ,q_0, z_(0 ), F )$

$ Q = {q_0, q_1, q_f}$

$Σ = {a, b}$

$Ґ = {X, R}$

$q_0 = q_0$

$z_0 = R$

$F = {q_f}$

δ:

$δ (q_0, a, R) = {(q_0, XXR)}$

$δ (q_0, a, X) = {(q_0, XXX)}$

$δ (q_0, b, X) = {(q_1, €)}$

$δ (q_1, b, X) = {(q_1, €)}$

$δ (q_1, €, R) = {(q_f, R)}$

enter image description here

Example:

$(q_0, aaabbbbbb, R)$

$| - (q_0, aabbbbbb, XXR)$

$| - (q_0, abbbbbb, XXXXR)$

$| - (q_0, bbbbbb, XXXXXXR)$

$| - (q_1, bbbbb, XXXXXR)$

$| - (q_1, bbbb, XXXXR)$

$| - (q_1, bbb, XXXR)$

$| - (q_1, bb, XXR)$

$| - (q_1, b, XR)$

$| - (q_1, €, R)$

$| - (q_f, €, R)$

(Accept)

ADD COMMENTlink
written 3.3 years ago by gravatar for Pooja Joshi Pooja Joshi740
Please log in to add an answer.