



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Solutions to various mathematical problems, including proofs by the chinese remainder theorem, fermat's little theorem, and the binomial theorem. The problems cover topics such as equivalence relations, carmichael numbers, sums of consecutive integers, and probabilities.
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!




(a) {(0, 0 , ), (1, 1), (2, 2), (3, 3)} (b) {(0, 0), (0, 1), (1, 0), (1, 1)}. Solution: (a) is an equivalence relation, since it is reflexive, symmetric, and transitive. (b) is not an equivalence relation, since it is not reflexive; neither (2,2) nor (3,3) are in the relation. (It is symmetric and transitive; you got one point if you said that, even if you didn’t get the right answer.) Grading: Basically, 1 point for the correct answer and 1 point for the reason. For (b), 1 point was given for the wrong answer if you said it was symmetric and transitive.
Grading: This one was hard for most people. You got 1 point for saying “pigeon hole”; 1 point for mentioning the trivial case where one of n 1 ,... , n 6 ≡ 0 (mod 6); 1 point for saying that two of the sequences from n 1 , n 1 + n 2 ,... n 1 + · · · + n 6 must be congruent mod 6; and 1 point for saying their difference must be congruent to 0 mod 6. No points were given for showing that the sum of 6 consecutive numbers is always divisible by 6. No points were given for listing pairs, triplets, etc of numbers that could not be used.
(2x −
x^2
k=
k
(2x)k(−
x^2 )^58 −k^ =
k=
k
2 k(−3)^58 −kxk−2(58−k).
k −2(58−k) = 25 iff 3k −116 = 25 iff k = 47. Thus, the coefficient of x^25 is
47
Grading: 2 points for using the binomial expansion; 2 points for getting k = 47 or k = 11; 1 point for getting the right answer.
Solution: We proceed by induction. Let P (n) be the statement that 3n^ ≥ n^3. P (3) is obviously true, since 3^3 = 3^3. Suppose that P (k) is true for k ≥ 3. That is, assume that 3k^ ≥ k^3. We want to show that 3k+1^ > (k + 1)^3. By the Binomial Theorem, (k + 1)^3 = k^3 + 3k^2 + 3k + 1. Since k ≥ 3, it follows that
Thus, (k + 1)^3 ≤ k^3 + 3k^2 + 3k + 1 ≤ 3 k^3. By the induction hypothesis, k^3 ≤ 3 k, so (k + 1)^3 l 33 k^ = 3k+1. This completes the induction proof. Grading: Here we used the standard induction grading scheme. 1 point for stating the induction hypothesis; 1 point for the base case; 1 point for the conclusion; 2 points for an appropriate use of the inductive hypothesis.
Solution: There are
3
ways of choosing the kings and
2
ways of choosing the re- maining two cards, so there are ( 4 3
ways altogether. (See the next problem for grading comments.)
(c) A sum of Bernoulli random variables is a binomial random variable. Solution: False. For example, take X + X, where X is Bernoulli. This is not a binomial random variable. This actually is true if all the Bernoulli random variables are iid (independent and identically distributed).
(d) If X and Y are independent then V (X + Y ) = V (X) + V (Y ).
Solution: True. This was done in class, but here’s a formal proof:
V (X + Y ) = E((X + Y )^2 ) − E(X + Y )^2 = E(X^2 + 2XY + Y 2 ) − (E(X)^2 + 2E(X)E(Y ) − E( = (E(X^2 ) − E(X)^2 ) + (E(Y 2 ) − E(Y )^2 ) + 2E(XY ) − E(X)E(Y ) = V (X) + V (Y ).
Here I’m using the fact that if X and Y are independent, then E(XY ) = E(X)E(Y ). (e) If a is a real number and X is a random variable, then V (aX) = aV (X). Solution: False. V (aX) = a^2 V (X). (Proof: V (aX) = E((aX)^2 ) − (E(aX))^2 = a^2 E(X^2 ) − a^2 E(X)^2 = a^2 V (X).) (f) If X and Y are not independent then E(X + Y ) 6 = E(X) + E(Y ). Solution: False. E(X + Y ) = E(X) + E(Y ) whether or not XR and Y are inde- pendent. (g) If A and B are independent events then Pr(A ∪ B) = Pr(A) + Pr(B). Solution: False. Pr(A ∪ B) = Pr(A) + Pr(B) − Pr(A ∩ B). If A and B are independent, then Pr(A ∩ B) = Pr(A) Pr(B), but it does not equal 0 in general.
(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. Solution: True. (This is Chebyshev’s inequality, using the fact that X is a binomial random variable, with p = .2 and n = 100. Thus, E(X) = 20, V ar(X) = np(1−p) = 16, and σX = 4. Note that Pr(X ≥ 60) = Pr(|X − 20 | ≥ 40), and 40 = 10σX. Thus, Pr(X ≥ 60) ≤ 1 /100.) (i) Let Tn be the number of times a fair coin lands heads after being flipped n times. Then
nlim→∞ Pr
Tn n
Solution: True. The Law of Large numbers says that for all ,
lim n→∞ Pr
Tn n
(j) Taking Tn as above, lim n→∞ Pr
2 Tn − n √ n
Solution: False. By the Central Limit Theorem, the required limit is the area under the curve of the Gaussian distribution, between -1 and 1. Although it is close to 1, it is not 1.
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. Solution: The loop invariant is that before the kth iteration, factorial = k! and i = k. We prove this by induction, taking P (k) to be the statement of the loop invariant. The base case is obvious, since initially factorial = 1 and i = 1. Suppose that P (k) holds; we prove P (k + 1). Clearly during the (k + 1)st interation, i is set to i + 1, which is k + 1, given the inductive hypothesis, and factorial is then set to i ∗ factorial, which is (k + 1)k! = (k + 1)!. This completes the inductive proof. It follows that before the nth iteration, i = n and factorial = n!. The program then terminates, since it is not the case that i < n. Grading: It’s fine to say that the loop invariant is factorial = i!, but then you have to be really careful to state your inductive hypothesis. Remember that if P (k) is your inductive hypothesis, it should have a k in it. Saying P (k) is factorial = i! lost you one
(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.
Solution:
(a) ∀x¬K(x, Alice) (or ¬∃xK(x, Alice)). (b) ∀xK(Sam, x). (c) ∃x¬K(Sam, x). (d) ∀x∃yK(x, y). (e) ∀x(K(David, x) ⇒ K(Sam, x)).
Grading: Each part got one point. Half a point was taken off for mixing up existential and universal quantifiers, if this mistake was made more than once; we tried not to penalize you for it each time. In general, the biggest mistake was people putting quantifiers inside predicates. (It’s not OK to write K(x, ∃y), for example.)