Massachusetts Institute of Technology
6.042J/18.062J, Spring ’10
: Mathematics for Computer Science
Prof. Albert R. Meyer
revised February 19, 2010, 1407 minutes
In-Class Problems Week 3, Fri.
Let’s refer to a programming procedure (written in your favorite programming language —C++,
or Java, or Python, .
. . ) as a
when it is applicable to data of type
returns values of type
. When a string procedure,
, applied to a
, we’ll say that
is the set of strings that
recognizes, we’ll call
Describe how a recognizer would work for the set of strings containing only lower case Ro-
man letter —
—such that each letter occurs twice in a row. For example,
is such a string, but
are not. (Even better, actually write a recognizer pro-
cedure in your favorite programming language).
A set of
s is called
if there is a recognizer procedure for it.
When you actually program a procedure, you have to type the program text into a computer
system. This means that every procedure is described by some
of typed characters. If a
, is actually the typed description of some string procedure, let’s refer to that procedure