4,4K visualizações

Enviado por tamirat

- Automata Theory Problems and Exercises
- compiler design – 2 marks question set with answers _ TUTOR4CS.pdf
- Automata Solved MCQ
- QUESTION BANK FOR COMPILER DESIGN
- CS402 Theory of Automata Solved MCQs From Quiz
- Formal Language & Automata Theory
- Theory of Automata - Solved Assignments - Semester Spring 2010
- Theory of Computation MCQs
- automata theory
- Introduction to Computer Theory by Daniel I. a. Cohen - Second Edition
- Analysis & Design Algorithm MCQ'S
- Theory of Automata - CS402 Solved Mcqs
- Compiler Design: Theory questions with answer
- Lab Manual in Theory of Computation
- Automata Theory Questions and Answers
- Cs9251 Mobile Computing University Questions With Answers
- Solution to Peter Linz
- Sham Daa Mcq
- Artificial Intelligence MCQ'S
- 100 TOP DATABASE MANAGEMENT SYSTEM Questions and Answers DATABASE MANAGEMENT SYSTEM Questions and Answers.pdf

Você está na página 1de 58

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on Regular Language

& Expression.

a) 4

b) 5

c) 6

d) unlimited

View Answer

Answer:b

Explanation: states,input symbols,initial state,accepting state and transition function.

a) * Q ->

b) Q * Q ->

c) * -> Q

d) Q * -> Q

View Answer

Answer:d

Explanation: Inputs are state and input string output is states.

a) 3

b) 2

c) 1

d) cant be represented.

View Answer

Answer:a

Explanation: This is minimal finite automata.

a) Q * * -> Q

b) Q * -> Q

c) Q* * * ->

d) Q * ->

View Answer

Answer:a

Explanation: This takes single state and string of input to produce a state.

5. *(q,ya) is equivalent to .

a) ((q,y),a)

b) (*(q,y),a)

c) (q,ya)

d) independent from notation

View Answer

Answer:b

Explanation: First it parse y string after that it parse a.

a) *(q,x) E A

b) (q,x) E A

c) *(Q0,x) E A

d) (Q0,x) E A

View Answer

Answer:c

Explanation: If automata starts with starting state and after finite moves if reaches to final step then it

called accepted.

7. Languages of a automata is

a) If it is accepted by automata

b) If it halts

c) If automata touch final state in its life time

d) All language are language of automata

View Answer

Answer:a

Explanation: If a string accepted by automata it is called language of automata.

a) Type 0

b) Type 1

c) Type 2

d) Type 3

View Answer

Answer:d

Explanation: According to Chomsky classification.

a) 1

b) 0

c) 2

d) None of the mentioned

View Answer

Answer:b

Explanation: Finite automata doesnt require any stack operation .

a) 1

b) 2

c) 3

d) None of the mentioned

View Answer

Answer:d

Explanation: No final state requires.

11. Regular expression for all strings starts with ab and ends with bba is.

a) aba*b*bba

b) ab(ab)*bba

c) ab(a+b)*bba

d) All of the mentioned

View Answer

Answer:c

Explanation: Starts with ab then any number of a or b and ends with bba.

12. How many DFAs exits with two states over input alphabet {0,1} ?

a) 16

b) 26

c) 32

d) 64

View Answer

Answer:d

Explanation: Number of DFAs = 2^n * n^(2*n).

a) It cant remember arbitrary large amount of information.

b) It sometimes recognize grammar that are not regular.

c) It sometimes fails to recognize regular grammar.

d) All of the mentioned

View Answer

Answer:a

Explanation:Because there is no memory associated with automata.

14. Number of states require to simulate a computer with memory capable of storing 3 words each of

length 8.

a) 3 * 2^8

b) 2^(3*8)

c) 2^(3+8)

d) None of the mentioned

View Answer

Answer:b

Explanation: 2^(m*n) states requires .

15. FSM with output capability can be used to add two given integer in binary representation. This is

a) True

b) False

c) May be true

d) None of the mentioned

View Answer

Answer:a

Explanation: Use them as a flip flop output

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on The

Language of DFA

a) countably infinite

b) countably finite

c) uncountable finite

d) uncountable infinite

View Answer

Answer: d

Explanation: A language over an alphabet R is a set of strings over A which is uncountable and

infinite.

Statement 1: q Q; Statement 2: FQ

a) Statement 1 is true, Statement 2 is false

b) Statement 1 is false, Statement 2 is true

c) Statement 1 is false, Statement 2 may be true

d) Statement 1 may be true, Statement 2 is false

View Answer

Answer: b

Explanation: Q is the Finite set of states, whose elements i.e. the states constitute the finite

automata.

a) how the DFA S behaves on a word u

b) the state is the dumping state

c) the final state has been reached

d) Kleene operation is performed on the set

View Answer

Answer: a

Explanation: or the Transition function describes the best, how a DFA behaves on a string

where to transit next, which direction to take.

A= {{abc, aaba}. {, a, bb}}

a) abcbb A

b) A

c) may not belong to A

d) abca A

View Answer

Answer: b

Explanation: As the question has dot operation, will not be a part of the concatenated set. Had

it been a union operation, would be a part of the operated set.

5. For a DFA accepting binary numbers whose decimal equivalent is divisible by 4, what are all

the possible remainders?

a) 0

b) 0,2

c) 0,2,4

d) 0,1,2,3

View Answer

Answer: d

Explanation: All the decimal numbers on division would lead to only 4 remainders i.e. 0,1,2,3

(Property of Decimal division).

6. Which of the following x is accepted by the given DFA (x is a binary string = {0,1})?

a) divisible by 3

b) divisible by 2

c) divisible by 2 and 3

d) divisible by 3 and 2

View Answer

Answer: d

Explanation: The given DFA accepts all the binary strings such that they are divisible by 3 and

2.Thus, it can be said that it also accepts all the strings which is divisible by 6.

7. Given:

L1= {x *|x contains even nos of 0s}

L2= {x *|x contains odd nos of 1s}

