Relevant to the first few problem, we define the sets Sn, n=0,1,2, ..., as follows:
| S0 | = | {0,1} | |
| Sn+1 | = | { x,y | x,y ∈ Sn : (x+y)/2 } | (n≥0) |
We then define S to be the union of all the Si's: S = {∪i | i≥0 : Si}
(Thus, one could view S as being the limit, as n approaches infinity, of Sn)
Hint: Expressed formally, what you are being asked to prove here is
Translating the body into a universal quantification (see Theorem (11.13)) and then applying Theorems (8.20) and (9.2), this becomes
By Metatheorem (9.16), a universal quantification is a theorem iff its body is a theorem. Which is to say that it suffices to prove
By definition, x ∈ Sn+1 is equivalent to
Consider the use of Theorem (9.28) here!
End of (long) hint.
As a corollary, it follows that no member of S, expressed as a fraction in simplest form, has a denominator that is not a power of two.
It follows from (2) and (3) that
because (2) shows inclusion from left to right, and (3) shows inclusion from right to left.
The next few problems pertain to bit strings (i.e., sequences of 0's and 1's). For a bit string x, we define #0(x) (respectively, #1(x)) to be the number of occurrences of 0 (respectively, 1) in x. Specifically, the problems pertain to "good" bit strings, which we define to be any that is either 1 or of the form 0xy, where each of x and y is itself a good bit string.
Equivalently, the set of good bit strings is the language generated by the context-free grammar G (denoted L(G)) whose lone nonterminal symbol is S and whose two productions are
Consider the predicates P1 and P2, each of which maps bit strings to boolean values.
In words, x satisfies P1 iff the number of occurrences of 1 in x exceeds by exactly one the number of occurrences of 0. Meanwhile, x satisfies P2 iff every proper prefix of x contains at least as many 0's as 1's.
Note: y is a proper prefix of x if x = yz for some nonempty string z.
3. Prove by (strong) mathematical induction that P1(x) is true for every good bit string x.
4. Prove by (strong) mathematical induction that P2(x) is true for every good bit string x.
5. Prove by (strong) mathematical induction that every bit string x that truthifies both P1 and P2 is a good bit string.
Hint: For the inductive step, it suffices to show that any bit string x that is of length n>1 and satisfies both P1 and P2 is of the form 0vw, where each of v and w is a bit string satisfying both P1 and P2. End of hint.
Of course, from (3), (4), and (5) it follows that the set of good bit strings is the same as the set of bit strings satisfying both P1 and P2.
In other words,