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:

Similar documents
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 Fall 2017 Ramchandran and Rao Midterm 2 Solutions

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

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

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 Spring 2015 Vazirani Midterm #2 Solution

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

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

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

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

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1

Discrete Mathematics and Probability Theory Spring 2017 Rao Midterm 2 Solutions

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

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

Lecture 22: RSA Encryption. RSA Encryption

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

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Midterm 2

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

Discrete Mathematics and Probability Theory Summer 2014 James Cook Final Exam

CS1800 Discrete Structures Fall 2017 October, CS1800 Discrete Structures Midterm Version A

Midterm Exam 1 Solution

Introduction to Cryptography Lecture 13

Solution to Midterm Examination

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

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

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

Lecture 21: Midterm 2 Review.

CS1800 Discrete Structures Final Version A

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 27 October, CS1800 Discrete Structures Midterm Version A

Modular Arithmetic Inverses and GCD

Discrete Mathematics for CS Fall 2003 Wagner MT2 Soln

MATH UN Midterm 2 November 10, 2016 (75 minutes)

Midterm 1 for CS 170

Midterm Exam 1 (Solutions)

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

Name: Mathematics 1C03

Discrete Mathematics and Probability Theory Spring 2015 Vazirani Final Exam Solution

Question: Total Points: Score:

CS1800 Discrete Structures Fall 2016 Profs. Gold & Schnyder April 25, CS1800 Discrete Structures Final

MATH 158 FINAL EXAM 20 DECEMBER 2016

6.041/6.431 Spring 2009 Quiz 1 Wednesday, March 11, 7:30-9:30 PM. SOLUTIONS

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

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

CS120, Quantum Cryptography, Fall 2016

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

CS 170 Algorithms Spring 2009 David Wagner Final

CS1800 Discrete Structures Spring 2018 February CS1800 Discrete Structures Midterm Version A

STAT 311 Practice Exam 2 Key Spring 2016 INSTRUCTIONS

Cryptography. P. Danziger. Transmit...Bob...

Lecture 1: Introduction to Public key cryptography

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

Georgia Tech High School Math Competition

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 6

Quiz 1 Date: Monday, October 17, 2016

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

Simple Math: Cryptography

Discrete Probability

Discrete Mathematics GCD, LCM, RSA Algorithm

Theory of Computation Chapter 12: Cryptography

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

Solutions to the Midterm Test (March 5, 2011)

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

Exam 1. Problem 1: True or false

Lecture 1: Perfect Secrecy and Statistical Authentication. 2 Introduction - Historical vs Modern Cryptography

Name: Exam 2 Solutions. March 13, 2017

Solutions to the Mathematics Masters Examination

Math.3336: Discrete Mathematics. Mathematical Induction

CMPSCI 311: Introduction to Algorithms Second Midterm Exam

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

Efficient Algorithms and Intractable Problems Spring 2016 Alessandro Chiesa and Umesh Vazirani Midterm 2

Problems for 2.6 and 2.7

The Laws of Cryptography Zero-Knowledge Protocols

Prob. 1 Prob. 2 Prob. 3 Total

PERFECT SECRECY AND ADVERSARIAL INDISTINGUISHABILITY

Prob. 1 Prob. 2 Prob. 3 Total

Notes 10: Public-key cryptography

Previous Exam Questions, Chapter 2

CHALMERS GÖTEBORGS UNIVERSITET. TDA352 (Chalmers) - DIT250 (GU) 11 April 2017, 8:30-12:30

Designing Information Devices and Systems I Fall 2017 Midterm 1. Exam Location: 155 Dwinelle

Introduction to Modern Cryptography. Benny Chor

Notes for Lecture 17

Math 51 Midterm 1 July 6, 2016

ECS 189A Final Cryptography Spring 2011

Final Examination. Adrian Georgi Josh Karen Lee Min Nikos Tina. There are 12 problems totaling 150 points. Total time is 170 minutes.

University of Illinois ECE 313: Final Exam Fall 2014

Cryptography and Security Final Exam

CS/MATH 111 Winter 2013 Final Test

1. When applied to an affected person, the test comes up positive in 90% of cases, and negative in 10% (these are called false negatives ).

Introduction to Probability 2017/18 Supplementary Problems