No of final states in Language L1 U L2?

a) 1

b) 2

c) 3

d) 4

View Answer

Answer: c

Explanation:

8. The maximum number of transition which can be performed over a state in a DFA?

= {a, b, c}

a) 1

b) 2

c) 3

d) 4

View Answer

Answer: c

Explanation: The maximum number of transitions which a DFA allows for a language is the

number of elements the transitions constitute.

9. The maximum sum of in degree and out degree over a state in a DFA can be determined as:

= {a, b, c, d}

a) 4+4

b) 4+16

c) 4+0

d) depends on the Language

View Answer

Answer: d

Explanation: The out degree for a DFA I fixed while the in degree depends on the number of

states in the DFA and that cannot be determined without the dependence over the Language.

10. The sum of minimum and maximum number of final states for a DFA n states is equal to:

a) n+1

b) n

c) n-1

d) n+2

View Answer

Answer: a

Explanation: The maximum number of final states for a DFA can be total number of states itself

and minimum would always be 1, as no DFA exits without a final state. Therefore, the solution is

n+1

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on Non

Deterministic Finite Automata-Introduction

Statement 1: Initial State of NFA is Initial State of DFA.

Statement 2: The final state of DFA will be every combination of final state of NFA.

a) Statement 1 is true and Statement 2 is true

b) Statement 1 is true and Statement 2 is false

c) Statement 1 can be true and Statement 2 is true

d) Statement 1 is false and Statement 2 is also false

View Answer

Answer: a

Explanation: Statement 1 and 2 always true for a given Language.

If X is the minimum number of states for a DFA and Y is the number of states to construct the

NFA,

|X-Y|=?

a) 2

b) 3

c) 4

d) 1

View Answer

Answer: a

Explanation: Construct the DFA and NFA individually, and the attain the difference of states.

a) Acceptor

b) Classifier

c) Transducer

d) None of the mentioned.

View Answer

Answer: c

Explanation: A transducer is an automaton that produces an output on the basis of what input

has been given currently or previous state.

4. If NFA of 6 states excluding the initial state is converted into DFA, maximum possible number

of states for the DFA is ?

a) 64

b) 32

c) 128

d) 127

View Answer

Answer: c

Explanation: The maximum number of sets for DFA converted from NFA would be not greater

than 2n.

a) The result is undetermined

b) The choice of path is non-deterministic

c) The state to be transited next is non-deterministic

d) All of the mentioned

View Answer

Answer: b

Explanation: Non deterministic or deterministic depends upon the definite path defined for the

transition from one state to another or undefined(multiple paths).

Statement 1: Non determinism is a generalization of Determinism.

Statement 2: Every DFA is automatically an NFA

b) Statement 2 is correct because Statement 2 is correct

c) Statement 2 is false and Statement 1 is false

d) Statement 1 is false because Statement 2 is false

View Answer

Answer: b

Explanation: DFA is a specific case of NFA.

Find the difference of transitions made in constructing a DFA and an equivalent NFA?

a) 2

b) 3

c) 4

d) Cannot be determined.

View Answer

Answer: a

Explanation: The individual Transition graphs can be made and the difference of transitions can

be determined.

8. The construction time for DFA from an equivalent NFA (m number of node)is:

a) O(m2)

b) O(2m)

c) O(m)

d) O(log m)

View Answer

Answer: b

Explanation: From the coded NFA-DFA conversion.

9. If n is the length of Input string and m is the number of nodes, the running time of DFA is x

that of NFA.Find x?

a) 1/m2

b) 2m

c) 1/m

d) log m

View Answer

Answer: a

Explanation: Running time of DFA: O(n) and Running time of NFA =O(m2n).

a) NFA is slower to process and its representation uses more memory than DFA

b) DFA is faster to process and its representation uses less memory than NFA

c) NFA is slower to process and its representation uses less memory than DFA

d) DFA is slower to process and its representation uses less memory than NFA

View Answer

Answer: c

Explanation: NFA, while computing strings, take parallel paths, make different copies of input

and goes along different paths in order to search for the result. This creates the difference in

processing speed of DFA and NFA

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on

Simpler Notations.

1.Given Language: L= {x= {a, b} |x has a substring aa in the production}. Which of the

corresponding representation notate the same?

a)

b)

c)

d)

View Answer

Answer: a

Explanation: The states transited has been written corresponding to the transitions as per the row

and column. The row represents the transitions made and the ultimate.

2.Let u=1101, v=0001, then uv=11010001 and vu= 00011101.Using the given information

what is the identity element for the string?

a) u -1

b) v -1

c) u v

-1 -1

d)

View Answer

Answer: d

Explanation: Identity relation: w = w = w, thus the one satisfying the given relation will be the

identity element.

3.Which of the following substring will the following notation result?

a) 0101011

b) 0101010

c) 010100

d) 100001

View Answer

Answer: c

Explanation: The given DFA notation accepts the string of even length and prefix 01.

4.Predict the following step in the given bunch of steps which accepts a strings which is of

even length and has a prefix=01

(q0, ) =q0 < (q0,0) = ( (q0, ),0) =(q0,0) =q1 < _______________

a) (q0, 011) = ( (q0,1), 1) = (q2, 1) =q3

b) (q0, 01) = ( (q0, 0), 1) = (q1, 1) =q2

c) (q0, 011) = ( (q01, 1), 1) = (q2, 0) =q3

d) (q0, 0111) = ( (q0, 011), 0) = (q3, 1) =q2

View Answer

Answer: b

Explanation: Here, refers to transition function and results into new state or function when an

transition is performed over its state.

Language L= {x= {0,1} |x accepts all the binary strings not divisible by 3}

a) Q0

b) Q1

c) Q2

d) No Transition

View Answer

Answer: Q1

Explanation: The tabular representation of DFA is quite readable and can be used to some ore

complex problems. Here, we need to form the transition graph and fill up the given blank.

6.Which among the following is the missing transition in the given DFA?

L= {x= {a, b} | x starts with a and ends with b}

