Review sheet for test 3 - EECS People Web Server

advertisement
EECS 210
Review for Test 3
Spring 2015
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 notes on the web. 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. The test will also cover relations, partial
orders and equivalence relations. Test 3 is Wednesday April 29 at 5:50 in 330 Strong.
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 { (m, n) m and are integers and m + n is even}.
Prove that R is an equivalence relation
4. Consider the following three relations. For each relation, place its number in the blank to
the left of each property it satisfies.
Relation 1: R = {(a, b) N  N | a + b is even}
Relation 2: R = {(a, b) | a, b  Z and |a - b|  1}
Relation 3: R = 
____________ Reflexive ____________ Symmetric
____________ Transitive
____________ Irreflexive ____________ Antisymmetric ____________ Asymmetric
5. If possible, give an example of a relation R on S = {a, b, c} with exactly 3 elements that is
both symmetric and transitive but not reflexive. If it’s not possible, explain why not.
6. 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.
7. Using the standard alphabet and allowing repetition of letters, find the number of words
of length 8 that are palindromes.
8. If C(n, 8) = C(n, 5) then n = _____________
9. 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?
10. How many three-digit numbers are there in which the sum of the digits is even?
11. 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
12. 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?
13. 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?
14. 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?
15. 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?
16. Matching exactly three white balls in the powerball lottery wins a prize. How many
powerball tickets are there for which exactly three white balls (and not the powerball) are
matched?
17. 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.
18. Always, Sometimes or Never: If f(x)  O(g(x)) then f(x)  (g(x)).
19. 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