Statistics 100 Exam 2 March 8, 2017

Fall 2016 Test 1 with Solutions

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

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

Lecture 3,4: Multiparty Computation

Practice Exam Winter 2018, CS 485/585 Crypto March 14, 2018

Selected problems from past exams and a few additional problems

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 14

Lecture 38: Secure Multi-party Computation MPC

Cryptography and Security Final Exam

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points

Transcription:

CS70 Discrete Mathematics and Probability Theory, Fall 2018 Midterm 2 8:00-10:00pm, 31 October Your First Name: SIGN Your Name: Your Last Name: Your SID Number: 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: Name of Person Sitting Behind You: Instructions: (a) As soon as the exam starts, please write your student ID in the space provided at the top of every page! (We will remove the staple when scanning your exam.) (b) There are 6 double-sided sheets (11 numbered pages) on the exam. Notify a proctor immediately if a sheet is missing. Do not write any answers on page 12; it will not be scanned. (c) We will not grade anything outside of the space provided for a question (i.e., either a designated box if it is provided, or otherwise the white space immediately below the question). Be sure to write your full answer in the box or space provided! Scratch paper is provided on request; however, please bear in mind that nothing you write on scratch paper will be graded! (d) The questions vary in difficulty, so if you get stuck on any question it may help to leave it and return to it later. (e) On questions 1-2: You must give the answer in the format requested (e.g., True/False, an expression, a statement.) An expression may simply be a number or an expression with a relevant variable in it. For short answer questions, correct, clearly identified answers will receive full credit with no justification. Incorrect answers may receive partial credit. (f) On questions 3-6, you should give arguments, proofs or clear descriptions if requested. If there is a box you must use it for your answer. (g) You may consult one two-sided cheat sheet of notes. Apart from that, you may not look at any other materials. Calculators, phones, computers, and other electronic devices are NOT permitted. (h) You may, without proof, use theorems and lemmas that were proven in the notes and/or in lecture. (i) You have 120 minutes: there are 6 questions on this exam worth a total of 128 points. [exam starts on next page]

1. True/False [No justification; answer by shading the correct bubble. 2 points per answer; total of 26 points. No penalty for incorrect answers.] (a) Are the following sets countable? Answer YES or NO for each set by shading the appropriate bubble. YES NO The set of all functions from N to {0, 1}. The set of all finite subsets of N. The set of all irrational numbers in the interval [0, 1]. The set of all possible Google search terms. The set of all undirected graphs with a finite number of vertices. 2pts 2pts 2pts 2pts 2pts TRUE FALSE (b) Answer each of the following questions TRUE or FALSE by shading the appropriate bubble. Any two distinct polynomials, each of degree at most d, can have at most d points in common. 2pts Every function over GF(p) can be represented as a polynomial of degree at most p 1. 2pts There exists a fixed computer program P such that no program can decide for any given input x 2pts whether P halts on x. For any two sets A and B, if there exists an injection f : A B and a surjection g : B A, 2pts then A = B. For any two sets A and B, if there exists an injection f : A B and an injection g : B A, 2pts then A = B. For any two finite sets A and B, if there exists a surjection f : A B such that f 1 (x) = m 2pts for all x B, then A = m B. (Here f 1 (x) denotes the preimage of x.) Let A and B be events on the same probability space, and suppose P[A] = 3 4 and P[B] = 1 2. Then 2pts it must be the case that 1 4 P[A B] 1 2. Consider a fair coin and a biased coin. One of the two coins is chosen at random and tossed twice. 2pts The outcomes of the two tosses are independent. Page 2

