CS 70 Discrete Mathematics and Probability Theory Summer 2016 Dinh, Psomas, and Ye Final Exam

Similar documents
Midterm 2. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

Discrete Mathematics and Probability Theory Fall 2017 Ramchandran and Rao Midterm 2 Solutions

EECS 70 Discrete Mathematics and Probability Theory Fall 2015 Walrand/Rao Final

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

Discrete Mathematics and Probability Theory Summer 2015 Chung-Wei Lin Midterm 2

Discrete Mathematics and Probability Theory Summer 2015 Chung-Wei Lin Midterm 1

CS 70 Discrete Mathematics and Probability Theory Spring 2018 Ayazifar and Rao Final

Discrete Mathematics and Probability Theory Spring 2015 Vazirani Midterm #2 Solution

Midterm Exam 1 (Solutions)

Discrete Mathematics and Probability Theory Spring 2017 Rao Midterm 2 Solutions

2. Polynomials. 19 points. 3/3/3/3/3/4 Clearly indicate your correctly formatted answer: this is what is to be graded. No need to justify!

Discrete Mathematics and Probability Theory Summer 2014 James Cook Final Exam

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1 (Version B)

EECS 126 Probability and Random Processes University of California, Berkeley: Fall 2014 Kannan Ramchandran November 13, 2014.

CS280, Spring 2004: Final

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Midterm 2

Midterm Exam 1 Solution

(Practice Version) Midterm Exam 2

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2017 Kannan Ramchandran March 21, 2017.

4. What is the probability that the two values differ by 4 or more in absolute value? There are only six

Discrete Mathematics for CS Fall 2003 Wagner MT2 Soln

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1

Midterm Exam 2 (Solutions)

Disjointness and Additivity

CS 170 Algorithms Spring 2009 David Wagner Final

Midterm 2 Review. CS70 Summer Lecture 6D. David Dinh 28 July UC Berkeley

CS 70 Discrete Mathematics and Probability Theory Summer 2016 Dinh, Psomas, and Ye Discussion 8A Sol

COS 341: Discrete Mathematics

Midterm 1. Total. CS70 Discrete Mathematics and Probability Theory, Spring :00-9:00pm, 1 March. Instructions:

Discrete Mathematics and Probability Theory Spring 2015 Vazirani Final Exam Solution

EECS 126 Probability and Random Processes University of California, Berkeley: Fall 2014 Kannan Ramchandran September 23, 2014.

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2018 Kannan Ramchandran February 14, 2018.

University of New Mexico Department of Computer Science. Midterm Examination. CS 261 Mathematical Foundations of Computer Science Spring, 2010

Prob. 1 Prob. 2 Prob. 3 Total

Coding for Digital Communication and Beyond Fall 2013 Anant Sahai MT 1

CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Nov 30. Final In-Class Exam. ( 7:05 PM 8:20 PM : 75 Minutes )

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Designing Information Devices and Systems I Spring 2018 Midterm 1. Exam Location: 155 Dwinelle Last Name: Cheng - Lazich

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculty of Mathematics and Computer Science Exam Cryptology, Tuesday 30 October 2018

Designing Information Devices and Systems I Fall 2017 Midterm 2. Exam Location: 150 Wheeler, Last Name: Nguyen - ZZZ

Prob. 1 Prob. 2 Prob. 3 Total

COMPSCI 611 Advanced Algorithms Second Midterm Exam Fall 2017

Discrete Structures Prelim 1 Selected problems from past exams

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculty of Mathematics and Computer Science Exam Cryptology, Friday 25 January 2019

COMPSCI 611 Advanced Algorithms Second Midterm Exam Fall 2017

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 11. Error Correcting Codes Erasure Errors

Midterm 1. Name: TA: U.C. Berkeley CS70 : Algorithms Midterm 1 Lecturers: Anant Sahai & Christos Papadimitriou October 15, 2008

CMSC Discrete Mathematics FINAL EXAM Tuesday, December 5, 2017, 10:30-12:30

Final Examination. Your name: Circle the name of your Tutorial Instructor: David Hanson Jelani Sayan

Randomized Algorithms

CS483 Design and Analysis of Algorithms

ECS 189A Final Cryptography Spring 2011

Math 223, Spring 2009 Final Exam Solutions

Discrete Mathematics and Probability Theory Fall 2017 Ramchandran and Rao Final Solutions

2. This exam consists of 15 questions. The rst nine questions are multiple choice Q10 requires two

Discrete Mathematics and Probability Theory Summer 2014 James Cook Final Exam

