EDAA40 At home exercises 1 1. Given, with as always the natural numbers starting at 1, let us define the following sets (with iff ): Give the number of elements in these sets as follows: 1. 23 2. 6 3. 6 Note that the question is about the cardinality of sets, so the answers are numbers. 2. With and compute the following images of R: 1. 2. 3. 4.
3. Assume you have an injection and a surjection. 1. Is their composition always injective? 2. If yes, prove that it is. If no, show a counterexample. (A counterexample involves making the three sets,, and concrete, giving two functions for and with the required properties, and showing how their composition is not injective.) A = {a, b}, B = {c, d}, C = {e} j = {(a, c), (b, d)}, s = {(c, e), (d, e)} s*j = {(a, e), (b, e)} 3. Is their composition always surjective? 4. If yes, prove that it is. If no, show a counterexample. (A counterexample involves making the three sets,, and concrete, giving two functions for and with the required properties, and showing how their composition is not surjective.) A = {a}, B = {c, d}, C = {e, f} j = {(a, c)}, s = {(c, e), (d, f)} s*j = {(a, e)}
4. Suppose we have a set that is totally ordered by a strict order relation on. A function is called strictly monotonic iff for any it is the case that. 1. If a function is strictly monotonic, does that imply it is injective? (circle answer) 2. If yes, prove it. If no, provide a counterexample. (If you use a counterexample, you may use any totally ordered set that you find convenient, such as the natural/integer/rational/real numbers under the usual arithmetic order.) It is to show that implies Since, and A is totally ordered, then either or. If the former, then and therefore. If the latter, correspondingly. You need to show that x!=y implies f(x)!=f(y), so x!=y is the starting point of the proof. To get from there to x<y (or y<x), you need to invoke the total order property of <. 3. If a function is strictly monotonic, does that imply it is surjective? (circle answer) 4. If yes, prove it. If no, provide a counterexample. (If you use a counterexample, you may use any totally ordered set that you find convenient, such as the natural/integer/rational/real numbers under the usual arithmetic order.) f is strictly monotonic, but not surjective.
5. In lecture 4, slide 11, the injection val produces a natural number of every finite string of a finite alphabet A. Is it also a bijection? If yes, prove it. If no, provide a counterexample. (If you need to create a counterexample, you also need to choose an alphabet A.) First, here are the definitions: Since we know (as in: were told) that val is injective, we only need to show that it is surjective in order to prove that it is a bijection. In other words, we need to show that every natural number is a value of val for some string in A *. Let s start by looking at the number of strings of length L, and the range of numbers in that they are mapped to. Since there are n symbols, there are exactly different strings of length L. We get the smallest value when all the in the sum are 1, and the largest when they are n. In other words, for any string s of length L, we get. Next, note that. 1 In order to figure out the range of numbers that strings of length L are mapped to, we need to take the largest number of that range, subtract the smallest from it, and add 1. Let's do that: So the different strings of length L get mapped to ranges of numbers. Since val is an injection, i.e. no two strings get mapped to the same number, it means that on those ranges, val is indeed surjective. We also know that those ranges cannot overlap (again, because of val's 1 We use the fact that. You can verify this as follows:
injectivity), so the only thing left is to show that they sit right next to each other, in other words: the largest value for a string of length L-1 is exactly one less than the smallest value of a string of length L: That concludes the proof: the natural numbers are partitioned into ranges, each of size, that the different strings of length L are mapped to. Since val is injective, every number in the range must be mapped to. We know it is a partition because the next range starts right after the previous one ends, and every natural number falls into one of those ranges. (This last bit we did not show, but let's say it is obvious.) So, every natural number is mapped to by val, and so val is surjective, and therefore bijective. 6. In lecture 4, slide 14, it is said that. Prove this. (You need to define something in order to prove this, and then show that the thing you defined has a certain property. Start by writing down what you need to define and what property it must have. Then define it. Then prove the property.) is true if there is an injection. Let, where is the sequence where the n-th entry is 1, all others are 0, more formally: Since if, the function is injective.
7. (advanced) Also in lecture 4, slide 11, it is claimed that for any finite n, or in other words, that for any finite set A, the set is equinumerous to the set. Show this. (Hint: Use the Cantor- Schröder-Bernstein theorem.) Let s start by noting a small error: if n=1, this is actually not true, because obvious, so what remains to be shown is that the equation remains true for n > 2.. For n=2, it s Using the CSB, we need to construct two injections, and. The second one maps infinite sequences of two symbols to infinite sequences of more than two symbols, so for example from infinite sequences of {0, 1} to infinite sequences in A={a, b, c}. That s trivial, since we can just replace 0 and 1 with two symbols from that larger alphabet, and get a unique sequence to map to. So, for example, 0,1,0,1,1,1, could be mapped to a,c,a,c,c,c, and similarly for every other sequence. Clearly, such an i is injective (it maps two different sequences of 0 and 1 to two different sequences of a and c. The reverse direction is slightly more complicated. Let s say that k is the smallest integer greater or equal to, so for n=3, k would be 2, same for n=4, but for n = 5 we would get 3 etc. Then we can uniquely encode each of the n symbols in A by a different string of k 0s and 1s. For example, a could become 00, b would be 01, c would be 10. We can represent this using a function. Now j would map a sequence s in A to a binary sequence j(s) that is defined as follows: Any two distinct sequences r, s in A would differ in at lest one position m, and the function code wuld assign those two different symbols r(m) and s(m) sequences that differ in at least one position, so the resulting sequences j(r) and j(s) would be different, hence j is injective. (You can boil this down even further by making the condition on code more explicit, but this should suffice for our purposes.)
8. Further exercises from SLAM If you want to work on more exercises, try the following from the textbook: 1.2.2 (3) (p. 5) 1.3 (b) (p. 24) 2.3.3 (1) (p. 39) 3.2.2 (1) (p. 62) 3.2 (a) (p. 77) 3.2 (b) (p. 77) TE: There is an error, it should read:
Some common symbols the natural numbers, starting at 0 the natural numbers, starting at 1 the real numbers the non-negative real numbers, i.e. including 0 the integers the rational numbers a and b are coprime, i.e. they do not have a common divisor other than 1 a divides b, i.e. power set of A of a relation R: its complement of a relation R: its inverse of relations and functions: their composition closure of a set X under a relation R, a set of relations R, or a function f closed, open, and half-open intervals from a to b two sets A and B are equinumerous for a finite set A, the set of all finite sequences of elements of A, including the empty sequence, sum of all elements of product of all elements of union of all elements in intersection of all elements in