a) (q0, a) =q0

b) (F, a) =q1

c) (F, a) =D

d) (q1, a) =D

View Answer

Answer: b

Explanation: For the given Language, the transition missing is (F, a) =q1.

7.The complement of a language will only be defined when and only when the __________

over the language is defined.

a) String

b) Word

c) Alphabet

d) Grammar

View Answer

Answer: c

Explanation: It is not possible to define the complement of a language without defining the input

alphabets. Example: A language which does not consist of substring ab while the complement

would be the language which does contain a substring ab.

a) Palindrome

b) Reverse

c) Factorial

d) L={ab}*

View Answer

Answer: Factorial

Explanation: Factorial, here is the most appropriate non-infinite domain. Otherwise, palindrome and

reverse have infinite domains.

9.Which among the following states would be notated as the final state/acceptance state?

L= {x= {a, b} | length of x is 2}

a) q1

b) q2

c) q1, q2

d) q3

View Answer

Answer: b

Explanation: According to the given language, q2 Is to become the final/acceptance state in order to

satisfy.

10.Which of the following are the final states in the given DFA according to the Language

given.?

L= {x= {a, b} |length of x is at most 2}

a) q0, q1

b) q0, q2

c) q1, q2

d) q0, q1, q2

View Answer

Answer: d

Explanation: According to the given language, the length is at most 2, thus the answer is found

accordingly.

Transition Function

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on

Extended Transition Function.

a) 5

b) 6

c) 7

d) 4

View Answer

Answer: a

Explanation: For NFA or extended transition function on NFA, the tuple elements remains same i.e.

5.

Statement: The DFA shown represents all strings which has 1 at second last position.

a) Correct

b) Incorrect, Incomplete DFA

c) Wrong proposition

d) May be correct

View Answer

Answer: c

Explanation: The given figure is an NFA. The statement contradicts itself.

Def: ({q0, q1, q2}, {0,1}, , q3, {q3})

a) The definition does not satisfy 5 Tuple definition of NFA.

b) There are no transition definition.

c) Initial and Final states do not belong to the Graph.

d) Initial and final states cant be same.

View Answer

Answer: c

Explanation: q3 does not belong to Q where Q= set of finite states.

4. If is the transition function for a given NFA, then we define the for the DFA accepting

the same language would be:

Note: S is a subset of Q and a is a symbol.

a) (S, a) =U (p, a)

ps

b) (S, a) =U (p, a)

ps

c) (S, a) =U (p)

ps

d) (S) =U (p)

ps

View Answer

Answer: a

Explanation: According to subset construction, equation 1 holds true.

5. What is the relation between DFA and NFA on the basis of computational power?

a) DFA > NFA

b) NFA > DFA

c) Equal

d) Cant be said

View Answer

Answer: c

Explanation: DFA is said to be a specific case of NFA and for every NFA that exists for a given

language, an equivalent DFA also exists.

1 2 3 n i

exists a sequence of states r0, r1, r2 rn such that (r(i), s ) =r for each 0, 1, n-1,

i+1 i+1

a) initial state

b) transition symbol

c) accepting state

d) intermediate state

View Answer

Answer: c

Explanation: r(n) is the final state and accepts the string S after the string being traversed through

r(i) other states where I 01,2(n-2).

7. According to the given table, compute the number of transitions with 1 as its symbol but

not 0:

a) 4

b) 3

c) 2

d) 1

View Answer

Answer: d

Explanation: The transition graph is made and thus the answer can be found.

8. From the given table, *(q0, 011) =?

a) {q0}

b) {q1} U {q0, q1, q2}

c) {q2, q1}

d) {q3, q1, q2, q0}

View Answer

Answer: b

Explanation: *(q0,011) = Ur*(q0,01) (r, 1) = {q0, q1, q2}.

a) 6

b) 5

c) 4

d) 7

View Answer

Answer: a

Explanation: According to the question, presence of q2 or q1 would count so it does and the answer

according to the diagram is 6.

1.(Q0, ) ={Q0},

2.(Q0, 01) = {Q0, Q1}

3.(Q0, 010) =?

b) {Q0, Q1}

c) {Q0, Q2}

d) {Q1, Q2}

View Answer

Answer: c

Explanation: According to given table and extended transition state implementation, we can find the

state at which it rests

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

As you can see we can make a lot of strings from these letters a and b.

so on.

But when we define a language over this alphabet having no as and only odd number

ofbs. Then the words of this language would have only those strings that have only odd

number of bs and no as.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.

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 is very important because it the Alphabet used by the computer.

N={1,2,3,4,5,..}

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.

Answer:The language consisting of (Null String) and the strings s defined over an

Alphabet such that

Rev(s)=s.

aa

As Rev(aa) = aa

aba

As Rev(aba) = aba

bbb

As Rev(bbb) = bbb

aabaa

As Rev(aabaa) = aabaa

bbbaaabbb

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

specifically for programming scientific computations. It started out in the late 1950s, 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. ALGOLs 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. ALGOLs 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.

Answer:Sequencing Operators:

Sequencing operators

a && b Sequential-and 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.

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.

Answer:FAs that accept the same set of languages are called Equivalent FAs.

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

Reverse =w

Example: ={a,b},

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

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}

If = {aaB, c}

Note:

Languages generated by Kleene Star Closure of set of strings, are infinite languages. (By

infinite language, it is supposed that the language contains infinite many words, each of

finite length)

QNo12.Valid/In-Valid alphabets?

Answer:Any alphabet is valid if any of its letter does not appear in the start of any other

letter otherwise it is invalid.

symbols. Reverse of the string means to write the string in reverse order. It has no effect on

alphabet. Alphabet will remain same.

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

Answer:Regular Expression is the generalized form of any regular language through which

you can construct any string related to that language.

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

respectively.

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

Automata Theory FAQs about Lectures 6 to 10Q No.1 What is the concept of FA

also known as FSM ( Finite State Machine) ?

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.

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 FAs. 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 FAs and TGs .Why we need TGs