Math 407: Probability Theory 5/10/ Final exam (11am - 1pm)

Math 51 Midterm 1 July 6, 2016

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

Question: Total Points: Score:

STAT 516 Midterm Exam 2 Friday, March 7, 2008

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Univ.-Prof. Dr. rer. nat. Rudolf Mathar. Written Examination. Cryptography. Tuesday, August 29, 2017, 01:30 p.m.

Carleton University. Final Examination Fall DURATION: 2 HOURS No. of students: 223

Guidelines for Solving Probability Problems

9.1 HW (3+3+8 points) (Knapsack decision problem NP-complete)

University of Regina Department of Mathematics & Statistics Final Examination (April 21, 2009)

Homework 1 Submission

MATH 158 FINAL EXAM 20 DECEMBER 2016

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2015 Abhay Parekh February 17, 2015.

Math 230 Final Exam, Spring 2009

Simple Math: Cryptography

Quiz 1 Date: Monday, October 17, 2016

1 Basic continuous random variable problems

UC Berkeley, CS 174: Combinatorics and Discrete Probability (Fall 2008) Midterm 1. October 7, 2008

9.2 Multiplication Properties of Radicals

Statistics 253/317 Introduction to Probability Models. Winter Midterm Exam Friday, Feb 8, 2013

Today. Wrapup of Polynomials...and modular arithmetic. Coutability and Uncountability.

Do not open this exam until you are told to begin. You will have 75 minutes for the exam.

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 6

Discrete Event Systems Exam

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Final Exam. Exam location: RSF Fieldhouse, Back Left, last SID 6, 8, 9

STAT/MA 416 Midterm Exam 3 Monday, November 19, Circle the section you are enrolled in:

basics of security/cryptography

Part I: Discrete Math.

The remains of the course

Math.3336: Discrete Mathematics. Mathematical Induction

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Mathematics of Cryptography

Discrete Mathematics

CS 246 Review of Proof Techniques and Probability 01/14/19

Banneker Middle School. Summer Math Packet C2.0 Algebra 1

Discrete Mathematics and Probability Theory Fall 2010 Tse/Wagner MT 2 Soln

6.042/18.062J Mathematics for Computer Science March 9, 2005 Srini Devadas and Eric Lehman. Quiz 1. Ishan Christos Grant

Lecture 15 and 16: BCH Codes: Error Correction

Candidates must show on each answer book the type of calculator used. Only calculators permitted under UEA Regulations may be used.

X = X X n, + X 2

CS103 Handout 22 Fall 2012 November 30, 2012 Problem Set 9

ECE 302 Division 2 Exam 2 Solutions, 11/4/2009.

Transcription:

CS 70 Discrete Mathematics and Probability Theory Summer 2016 Dinh, Psomas, and Ye Final Exam PRINT Your Name:, (last) By signing below, I agree that (a) I will not give or receive help from others during the exam, (b) that I will not use any electronic devices or other prohibited resources during the exam, and (c) that I will not discuss or disclose the contents of the exam before 2:30 PM PDT on Friday, August 12 2016. (first) SIGN Your Name: DATE: PRINT Your Student ID: CIRCLE your exam room: 1 Pimentel 120 Latimer 540 Cory 293 Cory Other Name of the person sitting to your left: Name of the person sitting to your right: After the exam starts, please write your student ID (or name) on every sheet (we will remove the staple when scanning your exam). We will not grade anything outside of the space provided for a problem unless we are clearly told in the space provided for the question to look elsewhere. You may consult three handwritten pages of notes (one double-sided sheet+one single-sided sheet; or three single-sided sheets) sheet of notes. Apart from that, you may not look at books, notes, etc. Calculators, phones, computers, and other electronic devices are not permitted. There are 28 pages (14 sheets) on the exam, including 3 pages of extra paper and an 2-page (1 sheet) equation reference at the end containing tables of distributions and bounds. Notify a proctor immediately if a page is missing. There are 10 questions on this exam, worth a total of 270 points. You may, without proof, use theorems and facts that were proven in the notes and/or in lecture. If you cannot solve a problem whose answer is required for a subsequent one, you may reference the answer to the previous problem by, for instance, saying Let y be the answer to part a". You have 170 minutes. Do not turn this page until your proctor tells you to do so. CS 70, Summer 2016, Final Exam 1

