Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
a) 0 is a number.
Define the usual next function in terms of these functions, and define
these functions using the next function. Show how addition and
multiplication of numbers can be defined using these operations.
2. Suppose we want to define the set of integers. Apart from the assumptions
for numbers, we assume there is another operation called minus(n) that
gives an integer for every number n. What properties must this operation
satisfy? We want to extend the definitions of minus and next to all
integers. How should this be done? Note that the induction principle holds
only for numbers and not integers. Extend the definition of addition
to integers.
(iii) There are exactly f(i) numbers j such that f(j) == i, for all i >= 1.
4. Suppose we want to define the set of all bit strings (only 0 or 1 digits)
that contain equal number of 0's and 1's. Define some operations that
can be used to construct all possible such strings, starting from the
empty string. In this case, it is possible that the same string can be
generated in more than one way. Define an equality operator that tests
whether two strings are equal or not. Is it possible to define some
operations such that every such string can be generated in a unique way?
5. Do the same as in problem 4 for the set of all bit strings that correspond
to the binary representation of a number divisible by 3. There should be
no leading 0's in the representation (0 is represented by the empty string).
In this case, can every such string be generated in a unique way? Hint:
This is an example of mutual recursion. You may need to construct strings
corresponding to numbers that 1 or 2 mod 3 also.