2. Short Answers [Answer is a single number or expression; write it in the box provided: anything outside the box will not be graded; no justification necessary. 3 points per answer; total of 45 points. No penalty for incorrect answers.] (a) Suppose that P (x) is a real polynomial of degree 2 that has zeros at x = 0 and x = 2 and also passes through the point (1, 1). What is the value of P (3)? (b) How many polynomials over GF(17) of degree at most 5 pass through the points (0, 0), (1, 3) and (2, 5)? (You may leave your answer as an unevaluated expression.) (c) A message consisting of n = 3 packets, each of which is an integer mod 11, is transmitted over an unreliable channel. We use the Berlekamp-Welch encoding scheme (over GF(11)) to protect against k = 1 error. The n + 2k = 5 packets received are (1, 1), (2, 2), (3, 0), (4, 2), (5, 8). After running the interpolation procedure, we recover the error polynomial E(x) = x 1 and the product polynomial Q(x) = P (x)e(x) = 2x 3 + 8x 2 + 8x + 4. Answer the following two questions. (i) Which one of the five received packets was (possibly) corrupted? (ii) What was the original value of the corrupted packet? (d) Alice and Bob are playing poker using a standard deck of cards. How many ways are there to deal 5 cards each to Alice and Bob (where the order of the cards does not matter)? (e) How many permutations of {1,..., n} are there with exactly k fixed points, where 1 k < n? Express your answer in terms of D m, the number of derangements of {1,..., m}. [Q2 continued on next page] Page 3

(f) Suppose a random number generator returns a number in {0, 1,..., 9} with uniform probability, and you run it 100 times to generate a 100-digit number (possibly with leading zeros). (i) What is the probability that the 100-digit number contains the digit 7 more than 50 times? (You should leave your answer as a summation.) (ii) What is the probability that the 100-digit number contains either no 0-digits or no 1-digits? (You should leave your answer as an unevaluated expression.) (g) You have a fair 6-sided die, and also a loaded 6-sided die that shows 6 with probability 1/2 and 1, 2, 3, 4, 5 with probability 1/10 each. One of the two dice is chosen uniformly at random and rolled once. Let A be the event that 6 is observed. (i) What is P[A]? (ii) What is P[ Loaded die was chosen A ]? (h) Let X Bernoulli( 1 2 ) and let Y be a random variable with probability distribution P[Y = 1] = 1 2 and P[Y = 2] = 1 2. Assuming that X, Y are independent, find P[X < Y ]. (i) Let X be a random variable with probability distribution P[X = 8] = 1 4, P[X = 4] = 1 2, P[X = 4] = 1 4. Find E[ 2X]. [Q2 continued on next page] Page 4

(j) Suppose m balls are thrown uniformly at random into n bins (one ball at a time). What is the expected number of bins that have exactly one ball in them? (k) The problem Finite takes as input a program P and decides whether the set of inputs on which P loops forever is finite (or empty). The following pseudo-code gives a reduction from the Halting Problem, Halt, to Finite. Fill in the blanks to make the reduction behave correctly. Test-Halt(P,x) let P be a program that, on every input, runs P on x if Test-Finite(P ) then return else return (l) We say that programs P 1, P 2 differ on input x if one of the programs halts and the other loops forever on x. The problem InfDiff takes as input two programs, P 1 and P 2, and decides whether there are infinitely many inputs x on which P 1, P 2 differ. The following pseudo-code gives a reduction from the Halting Problem, Halt, to InfDiff. Fill in the blank to make the reduction behave correctly. Test-Halt(P,x) let P 1 be a program that, on every input, runs P on x let P 2 be a program that, on every input, if Test-InfDiff(P 1,P 2 ) then return "yes" else return "no" Page 5

3. Modifying Secrets [All answers to be justified. Total of 12 points.] Alice sets up a secret sharing scheme with her n friends Bob 1,..., Bob n, in which each Bob i gets a point (x i, y i ) where y i = P (x i ) for a fixed polynomial P over a field GF(q), where q > 2n. The secret is kept at P (0) = s. When Alice is distributing these points to the Bobs, an adversary Eve can tamper with the points, and thus change the value of the secret that will be recovered. For each scenario in (a) (c) below, give the value of the new secret that will be recovered; your answers may depend on s or on P. In each case, prove that your answer is correct. (a) Eve replaces each point (x i, y i ) with (x i, 2y i + 1). (b) Eve replaces each point (x i, y i ) with (2x i, y i ). (c) Eve replaces each point (x i, y i ) with (x i 1, y i ). [You may assume that x i 1 for all i = 1,..., n.] Page 6

