Discrete Maths Assignment

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Test 3 Chapters 7 & 8

Math 220 Discrete Math


Section 1
Time: Due: R May 8 Calculator: OK
Notes: ???
Form Q 1 of 7
Directions: For multiple choice (A, B, C, etc.), circle the letter of the best choice. For TRUE/FALSE, circle the word
TRUE or the word FALSE. When a list of choices is given for a ll-in-the-blank, circle the word or phrase
you feel most appropriately matches the surrounding sentence. Otherwise follow the directions given.
Unless told otherwise, all numbers in answers should be as common fractions in reduced form or in
radical form similarly reduced. (You may also use decimal form if the value is terminating or proper
notation is used to denote the repeating digit sequence.)
Work easier problems rst. Write out your plan for harder problems before beginning them.
1) Meg decides to throw her 10-year-old daughter Sue a birthday party and allows her to invite 15 friends
to the house. Meg purchases 25 red balloons for the children, since red is Sues favorite color. In
how many ways can the balloons be distributed to the children at the birthday party (including Sue),
assuming that no child should go home without a balloon?
2) An English professor has chosen ve novels for a course in contemporary literature. Each student must
choose to write an analysis of at least one of the novels. Extra credit will be given for every additional
analysis. There are six students enrolled in the class. Give a numeric count of the number of ways the
students can submit reports.
3) I have a bowl of identical candy bars. Four young trick-or-treaters have just knocked on my door and
are holding their bags out for some candy. If I grab six candy bars from my bowl, in how many ways
can I distribute all six of them? Give two answers: (a) I will try to be fair (b) I need not be fair.
4) The people in charge of a rafe are going to give out four prize bags to the rafe winners. They want to
make sure that each prize bag contains at least one of the 11 gift certicates for a department store. In
how many ways can the prize bags be prepared, assuming that all the gift certicates are of the same
monetary value?
Start Date: R Apr 25
Test 3 Chapters 7 & 8
Math 220 Discrete Math
Section 1
Time: Due: R May 8 Calculator: OK
Notes: ???
Form Q 2 of 7
5) Use Theorem7.22 on multiplying generating functions to nd the coefcients of the following generating
function. Simplify as far as possible.

k0
3
k
z
k

k0
3
k
z
k

6) Use Newtons binomial theorem to expand the following into a power series:

1
1 4z
2

3
7) Mary made three dozen identical homemade chocolate chip cookies and is going to distribute them to
four families in her neighborhood. Each family must receive at least six cookies. The Landers family
cannot receive more than seven cookies because the mother does not want her family eating too many
sweets. Mary also knows that there are many children in the Johnson family, so she wants to give them
an ample supply of cookies. There are seven people in this family, and Mary wants to make sure that
each family member gets at least two cookies. In how many ways can Mary distribute the chocolate
chip cookies to the four neighborhood families? (Of course you should use generating functions in your
solution strategy.)
Start Date: R Apr 25
Test 3 Chapters 7 & 8
Math 220 Discrete Math
Section 1
Time: Due: R May 8 Calculator: OK
Notes: ???
Form Q 3 of 7
8) Recall Example 7.4.
i) Use pseudocode to write a recursive algorithm for calculating the sum of the rst n positive inte-
gers. You may assume that n will never be less than 1.
ii) Does this algorithm use tail-end recursion?
iii) Use pseudocode to write a non-recursive algorithm for calculating the sum of the rst n positive
integers.
9) Solve the following recurrence relation. (No, I dont want to know what all the numbers are, I want you
to nd a closed-form formula).
a
0
7 and a
n
pn `1qa
n1
, n 1
Start Date: R Apr 25
Test 3 Chapters 7 & 8
Math 220 Discrete Math
Section 1
Time: Due: R May 8 Calculator: OK
Notes: ???
Form Q 4 of 7
10) The following algorithm takes an unsorted list of positive integers, along with two integers x and y. It
returns the largest number, z, in the list such that either z
x
y or z
y
x is true. It returns 0 if no such z
exists. The algorithm assumes that the list size, n, is a power of 2 with n 1.
1 : integer xyMax(x,y,ta
0
, a
1
, . . . , a
n1
u)
2 : if n == 1
3 : if (a
x
0
== y) or (a
y
0
== x)
4 : return a
0
5 : else
6 : return 0
7 :
8 : # process the left half
9 :
10 : m
1
= xyMax(x,y,ta
0
, . . . , a
t
n
2
u1
u)
11 :
12 : # process the right half
13 :
14 : m
2
= xyMax(x,y,ta
t
n
2
u
, . . . , a
n1
u)
15 :
16 : # nd the largest
17 :
18 : max = m
1
19 : if m
2
max
20 : max = m
2
21 :
22 : return max
23 : end xyMax
i) What is the recurrence relation that counts the number of comparisons for this algorithm? (The
critical steps are at lines 2, 3, and 19.)
ii) What is a good big- reference function for algorithm xyMax?
Start Date: R Apr 25
Test 3 Chapters 7 & 8
Math 220 Discrete Math
Section 1
Time: Due: R May 8 Calculator: OK
Notes: ???
Form Q 5 of 7
11) Find a closed-form formula for the following linear homogeneous recurrence relation with constant
coefcients. Do not round off or use calculator approximations: use exact arithmetic!
a
0
2, a
1
2, and a
n
2a
n1
`15a
n2
, n 2
Bonus Problems:
12) Repeat Quick Check 7.1 (page 338) but in line 14 of SubsetSum, always choose the smallest element
of W.
i) Diagram of recursive invocations:
ii) Which strategy (largest element as in the original Quick Check or smallest element as here) seems
better? (Explain your answer.)
Start Date: R Apr 25
Test 3 Chapters 7 & 8
Math 220 Discrete Math
Section 1
Time: Due: R May 8 Calculator: OK
Notes: ???
Form Q 6 of 7
13) Find a closed-form formula for this following linear homogeneous recurrence relation with constant
coefcients. Do not round off or use calculator approximations: use exact arithmetic!
a
0
4, a
1
3, a
2
0, and a
n
3a
n1
3a
n2
a
n3
, n 3
14) A library has four identical display cases that are used to promote new acquisitions. This month, the
librarians wish to promote nine books. They do not want any empty display cases. In how many ways
can the books be displayed?
Start Date: R Apr 25
Test 3 Chapters 7 & 8
Math 220 Discrete Math
Section 1
Time: Due: R May 8 Calculator: OK
Notes: ???
Form Q 7 of 7
15) Find the performance of algorithms with the given recurrence relations.
i) f p1q 11 and f pnq 2 f
`
n
4

`
1
4
log
4
pnq
ii) f p1q 1 and f pnq f
`
n
5

`2
?
n
16) Use a generating function approach to solve the following recurrence relation:
a
0
2, a
1
2, and a
n
2a
n1
`15a
n2
, n 2
Start Date: R Apr 25

You might also like