SID: 1 T/F 1 T/F (3 points each) Circle T for True or F for False. We will only grade the answers, and are unlikely to even look at any justifications or explanations. (a) T F x(p(x) Q(x)) is equivalent to ( x, P(x)) ( x, Q(x)). (b) T F x(p(x) Q(x)) is equivalent to ( x, P(x)) ( x, Q(x)). (c) T F If b c (mod d), then a b a c (mod d). (d) T F The multiplicative inverse of 3 modulo 5 is 2. (e) T F It is safe to send the number 1 using the RSA protocol. (f) T F If events A and B are independent then Pr[A B] = Pr[A]. (g) T F It is always the case that Pr[A B] Pr[A] + Pr[B] 2

SID: 1 T/F (h) T F The set of all polynomials over prime fields is countable. (i) T F It is possible to write a program that takes a program P and a string x as input and correctly returns either "P(x) definitely halts" or "P(x) may or may not loop infinitely". (j) T F Let A, B and C be 3 events. Suppose that Pr[B A] = Pr[C A], and that Pr[B] < Pr[C]. Then the probability that A happens (given that we observe B) is greater than the probability that A happens (given that we observe C). (k) T F In all stable matching problems, there are at most two stable matchings: the male optimal and the female optimal. (l) T F The probability 1 k of being k times away from the expectation, given by Markov s inequality, is never tight. In other words, there is no random variable X, such that Pr[X a] = E[X] a. (m) T F I have a coin with unknown probability p of coming up H. I flip it 100 times, and get H 50 times. If I flip the coin 1000 times, the expected number of H is 500. 3

SID: 2 SHORT ANSWERS 2 Short Answers (a) (4 points) A student retakes classes until they get a good grade, and ceases to take a class once a good grade in that class is attained. The probability that they get a good grade in class A is 1 2. The probability that they get a good grade in class B is 3 4. The probability that they get a good grade in class C with probability 4 5. How many classes should they expect to take? (b) (4 points) I have a pile of six pens, four highlighters, ten pencils, and five styluses. I pick five at random from the pile. What is the probability that I end up with at least one of each kind of writing implement? 4

SID: 2 SHORT ANSWERS (c) (4 points) What is the last digit of 2016 70? (d) (4 points) Calculate 12 136 (mod 7). (e) (4 points) Compute gcd(512,480). 5

SID: 2 SHORT ANSWERS (f) (4 points) Find a stationary distribution of the following Markov Chain (1 > p > 0): p p 0.5 A 1 p B E 1 p 1 p 0.5 0.5 0.5 C D p (g) (4 points) Let G = (V,E) be an undirected graph with V = {0,...,6} and E = {(i,i + 1 (mod 7))} {(i, j) : i j = 1 (mod 7),i j}. There are no self-loops. How many edges does the graph have? 6

SID: 2 SHORT ANSWERS (h) (4 points) You and 6 friends have a bag of 7 distinct chocolates. You have a favorite chocolate. Everyone takes turns and picks a chocolate at random, but unfortunately you pick last. What is the probability that you pick your favorite chocolate? (i) (4 points) You have a coin that has probability of coming up heads p = Pr[H] = 0.35. You flip the coin 100 times. Use CLT to get an estimate of the probability that the number of heads is more than the number of tails. You can approximate 0.35 0.65 by 0.5. You can also use the 68 95 99.7 rule. Evaluate to a number. 7

SID: 2 SHORT ANSWERS (j) (4 points) Suppose Alex and David are using Blum s coin toss scheme. Alex sends David n = pq, the product of two primes each congruent to 3 mod 4 as in the normal protocol. David is feeling lazy that day and, instead of choosing an x and sending back a = x 2, just picks random a directly. Luckily for him, a is indeed a perfect square, although he doesn t know what its square root is. Who wins the coin toss, and why? (k) (6 points) Prove or disprove: The variance of a random variable that only attains nonnegative values cannot exceed the expectation of the random variable. 8

SID: 3 SHORT PROOFS 3 Short proofs (a) (4 points) Prove that if n 2 + 2 and n 2 2 are prime, for some natural number n, then n is divisible by 3. 1 (b) (4 points) Prove that 1 2 + 1 2 3 + 1 3 4 + + 1 n(n+1) = n n+1, for all n N. 9

SID: 3 SHORT PROOFS (c) (4 points) A connected graph G is k-edge-connected, if the minimum number of edge removals necessary to make it disconnected is k. For example, trees are 1-connected, since any edge removal disconnects them. Prove or disprove: There exists a 6-edge-connected planar graph. (d) (4 points) Prove that if you put n items in k < n boxes, there is a box with at least (inclusive) n k number of items. Recall that x is the smallest number y x, such that y Z. For example, 1.9 = 2, and 3 = 3. 10

