Lecture # 12. Agenda: I. Vector Program Relaxation for Max Cut problem. Consider the vectors are in a sphere. Lecturer: Prof.

Similar documents
CSC 373: Algorithm Design and Analysis Lecture 30

Primality Testing. 1 Introduction. 2 Brief Chronology of Primality Testing. CS265/CME309, Fall Instructor: Gregory Valiant

Applied Cryptography and Computer Security CSE 664 Spring 2018

n Boolean variables: x 1, x 2,...,x n 2 {true,false} conjunctive normal form:

1. Algebra 1.7. Prime numbers

Great Theoretical Ideas in Computer Science

Ma/CS 6a Class 4: Primality Testing

Instructor: Bobby Kleinberg Lecture Notes, 25 April The Miller-Rabin Randomized Primality Test

Advanced Algorithms and Complexity Course Project Report

University of Tokyo: Advanced Algorithms Summer Lecture 6 27 May. Let s keep in mind definitions from the previous lecture:

Primality Testing- Is Randomization worth Practicing?

Factorization & Primality Testing

CSE 521: Design and Analysis of Algorithms I

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn

ALG 4.0 Number Theory Algorithms:

The running time of Euclid s algorithm

CPSC 467b: Cryptography and Computer Security

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

PRIMES is in P. Manindra Agrawal. NUS Singapore / IIT Kanpur

CSC2420 Spring 2016: Algorithm Design, Analysis and Theory Lecture 11

RSA Key Generation. Required Reading. W. Stallings, "Cryptography and Network-Security, Chapter 8.3 Testing for Primality

Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn

-bit integers are all in ThC. Th The following problems are complete for PSPACE NPSPACE ATIME QSAT, GEOGRAPHY, SUCCINCT REACH.

ECEN 5022 Cryptography

Ma/CS 6a Class 4: Primality Testing

LARGE PRIME NUMBERS. In sum, Fermat pseudoprimes are reasonable candidates to be prime.

A polytime proof of correctness of the Rabin-Miller algorithm from Fermat s Little Theorem

p = This is small enough that its primality is easily verified by trial division. A candidate prime above 1000 p of the form p U + 1 is

How To Test If a Polynomial Is Identically Zero?

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

Bipartite Perfect Matching

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Lecture Examples of problems which have randomized algorithms

Entry Number:2007 mcs Lecture Date: 18/2/08. Scribe: Nimrita Koul. Professor: Prof. Kavitha.

IRREDUCIBILITY TESTS IN F p [T ]

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence:

Analyzing and Optimizing the Combined Primality test with GCD Operation on Smart Mobile Devices

MATH 145 Algebra, Solutions to Assignment 4

PRIMALITY TESTING. Professor : Mr. Mohammad Amin Shokrollahi Assistant : Mahdi Cheraghchi. By TAHIRI JOUTI Kamal

THE MILLER RABIN TEST

10 Concrete candidates for public key crypto

Lecture 1: Introduction to Public key cryptography

Improving the Accuracy of Primality Tests by Enhancing the Miller-Rabin Theorem

Advanced Algorithms 南京大学 尹一通

Introduction to Public-Key Cryptosystems:

THE SOLOVAY STRASSEN TEST

Math/Mthe 418/818. Review Questions

Addition. Ch1 - Algorithms with numbers. Multiplication. al-khwārizmī. al-khwārizmī. Division 53+35=88. Cost? (n number of bits) 13x11=143. Cost?

Introduction to Number Theory

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Lecture 31: Miller Rabin Test. Miller Rabin Test

Lecture 11 - Basic Number Theory.

fsat We next show that if sat P, then fsat has a polynomial-time algorithm. c 2010 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 425

Simultaneous Linear, and Non-linear Congruences

Part II. Number Theory. Year

A Few Primality Testing Algorithms

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).

Theoretical Cryptography, Lecture 13

Lecture 6: Deterministic Primality Testing

Lecture Notes CS:5360 Randomized Algorithms Lecture 20 and 21: Nov 6th and 8th, 2018 Scribe: Qianhang Sun

Cryptography CS 555. Topic 24: Finding Prime Numbers, RSA

Lecture 11: Number Theoretic Assumptions

Theme : Cryptography. Instructor : Prof. C Pandu Rangan. Speaker : Arun Moorthy CS

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS

1 Overview and revision

Lecture 2: Randomized Algorithms

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

20.1 2SAT. CS125 Lecture 20 Fall 2016

basics of security/cryptography

Lecture Notes, Week 6

Lecture Prelude: Agarwal-Biswas Probabilistic Testing

