Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
MACM 101 — Discrete Mathematics I Exercises on Functions and Induction. Due: Tuesday, November 15th (at the beginning of the class) Reminder: the work you submit must be your own. Any collaboration and consulting outside resources must be explicitly mentioned on your submission. Please, use a pen. 30 points will be taken off for pencil written work. 1. Is the function f : Z → Z defined as f (n) = n3 one-to-one? 2. Determine whether or not the function f : Z × Z → Z is onto, if f ((m, n)) = mn. 3. Let f (x) = ax2 and g(x) = bx + c, where a, b, and c are constants. Compute f ◦ g and g ◦ f . Determine for which constants a, b, and c it is true that f ◦ g = g ◦ f . (Hint: Note that polynomials dn xn + dn−1 xn−1 + · · · + d1 x + d0 and en xn + en−1 xn−1 + · · · + e1 x + e0 are equal as functions if and only if dn = en , dn−1 = en−1 , . . . , d1 = e1 , d0 = e0 .) 4. If g and f ◦ g are both onto, does it follow that f is onto? 5. Show that the function f : R − {1} → R − {2} defined by f (x) = is a bijection, and find the inverse function. (Hint: Pay attention to the domain and codomain.) 2x−3 x−1 6. Fibonacci numbers F1 , F2 , F3 , . . . are defined by the rule: F1 = F2 = 1 and Fk = Fk−2 + Fk−1 for k > 2. Lucas numbers L1 , L2 , L3 , . . . are defined in a similar way by the rule: L1 = 1, L2 = 3 and Lk = Lk−2 + Lk−1 for k > 2. Show that Fibonacci and Lucas numvers satisfy the following equality for all n ≥ 2 Ln = Fn−1 + Fn+1 . 1 7. Prove that for every positive integer n 12 − 22 + 32 − . . . + (−1)n−1 n2 = (−1)n−1 n(n + 1) . 2 8. In a magic trick four playing cards were stacked together, three of them face up and one face down, with a heart at the bottom, then a club, then a diamond, and then a spade (facing down). There are three ways in which the packet of cards is allowed to be mixed: The packet can be cut, the top two cards can be turned over as one, or the entire packet can be turned over together. Prove that for any n ≥ 0 after n allowed shuffles there will be exactly one card facing the wrong way, that is, different from the other three. 9. Suppose you begin with a pile of n stones and split this pile into n piles of one stone each by successively splitting a pile of stones into two smaller piles. Each time you split a pile you multiply the number of stones in each of the two smaller piles you form, so that if these piles have r and s stones in them, respectively, you compute rs. Show that no matter how you split the piles, the sum of the products computed . at each step equals n(n−1) 2 10. A complete binary tree is a graph defined through the following recursive definition. Basis step: A single vertex is a complete binary tree. Inductive step: If T1 and T2 are disjoint complete binary trees with roots r1 , r2 , respectively, the the graph formed by starting with a root r, and adding an edge from r to each of the vertices r1 , r2 is also a complete binary tree. The set of leaves of a complete binary tree can also be defined recursively. Basis step: The root r is a leaf of the complete binary tree with exactly one vertex r. Inductive step: The set of leaves of the tree T built from trees T1 , T2 is the union of sets of leaves of T1 and the set of leaves of T2 . The height h(T ) of a binary tree is defined in the class. Use structural induction to show that `(T ), the number of leaves of a complete binary tree T , satisfies the following inequality `(T ) ≤ 2h(T ) . 2