Languages · Models · Computation

Automata and Formal Languages

How do we describe a language formally, and which computational models can recognize it?

This course is being built. Only some of the units are published; the rest are marked ‘in preparation’. What is published is complete and can be studied now.

Learning materials and visual explanations

  1. Strings and Formal Languages

    Available

    Alphabets, words, operations on languages, and decision problems.

    1. 1.1LessonWords: Inductive Definitions and OperationsWords defined inductively (length, letter count, concatenation, powers, reverse), and why every yes/no question about text is a question about a language.
    2. 1.2LessonLanguages: Operations and EqualitiesFormal languages, the operations on them (complement, concatenation, powers, star, reverse, prefixes), and how to prove or refute an equality of languages.
      Practice pages (6)
      1. 1.2.1ExerciseLanguages: Practice and Check of UnderstandingPractice by levels on formal languages: membership and set operations by hand, a real-life DNA example, proofs of claims about languages, and refutations by counterexample.
      2. 1.2.2ExerciseSort the Words: Languages as SetsPractice languages as sets: sort the 15 words of length at most 3 into the regions of a Venn diagram of two or three languages, or choose the words of a set expression, and get an explanation for every mistake.
      3. 1.2.3ExerciseCounterexample HunterClaims about languages and their operations: decide whether each is true for all languages, refute the false ones with a counterexample that the tool checks exactly, and order the proof of the true ones.
      4. 1.2.4ExerciseTables and Splits: Concatenation, Star, PrefixesPractice concatenation of languages with a product table, powers and star with split searches, cutting a word into two parts, and prefixes, suffixes and substrings. Every question is drawn at random and checked at once.
      5. 1.2.5ExerciseDescribe the Language with OperationsPractice describing languages with union, intersection, difference, complement, concatenation, star, reverse and prefixes: requirements from DNA, codes and file names turned into expressions and checked exactly, three representations of one language, and an open lab.
      6. 1.2.6ExerciseRandom Practice Questions on LanguagesA stream of freshly drawn questions on languages: compute operations on small sets, decide membership, count words, find a shortest word, and judge claims, with instant checking, hints and step-by-step solutions.
  2. Deterministic Finite Automata and Regular Languages

    Available

    States, transitions, acceptance, designing an automaton for a language, combining automata, minimization, and the Myhill–Nerode classes.

    1. 2.1LessonDeterministic Finite Automata: Deciding with Fixed MemoryThe formal and graphical definition of a deterministic finite automaton, its language, its run, and trap states.
      Practice pages (1)
      1. 2.1.1ExerciseFrom a Drawing to a Definition, and BackPractise moving between the two descriptions of a deterministic finite automaton (DFA): read a drawn automaton and write its formal definition, and draw an automaton from a definition; the tool checks every answer.
    2. 2.2LessonDesigning a Deterministic Finite AutomatonHow to build a deterministic finite automaton for a given language: ask what the machine must remember, discover five design strategies (one fact, progress in a pattern, counting modulo, stages, a trap state) and practise each at once, on validators from real life.
      Practice pages (1)
      1. 2.2.1ExerciseDoes My Automaton Do What I Meant?Build a deterministic finite automaton (DFA) with a drawing or with a table, and check it against a language or against another automaton: the tool returns a shortest word on which the answers differ, and the states the automaton visits while reading it.
    3. 2.3LessonCombining Automata: Complement and ProductA form field with two validity rules: building the product and the complement of deterministic finite automata, proving that the product runs both in parallel, and combining simple validators for and, or and negation.
    4. 2.4LessonMinimizing Automata by Table FillingTwo correct automata for the same language, one larger than the other: unreachable states, distinguishing words and equivalent states, table filling in rounds, and the quotient automaton that recognizes the same language.
      Practice pages (1)
      1. 2.4.1ExerciseMinimization Step by StepRun table filling step by step on the product automaton for "contains aa or contains bb": predict which pairs are marked in each round, check that the minimal automaton is equivalent to the original, and meet a product that minimization does not shrink.
    5. 2.5LessonMyhill–Nerode: What a State RemembersWhat each state of an automaton remembers, indistinguishable words and Myhill–Nerode classes, a lower bound on the number of states, and the smallest automaton for a language: how to build it and why it is unique up to renaming.
      Practice pages (4)
      1. 2.5.1ExerciseMyhill–Nerode Classes and Minimization: Practice with ToolsCollect words that are pairwise distinguishable and get a lower bound, check whether an automaton is minimal with a certificate of words, minimize an automaton through the words that reach its states, and map each state of a large automaton to a class of the smallest automaton.
      2. 2.5.2ExerciseMyhill–Nerode PracticeComplete the automaton of the classes in a tool that checks every transition, and questions to solve on paper: the classes of a finite language and of new languages, the classes of the complement, a bound on the number of classes of an intersection, and a claim to refute.
      3. 2.5.3ExerciseThe Lower Bound in ActionTry to build a DFA with one state fewer than the number of classes of the language; for each attempt the tool shows two words from different classes that reach the same state and the word on which the automaton is wrong.
      4. 2.5.4ExerciseDistinguishable or NotRepeated practice: the tool draws a language and two words, and you decide whether they are in the same class or write a distinguishing word that the tool checks.
  3. Nondeterministic Finite Automata

    In preparation

    Nondeterminism, epsilon transitions, and the equivalence of DFAs and NFAs.

  4. Regular Expressions

    In preparation

    Regular expressions, and conversion in both directions between regular expressions and finite automata.

  5. Context-Free Languages

    In preparation

    Context-free grammars, derivations, and parse trees.

  6. Pushdown Automata

    In preparation

    Adding a stack to a finite automaton, its equivalence with grammars, and the pumping lemma for context-free languages.

For the whole course

These materials supplement the teaching in the course. The syllabus, deadlines, assessment instructions, and group announcements are published in the institution’s course system.