Maths 220, Discrete Maths, Test 3 , Chapter 7&8

Embed Size (px)

DESCRIPTION

Maths 220, Discrete Maths, Test 3 , Chapter 7&8

Citation preview

  • Test 3 Chapters 7 & 8

    Math 220 Discrete MathSection 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 fill-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 first. 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 five 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 raffle are going to give out four prize bags to the raffle winners. They want to

    make sure that each prize bag contains at least one of the 11 gift certificates for a department store. In

    how many ways can the prize bags be prepared, assuming that all the gift certificates are of the same

    monetary value?

    Start Date: R Apr 25

  • Test 3 Chapters 7 & 8

    Math 220 Discrete MathSection 1

    Time: Due: R May 8 Calculator: OK

    Notes: ??? Form Q 2 of 7

    5) Use Theorem 7.22 on multiplying generating functions to find the coefficients of the following generating

    function. Simplify as far as possible. 8

    k0

    3kzk

    8

    k0

    3kzk

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

    1

    1 4z23

    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 MathSection 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 first 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 first n positive

    integers.

    9) Solve the following recurrence relation. (No, I dont want to know what all the numbers are, I want you

    to find a closed-form formula).

    a0 7 and an pn ` 1qan1, n 1

    Start Date: R Apr 25

  • Test 3 Chapters 7 & 8

    Math 220 Discrete MathSection 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 zx y or zy x is true. It returns 0 if no such zexists. The algorithm assumes that the list size, n, is a power of 2 with n 1.

    1 : integer xyMax(x,y,ta0, a1, . . . , an1u)2 : if n == 1

    3 : if (ax0== y) or (a

    y

    0== x)

    4 : return a05 : else

    6 : return 0

    7 :

    8 : # process the left half

    9 :

    10 : m1 = xyMax(x,y,ta0, . . . , at n2 u1u)11 :

    12 : # process the right half

    13 :

    14 : m2 = xyMax(x,y,tat n2

    u, . . . , an1u)15 :

    16 : # find the largest

    17 :

    18 : max = m119 : if m2 max20 : max = m221 :

    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 MathSection 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

    coefficients. Do not round off or use calculator approximations: use exact arithmetic!

    a0 2, a1 2, and an 2an1 ` 15an2, 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 MathSection 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

    coefficients. Do not round off or use calculator approximations: use exact arithmetic!

    a0 4, a1 3, a2 0, and an 3an1 3an2 an3, 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 MathSection 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 ` n4

    ` 14

    log4pnq

    ii) f p1q 1 and f pnq f `n5

    ` 2?n

    16) Use a generating function approach to solve the following recurrence relation:

    a0 2, a1 2, and an 2an1 ` 15an2, n 2

    Start Date: R Apr 25