SID: 3 SHORT PROOFS (e) (4 points) Let a,b N, and let k be the smallest positive integer such that a k = 1 (mod b). Prove that if a n = 1 (mod b) then k divides n. (f) (4 points) Prove that if Alex sends a message m a to Fan, encrypted with Fan s (public) RSA key, David can send another message m d = qm a for some q of David s choice, without knowing either m a or Fan s private key, assuming he knows the (encrypted) ciphertext that Alex sent to Fan. 11

SID: 3 SHORT PROOFS (g) (4 points) Prove combinatorially that for n > 2: n 1 (n 2)! i = n! 2. i=1 Hint: How many ordered permutations of {1,2,3,...,n} are there such that 1 occurs earlier than 2? 12

SID: 4 RANDOM GRAPHS 4 Random graphs Define G n,p as a random graph with n 5 vertices, where a pair of distinct vertices (u,v) forms an edge independently with probability p (there are no self-loops). (a) (5 points) What is the probability that the path u 1 u 2 u n exists? (b) (5 points) In terms of n, p, what is the expected number of times K 5 (the complete graph of size 5) appears in G n,p as a subgraph? Note that K 5 appears 6 times in a K 6. 13

SID: 4 RANDOM GRAPHS (c) (5 points) Fix a vertex v. The degree of v is a random variable. In terms of n, p, what is the expected degree of v? (d) (5 points) What is the probability that the degree of v is equal to k? 14

SID: 4 RANDOM GRAPHS (e) (5 points) What is the variance of the degree of v? 15

SID: 5 MAGIC BOX 5 Magic Box (20 points) For your birthday you get a magic box. The box works as follows: you ask a yes or no question, and the box replies with a "YES" or a "NO". The box says the correct answer with probability 2 3. The probability that the box makes a mistake is independent of all the past and previous mistakes. You decide to use this box to figure out whether P is equal to NP. You devise the following algorithm: You ll ask the box n times whether or not P is equal to NP. The box will answer "YES" some number of times x, and "NO" some number of times y. If x y you ll conclude that P equal NP, otherwise you ll conclude that P does not equal NP. Prove that you ll arrive at the correct conclusion with probability exponentially (in n) close to 1. This means that the probability of coming to the correct conclusion is at least 1 c n, for some c < 1. You can assume that e 1 k < 1, for all k > 0. 16

SID: 6 MAGIKARPS CAN T KEEP SECRETS 6 Magikarps Can t Keep Secrets (20 points) Suppose a trainer has 100 Pokemon and wants to share a secret with them. He knows that exactly 10 of the Pokemon are Magikarps (but doesn t know which ones are Magikarps). Magikarps aren t the best at remembering things. When asked for the secrets that they were given, they ll just give an arbitrary number instead of the actual secret that they were entrusted with. Pokemon who are not Magikarps will honestly give the numbers that they were entrusted with by the trainer. The trainer wants a scheme with the following properties: Any group of 40 Pokemon can reveal the secret if they carry out the protocol correctly, even if some of them are Magikarps and reveal incorrect numbers. Anyone who obtains the correct secrets of all 10 Magikarps will not be able to recover any information about the secret. Any group of less than 40 Pokemon who get together cannot recover the secret, as long as nobody in the group knows who the Magikarps are. Devise an efficient protocol (no brute forcing) that follows these constraints, and justify why it works. 17

SID: 7 ERROR CORRECTION (WITH CODES, NOT ERASERS) 7 Error Correction (with Codes, not Erasers) Alice sends a message to Bob over a channel that corrupts k = 2 numbers. Alice computes a polynomial P and sends a number of points x, P(0),P(1),...,P(x 1), to Bob. Bob applies the Berlekamp-Welch algorithm to the message he receives and correctly recovers the message that Alice sent. The message is (2, 0, 0). Everything is GF(11). If you get an incorrect answer for (a), you can still get full credit for (b) and (c) if your math for those parts is correct. (a) (10 points) What are the points Alice sent? 18

SID: 7 ERROR CORRECTION (WITH CODES, NOT ERASERS) (b) (10 points) What is the probability that Bob received message (2,0,0,2,1,3,0)? You may assume that the channel picks 2 packets at random and corrupts them to a random number in GF(11). The new number could be the same as the old one. For example, if Alice sent (1,2,3), the channel could pick 1 and 3 and change 1 to 5 and 3 to 3, and thus Bob receives (5,2,3). (c) (10 points) What is the probability that Bob received message (2,0,0,2,6,1,9)? 19