About complexity. We define the class informally P in the following way:

FINITE ABELIAN GROUPS Amin Witno

CSC2420 Fall 2012: Algorithm Design, Analysis and Theory

CPSC 467b: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security

The RSA cryptosystem and primality tests

On the efficient approximability of constraint satisfaction problems

KTH, NADA , and D1449 Kryptografins grunder. Lecture 6: RSA. Johan Håstad, transcribed by Martin Lindkvist

Introduction to Quantum Information Processing QIC 710 / CS 768 / PH 767 / CO 681 / AM 871

LARGE PRIME NUMBERS (32, 42; 4) (32, 24; 2) (32, 20; 1) ( 105, 20; 0).

Cryptography: Joining the RSA Cryptosystem

About complexity. Number theoretical algorithms

Chapter 5 : Randomized computation

ECE646 Lecture 11 Required Reading Chapter 8.3 Testing for Primality RSA Key Generation

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

FERMAT S TEST KEITH CONRAD

Lecture 13 March 7, 2017

Corollary 4.2 (Pepin s Test, 1877). Let F k = 2 2k + 1, the kth Fermat number, where k 1. Then F k is prime iff 3 F k 1

Primality Testing SURFACE. Syracuse University. Per Brinch Hansen Syracuse University, School of Computer and Information Science,

Introduction to Cybersecurity Cryptography (Part 5)

CSCI3390-Second Test with Solutions

Lecture 15 & 16: Trapdoor Permutations, RSA, Signatures

Probabilistic Constructions of Computable Objects and a Computable Version of Lovász Local Lemma.

Lecture 10 Algorithmic version of the local lemma

Cryptography CS 555. Topic 18: RSA Implementation and Security. CS555 Topic 18 1

Introduction to Advanced Results

Lecture 18: PCP Theorem and Hardness of Approximation I

Introduction to Modern Cryptography. Benny Chor

Transcription:

Lecture # 12 Lecturer: Prof. Allan Borodin Scribe: Yeleiny Bonilla Agenda: I. Finish discussion of Vector Program Relaxation for Max-Cut problem. II. Briefly discuss same approach for Max-2-Sat. III. The constructive Lovasz Local Lemma (LLL). IV. The Miller Rabin primality testing. V. Multiplicative update. I. Vector Program Relaxation for Max Cut problem We can write the Max Cut problem as: maximize i,j E w ij 1/2(1-v iv j ) (1) subject to v i 2 = 1 v i R n Consider the vectors are in a sphere We are going to take a random unit vector r R n. Set y i = +1 if (v i r 0) As the inner product of two vectors is equal v i v j = cos (θ ij) and 0 θ π. Then substituting in equation (1), we can re-write the problem as: * Where cos (π) = -1 cos (π/2) = 0 cos (0) = 1 maximize i,j E w ij 1/2(1- cos (θ ij)) Claim: The expected value of the rounded solution will be E [rounded solution] α i,j E w ij 1/2(1- cos (θ ij))

Main Claim: Prob r [v i and v j are separated by r] = θ ij / π (Proof by picture above *) To get the desired expectation we want θ ij / π α ( (1 - cos (θ ij) ) /2 ) α = min 0 θ π 2/π * (1 - cos (θ))/ θ) 0.87856 II. Vector Program Relaxation for Max-2-Sat problem y 0 y i 0 i n {+1, - 1} y i ~ propositional x i Interpretation: x i = {true if y i = y 0 false if y i = - y 0 } We are trying to maximize: maximize τ C val τ (C) val(c) -> {1 if C/ τ = true 0 if C/ τ = false} If C = x i then val(c) = (1+ y i y 0 ) /2 If C = x i then val(c) = 1 (yi y 0 )/2 And if C = x i v x j then val(c) = 1 val (x i) * val (x j) = a ((1 + y i y 0 ) /2) + b ((1 - y i y 0 ) /2) maximize i j a ij (1+ y i y j ) + b ij (1- y i y j ) Relaxing yi y j to v i v j, with v i R n+1, v i =1, 0 i n. Doing the calculations we get the same α ~ 0.87856 approximation. III. The constructive Lovasz Local Lemma (LLL) Having a series of events E 1,..., E m Prob [E i ] = p < 1 Prob [Ē 1 ^ Ē 2 ^..^ Ē m ] > 0, if all E i are independent Suppose that each E i occurs with probability at most p, and such that each event is independent of all the other events except for at most d of them.

