This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full 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.34+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. ﬁr‘ 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 certiﬁcates in denomina— tiOns of 25 dollars and 40 dollars. Determine the possible
total amounts you can form using these gift certﬁcates. ' 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 deﬁnitions is a valid recursive deﬁnition of a function f from the set
F of nonnegative integers to the set of integers. If f is well
9 :' deﬁned, ﬁnd 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(n3)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:—_ﬁ,ﬁ,+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~iﬁwvﬁvl9~4dr~wvwxvm«ﬁ(mvn>.m\»« ea no.1. .«Mwmmraa ﬁt i
r
ff
%
i
.2
E i
i
’x
{f evrse a recursive algorithm for ﬁnding 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 ﬁnd 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 efﬁcient algorithm. To sortal , a2, . . . , a
c this algorithm begins by taking the ﬁrst element a1 and form
5 111g two sublists, the ﬁrst 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 ﬁrst 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
This note was uploaded on 11/11/2008 for the course CS 2305 taught by Professor Ntafos during the Fall '08 term at University of Texas at Dallas, Richardson.
 Fall '08
 Ntafos

Click to edit the document details