MIT6 042JS15 ps4
MIT6 042JS15 ps4
Problem Set 4
Due: March 6
Reading:
Problem 1.
A robot moves on the two-dimensional integer grid. It starts out at .0; 0/ and is allowed to move in any of
these four ways:
3. .C1; C3/
4. .-1; -3/
Problem 2.
Let L be some convenient set whose elements will be called labels. The labeled binary trees, LBT’s, are
defined recursively as follows:
The leaf-labels and internal-labels of an LBT are defined recursively in the obvious way:
Definition. Base case: The set of leaf-labels of the LBT hl; leafi is flg, and its set of internal-labels is the
empty set.
Constructor case: The set of leaf labels of the LBT hl; B; C i is the union of the leaf-labels of B and of C ;
the set of internal-labels is the union of flg and the sets of internal-labels of B and of C .
The set of labels of an LBT is the union of its leaf- and internal-labels.
The LBT’s with unique labels are also defined recursively:
2015, Eric Lehman, F Tom Leighton, Albert R Meyer. This work is available under the terms of the Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 license.
2 Problem Set 4
Definition. Base case: The LBT hl; leafi has unique labels.
Constructor case: If B and C are LBT’s with unique labels, no label of B is a label C and vice-versa, and
l is not a label of B or C , then hl; B; C i has unique labels.
If B is an LBT, let nB be the number of distinct internal-labels appearing in B and fB be the number of
distinct leaf labels of B. Prove by structural induction that
fB D nB C 1 (1)
for all LBT’s B with unique labels. This equation can obviously fail if labels are not unique, so your proof
had better use uniqueness of labels at some point; be sure to indicate where.
Problem 3.
In this problem you will prove a fact that may surprise you—or make you even more convinced that set
theory is nonsense: the half-open unit interval is actually the “same size” as the nonnegative quadrant of the
real plane!1 Namely, there is a bijection from .0; 1] to Œ0; 1/ Œ0; 1/.
(a) Describe a bijection from .0; 1] to Œ0; 1/.
Hint: 1=x almost works.
(b) An infinite sequence of the decimal digits f0; 1; : : : ; 9g will be called long if it does not end with all
0’s. An equivalent way to say this is that a long sequence is one that has infinitely many occurrences of
nonzero digits. Let L be the set of all such long sequences. Describe a bijection from L to the half-open
real interval .0; 1].
Hint: Put a decimal point at the beginning of the sequence.
(c) Describe a surjective function from L to L2 that involves alternating digits from two long sequences.
Hint: The surjection need not be total.
(d) Prove the following lemma and use it to conclude that there is a bijection from L2 to .0; 1]2 .
Lemma 3.1. Let A and B be nonempty sets. If there is a bijection from A to B, then there is also a bijection
from A A to B B.
(e) Conclude from the previous parts that there is a surjection from .0; 1] to .0; 1]2 . Then appeal to the
¨ -Bernstein Theorem to show that there is actually a bijection from .0; 1] to .0; 1]2 .
Schroder
(f) Complete the proof that there is a bijection from .0; 1] to Œ0; 1/2 .
1 The half-open unit interval, .0; 1], is fr 2 R j 0 < r 1g. Similarly, Œ0; 1/ WWD fr 2 R j r 0g.
MIT OpenCourseWare
https://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.