**Top Automata Interview Questions**

**What Is The Difference Between The Strings And The Words Of A Language?**

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.

**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?**

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.

**What Is Null String (Λ) ?**

The string with zero occurrences of symbols (letters) from ∑.

It is denoted by (Small Greek letter Lambda) λ or (Capital Greek letter Lambda) Λ, is called an empty string or null string.

The capital lambda will mostly be used to denote the empty string, in further discussion.

**What Is The Concept Of Valid And Invalid Alphabets ?**

While defining an alphabet of letters consisting of more than one symbols, no letter should be started with any other the letter of the same alphabet i.e. one letter should not be the prefix of another. However, a letter may be ended in the letter of same alphabet i.e. one letter may be the suffix of another.

**Σ=**

{ a , b } ( Valid Alphabet)

**Σ=**

{ a , b , cd } ( Valid Alphabet)

**Σ=**

{ a , b , ac } ( Invalid Alphabet)

**What Is Algol ?**

ALGOL (ALGOrithmic Language) is one of several high level languages designed specifically for programming scientific computations. It started out in the late 1950’s, first formalized in a report titled ALGOL 58, and then progressed through reports ALGOL 60, and ALGOL 68.

It was designed by an international committee to be a universal language. Their original conference, which took place in Zurich, was one of the first formal attempts to address the issue of software portability.

ALGOL’s machine independence permitted the designers to be more creative, but it made implementation much more difficult. Although ALGOL never reached the level of commercial popularity of FORTRAN and COBOL, it is considered the most important language of its era in terms of its influence on later language development.

ALGOL’s lexical and syntactic structures became so popular that virtually all languages designed since have been referred to as “ALGOL – like”; that is they have been hierarchical in structure with nesting of both environments and control structures.

**What Is Non-determinism And Determinism And What Is The Difference Between Them ?**

Determinism means that our computational model (machine) knows what to do for every possible inputs. Non determinism our machine may or may not know what it has to do on all possible inputs.

As you can conclude from above definition that Non-Deterministic machine can not be implemented ( used ) on computer unless it is converted in Deterministic machine.

**What Is Meant By Equivalent Fa’s ?**

FA’s that accept the same set of languages are called Equivalent FA’s.

**What Is The Difference Between Palindrome And Reverse Function?**

It is to be denoted that the words of PALINDROME are called palindromes.

**Reverse**

= w

**Example:**

Σ={a,b},

**PALINDROME**

={Λ , a, b, aa, bb, aaa, aba, bab, bbb, …}

If a is a word in some language L, then reverse (a) is the same string of letters spelled backwards, called the reverse of a.

e.g

reverse (xxx) = xxx

reverse (623) = 326

reverse (140) = 041

**Valid/in-valid Alphabets?**

Any alphabet is valid if any of its letter does not appear in the start of any other letter otherwise it is invalid.

**What Is Reverse Of A String?**

Alphabet provides only a set of symbols. A string is a concatenation of these symbols. Reverse of the string means to write the string in reverse order. It has no effect on alphabet. Alphabet will remain same.

**Differentiate Kleene Star Closure And Plus?**

Given Σ, then the Kleene Star Closure of the alphabet Σ, denoted by Σ*, is the collection of all strings defined over Σ, including Λ.

Plus Operation is same as Kleene Star Closure except that it does not generate Λ (null string), automatically.

Given Σ, then the Kleene Star Closure of the alphabet Σ, denoted by Σ*, is the collection of all strings defined over Σ, including Λ.

Plus Operation is same as Kleene Star Closure except that it does not generate Λ (null string), automatically.

You can use other symbol for alphabet but we are mostly use sigma symbol.

**Define Regular Expression?**

Regular Expression is the generalized form of any regular language through which you can construct any string related to that language.

Take an example from your handouts

L1 = {Λ, a, aa, aaa, …} and L2 = {a, aa, aaa, aaaa, …} can simply be expressed by a* and a+, respectively.

so a* and a+ are the generalized form of Languages L1, L2.

And a* and a+ are called the regular expressions (RE) for L1 and L2 respectively.

**What Is The Concept Of Fa Also Known As Fsm ( Finite State Machine) ?**

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.

**What Is The Difference Between Fa , Tg , Gtg. ?**

In every FA, we mark transitions with single letter of the given alphabet but in TG transitions can be marked with letters or strings (combination of letters).

In every FA, every state shows transition for all letters of given alphabet but in any TG it is not necessary to show all transition for all letters of given alphabet. In TG, we may or may not show all letter transitions according to requirement.

We can also show transitions on reading any strings in TGs but it is not possible in FA’s. In GTG Directed edges connecting some pair of states are labeled with regular expressions . It may be noted that in GTG, the labels of transition edges are corresponding regular expressions.

In TG we write strings and in GTG we are bound to write RE. Every FA is also a TG but not every TG is FA.

**What Is The Difference Between Fa’s And Tg’s .why We Need Tg’s When We Have Fa’s?**

**The Transition Graphs (TG) differ from FA in the following areas**

TG’s are generalizations of FA’s.

TG’s can change state without an input ( Null transition).

Can read more than one letter (words of the language they are accepting) along the transition edges at a time.

Can have a regular expression as a edge label.

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.

**What Is The Concept Of The Union Of Fa’s ?**

When we take Union of two FA’s it means that resultant FA’s should accept all the words that were accepted by the two FA’s individually. It is like taking union of two sets, the resultant set contain members of both sets.

**For example**

Let A ={1,3,5,7,9}

and

B = {0,2,4,6,8,10}

then, A U B = { 0,1,2,3,4,5,6,7,8,9,10 }

you can see that A U B contain elements of both sets similar is the case with FA’s.

**What Is The Difference Between Is Tg And Gtg ?**

In TG, there are letter transitions for the strings. While in GTG, one can write whole RE as a transition from one state to another one.

What Is Difference Between Fa’s And Nfa’s. Are They Opposite To Each Other ?

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.