Unit 2Automata and Languages
Follows IGNOU MCS-212, Block 2 Unit 2
When you type an e-mail address into a form, a program checks whether it “looks valid”. When a compiler reads your code, it first cuts it into words such as while, x1 and 42. Both tasks are about languages — sets of strings — and about simple machines that recognise them. This unit introduces formal languages, describes them with regular expressions, and builds the simplest computing machines, finite automata, that read a string one symbol at a time and say “accept” or “reject”. Unit 3 will then study the most powerful machine, the Turing machine.
In this unit you will learn to
- use the words alphabet, string, length, concatenation, reverse and language;
- form the Kleene closure , the positive closure and the product of languages;
- write and read regular expressions, and use their algebraic laws correctly;
- define a deterministic finite automaton (DFA), trace it on a string, and design DFAs for simple languages;
- describe Mealy and Moore machines, which produce output;
- define a nondeterministic finite automaton (NFA), test strings on it, and convert it to a DFA.
Sections in this unit
- 2.1Alphabets, strings and languagesThe basic vocabulary of formal languages: alphabet, string, length, null string, concatenation, reverse, palindromes and languages.9 min
- 2.2Kleene closure and products of languagesThe Kleene star Σ* and S*, positive closure S⁺, the product ST of two languages, and the theorem (S*)* = S*.10 min
- 2.3Regular expressionsThe formal definition of regular expressions, the language L(R) each one describes, and how to write regular expressions for given languages.11 min
- 2.4Algebra of regular expressions and regular languagesCorrect identities for regular expressions, proofs and simplifications, regular languages, and why every finite language is regular.12 min
- 2.5Deterministic finite automataThe formal 5-tuple definition of a DFA, transition diagrams and tables, running a DFA on a string, δ*, and the language it accepts.12 min
- 2.6Designing finite automataHow to design DFAs: let states remember just enough, use dead states, check with examples; worked exercises and what finite automata cannot do.11 min
- 2.7Finite automata with output: Mealy and Moore machinesMealy machines (output on transitions) and Moore machines (output on states), how to trace them, and examples: counting bab and a traffic light.11 min
- 2.8Nondeterministic finite automataNFAs: several or no next states, acceptance if some path ends in a final state, worked traces, and converting an NFA to an equivalent DFA.13 min