0% found this document useful (0 votes)
159 views4 pages

TCS

The document defines several formal language concepts including strings, DFAs, NFAs, Moore machines, Mealy machines, regular expressions, grammars, context-free grammars, pushdown automata, and their formal definitions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
159 views4 pages

TCS

The document defines several formal language concepts including strings, DFAs, NFAs, Moore machines, Mealy machines, regular expressions, grammars, context-free grammars, pushdown automata, and their formal definitions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

b) List all the proper suffixes of the string "0123".

c) Define Useless symbol.


d) Give formal definition of Turning Machine.
e) Define left linear grammar.
f) State True or False. DFA do not have multiple final states.
g) Name the type of language accepted by Pushdown Automata.
h) Write the tuples of LBA.
i) State true or false. Pumping lemma is used to show that language is not context tree.
j) Write smallest possible string accepted by the following regular expression. a(a+b)*ab
Answer:

b) The proper suffixes of the string "0123" are: "123", "23", "3".

c) In formal language theory, a useless symbol is a symbol that does not affect the language
generated by a grammar.

d) A Turing Machine is formally defined as a 7-tuple (Q, Σ, Γ, δ, q₀, q_accept, q_reject), where Q is
the set of states, Σ is the input alphabet, Γ is the tape alphabet, δ is the transition function, q₀ is
the initial state, q_accept is the accepting state, and q_reject is the rejecting state.

e) A left-linear grammar is a type of formal grammar where all the production rules are of the
form A → αB or A → α, where A and B are non-terminal symbols, and α is a string of terminal
and/or non-terminal symbols.

f) False. DFAs can have multiple final states.

g) Pushdown Automata accept context-free languages.

h) The tuples of a Linear Bounded Automaton (LBA) include (Q, Σ, Γ, δ, q₀, q_accept, q_reject),
where Q is the set of states, Σ is the input alphabet, Γ is the tape alphabet, δ is the transition
function, q₀ is the initial state, q_accept is the accepting state, and q_reject is the rejecting state.

i) False. The pumping lemma is used to show that a language is not context-free.

j) The regular expression "a(a+b)*ab" describes strings that start with 'a', followed by zero or
more occurrences of 'a' or 'b', and ending with 'ab'. The smallest possible string accepted by
this regular expression is "aab".

a) Define Unit production of grammar.


b) Construct Melay machine which toggles its input.
c) Explain proper Suffix and Prefix of a string with one example.
d) Give formal definition of Push down Automata.
e) Define left linear and right linear grammar
. f) State True or False. Finite Automata has an infinite number of states.
g) Name the types of normal forms of grammar.
h) Write the tuples of LBA.
i) State true or false. Pumping lemma is used to show that language is not context tree.
j) Write smallest possible string accepted by the following regular expression. 10+(0+11)0*1

Answer:

a) In grammar, a unit production is a production rule of the form A → B, where both


A and B are non-terminal symbols. It represents a transition from one non-terminal
symbol to another without involving any terminal symbols.

c) Proper Suffix: A proper suffix of a string is obtained by removing the entire string
or a prefix of it. Example: For the string "abc", "bc" is a proper suffix.

d) The formal definition of a Pushdown Automaton (PDA) is a 7-tuple (Q, Σ, Γ, δ, q₀,


Z₀, F), where Q is the set of states, Σ is the input alphabet, Γ is the stack alphabet, δ is
the transition function, q₀ is the initial state, Z₀ is the initial stack symbol, and F is the
set of accepting states.

e) Left linear grammar has production rules of the form A → αB or A → α, where A


and B are non-terminals and α is a string of terminal and/or non-terminal symbols.
Right linear grammar has production rules of the form A → Bα or A → α.

f) False. Finite Automata has a finite number of states.

g) The types of normal forms of grammar include Chomsky Normal Form (CNF) and
Greibach Normal Form (GNF).

h) The tuples of a Linear Bounded Automaton (LBA) include (Q, Σ, Γ, δ, q₀, q_accept,
q_reject), where Q is the set of states, Σ is the input alphabet, Γ is the tape alphabet, δ
is the transition function, q₀ is the initial state, q_accept is the accepting state, and
q_reject is the rejecting state.

i) False. The pumping lemma is used to show that a language is not regular.

j) The smallest possible string accepted by the given regular expression


"10+(0+11)0*1" is "1001".
String: A string is a finite ordered sequence of symbols from the alphabet

Definition of DFA: Deterministic Finite Automation (DFA) is a 5-tuple or quintuple namely,


Q, Σ, δ, q0 , F), where Q is a finite set of states. Σ is a finite set of symbols called the
alphabet. δ is a transition function mapping Q × Σ to Q. q0 is the initial state from where any
input is processed (q0 ∈ Q). F is a set of final state/states of Q (F ⊆ Q).

Definition of NFA: • NFA is denoted by 5-tuple (Q, Σ, δ, q0 , F), where o Q is a finite set of
states. o Σ is a finite set of symbols called the alphabets. o δ is the transition function where δ:
Q × Σ → 2Q , (here, the power set of Q (2Q ) has been taken because in case of NDFA, from
a state, transition can occur to any combination of Q states) o q0 is the initial state from
where any input is processed (q0 ∈ Q). o F is a set of final state/states of Q (F ⊆ Q).

Moore Machine: [April 16, 17, Oct. 17, 18] • Moore machine is the machine with finite
number of states and for which, the output symbol at a given time depends only upon the
present state of machine. Definition: A Moore machine is a 6-tuple (Q, Σ, ∆, δ, λ, q0 ) where,
Q : Finite set of states. Σ : Finite input alphabet. ∆ : An output alphabet. δ : State function, δ :
Q × Σ → Q. λ : Machine function, λ : Q → ∆. q0 : Initial state of the machine.

Mealy Machine: [Oct. 16, 17, 18, April 17, 19] • It is the machine with finite number of states
and for which, the output symbol at a given time is a function of (i.e. it depends on) the
present input symbol, as well as the present state of the machine. Definition: A Mealy
machine is denoted by a 6-tuple (Q, Σ, ∆, δ, λ, q0 ), where, Q : Finite set of states. Σ : Finite
input alphabet ∆ : Finite output alphabet δ : State function, δ": Q × Σ → Q λ : Machine
function λ: Q × Σ → ∆ q0 : Initial state of the machine.

REGULAR EXPRESSION : The languages accepted by finite automata are described or


represented by simple expressions called regular expressions.

GRAMMAR - Grammar can be defined as, a set of formal rules for generating syntactically
correct sentence from a particular language for which it is written.

CONTEXT-FREE GRAMMAR = A CFG is notation that can be used to specify language,


and the language specified by a CFG is called as context-free language

Basic Concept of Pushdown Automata = Pushdown Automata is a finite automaton with


extra memory called stack which helps Pushdown automata to recognize Context Free
Languages.

• The term "pushdown" refers to the fact that the stack can be regarded as being "pushed
down" like a tray dispenser at a cafeteria, since the operations never work on elements other
than the top element.

DEFINITION OF PUSHDOWN AUTOMATA = A pushdown automata M is a system (Q, Σ,


Γ, δ, q0 , Z0 , f), where, Q is finite set of states. Σ is an alphabet called the input alphabet. Γ is
an alphabet called stack alphabet. q0 is initial state and q0 ∈ Q. Z0: Z0 ⊂ Γ is a particular
stack symbol called start symbol. F: set of final states F ∏ Q. δ: is a mapping from Q × (Σ ∪
{∈}) × Γ to finite subsets of Q × Γ*.

You might also like