1. Gyanastra
  2. Theory of Computation
  3. Basics: Alphabets, Strings and Languages
  4. Definition of Computation and Modeling Machines
Free lesson, no account needed 4 min read 2 practice questions after it

Theory of Computation · Basics: Alphabets, Strings and Languages

Definition of Computation and Modeling Machines

Overview

Theory of Computation (TOC) studies computation by building a mathematical model of a computer or machine and then analyzing what that model can and cannot do.
The subject is built bottom-up from the most basic object, the symbol, which is collected into an alphabet Σ\Sigma on which all later objects (strings, languages) are defined.

Key concepts

  • Theory of Computation (TOC): T = Theory, O = of, C = Computation; the subject is "the theory of computation".
  • Computation: any task that can be performed by a calculator or a computer.
  • Goal of the subject: to mathematically model a computer (or any machine in general), and then study the theory about that model — its capabilities, the problems it can solve, and its limitations.
  • Symbol: the basic building block of TOC. A symbol can be any letter (like a, b, ...) or anything at all — even a picture can be a symbol.
  • Alphabet: a collection of symbols, generally represented by Σ\Sigma (sigma); Σ\Sigma is also called the alphabet. An alphabet can have any number of symbols in it.
  • Predefined alphabet: once the alphabet is defined, all strings are based on this predefined set.

How it works

  1. Start from the idea of computation: any task a calculator or computer can do.
  2. To study computation rigorously, build a mathematical model of a machine, then ask what its capabilities are, what problems it can solve, and what its limitations are.
  3. Build the model from the bottom up: the most basic object is the symbol (any letter or mark).
  4. Collect symbols into a set — this set is the alphabet Σ\Sigma. Everything studied afterwards (strings, languages) is defined relative to this fixed, predefined alphabet.
  5. The alphabet may contain any number of symbols; the choice of alphabet is free.

Formulas

  • Σ={A,B}\Sigma = \{A, B\} — example alphabet: the set whose elements are the symbols AA and BB; all strings are then based on this predefined set.

Revision summary

  • Computation = any task performable by a calculator or computer.
  • TOC = mathematical modeling of a computer/machine plus the study of its capabilities, solvable problems, and limitations.
  • Hierarchy of basics: symbol → alphabet (Σ\Sigma) → strings, built over the alphabet.
  • A symbol is the basic building block; it can be any letter or even a picture.
  • An alphabet Σ\Sigma is a collection of symbols and can contain any number of symbols.
  • All strings are defined with respect to a predefined alphabet.

Previous-year exam insights

  • An alphabet is a finite, non-empty set of symbols; the empty set is not a valid alphabet, and the alphabet of a language is fixed once the language is defined.
  • A string is a finite sequence of symbols from the alphabet; the empty string is denoted ε (or λ), has length 0, and is a string over every alphabet.
  • The length of a string w is written |w|; the number of occurrences of a symbol a in w is written #a(w) or na(w), and the sum of these counts over all symbols of the alphabet equals |w|.
  • Σ* is the set of all finite strings over Σ (including ε) and is countably infinite; Σ+ = Σ* − {ε}. For an alphabet of size k, the number of strings of length exactly n is knk^{n}, and the number of strings of length at most n is 1+k+k21 + k + k^{2} + … + knk^{n}.
  • A language over Σ is any subset of Σ*; it may be finite or infinite, and the empty language ∅ and {ε} are different languages (∅ has no strings, {ε} has one string of length 0).
  • Standard string operations to memorise: concatenation (|xy| = |x| + |y|, εw = wε = w), reversal wRw^{R}, and prefix/suffix/substring relations;
    a string is a prefix or suffix of itself, and ε is a prefix and suffix of every string.
Pages 1–2 of 2