0% found this document useful (0 votes)
13 views2 pages

Languages of PushDown Automata

The document discusses the acceptance of languages by Pushdown Automata (PDA) through two methods: acceptance by final state and acceptance by empty stack. It explains the equivalence of these two acceptance methods and provides an example of constructing a PDA that accepts strings where the number of 0's is twice that of 1's. The document also details the transition functions for the PDA designed to accept the specified language.

Uploaded by

jeevitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Languages of PushDown Automata

The document discusses the acceptance of languages by Pushdown Automata (PDA) through two methods: acceptance by final state and acceptance by empty stack. It explains the equivalence of these two acceptance methods and provides an example of constructing a PDA that accepts strings where the number of 0's is twice that of 1's. The document also details the transition functions for the PDA designed to accept the specified language.

Uploaded by

jeevitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Languages of PushDown Automata

PDA Acceptance
A language can be accepted by Pushdown automata using two
approaches:

1. Acceptance by Final State: The PDA is said to accept its input by


the final state if it enters any final state in zero or more moves after
reading the entire input.

Let P =(Q, ∑, Γ, δ, q0, Z, F) be a PDA. The language acceptable by the


final state can be defined as:

1. L(PDA) = {w | (q0, w, Z) ⊢* (p, ε, ε), q ∈ F}

2. Acceptance by Empty Stack: On reading the input string from the


initial configuration for some PDA, the stack of PDA gets empty.

Let P =(Q, ∑, Γ, δ, q0, Z, F) be a PDA. The language acceptable by empty


stack can be defined as:

1. N(PDA) = {w | (q0, w, Z) ⊢* (p, ε, ε), q ∈ Q}

Equivalence of Acceptance by Final State and Empty Stack

o If L = N(P1) for some PDA P1, then there is a PDA P2 such that L =
L(P2). That means the language accepted by empty stack PDA will
also be accepted by final state PDA.
o If there is a language L = L (P1) for some PDA P1 then there is a
PDA P2 such that L = N(P2). That means language accepted by final
state PDA is also acceptable by empty stack PDA.

Example:
Construct a PDA that accepts the language L over {0, 1} by empty stack
which accepts all the string of 0's and 1's in which a number of 0's are
twice of number of 1's.

Solution:

There are two parts for designing this PDA:

o If 1 comes before any 0's


o If 0 comes before any 1's.
We are going to design the first part i.e. 1 comes before 0's. The logic is
that read single 1 and push two 1's onto the stack. Thereafter on reading
two 0's, POP two 1's from the stack. The δ can be

1. δ(q0, 1, Z) = (q0, 11, Z) Here Z represents that stack is empty


2. δ(q0, 0, 1) = (q0, ε)

Now, consider the second part i.e. if 0 comes before 1's. The logic is that
read first 0, push it onto the stack and change state from q0 to q1. [Note
that state q1 indicates that first 0 is read and still second 0 has yet to
read].

Being in q1, if 1 is encountered then POP 0. Being in q1, if 0 is read then


simply read that second 0 and move ahead. The δ will be:

1. δ(q0, 0, Z) = (q1, 0Z)


2. δ(q1, 0, 0) = (q1, 0)
3. δ(q1, 0, Z) = (q0, ε) (indicate that one 0 and one 1 is already read, s
o simply read the second 0)
4. δ(q1, 1, 0) = (q1, ε)

Now, summarize the complete PDA for given L is:

1. δ(q0, 1, Z) = (q0, 11Z)


2. δ(q0, 0, 1) = (q1, ε)
3. δ(q0, 0, Z) = (q1, 0Z)
4. δ(q1, 0, 0) = (q1, 0)
5. δ(q1, 0, Z) = (q0, ε)
6. δ(q0, ε, Z) = (q0, ε) ACCEPT state

You might also like