Download Here

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CS280, Spring 2004: Final
This exam is out of 70; the amount for each question is as marked. Clearly explain your
reasoning. (Remember, we can’t read your mind! Besides, it gives us a chance to give you
partial credit.) Don’t forget to put your name and student number on each blue book you use.
You can answer the questions in any order, just as long as you mark clearly which question
you’re answering. A good strategy is to do the ones you find easiest first.
Exams should be available next Tuesday or Wednesday; your grades will be posted on the
CMS then too. You can pick up your exam in 4146 Upson after they’re graded. We’ll send out
a message when that’s done.
Good luck!
1. [4 points] Which of the following relations on {0, 1, 2, 3} is an equivalence relation. (If it is,
explain why. If it isn’t, explain why not.) Just saying “Yes” or “No” with no explanation
gets 0 points.)
(a) {(0, 0, ), (1, 1), (2, 2), (3, 3)}
(b) {(0, 0), (0, 1), (1, 0), (1, 1)}.
2. [5 points] Recall that a composite n is a Carmichael number if for any b relatively prime to
n, bn−1 ≡ 1 (mod n). Show that 1105 is a Carmichael number. [Hint: 1105 = 5 · 13 · 17.]
3. [4 points] Consider any six natural numbers n1 , . . . , n6 . Show that the sum of some
subsequence of consecutive numbers is divisible by 6 (e.g., perhaps n3 +n4 +n5 is divisible
by 6, or n4 itself is divisible by 6, or n2 + n3 is divisible by 6). [Hint: Look at the sums
0, n1 , n1 + n2 , n1 + n2 + n3 , . . . , n1 + n2 + · · · + n6 , and think in terms of mod 6.]
4. [5 points] What is the coefficient of x25 in the binomial expansion of (2x − x32 )58 ? (There’s
no need to simplify the expression.)
5. [5 points] Prove that 3n ≥ n3 for all n ≥ 3.
6. [3 points] How many 5-card hands have exactly 3 kings?
7. [4 points] A committee of 7 is to be chosen from 8 men and 9 women. How many contain
either Alice or Bob, but not both? [You do not have to simplify the expression that you
get.]
8. [5 points] There are N different types of coupons. Each time a coupon collector obtains
a coupon it is equally likely to be any one of those. What is the probability that the
collector needs more than k (k > N ) coupons to complete his collection (have at least
one of each type of coupon)? (You do not have to simplify the expression that you get.)
[Hint: In other words, what is the probability that at least one type coupon is missing
among the first k coupons.]
1
9. [10 points] For each of the following clearly answer yes or no (no justification is needed
nor will it help you). If you answer correctly you get +1 but if you give the wrong answer
you get -1 points. A skipped item earns 0 points. In any case the overall grade for this
particular problem will not be less than zero.
(a) If A and B are disjoint events then they are independent.
(b) If A and B are independent events, then so are A and B.
(c) A sum of Bernoulli random variables is a binomial random variable.
(d) If X and Y are independent then V (X + Y ) = V (X) + V (Y ).
(e) If a is a real number and X is a random variable, then V (aX) = aV (X).
(f) If X and Y are not independent then E(X + Y ) 6= E(X) + E(Y ).
(g) If A and B are independent events then Pr(A ∪ B) = Pr(A) + Pr(B).
(h) Suppose that you have a coin that has probability .2 of landing heads, and you
toss it 100 times. Let X be the number of times that the coin lands heads. Then
P r(X ≥ 60) ≤ 1/100.
(i) Let Tn be the number of times a fair coin lands heads after being flipped n times.
Then
Tn 1 lim Pr − < .01 = 1.
n→∞
n
2
(j) Taking Tn as above,
2Tn − n < .01 = 1.
lim Pr √
n→∞
n 10. [4 points] There are three cards. The first is red on both sides; the second is black on both
sides; and the third is red on one side and black on the other side. A card is randomly
selected and randomly placed on the table. The color that we see is red. What is the
probability that the hidden side is black?
11. [4 points] Two fair dice are rolled. What is the probability at least one lands on 6 given
that the dice land on different numbers?
12. [5 points]
Input: n (a positive integer)
factorial ← 1
i←1
while i < n do
i←i+1
factorial ← i ∗ factorial
Prove that the program terminates with factorial = n! given input n, using an appropriate
loop invariant.
2
13. [7 points] Translate the following argument into propositional logic, then determine whether
it is valid. (Remember that an argument is valid if, whenever the premises are true, the
conclusion is true.)
If I like mathematics, then I will study.
Either I don’t study or I pass mathematics.
If I don’t graduate, then I didn’t pass mathematics.
If I like mathematics, then I will graduate
[3 points for the translation, and 4 points for proving that it is valid or not valid.]
14. [5 points] Suppose that K(x, y) “x knows (i.e., is acquainted with) y”. Translate each of
the following sentences into first-order logic:
(a) Nobody knows Alice.
(b) Sam knows everyone.
(c) There is someone that Sam doesn’t know.
(d) Everyone knows someone.
(e) Sam knows everyone that David knows.
3