SID: 8 SPECIAL, GENERAL, AND... PRIMAL RELATIVITY? 8 Special, General, and... Primal Relativity? (22 points) Let p and q be distinct prime numbers. Show that if you pick a number x uniformly at random between 0 and pq 1 (inclusive), then the probability that x is relatively prime to pq is (p 1)(q 1) pq. Hint: Use the Chinese remainder theorem. 20

SID: 9 CHICKEN BUSINESS 9 Chicken Business In any flock, every pair of chickens will engage in barnyard squabble to determine which of the two is dominant over the other (hence the origin of the phrase "pecking order"). In other words, for every pair of chickens i, j, either i pecks j or j pecks i. In general, pecking is not transitive, meaning that if C 1 pecks C 2, who pecks C 3, then it is not necessarily the case that C 1 pecks C 3. Define a chicken K as a king if, for any other chicken C, either K pecks C directly (which we will abbreviate as K C), or there exists a field marshal F such that K pecks F, who pecks C (denoted by K F C). We ll call the second type of pecking indirect pecking. You may assume that a king always exists. Notice that there may be multiple king chickens in a flock. For instance, if Alex pecks David, who pecks Fan, who pecks Alex, then Alex, David, and Fan are all kings. You may assume the following lemma: given a chicken C in a particular flock G, if C is pecked by other chickens, then one of the chickens that pecks C must be a king. (a) (7 points) Prove that a flock of four chickens cannot have exactly four kings. 21

SID: 9 CHICKEN BUSINESS (b) (7 points) Use the lemma to prove that no flock can have exactly two kings. (c) (7 points) Use the lemma to prove that if a flock has exactly one king, then that king must peck all the other chickens. 22

SID: 10 EXPECTED DISTANCE 10 Expected Distance (19 points) Let X and Y be two random variables in Exponential(1). X and Y are independent. Find E[ X Y ]. 23

SID: 11 EXTRA PAGES 11 Extra Pages If you use this page as extra space for answers to problems, please indicate clearly which problem(s) you are answering here, and indicate in the original space for the problem that you are continuing your work on an extra sheet. You can also use this page to give us feedback or suggestions, report cheating or other suspicious activity, or to draw doodles. 24

SID: 11 EXTRA PAGES More extra paper. If you fill this sheet up you can request extra sheets from a proctor (just make sure to write your SID on each one, and to staple the extra sheets to your exam when you submit it). 25

SID: 11 EXTRA PAGES More extra paper. If you fill this sheet up you can request extra sheets from a proctor (just make sure to write your SID on each one, and to staple the extra sheets to your exam when you submit it). 26

SID: 11 EXTRA PAGES Equation Sheet - PLEASE REMOVE THIS SHEET Discrete Distributions Bernoulli Distribution 1 with probability p, 0 with probability 1 p Expectation: p Variance: p(1 p) Binomial Distribution with parameters n, p Pr[X = k] = ( ) n k p k (1 p) n k Expectation: np Variance: np(1 p) Geometric Distribution with parameters p Pr[X = k] = (1 p) k 1 p Expectation: 1/p Variance: 1 p p 2 Uniform Distribution with parameters a,b (a b) Pr[X = k] = 1 b a+1 for k [a,b], 0 otherwise. Expectation: (a + b)/2 Variance: (b a+1)2 1 12 Poisson Distribution with parameter λ Pr[X = k] = λ k e λ k! Expectation: λ Variance: λ Continuous Distributions Uniform Distribution with parameters a,b (a < b). 1 PDF: b a for x [a,b], 0 otherwise. Expectation: (a + b)/2 27

SID: 11 EXTRA PAGES Variance: (b a)2 12 Exponential Distribution with parameter λ PDF: λe λx for x > 0, 0 otherwise Expectation: 1/λ Variance: 1/λ 2 Normal Distribution with parameters µ, σ 2 (x µ)2 1 PDF: 2σ 2 e 2σ 2 π Expectation: µ Variance: σ 2 Chernoff Bounds Theorem: Let X 1,...,X n be independent indicator random variables such that Pr[X i = 1] = p i, and Pr[X i = 0] = 1 p i. Let X = n i=1 X i and µ = E[X]. Then the following Chernoff bounds hold: For any δ > 0 : For any 1 > δ > 0 : For any 1 > δ > 0: For any 1 > δ > 0: For R > 6µ: ( e δ Pr[X (1 + δ)µ] (1 + δ) (1+δ) ( e δ Pr[X (1 δ)µ] (1 δ) (1 δ) Pr[X (1 + δ)µ] e µδ2 3 Pr[X (1 δ)µ] e µδ2 2 Pr[X R] 2 R ) µ ) µ Please remove this sheet before submitting. 28