Skip to content

1. Languages

Jan 11/13, 2022

Automata

  • distinguished by temporal memory
    • finite automata: no temporary memory
    • pushdown automata: stack
    • Turing machines: random access
  • more flexible memory → able to solve more computational problems:
1
2
Finite automata  <     Pushdown automata    <    Turing machine
simple problems  <   more complex problems  <   hardest problems
  • Turing machine is the most powerful known computational model, though cannot solve all computational problems

Languages

  • language is a set of strings
    • string is a sequence of symbols from the alphabet
    • alphabet Σ is a set of symbols e.g. Σ={a,b} (non-empty)
  • operations: concatenation (wv), reverse (wR), exponent (wn)
  • length: |w| → length of concat: |uv|=|u|+|v|
  • empty string: ϵ or λ
    • note: |ϵ|=0,   ϵw=wϵ=w,   w0=ϵ
  • star Σ operation: all possible strings from the alphabet (including ϵ)
    • e.g. Σ={a,b} => Σ={ϵ,a,b,aa,ab,ba,bb,aaa,aab,...}
    • language over alphabet Σ is any subset of Σ
    • Σ+=Σ{ϵ}
  • language problems are membership problems => does string belong to language

  • Two special languages:

    • empty language {} or Ø   => size |{}|=0
    • empty string language {ϵ}   => size |{ϵ}|=1, string length |ϵ|=0

Operations

  • union: L1L2, intersection: L1L2, difference L1L2
  • complement: L¯=ΣL
  • reverse: LR={wR:wL}
  • concatenation: L1L2={xy:xL1,yL2}
  • Ln (or "L n times")
    • e.g. {a,b}3={a,b}{a,b}{a,b}={aaa,aab,aba,abb,baa,bab,bba...}
    • e.g. L={anbn:n0} then L2={anbnambm:n,m0}
    • special case: L0={ϵ}
  • Star closure / Kleene *: L=L0L1L2...
{a,bb}={ϵ,(L0)a,bb,(L1)aa,abb,bba,bbbb,(L2)aaa,aabb,abba,abbbb,...(L3)
  • Positive closure: L+=L1L2...
    • note: L=L0L+
{a,bb}+={a,bb,(L1)aa,abb,bba,bbbb,(L2)aaa,aabb,abba,abbbb,...(L3)