Homework 6

Homework 6 - i g 5 $ E i s g, g i i g i ‘5 ,5 Z ‘ I . g...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: i g 5 $ E i s g, g i i g i ‘5 ,5 Z ‘ I . g - by examining the values of this expression for small g values of n. 3% b) Prove the formula you conjectured'rn part (a). a; s Sitive integer n, ve that for every P0 V 16.Pro 2.3-4+w+n(n+1)(n+2) 20. Prove that 3” < n! ifn is an integer greater than 6. 34. Prove that 6 divides n3 — n whenever n is a nonnegative integer. fir‘ a i mtmmwwwmwmmay;er my» 1(- .mM «was M Mi. .. s. Mmmmiuunwwm... \ «M311: .gi s» . Z Lia a 8. Suppose that a store offers gift certificates in denomina— tiOns of 25 dollars and 40 dollars. Determine the possible total amounts you can form using these gift certficates. ' 10. Assume that a chocolate bar consists of n squares arranged in a rectangular pattern. The bar, a smaller rectangular _ piece of the bar, can be broken along a vertical or a hor- izontal line separating the squares. Assuming that only one piece can be broken at a time, determine how many breaks you must successively make to break the bar into 11 separate squares. Use strong induction to prove your _ answer. , .s ------ ~ _ , .v ,, \l ' ~ ‘_ Split this . ose ou begin With a pile of In stones a . I 14 igggnto r? piles of one stone each by successrvely splittmg a pile of stones into two smaller piles. Each time yousplit a pile you multiply the numb er 0 f stones in each of the two smaller piles you form, so that if these piles have r and s stones in them, respectively, you c ompute rs. Show that no matter how you split the piles, the sum of the products computed at each step equals n(n l) / 2. ; 0 it“: 6. Determine whether each of these proposed definitions is a valid recursive definition of a function f from the set F of nonnegative integers to the set of integers. If f is well 9 :' defined, find a formula for f (11) when n is a nonnegative integer and prove that your formula is valid. a) f(0) : l, f(n) = ——f(n — l)forn 21 b) f(0)=1,f(1)=0,f(2)=2=f(n)=2f(n-3)f0r 1133 c) f(0) = 0,f(1) = 1;“;(n3“=”“2}<n + 1) fail”: 2 d) f(0) = 0,f(1)=1,f(n)== 2f(n —1)forn :1 e) f(0) = 2, f(n) = f(.n ——1.)ifnisoddandn _>_ 1. ». r. == 2f(n ,— 2) if 13;. 2 1.. WWWWW n Exercises 12—19 f,2 is thenthFihonacci nurnber. 12. From that f 2 2 . V H I l+f2+m+f3:—_fi,fi,+1whenmsapos a Itlve Integer. 'ztm: m ., ‘ mmwwp I ‘ l.\' 11 30. Prove that in a bit string, the string 01 occurs at most one more time than the string 10. I W a. v magnate . . WWW...M..WWN.\ , H- 4:? - M~ifiwvfivl9~4dr~wvwxvm«fi(mvn>.m\»« ea no.1. .«Mwmmraa fit i r ff % i .2 E i i ’x {f evrse a recursive algorithm for finding 1:" mod m when— ‘er 7;, x, and m are positive integers based on the fact at x mod m = (Jc”“l mod m; x mod m) mod m. 24. Devise a recursive algorithm to find a2" , Where a is areal number and n is a positive integer. [Hint Use the equality 2"“ ._ 2" 2 a — (a ) .] W1. The quick sort is an efficient algorithm. To sortal , a2, . . . , a c this algorithm begins by taking the first element a1 and form 5 111g two sublists, the first containing those elements that a less than a1, in the order they arise, and the second conta' . ing those elements greater than al, in the» order they arise; ‘ Then a1 is put at the end of the first sublist. This proce .‘Q dure is repeated recursively for each sublist, until. all» lists contain one item. The ordered list of 11 items is ob.~ tained by combining the sublists of one item in the order. they occur. ‘ . ._ is, , ...
View Full Document

Page1 / 4

Homework 6 - i g 5 $ E i s g, g i i g i ‘5 ,5 Z ‘ I . g...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online