Interview Questions in Automata
Interview Questions in Automata
Question 1. What Is The Difference Between The Strings And The Words Of A Language?
Answer :
A string is any combination of the letters of an alphabet where as the words of a language are the
strings that are always made according to certain rules used to define that language.For example if
we take
Alphabet Σ = { a , b } Here a , b are the letters of this alphabet.
As you can see we can make a lot of strings from these letters a and b.
For example a,b,aa,ab,ba,bb,aaa,aab,aba,baa,…………………… and so on.
But when we define a language over this alphabet having no a’s and only odd number ofb’s. Then
the words of this language would have only those strings that have only odd number of b’s and no
a’s.some example words of our defined language are b , bbb , bbbbb , bbbbbbb
,……………………………..and so on.
So we can say that all the words are strings but all the strings may not be the words of a language.
Hence strings are any combination of letters of an alphabet and the words of a language are
strings made according to some rule.
Question 2. What Is The Difference Between An Alphabet And An Element Of A Set.
Whether Alphabet Is An Element Of A Set Or It Is A Set Itself?
Answer :
An Alphabet is a set in itself. The elements of an Alphabet are called letters.
For example
Binary Alphabet Σ = {0,1}
Here 0,1 are the letters of binary alphabet.
Binary Alphabet is very important because it the Alphabet used by the computer.
Set of Natural Numbers
N={1,2,3,4,5,…………………………………..}
Here 1,2,3……………………………………. are the elements of set of Natural Numbers.
Question 13. What Is The Concept Of Fa Also Known As Fsm ( Finite State Machine) ?
Answer :
FA (Finite Automaton) is a finite state machine that recognizes a regular language. In computer
science, a finite-state machine (FSM) or finite-state automaton (FSA) is an abstract machine that
has only a finite, constant amount of memory. The internal states of the machine carry no further
structure. This kind of model is very widely used in the study of computation and languages.
Question 15. What Is The Difference Between Fa’s And Tg’s .why We Need Tg’s When We
Have Fa’s?
Answer :
The Transition Graphs (TG) differ from FA in the following areas
o TG’s are generalizations of FA’s.
o TG’s can change state without an input ( Null transition).
o Can read more than one letter (words of the language they are accepting) along the
transition edges at a time.
o Can have a regular expression as a edge label.
o Can have more then one start state.
We have been given more freedom in TG’s. But this freedom is on the cost of more memory and
processing power it means that if we implement TG’s on computer using some programming
language it will need more memory and processing power of computer than used in the
implementation of FA’s.
Question 18. What Is Difference Between Fa’s And Nfa’s. Are They Opposite To Each
Other ?
Answer :
FA stands for finite automata while NFA stands for non-deterministic finite automata, In FA there
must be a transition for each letter of the alphabet from each state. So in FA number of transitions
must be equal to (number of states * number of letter in alphabet).
While in NFA there may be more than one transition for a letter from a state. And finally every
FA is an NFA while every NFA may be an FA or not.
Question 26. If A Language Can Be Expressed In The Form Of Fa Than Why It Is Needed
To Use Nfa ?
Answer :
NFA stands for non-deterministic FA and this sort of structure has relaxation compared with FA.
So it is rather more easy to represent a language using NFA.
We have methods to convert NFA into FA’s so sometimes it is easier to build NFA of a given
language and than convert its NFA into FA using these methods rather than directly building an
FA for a language which may be very difficult.
Question 31. What Is The Difference Between Semiword And Word Please Also Give An
Example Regarding This?
Answer :
Word: A word is complete combinations of terminals only e.g. abba or ab or a or null string.
Semiword: A semiword is a string of terminals (may be none) concatenated with exactly one
nonterminal on the right i.e. a semi word, in general, is of the following form (terminal)(terminal)
——- (terminal)(nonterminal)
For example
aaaaaaB , aabbaaaA , A.
Question 32. What Is The Difference Between Derivation Tree And Total Tree ?
Answer :
A Derivation tree is the one that shows how to derive any specific word of the language described
by CFG but Total Language Tree shows all words of the Language described by CFG on it.
Question 35. What Is The Difference Between Concatenation And Intersection Of Two Fa’s
Also What Is The Difference Among Union Of Two Fa’s And Addition Of Them?
Answer :
In intersection of two FA’s only those strings are accepted which are independently accepted by
both FA’s, while in concatenation of two FA’s only those strings will be accepted in which first
part of string is accepted by first FA and remaining part of string is accepted by the second FA.
While taking union of two FA’s one can represent it using + sign. So (FA1 U FA2) and (FA +
FA2) both are same. There is no difference between them.
Question 36. Is It Possible To Make Cfg For Infix And Post-fix Expression’s Using
Derivation Tree ?
Answer :
Derivation tree is only used to derive words of language that is described by a CFG. Yes, we can
create CFG for languages infix expressions, postfix expressions.
Question 38. What Is Difference Between Push Down Stack And Push Down Store ?
Answer :
No difference at all. Both terms are used to describe memory structure attached with FAs to store
some characters in it.
Question 39. What Is Meant By The Terms Stack Consistence And Input Tape Consistence
?
Answer :
Term Stack consistent means we can pop any character from the top of the stack only. PDA
should not be able to pop any character other than that is present on the top of the stack.
Term Tape consistent means we can read only the first letter on the tape not any other letter of the
tape after the first one.