James A. Foster

Lecture notes for CS 490/Ma 485

This document contains notes for the following lectures
Lecture Date Topic
2 8/28/96 Formal Languages
41 12/11/96 Proving the Clique Problem NP Complete

Formal Languages (28 Aug 1996, Lecture 2)

We need a mathematical model of input and output, and a definition of a problem, in order to build a general, abstract mathematical models of computation. Our tool will be formal languages. We used the following definitions:

Alphabet
A finite set of characters (which are primitives)
Word (or string)
A finite sequence of zero or more characters from a given alphabet
Language
A set of words (may be infinite or finite)

For example, assume we're using the alphabet SIGMA={a,b}. The characters are: a and b. Some words are: Lambda (the word with zero characters), aaabb, a, and aaaaaaaaaaaaaaaaa. Some languages are: {} (a set with no words), {lambda} (the set with a single word, where the word has no characters), {a,aa,aaa,aaaa,...}, and {a,b,aa,bb,ab,ba,bb}.

Here are some operations on words:

Catenation
The catenation of two words w and u, denoted wu, is the word consisting of all the characters in w followed by all those in u. Iterated catenation of a word, wk, represents k copies of w stuck together. (note: w0 = Lambda.)
Reversal
The reversal of a word, denoted wR, is all the characters in w in reverse order
Length
The length of a word, denoted |w|, is the number of characters in w
Census
The number of times a particular character x occurs in word w is denoted Nx(w)

Here are some operations on languages:

Catenation
The catenation of two languages L1 and L2, denoted L1L2, is the set {xy : x is in L1 and y is in L2}. L1k denotes the set {xk : x is in L1}. L1* denotes the union of L1k over all k.
Union, Intersection
These have the usual set-theoretic definitions.
Complement
L1\L2 = {x : x is in L1 and x is not in L2}. L1' = Sigma*\L1.

The power set of a set L is the set of all subsets of L. We will denote this 2L. We distinguish between a language, and a set of languages by calling the latter a class of languages.

Each formal language L has an associated decision problem, namely:

Given a word x, is x in L?

A decision problem is solveable if there is an algorithm which solves it. Otherwise, it is unsolvable.

There are many interesting questions which we can now pose and answer with this terminology. For example:
bullet Given a language L and a mathematical model of computation, is L solvable using that model?
bullet Given two mathematical models, are there any languages whose decision problems are soveable with one, but not the other?
bullet Are there any languages whose decision problem is not solvable by any model of computation?
bullet Is there any model of computation which can solve all decision problems?

This approach characterizes "computation" as "solution of decision problems with algorithms". This seems highly artificial. We usually think of computation as a functional transformation of inputs into outputs. However, note that the problem of computing a function f(x)=f is very similar to recognizing the set of pairs {< x,y > : f(x) = y} in that if we could write a program to recognise this set, we could compute f(x) with the following algorithm:

input x for y = each possible string in order if < x,y > is in the set (using algorithm for decision problem) then return y So, this approach isn't as artificial as it seems. However, we will discuss the theory of computable functions later in the course.

James Foster
Last modified: Wed Aug 28 15:53:30 PDT

Last Updated 01/13/2003 15:56 -0800