when we have FAs?

Can read more than one letter (words of the language they are accepting) along the

transition edges at a time.

We have been given more freedom in TGs. But this freedom is on the cost of more

memory and processing power it means that if we implement TGs on computer using

some programming language it will need more memory and processing power of

computer than used in the implementation of FAs.

When we take Union of two FAs it means that resultant FAs should accept all the

words that were accepted by the two FAs 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 FAs.

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.

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.

Let our language consist of the words of length three exactly over alphabet = {a,b}

which simply means that our language consists of only these words.

So we can make RE for a finite language by writing its all words with + operator

between them.

We should also keep the null string in our mind. If our language generates null string

than our RE should also generate it)

For example language having all the words of even length has null string in it as well

so we can write its RE as follows

RE = ((a+b)(a+b))*

If a language generates all strings starting with a. then strings will be of type

Here RE should start with a and then all strings including null. So this will be (a + b)*

and complete RE is a (a+ b)*.

Q No.9 What is difference between FAs and NFAs. 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.

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

Q No.1 What is the difference between hows FA and TG .Why we need TGs

when we have FAs? The Transition Graphs (TG) differ from FA in the following areas

We have been given more freedom in TGs. But this freedom is on the cost of more

memory and processing power it means that if we implement TGs on computer using

some programming language it will need more memory and processing power of

computer than used in the implementation of FAs.

When we take Union of two FAs it means that resultant FAs should accept all the words

that were accepted by the two FAs 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 FAs.

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.

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.

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.

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

I am giving you few tips. I hope those will help you.

If we have a finite language then it will always be regular and will not have * in RE.

e.g. L={aaa, aba, bb}. L language generates given three strings then its RE will be

(aaa + aba + bb}. So in finite language + of all strings can be its RE.

For practice just try to create RE of simple languages. Dont try to confuse yourself with

complex languages.

For example if a language generates all strings starting with a. then strings will be of

type

Here RE should start with a and then all strings including null. So this will be (a + b)*

and complete RE is a (a+ b)*.

I hope now you will be able to generate the RE of simpler languages. Gradually, increase

the complexity of languages to become a perfect in REs.

Now as similar to RE, FA of finite language will not have any loop in it.

If language is infinite then there will always be at least one loop in its FA.

From RE, if you want to generate its FA, then first get the smallest strings and generate

their FA and then gradually get the strings of bigger length and keep amending the

created FA. After some practice, you will be able to generate the FAs.

And the last thing nobody can do the new task accurately for the first time. Practice is

the key to success. In the start you will have lot of mistakes but after practice you will be

able to clear all of them.

There are two or three big differences between FAs and TGs.

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.

Definition:

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.

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.

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:

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 FAs and NFAs in the start.

Nondeterminism plays a key role in the theory of computing. A nondeterministic finite state

automaton is one in which the current state of the machine and the current input do not

uniquely determine the next state. This just means that a number of subsequent states

(zero or more) are possible next states of the automaton at every step of

a computation.Of course, nondeterminism is not realistic, because in real life, computers

must be deterministic. Still, we can simulate nondeterminism with deterministic programs.

Furthermore, as a mathematical tool for understanding computability, nondeterminism is

invaluable.

As with deterministic finite state automata, a nondeterministic finite state automaton has

five components.

a set of states

a transition function that describes how the automaton changes states as it processes an

input string

The only difference lies in the transition function, which can now target subsets of the

states of the automaton rather than a single next state for each state, input pair.

use NFA ?

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

Q No 3.How to made NFA corresponding to the closure of an FA ?

While generating NFA corresponding to closure of an FA one should take care of the null

string. Simple way to accept null string is declare initial state, final as well. But in this way a

lot of other strings will also be accepted. Therefore, accurate way is draw another state.

Declare the new state initial as well as final. Connect the new state with the states

originally connected with the old start state with the same transitions as the old start state.

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

FAs and closure of two FAs ?

Y2+

Y1-

X2+

X1-

FA1

FA2

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

FAQs about Lectures 21 to 25

Automata Theory FAQs about Lectures 21 to 25Q 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 & 1s complement

machine etc. These operations as basic computer operations so these machines are very

important.

Sequential Circuit:

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 2 n 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.

that enumerates all possible transitions for every possible input combination.

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 by Pumping Lemma I are proved Non Regular by

pumping Lemma II easily.

Further mare in pumping lemma I we have to generate all words to of a language but in

Pumping Lemma II we have to generate a single word to prove a language non regular.

Explanation:

Some languages like PALINDROME that are proved to be regular by first version

due to some of their symmetrical words when we pump these words they remain to be

bbabb

By pumping lemma 1

Let y = a

bbaaabb

That is also a valid word of PALINDROME so by pumping lemma I PALINDROME can not

be proved non regular, so there was the need of pumping lemma version version 2.

bbabb

if we take N=2

bbbbabb

bbaaabb

and also the repeating factor (y) to prove an infinite language non regular you

need to prove only one word that is not part of the language.

The significance of 2nd version of pumping lemma is that there are some infinite non

regular languages like PALINDROME we can built FA that can accept there certain words

but if we increase the length of their words that FA dont accept these words so by

pumping lemma version I it is very difficult to prove them non regular but with the

second version we can prove that a language is Non regular even its some words may

be accepted by some FAs.

See page 195 of the book for further example.

1. In order to run a string on a Mealy or Moore machine, you can take directions from

transition table. Running string on Mealy or Moore machine is similar to running string on

a FA. For example, if want to run abba on the machine, take start from initial state.

Check what is the transition for a, what state it goes. After that check what is the path of

b from that state and so on. In this way you will be able to run whole of the string. Note

that there is no final state in Mealy or Moore machine. So there is no case of acceptance

or rejection of string. You just have to determine what the output is. I hope that will clear

your mind for further clarification please listens to your lecture carefully.

2. The string is taken for the testing purposes. You can take any sort of string and

determine its output using machine.

also give an example regarding this? Word:

string.