If (Where e = 2.718... is the base of natural logarithms), then there is a nonzero probability that none of the events occurs. Consider an instance of the LLL, F= C 1 ^ C 2 ^.^ C m F in an exactly K CNF, E i = C i is not satisfied by a random τ, then Prob [E i ] = 1/2 k Ē i means C i is satisfied, then Prob [Ē 1 ^ Ē 2 ^..^ Ē m ] = Prob τ [F/ τ is satisfied] >0 Let d be the number of clauses that share a variable (with a given clause C), then to apply the LLL we want: d + 1 2 k / e which implies that d < 2 k /e. The Constructive Proof: (Proof by Moser and Gabor, Tardos + Moser) Chose any random τ Solve, while there exists a clause C not satisfied by τ Call Fix(C) end while Fix(C) Randomly set the bits in C While there is a neighboring clause D that is unsatisfied Call Fix (D) End while Theorem: Let r be the size of neighborhood. If r is not to big: r 2 k /8, then with high probability the algorithm terminates in O (mlogm) calls to Fix(C) and hence found a satisfying assignment. Proof: Suppose the algorithm takes at least s recursive calls to fix,

n + s*k bits describes algorithm up to the s th cell at which time we have some true assignment τ. Using Kolmogorov complexity, we state the fact that most random strings cannot be compressed. Now we say that if r is sufficiently small k log v c > 0 Then we can describe these n + s*k bits in a compressed way. n bits to describe τ. s calls to fix C 1.. C s clauses being fixed. Claim: Solve has at most m clauses. Any C satisfied before Fix(C) that is called in Solve remains satisfied. Claim: We can recover original n + s*k bits using n + m logm + s (logr + c) n + s*k (for τ ) (calls to fix in solve) m logm s ( k logr c) (Note: Here it is not proved, but the algorithm does not always terminates) IV. Primality testing Some background in primality tests and authors: The Solovay Strassen primality test, developed by Robert M. Solovay and Volker Strassen, is a probabilistic test to determine if a number is composite or probably prime. It has been largely superseded by the Miller Rabin primality test, but has great historical importance in showing the practical feasibility of the RSA cryptosystem. The Miller Rabin primality test or Rabin Miller primality test is in an algorithm which determines whether a given number is prime, similar to the Fermat primality test and the Solovay Strassen primality test. Its original version, due to Gary L. Miller, is deterministic, but the determinism relies on the unproven generalized Riemann hypothesis; Michael O. Rabin modified it to obtain an unconditional probabilistic algorithm. In general those authors gave a one sided randomized algorithm. Prob[ ALG says N prime N composite ] ½ Prob [ALG says N composite N prime] = 0 Composite testing RP

Except for a very small (but still infinite) class of numbers, there is a very simple randomized algorithm: Fernat s little theorem: N prime implies a N-1 = 1 mod N, where gcd(a,n) = 1 Lagrange s Theorem: If S is a subgroup of a group G, then S divides G. Our group: Z* N = {a gcd(a,n) = 1, under mullt mod N} S = {a gcd(a,n) = 1 and a n-1 mod N =1, 1 a n-1 } is a subgroup. False test: choose a Z* N randomly. If a k-1 mod N = 1 -> Output prime Else -> Output composite Carmichael number (AKA false primes): For all a Z* N, a k-1 mod N = 1, and N is composite. N- Carmichael -> N=N 1 N 2 N 3, N i square free. Gcd (N i, N J ) = 1 If N is prime, then Z* N is a field, and 1 has exactly 2 square roots {-1, +1} If N is odd then N-1 is even -> N-1 = 2 t u, with u odd Algorithm: Choose a Z* N randomly, x 0 = a u mod N, x t = a N-1 mod N for i=1 until t x i = x 2 i-1 mod N if x i does not belong to {-1, +1} then output composite. end for if x i 1 then output composite else output prime. Chinese remainder theorem (CRT): gcd(n 1 N 2 ) =1 then for all u, v, N = N 1 N 2 Exist λ: λ = u mod N 1

λ = v mod N 2 and 0 λ < N 1 N 2. V. Multiplicative update Suppose we have n experts who every day are predicting the value of a {0, 1} event. Let m t i be the number of errors by experts i in first t days. We want an algorithm that will do well compared to the best expert. w i will be the weight of i th expert. Initially w 0 i = 1. Algorithm: For j=1 until t (for each day) For each i if prediction of expert i on day j is wrong then w j i = w j-1 i (i- Ɛ) else w j i = w j-1 i end for end for Output: the weighted majority of the expert predictions. Claim: Let m t be the number of errors the algorithm make. Then m t 2lnn/Ɛ + 2(1+ Ɛ)m t i, for all i.