Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Exam Related Important Questions anwsers, Exams of Theory of Automata

Exam Related Important Questions anwsers

Typology: Exams

2018/2019

Uploaded on 11/21/2019

hassan-tuqeer
hassan-tuqeer 🇬🇧

5

(1)

1 document

1 / 59

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
By: Ali Hassan Soomro
BSCS from UBIT, University of Karachi
DAE in Electronics from SBTE
Facebook: www.facebook.com/AliiHassanSoomro
Gmail: alisoomro666@gmail.com
Youtube: www.youtube.com/programology
Theory of Automata Questions/Answers
Write a regular Expression for Even Even Language
Draw a finite automata for Even Even language
QNo:Write a regular expression and give the corresponding automata for
each of the following sets of binary strings. Use only the basic operations
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b

Partial preview of the text

Download Exam Related Important Questions anwsers and more Exams Theory of Automata in PDF only on Docsity!

By: Ali Hassan Soomro BSCS from UBIT, University of Karachi DAE in Electronics from SBTE Facebook: www.facebook.com/AliiHassanSoomro Gmail: alisoomro666@gmail.com Youtube : www.youtube.com/programology

Theory of Automata Questions/Answers

Write a regular Expression for Even Even Language

Draw a finite automata for Even Even language

QNo:Write a regular expression and give the corresponding automata for each of the following sets of binary strings. Use only the basic operations

Regular Expressions

DFA

QNo1.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 of b'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.

QNo.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.

QNo.3 What is Null String (Λ)?

Answer: 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.

Σ= { a , b , ac } ( Invalid Alphabet)

QNo 6. What is ALGOL?

Answer: 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.

QNo7. What are the Sequential Operators?

Answer:Sequencing Operators:

Sequencing operators a >> b Sequence Match a and b in sequence

a && b Sequential-and Sequential-and. Same as above, match a and b in sequence a || b Sequential-or Match a or b in sequence

The sequencing operator >> can alternatively be thought of as the sequential- and operator. The expression a && b reads as match a and b in sequence. Continuing this logic, we can also have a sequential-or operator where the expression a || b reads as match a or b and in sequence. That is, if both a and b match, it must be in sequence; this is equivalent to a >> !b | b.

QNo 8.What is Non-Determinism and Determinism and what is the difference between them?

Answer: 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.

QNo 9. What is meant by equivalent FA's?

Answer: FA's that accept the same set of languages are called Equivalent FA's.

QNo 10. What is the difference between Palindrome and Reverse function?

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

Reverse (w) = 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

QNo11.Define Kleene Star?

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

It is to be noted that Kleene Star Closure can be defined over any set of strings.

Examples

If Σ = {x}

Then Σ* = {Λ, x, xx, xxx, xxxx, ….}

If Σ = {0,1}

And a*^ and a+^ are called the regular expressions (RE) for L 1 and L 2 respectively.

FAQ's about Lectures 6 to 10 Automata Theory FAQ's about Lectures 6 to 10

Q No.1 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.

Q No.2 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.

Q No.3 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.

Q No.4 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.

Q No.5 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.

Q No.6 How one can create RE of a particular language?

First thing about RE and FA is that there is no hard and fast formula or method to generate these. One can generate them by its mental approach. And this mental approach can be acquired through only PRACTICE.

Here are some useful tips to write RE's,

Let our language consist of the words of length three exactly over alphabet

Q No.8 What is the corresponding FA for RE =aa((a+b)(a+b))*

RE is aa((a + b)(a + b))*. Its corresponding FA is as follows.

Q No.9 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.

Q No.10 Differentiate between (a,b) and (a+b)?

(a, b) = Represents a and b. (a + b) = Represents either a or b.

FAQ's about Lectures 11 to 15 Q No.1 What is the difference between how’s FA and TG .Why we need TG's when we have FA's?

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

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

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.

Q No.2 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.

Q No.3 What is the difference between GT and GTG?

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

Q No.4 How to create a RE of a particular Language?

Regular expression is used to express the infinite or finite language, these RE are made in such a way that these can generate the strings of that unique language also for the cross check that the defined RE is of a specified language that RE should accept all the string of that language and all language strings should be accepted by that RE.

Q No.5 How diagrams of FA's are created?

It depends upon the question how many states involve in a FA. There is not any formal procedure to design FA for a language. This ability just improves with time and practice. Every FA is also a TG but not every TG is FA. In every FA, every state shows transition of all letters of given alphabet but in any TG it is not must. In TG, we may or may not show all letters transition according to requirement. We can also show transitions on reading any strings in TGs but it is not possible in FAs.

Q No.6 How one can create RE of a particular language?

