COMPILER DESIGN

LEXICAL ANALYSIS

REGULAR EXPRESSIONS AND FINITE AUTOMATA

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A FA can be used for
A
calculating square root
B
arithmetic operations
C
string recognition
D
comparision
Explanation: 

Detailed explanation-1: -The finite automaton starts in state q0 and reads the characters of its input string one at a time. If the automaton is in state q and reads input character a, it moves from state q to state (q, a). Whenever its current state q is a member of A, the machine M has accepted the string read so far.

Detailed explanation-2: -FA accepts all strings where each string ends with 01.

Detailed explanation-3: -A finite automaton (FA) is a simple idealized machine used to recognize patterns within input taken from some character set (or alphabet) C. The job of an FA is to accept or reject an input depending on whether the pattern defined by the FA occurs in the input.

Detailed explanation-4: -A string is accepted by a DFA, if it transits to a final state. A string is accepted by a NDFA, if at least one of all possible transitions ends in a final state.

There is 1 question to complete.