Semiword:

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.

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

operation.

A simple example may be that the set of integers is closed under addition. It

means when we take two numbers from set of integers say 3, 7 the result of

their addition would also be in the set of integers.

word of the same language we say that the language is closed under that

operation.

Productions are the grammatical rules and regulations. These rules express

the behavior of CFG. Using production in CFG terminals are converted into

non-terminals and when all the terminals are converted using productions, a

word is acquired.

intersection of two FAs also what is the difference among Union of

two FAs and addition of them?

In intersection of two FAs only those strings are accepted which are

independently accepted by both FAs, while in concatenation of two FAs 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 FAs one can represent it using + sign. So (FA1 U

FA2) and (FA + FA2) both are same. There is no difference between them.

How to make eliminate Nullable and for Null Productions from the

CFG ?

nonterminal L

Example:

S aA|bB|L, A aa|L, B aS

Non Terminal and leads to L i.e.

S > aA | bB | aa

A-> C | bb

C> L

leads to null.

Example:

S XY, X Zb, Y bW

Z AB, W Z, A aA|bA|L

B Ba|Bb|L.

productions.

Method:

Delete all the Null productions and add new productions e.g.

the production N L and using the production

Thus the new CFG will contain the following productions X Nba|abNa|aba|

aNbNa

Note: It is to be noted that X aNbNa will still be included in the new CFG.

Method:

S XY, X Zb, Y bW

Z AB, W Z, A aA|bA|L

B Ba|Bb|L.

productions. The new CFG after, applying the method, will be

S XY

X Zb|b

Y bW|b

Z AB|A|B

WZ

A aA|a|bA|b

B Ba|a|Bb|b

handled with care. All Nullable productions will be used to add new

productions, but only the Null production will be deleted

using derivation tree ?

CFG. Yes, we can create CFG for languages infix expressions, postfix

expressions.

PDA is just an enhancement in FAs. i.e Memory is attached with machine that

recognizes some language. FA is basic structure for most advanced electronic

machines such as computer etc.

Q No 4 What is difference between PUSH DOWN STACK and PUSH

DOWN STORE ?

attached with FAs to store some characters in it.

questions ?

or

Thus if the given CFG is in the form specified above it will be called in CNF.

consistence ?

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.

For example

S A (Unit Produciton)

A a | b

S - a | b

Context Free Grammars are called context free because the words of the

languages of Context Free Grammars have words like aaabbb(PALINDROME).

In these words the value of letters (a , b) is the same on whatever position

they appear. On the other hand in context sensitive grammars their value

depend on the position they appear in the word a simple example may be as

follows

reads it, it would be in the form of string. The compiler would calculate its

decimal equivalent so that we can perform mathematical functions on it. In

calculating its decimal value , weight of first 1 is different than the second

1 it means it is context sensitive (depends on in which position the 1

has appeared).

i.e.

That is not the case with the words of Context Free Languages. (The value of

a is always same in whatever position a appears).

Q No 9. What is Unit Production?

It is a method of generation of strings from a CFG starting from left most letter

of the string.

given below

S ABC

A aa | b

B c

Cd

Its CNF will be

S DC

D AB

A EE | b

Ea

Bc

Cd

conversion form and a word aaaabb is derived from this conversion

form PDA. What are the derivation steps.

The PDA converted to conversion form has some specific features that are

important to understand first. These features are

The states named START, READ, HERE and ACCEPT are called joints of the

machine.

With the help of the conversion form we have been able to achieve that POP

state has only one path out of it and the path taking (multiple paths) decisions

take place only on the READ state.

START-POP4-PUSH $

This step pops $ and then pushes it to ensure that stack contains $ at the

beginning.

READ1-POP6-PUSH $-PUSH a

As first time after reading a there is $ at the top of stack so we will follow

path segment READ1-POP6-PUSH $-PUSH a

READ1-POP5-PUSH a-PUSH a

READ1-POP5-PUSH a-PUSH a

READ1-POP5-PUSH a-PUSH a

READ1-POP1- HERE-POP2

READ2-POP1-HERE-POP2

READ2-POP3-ACCEPT.

branch ?

When we derive a word in Top down parsing beginning with the starting Non

Terminal the branches of the tree that do not lead to our required word are left

aside these branches are called unwanted branches.

S>AA

A>a | b

the production A>b.

language?

Intersection of two languages will consist of all those words which are in both

languages while union of two languages will consist of all those words which

are present in at least one language.

regular languages?

Regular languages can be represented by FAs because we do not need any

memory to recognize (accept or reject them on FA) them but there is another

class of languages that can not be represented by FAs because these

languages require that we have some memory (with the help of memory we

can store letters of the string we are checking so that we can compare them

with next coming letters in the string).

For example language anbn requires that we must store as and then compare

their count with next coming bs so that we can check whether as are equal to

bs or not.

Due to this reason we use Context Free Grammars to represent them because

we can5t write REs for them.

include regular languages as subcategory. It means that context free

languages include regular languages as well as some other languages.

In Mealy Machine we read input string letters and generate output while

moving along the paths from one state to another while in Moore machine we

generate output on reaching the state so the output pattern of Moore machine

contains one extra letter because we generated output for state q0 where we

read nothing.

i. STACK Consistent

Stack consistence means that in the PDA converted in the conversion form,

when we follow a path segment (which is formed by combining start, read or

here state with next read, here or accept state on the path) along the

PDA its pop state should have the path for the same letter that is present on

the top of the stack at that stage. If this doesnt happen our PDA will crash

because in conversion form of the PDA the pop state has only one letter path,

so if we could not be able to find that letter on the top of the stack our PDA will

crash (if will not find path where to go from that state)

Y-able Paths means that when we follow a certain sequence of rows from the

row table to generate a path for a word form start state to accept state. The

path (sequence of rows) should be stack as well as joint consistent it means

that rows should end at the same read or here state (join consistency ) and the

rows should be able to pop the letter from the top that is indicated in the pop

state of the row.

Semi word is the string of terminals it may be null string ending with a Non