First thing about RE and FA is that there is no hard and fast formula or method to generate these. One can generate them by their mental approach. And this mental approach can be acquired through only

after practice you will be able to clear all of them.

Q No.7 What is the difference between FA's ,and TG's?

There are two or three big differences between FA‟s and TG‟s.

In FA there can be maximum one initial or starting state while in TG there may be more than one initial state.

In FA there can be transition for letters only while in TG transitions from a state to another one can be for strings.

In FA there must be transition from each state for each letter (deterministic) while in TG there may be no transition for specific letter from a state and there may be more than one path for a string or letter from a state.

Q No.8 What is the exact definition of FA?

Definition:

A Finite automaton (FA), is a collection of the followings

Finite number of states, having one initial and some (maybe none) final states.

Finite set of input letters (Ó) from which input strings are formed.

Finite set of transitions i.e. for each state and for each input letter there is a transition showing how to move from one state to another.

Q No.9 What is the difference between TG and GTG?

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

For RE =aa((a+b)(a+b))* what will be its corresponding FA?

RE is aa((a + b)(a + b))*. Its corresponding FA is as follows.

Q No.10 What is the difference between FA and NFA?

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 a transition for a letter from a state. 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.

FA:

NFA:

Q No.11 What is the method to understanding FA's and NFA's

Firstly we know that an FA is used to describe a language. Now a language consists of strings. FA will describe the specific language only if it accepts all the strings of that particular language and all the strings generated by the FA are in the language. So confirmation is of two ways.

Now, how to traverse the FA. It is very easy. Every FA has one initial state (state with - sign). From every state of FA there is one transition for every letter of the alphabet. Read the string letter by letter and move according to transitions from state to state. If the string ends in the final state (state with a + sign), that particular string will be accepted otherwise rejected.

So, every string ending in final state will be accepted by FA and will be a word of the language.

For NFA, there may be no path or more than one path for a letter from a specific state. As similar to FA just start traversing from the initial state and if the string ends in the final state, it will be accepted.

Remember, as there may be more than one path for a letter from a state. So any path can be used. Goal is to reach the final state. Remaining theory is same to the FA.

Practice is the key to success. Just try simple FA's and NFA's in the start.

FAQ's about Lectures 16 to 20

diagram will be an NFA representing the language closure of the given FA

Q No 4.What is the difference between Union of two FA’s , Concatenation of two FA’s and closure of two FA’s?

Consider two FA's given below

a a b b a b a b

Y2+

Y1-

X2+

X1-

FA

FA

Here FA1 accepts all strings ending in a and FA2 accepts all strings ending b.

An FA corresponding to FA1UFA2 will accept all the strings ending in a or ending in b. for example, aba,bbaaab,bbb

An FA corresponding to FA1FA2 will accept all the strings whose first substring belongs to FA1 and second substring belongs to FA2. for example, ababab, bbabbb.

An FA corresponding to FA1* will accepts all the strings of FA1 including null string. if FA1 represents RE r1 then FA1* will correspond to RE r1*.

FAQ's about Lectures 21 to 25 Automata Theory FAQ's about Lectures 21 to 25

Q No 1.How Moore and Mealy machine works in Computer Memory what is their importance in Computing?

Mealy & Moore Machines work in computing as incrementing machine & 1's complement machine etc. These operations as basic computer operations so these machines are very important.

Q No 2.What is sequential circuit?

Sequential Circuit:

A sequential circuit contains a memory component.

The memory component provides a state input. A flip-flop is often used as a memory component.

The state variable indicates the states of the sequential machine, i.e. the status or stage or progress of the whole event.

The state of a sequential circuit is indicated by the output of a flip-flop. A single flip-flop can be used to indicate two states (q=0 and q=1). When there are more than two states, additional flip-flops are used. Given n flip-flops, a total of 2n states can be represented.

In other words, a sequential machine can be put into a number of different states depending on the particular inputs given.

The output is a function of both the Present Inputs and the Present States.

In addition to the outputs, the circuit must also generate an update to the memory components so that the state of the machine can also be changed with respect to the new inputs. The update is called the Next State Function and is also a function of the Present Inputs and the Present States.

Both the output functions and the Next State Functions are combinational circuits. Z=f(X,St) S=g(X,St)

The superscript t indicates the present time period while the superscript (t+1) indicates the next time period.

The characteristic of a sequential circuit is completely defined by a state transition diagram that enumerates all possible transitions for every possible input combination.

Q No 1.What is the concept of Pumping Lemma I and II and what is the difference between pumping Lemma 1 and pumping Lemma 2?

In fact PLI & PLII are same (A way to recognize Non Regular language). The only difference is that the conditions in pumping lemma II are more stricter than Pumping Lemma I some language that are difficult to proof Non Regular