4. Breaking RSA [All parts to be briefly justified. Total of 16 points.] (a) Alice sends the same message, m < N, to two friends, Bob and Carol using the standard RSA protocol discussed in class. Bob s public key is (N, e 1 ) and Carol s is (N, e 2 ), where gcd(e 1, e 2 ) = 1. Explain how an eavesdropper, Eve, can decrypt m by observing the encrypted messages that Alice sends to Bob and Carol. [Hint: Use the extended gcd algorithm.] (b) Dennis decides to simplify the RSA cryptosystem as follows. Instead of choosing the usual type of public key (N = pq, e), he instead chooses a key (N, e) where N is a prime and e is an integer in {2,..., N 1} with gcd(n 1, e) = 1. To send a message m to Dennis, Alice sends the encrypted message m e (mod N). Is Dennis scheme secure? Explain your answer. [Q4 continued on next page] Page 7

(c) Frank has published his RSA public key (N = pq, e). Gina wants to construct her own public key, and has found one large prime p p; being too lazy to find another one, she asks if she can use one of Frank s; since Frank trusts Gina, he gives her his prime q. Gina then publishes her key (N = p q, e ). Explain how Eve is able to break both Frank s and Gina s RSA schemes. (d) Harry, Imogen and Jasper have RSA public keys (N H, 3), (N I, 3) and (N J, 3) respectively, where N H, N I, N J are all distinct. Alice sends the same message m (where m is less than all of N H, N I, N J ) to all three of them using their respective keys. Explain how Eve is able to decrypt this message by observing the three encrypted messages. [Hints: You may use without proof the Chinese Remainder Theorem, which says the following: Let n be a natural number. Given the values c i = n mod r i, for 1 i k, where the r i are coprime, we can efficiently compute the value c = n mod (r 1 r 2 r k ). You may also use the fact that the cube root of an integer can be found efficiently.] Page 8

5. Counting Team Compositions [All parts to be briefly justified. Total of 16 points.] UC Berkeley has n students who are interested in participating in both the CS Programming and the Putnam Mathematical competitions. In parts (a) and (b), count the number of ways to choose a CS team with c members and a Putnam team with p members under the specified constraint, assuming that n c + p. Whenever possible, express your answers in terms of binomial coefficients and clearly indicate how each coefficient arises. (a) No restriction; any student can be on both teams. (b) No student can be on both teams. (c) Let A n,c,p denote the number of ways to choose the teams as in part (a), and let B n,c,p denote the number of ways to choose the teams as in part (b). Fill in the blank in the equation below to produce a valid combinatorial identity, and briefly explain your reasoning. A n,c,p = min(c,p) j=0 B n j,c j,p j (d) The CS team wins an international programming contest and receives k gold coins as a prize. How many ways are there to divide up the coins among the c team members, under the condition that each student should receive at least three coins? (Assume that k > 3c.) Page 9

6. Noisy Transmission on a Binary Tree [All parts to be justified. Total of 13 points.] 0 or 1 Consider a binary tree of depth D, which has 2 D leaves; in the example shown above, D = 4. At the root of the tree is a single bit (0 or 1). This bit is transmitted separately to each of the two children of the root, but in each case the value of the bit is flipped (i.e., 0 1 or 1 0) independently with probability p. This process continues, with each vertex of the tree transmitting its bit value (flipped with probability p, independently of all other transmissions) to its two children. The process stops at the leaves. Suppose two distinct leaves a, b are chosen uniformly at random. Let T denote the height of the lowest common ancestor (LCA) of a and b; in the example above, T = 1 for (a, b) = (1, 2), while T = 3 for (a, b) = (1, 8). (a) Find a formula for the probability P[T = t], where t = 1,..., D, for a general binary tree of depth D. 5pts (b) Let M denote the total number of times the bit is flipped when traversing the tree from the LCA to leaf a plus the analogous number of bit flips from the LCA to b. Write down a formula for the conditional probability P[M = m T = t]. Be sure to specify what values of m are possible. [Q6 continued on next page] Page 10

(c) Now let the random variables B a and B b respectively denote the bits observed at the sampled leaves a and b. What condition on M guarantees that B a = B b? 2pts (d) Find a formula for P[B a = B b ]. You may leave your answer as an unevaluated expression. [Hints: Use parts (b) and (c) to compute P[B a = B b T = t], then combine with part (a).] [End of Exam] Page 11

DO NOT WRITE ANY ANSWERS ON THIS PAGE! THIS PAGE WILL NOT BE SCANNED Page 12