terminals on the right.

aaS

aabbA

This topic goes back to the days before digital computers and describes what

is possible to compute using an abstract machine.These ideas directly apply to

creating compilers, programming languages, and designing applications. They

also provide a formal framework to analyze new types of computing devices,

e.g. biocomputers or quantum computers

and the formal Languages?

are the basis of many important software components like:

Text searching

System verification

Finite Automata

Regular Languages

Linear-bounded Automata

Push-Down Automata

Turing Machines

Arrays of Automata

Power

Question: What is the difference between the alphabet and an element of a set?

Alphabets is a set of letters nothing else but a set of strings (elements) can

Answer: have more than one letters in one string.

Answer: The language consisting of and the strings s defined over such that

Rev(s)=s.It is to be denoted that the words of PALINDROME are called

palindromes.

Reverse =w

Example: ={a,b},

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

e.g If = {a,b} then a language L can be defined asL = {a, abab,

aaabb, ababababababababab,}

string with no symbol at all is used, denoted by (Small Greek letter Lambda)

Answer: or (Capital Greek letter Lambda) , is called an empty string or null string.

word.

Answer: A string is a finite sequence of symbols from an alphabet.

Question: 1, please explain?

1 in odd palindrome) does not cause any change in no. of palindromesDefining

the language PALINDROME, of length 2n and 2n-1 defined over S = {a,b}

Automata Theory Questions and Answers Regular Language

& Expression 1

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on

Regular Language & Expression.

a) union

b) concatenation

c) kleene

d) All of above

View Answer

Answer : d

Explanation : None.

a) 0 U 1

b) 0 / 1

c) 0 + 1

d) All of above

View Answer

Answer : d

Explanation : All are equivalent to union operation.

a) * , . , +

b) . , * , +

c) . , + , *

d) + , a , *

View Answer

Answer : a

Explanation : None.

a)

b)

c) 0

d) 1

View Answer

Answer : a

Explanation : None.

5. a? is equivalent to

a) a

b) a+

c) a+

d) wrong expression

View Answer

Answer : c

Explanation : Zero or one time repetition of previous character .

6. L is equivalent to

a)

b)

c) L

d) L

View Answer

Answer : c,d

Explanation : None.

7. (a+b)* is equivalent to

a) b*a*

b) (a*b*)*

c) a*b*

d) none of above

View Answer

Answer : b

Explanation : None.

8. L is equivalent to

a) L

b)

c) L

d)

View Answer

Answer : a,b

Explanation : None.

a) 1(01)* and (10)*1

b) x(xx)* and (xx)*x

c) (ab)* and a*b*

d) x+ and x*x+

View Answer

Answer : c

Explanation : (ab)*=(a*b*)*.

i) (a/b)* ii) (a*/b*)* iii) ((/a)b*)*

Which of the following statements is correct

a) i,ii are equal and ii,iii are not

b) i,ii are equal and i,iii are not

c) ii,iii are equal and i,ii are not

d) all are equal

View Answer

Answer : d

Explanation : All are equivalent to (a+b)*

& Expression 2

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on

Regular Language & Expression.

1. How many strings of length less than 4 contains the language described by the regular

expression (x+y)*y(a+ab)*?

a) 7

b) 10

c) 12

d) 11

View Answer

Answer : d

Explanation : string of length 0 = 1

string of length 1 = 4

string of length 2 = 3

string of length 3 = 3

a) (01)*0 = 0(10)*

b) (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

c) (0+1)*01(0+1)*+1*0* = (0+1)*

d) All of the mentioned

View Answer

Answer : d

Explaination : None.

3. A language is regular if and only if

a) accepted by DFA

b) accepted by PDA

c) accepted by LBA

d) accepted by Turing machine

View Answer

Answer : a

Explanation : All of above machine can accept regular language but all string accepted by machine

is regular only for DFA.

4. Regular grammar is

a) context free grammar

b) non context free grammar

c) english grammar

d) none of the mentioned

View Answer

Answer : a

Explanation : Regular grammar is subset of context free grammar.

5. Let the class of language accepted by finite state machine be L1 and the class of

languages represented by regular expressions be L2 then

a) L1=L2

c) L1 U L2 = .*

d) L1=L2

View Answer

Answer : d

Explanation : Finite state machine and regular expression have same power to express a language.

a) [(a+b)*-(aa+bb)]*

b) [(0+1)-(0b+a1)*(a+b)]*

c) (01+11+10)*

d) (1+2+0)*(1+2)*

View Answer

Answer : b

Explanation : Except b all are regular expression*.

a) Type 0 language

b) Type 1 language

c) Type 2 language

d) Type 3 language

View Answer

Answer : a

Explanation : According to Chomsky hierarchy .

a) Every subset of a regular set is regular

b) Every finite subset of non-regular set is regular

c) The union of two non regular set is not regular

d) Infinite union of finite set is regular

View Answer

Answer : b

Explanation : None.

a) Regular

b) Context free

c) Context sensitive

d) Recursive

View Answer

Answer : d

Explanation :If L is recursive enumerable and its complement too if and only if L is recursive.

a) Union

b) Intersection

c) Kleen star

d) All of the mentioned

View Answer

Answer : d

Explanation : According to definition of regular expression

Expression-Introduction

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on

Regular Expression-Introduction.

a) Equivalence

b) Reflexive

c) Myhill

d) Nerode

View Answer

Answer: a

Explanation: According to Myhill Nerode theorem, the corollary proves the given statement correct

for equivalence classes.

2. A language can be generated from simple primitive language in a simple way if and only if

a) It is recognized by a device of infinite states

b) It takes no auxiliary memory

c) Both are correct

d) Both are wrong

View Answer

Answer: b

Explanation: A language is regular if and only if it can be accepted by a finite automaton. Secondly, It

supports no concept of auxiliary memory as it loses the data as soon as the device is shut down.

Language: {0,01}

a) 0+01

b) {0} U {01}

c) {0} U {0}{1}

d) {0} ^ {01}

