

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


These problems should not be turned in. They are to help you review for the final.
(a) Let M = {a, b, c, d}. How many different partitions of M are there? (b) In the game Tic-tac-toe (played on the usual 3 by 3 grid), how many different board configurations are possible after four moves (i.e. two moves by each player)? (c) Suppose we have a state diagram with n states and k different actions. In how many different ways could we construct a transition function for this diagram?
01 Gnarly (a 1 ,... , an: array of integers) 02 if (n = 1) return true 03 else if (n = 2) 04 if (a 1 = a 2 ) return true 05 else return false 06 else if (Gnarly(a 1 ,... , an− 1 ) and Gnarly(a 2 ,... , an)) return true 07 else return false (a) If Gnarly returns true, what must be true of the values in the input array? Briefly justify your answer. (b) Express T (n), the running time of Gnarly on an input of length n, as a recurrence. Be sure to include an initial condition. (c) Give a big-theta bound on the running time of Gnarly. For full credit, you must show work or briefly explain your answer.
(a) Suppose a set S has 11 elements. How many subsets of S have an even number of elements? Express your answer as a summation. (You do not need to simplify expressions involving permutations and/or combinations.) (b) If x, y, z ∈ N, how many solutions are there to the equation x + y + z = 25? (c) Suppose that A is a set containing p elements and B is a set containing n elements. How many functions are there from A to P(B)? How many of these functions are one-to-one?
(a) How many terms are contained in (x + y + z)^30 after carrying out all multiplications, but before collecting like terms? (b) How many terms are contained in (x + y + z)^30 after carrying out all multiplications and collecting like terms? (c) What is the coefficient of the x^15 y^6 z^9 term? (You may leave you answer in terms of factorials!)
Suppose you were given the following sets:
A = {Vine, Tree, Shrub} B = {{Tree}} C = {Vine, Moss} D = {Red, Green} E = {Red}
For the following expressions, list the elements of the set or give the cardinality (as appropriate):
(a) D × C (b) P(B ∪ E) (c) |A × P(A ∪ D) | (d) {S ∈ P(A ∪ D) : |S| is a multiple of 4} (e) P(P(P(∅)))
(a) Suppose that G is an undirected connected simple planar graph with 10 vertices, all of degree 4. How many edges does it have? Use Euler’s formula and the Handshaking Theorem to calculate how many regions it has. (b) Show that this graph is planar by redrawing it without crossings: