Test 3 review answers - EECS People Web Server

advertisement
EECS 210
Review for Test 3
Fall 2014
Here’s a review sheet for test 3. As usual it’s not necessarily designed to be all inclusive. I
did not include any big-O or big- proofs since they appear in the notes on the web and
discussion sheets. Go back through your discussion worksheets and homework while
preparing for the test. Also, look at the discussion notes for examples done during the
discussions. You are responsible for all counting material covered in class and discussion up
to and including section 5.3. Test 3 is Tuesday, December 2 at 6:00 p.m. in 130 Budig.
If you want more practice on counting, go to the online text. The relevant material is in
sections 9.2 – 9.4. Try exercises 9.2.2, 9.2.4, 9.3.4, and 9.4.5.
1. Prove or disprove that if R is a transitive relation on set A, then R' is also transitive.
2. Find the smallest partial order on {a, b, c} that contains {(b, b), (b, a), (a, c)}.
3. Let R be the relation on the positive integers by (m, n)  R if m + n is even.
Prove that R is an equivalence relation
4. An ice cream parlor offers 6 toppings for its sundaes. A customer can choose as many or
as few of the toppings as desired. If you eat one sundae each Sunday, how many
Sundays will it take to try each topping combination. (At least one topping must be used.)
The order in which the toppings are put on the sundae doesn’t matter.
5. Using the standard alphabet and allowing repetition of letters, find the number of words
of length 8 that are palindromes.
6. If C(n, 8) = C(n, 5) then n = _____________
7. Consider the set of bit strings of length 10. How many
a. contain exactly three 0's?
b. begin or end with 0
c. contain at least two 0's?
8. How many three-digit numbers are there in which the sum of the digits is even?
9. A group of n men and n women are arranged in a row. The number of arrangements with
a. the men and women in any order is _______
b. the men and women in alternate places is
c. The men occupying n consecutive seats
10. Consider the set {1, 2, …, 12}.
a. How many subsets contain only even numbers?
b. How many subsets contain 3 and 5 but not 7?
c. How many subsets of size 6 contain at least two odd numbers?
d. In how many 6-element subsets of S is 3 the smallest element?
11. A coin is tossed eight times. An outcome is string of length 8 made up of H’s and T’s.
a. How many outcomes have a head (H) on the fifth toss?
b. How many outcomes have equal numbers of heads and tails?
12. A class contains 30 students--10 freshmen, 12 sophomores and 8 juniors.
a. How many 3-member committees contain exactly one person from each class?
b. How many 4-member committees contain at least one person from each class?
c. How many ways are there to arrange the students in a line so that all the freshmen are
together at the front of the line?
d. How many ways are there to arrange the students if all students from the same class
stand together?
13. Consider 5-card hands selected from a deck of 52 cards. How many hands
a. contain no face cards (Aces are not face cards)?
b. contain only face cards?
c. contain three cards of one suit and one each of two other suits?
d. contain exactly two queens and exactly three spades?
14. Write a pseudocode algorithm that returns the index of the first item that is greater than its
predecessor in the array[a1, a2, ..an]. Output 0 if the numbers are in nonincreasing order.
Give the number of comparisons made in the best and worst cases.
15. Always, Sometimes or Never: If f(x)  O(g(x)) then f(x)  (g(x)).
16. Using the definition of big-O prove or disprove that f(x)  O(g(x)) where f(x) = 3x2 + 5x and
g(x) = 7x.
Download