View Answer

Answer: d

Explanation: The given option represents {0, 01} in different forms using set operations and Regular

Expressions. The operator like ^, v, etc. are logical operation and they form invalid regular

expressions when used.

4. According to the given language, which among the following expressions does it

corresponds to?

Language L={x{0,1}|x is of length 4 or less}

a) (0+1+0+1+0+1+0+1) 4

b) (0+1) 4

c) (01)4

d) (0+1+) 4

View Answer

Answer: d

Explanation: The extended notation would be (0+1) 4 but however, we may allow some or all the

factors to be . Thus needs to be included in the given regular expression.

5. Which among the following looks similar to the given expression?

((0+1). (0+1)) *

a) {x {0,1} *|x is all binary number with even length}

b) {x {0,1} |x is all binary number with even length}

c) {x {0,1} *|x is all binary number with odd length}

d) {x {0,1} |x is all binary number with odd length}

View Answer

Answer: a

Explanation: The given regular expression corresponds to a language of binary strings which is of

even length including a length of 0.

most correctly?

a) An Irregular Set

b) R*

c) R complement

d) R reverse

View Answer

Answer: b

Explanation: The given diagram represents the Kleene operation over the Regular Language R in

which the final states become the initial and the initial state becomes final.

7. The given NFA corresponds to which of the following Regular expressions?

b) (0+1) *(00+11) *(0+1) *

c) (0+1) *(00+11) (0+1)

d) (0+1) (00+11) (0+1) *

View Answer

Answer: a

Explanation: The transition states shown are the result of breaking down the given regular

expression in fragments. For dot operation, we change a state, for union (plus) operation, we diverge

into two transitions and for Kleene Operation, we apply a loop.

a) Union

b) Dot

c) Kleene

d) Two of the options are correct

View Answer

Answer: b

Explanation: Two operands are said to be performing Concatenation operation AB = AB = {xy: x A

& y B}.

a) R

b)

c) R.

d) None of the mentioned

View Answer

Answer: b

Explanation: By distributive property (Regular expression identities), we can prove the given identity

to be .

a) R+

b) R-

c) R+ U R-

d) R

View Answer

Answer: a

Explanation: RR*=R+ as R+ means the occurrence to be at least once.

Expressions

This set of Automata Theory Multiple Choice Questions & Answers (MCQs) focuses on

DFA to Regular Expressions.

a) (0+1)*001(0+1)*

b) 1*001(0+1)*

c) (01)*(0+0+1)(01)*

d) None of these

View Answer

Answer: a

Explanation: There needs to be 001 together in the string as an essential substring. Thus, the other

components can be anything, 0 or 1 or e.

a) Every language defined by any of the automata is also defined by a regular expression

b) Every language defined by a regular expression can be represented using a DFA

c) Every language defined by a regular expression can be represented using NFA with e

moves

d) Regular expression is just another representation for any automata definition

View Answer

Answer: b

Explanation: Using NFA with e moves, we can represent all the regular expressions as an automata.

As regular expressions include e, we need to use e moves.

3. The total number of states required to automate the given regular expression

(00)*(11)*

a) 3

b) 4

c) 5

d) 6

View Answer

Answer: c

Explanation:

a) (110+1)*0

b) (11+110)*1

c) (110+11)*0

d) (1+110)*1

View Answer

Answer: c

Explanation: There is no state change for union operation, but has two different paths while for

concatenation or dot operation, we have a state change for every element of the string.

Password Validation: String should be 8-15 characters long. String must contain a number,

an Uppercase letter and a Lower case letter.

a) ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,15}$

b) ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{9,16}$

c) ^(?=.[a-z])(?=.[A-Z])(?=.\d).{8,15}$

d) None of the mentioned

View Answer

Answer: a

Explanation: Passwords like abc123, 123XYZ, should not be accepted . If one also wants to include

special characters as one of the constraint, one can use the following regular expression:

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-za-Z]).{8,15}$

P(x): String of length 6 or less for ={0,1}*

a) (1+0+e)6

b) (10)6

c) (1+0)(1+0)(1+0)(1+0)(1+0)(1+0)

d) More than one of the mentioned is correct

View Answer

Answer: a

Explanation: As the input variables are under Kleene Operation, we need to include e,thus option c

is not correct,thereby option (a) is the right answer.

7. The minimum number of states required in a DFA (along with a dumping state) to check

whether the 3rd bit is 1 or not for |n|>=3

a) 3

b) 4

c) 5

d) 1

View Answer

Answer: c

Explanation:

P(x): Express the identifiers in C Programming language

l=letters

d=digits

a) (l+_)(d+_)*

b) (l+d+_)*

c) (l+_)(l+d+_)*

d) (_+d)(l+d+_)*

View Answer

Answer: c

Explanation:

Identifiers in C Programming Language follows the following identifiers rule:

a) The name of the identifier should not begin with a digit.

b) It can only begin with a letter or a underscore.

c) It can be of length 1 or more.

L(x): {x{0,1}*| x ends with 1 nd does not contain a substring 01}

a) (0+01)*

b) (0+01)*1

c) (0+01)*(1+01)

d) All of the mentioned

View Answer

Answer: c

Explanation: (a) and (b) are the general cases where we restrict the acceptance of a string witrh

substring 00 but we ignore the case where the string needs to end with 1 which therby, does not

allows the acceptance of e.

10. The minimum number of transitions to pass to reach the final state as per the following

regular expression is:

{a,b}*{baaa}

a) 4

b) 5

c) 6

d) 3

View Answer

Answer: a

Explanation:

- Automata Theory Problems and ExercisesEnviado porKate Bayona
- compiler design – 2 marks question set with answers _ TUTOR4CS.pdfEnviado porshekhar kumar
- Automata Solved MCQEnviado porDeepak Bagga
- QUESTION BANK FOR COMPILER DESIGNEnviado porPRIYA RAJI
- CS402 Theory of Automata Solved MCQs From QuizEnviado porzubair254
- Formal Language & Automata TheoryEnviado porRaghavendra Rao
- Theory of Automata - Solved Assignments - Semester Spring 2010Enviado porMuhammad Umair
- Theory of Computation MCQsEnviado porJitender Sharma
- automata theoryEnviado porNilesh Patel
- Introduction to Computer Theory by Daniel I. a. Cohen - Second EditionEnviado porAnonymous uSOuOYV
- Analysis & Design Algorithm MCQ'SEnviado porGuruKPO
- Theory of Automata - CS402 Solved McqsEnviado porSaddam Lashari
- Compiler Design: Theory questions with answerEnviado porMd Saidur Rahman Kohinoor
- Lab Manual in Theory of ComputationEnviado porrhejlim6354
- Automata Theory Questions and AnswersEnviado portamirat
- Cs9251 Mobile Computing University Questions With AnswersEnviado porNivitha
- Solution to Peter LinzEnviado porGinny Chugh
- Sham Daa McqEnviado porshambhand2020
- Artificial Intelligence MCQ'SEnviado porGuruKPO
- 100 TOP DATABASE MANAGEMENT SYSTEM Questions and Answers DATABASE MANAGEMENT SYSTEM Questions and Answers.pdfEnviado porSumeet Bhardwaj
- Example Program for the Lex and Yacc ProgramsEnviado porcse.rajiv8466
- UndecidabilityEnviado porapi-19970469
- rr310504-theory-of-computationEnviado porSRINIVASA RAO GANTA
- r05310501 Formal Languages and Automata TheoryEnviado porSRINIVASA RAO GANTA
- dbms 100 mcq.pdfEnviado porSelvaraj Villy
- BS Computer Science.pdfEnviado porSheraz Ali
- Dbms 16 Marks - All 5 UnitsEnviado porsabarish001
- 100-top-c-programming-multiple-choice-questions-and-answers.pdfEnviado pormspereira
- Solution Manual for Introduction to Automata Theory Languages and Computation by ULmanEnviado porShafin Islam
- Multiple Choice QuestionsEnviado porNikita Mittal

- 2-ethics-for-IT best.pdfEnviado portamirat
- Proposal Guidelinesproposal_guidelines.pdfEnviado porKilari Umesh
- ArayaEnviado portamirat
- Assignment for Professionan Ethics & Human ValuesEnviado portamirat
- Project_Proposal_and_Review_ Process 082509.pdfEnviado portamirat
- AutomataEnviado porkirivarnan
- Asia Broadcast ABS 3A Satellite FootprintEnviado portamirat
- assiagmentEnviado portamirat
- New Microsoft Office Word DocumentEnviado portamirat
- Alg-of-Inf-1Enviado portamirat
- New Microsoft Office Word Document (2)Enviado portamirat
- Answer-1-6Enviado portamirat
- Hw3f03 Sol PostEnviado portamirat
- week.3Enviado portamirat
- Theory of Automata by CohenEnviado porMuhammad Irshad Nazeer
- ስልጠናEnviado portamirat
- Business LawEnviado portamirat
- Business LawEnviado portamirat
- Business LawEnviado portamirat
- cryptography_tutorial.pdfEnviado porBalaji Ramamurti
- Huawei Ascend Y300 Firmware UpgradeEnviado portamirat
- Http TutorialEnviado porRithuik Yerrabrolu
- Network Security TutorialEnviado porJohn
- Business Law TutorialEnviado portamirat
- Bba Accounting Fa15Enviado portamirat
- Computer SecurityEnviado portamirat
- the-indian-contract-act-1872.rtfEnviado portamirat
- the-indian-contract-act-1872.rtfEnviado portamirat
- Automata Theory Questions and AnswersEnviado portamirat

- Tutorial 2 Temperature & Heat _Part 2Enviado porYixiang Tan
- Chapter 9 - Discrete Control Using PLC and PCEnviado porAnonymous 8NSojG
- ETABS 2016 16.2.0-Report ViewerEnviado porIvan Williams Sucuitana
- bmsv-58-parallel-magres[1] (1)Enviado porDaniel Jenkins
- TutorialEnviado porskullskull
- TC (Cleanroom Precision Positioning Table)Enviado porchidambaram kasi
- revised blooms taxonomyEnviado porapi-303116833
- C3_Ch17_FS_eEnviado porLaplaceNerd
- Structure of Motor Symptoms of Parkinson DiseaseEnviado pormusalek
- Anomaly Detection RapidMinerEnviado porAnwar Zahroni
- AMP Chapter 13 _ Nonlinier ProgramingEnviado porIlfan Kazaro
- PTFE Tube ExtruderEnviado porsukoptfe
- Computer Aided Design for Underground Cable System 00818708Enviado porGilberto Mejía
- Electrostatic Precipitator - Mechanical DescriptionEnviado porhozipek5599
- Draft 3Enviado porNizashiva
- Santos Silva and Tenreyro 2006Enviado porjohnwcajas
- Principles of CAD/CAM/CAEEnviado porMuhammad Bilal
- IJNCAA_Vol5No1Enviado porSDIWC Publications
- Ao Xiii, 1-2, 2006 PapersEnviado porBurn Bianca
- [PoiEnviado porAnonymous FW5PVUp
- A14-DOMM-I-(ME)-04-05-2018-(Supple)Enviado porMilan Motta
- How UE Identify Various Radio Links and Usage of Frame Offset and ChipEnviado porDoanh Kat
- Calculus IIIEnviado porallanviento
- Mobius TransformationEnviado porHearty Nuenay-Maglanque
- [MS-WPFXV]: WPF XAML Vocabulary Specification 2006Enviado pormhenriq
- Engineering Design Guidelines and Standard DrawingsEnviado porUdomsin Wutigulpakdee
- 8-IP-Networking_Req V2.0Enviado porGuruh Ty
- CHAPTER 4 - Levelling DetailEnviado porNurisz Iskandar
- Principles TdEnviado porEnrique Flores
- Chapter1(OFC)Enviado porCharith Lakshitha