Lecture 5: Two-point Sampling

Size: px
Start display at page:

Download "Lecture 5: Two-point Sampling"

Transcription

1 Randomized Algorithms Lecture 5: Two-point Sampling Sotiris Nikoletseas Professor CEID - ETY Course Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 1 / 26

2 Overview A. Pairwise independence of random variables B. The pairwise independent sampling theorem C. Probability amplification via reduced randomness Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 2 / 26

3 A. On the Additivity of Variance In general the variance of a sum of random variables is not equal to the sum of their variances However, variances do add for independent variables (i.e. mutually independent variables) In fact, mutual independence is not necessary and pairwise independence suffices This is very useful, since in many situations the random variables involved are pairwise independent but not mutually independent. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 3 / 26

4 Conditional distributions Let X, Y be discrete random variables. Their joint probability density function is f(x, y) = Pr{(X = x) (Y = y)} Clearly f 1 (x) = Pr{X = x} = y f(x, y) and f 2 (y) = Pr{Y = y} = x f(x, y) Also, the conditional probability density function is: Pr{(X = x) (Y = y)} f(x y) = Pr{X = x Y = y} = Pr{Y = y} f(x, y) f(x, y) = = f 2 (y) f(x, y) x = Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 4 / 26

5 Pairwise independence Let random variables X 1, X 2,..., X n. These are called pairwise independent iff for all i j it is Pr{(X i = x) (X j = y)} = Pr{X i = x}, x, y Equivalently, Pr{(X i = x) (X j = y)} = = Pr{X i = x} Pr{X j = y}, x, y Generalizing, the collection is k-wise independent iff, for every subset I {1, 2,..., n} with I < k for every set of values { {a i }, b and j / I, it is Pr X j = b i I X i = a i } = Pr{X j = b} Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 5 / 26

6 Mutual (or full ) independence The random variables X 1, X 2,..., X n are mutually independent iff for any subset X i1, X i2,..., X ik, (2 k n) of them, it is Pr{(X i1 = x 1 ) (X i2 = x 2 ) (X ik = x k )} = = Pr{X i1 = x 1 } Pr{X i2 = x 2 } Pr{X ik = x k } Example (for n = 3). Let A 1, A 2, A 3 3 events. They are mutually independent iff all four equalities hold: Pr{A 1 A 2 } = Pr{A 1 } Pr{A 2 } (1) Pr{A 2 A 3 } = Pr{A 2 } Pr{A 3 } (2) Pr{A 1 A 3 } = Pr{A 1 } Pr{A 3 } (3) Pr{A 1 A 2 A 3 } = Pr{A 1 } Pr{A 2 } Pr{A 3 } (4) They are called pairwise independent if (1), (2), (3) hold. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 6 / 26

7 Mutual vs pairwise independence Important notice: Pairwise independence does not imply mutual independence in general. Example. Let a probability space including all permutations of a, b, c as well as aaa, bbb, ccc (all 9 points considered equiprobable). Let A k = at place k there is an a (for k = 1, 2, 3). It is Pr{A 1 } = Pr{A 2 } = Pr{A 3 } = = 1 3 Also Pr{A 1 A 2 } = Pr{A 2 A 3 } = Pr{A 1 A 3 } = 1 9 = thus A 1, A 2, A 3 are pairwise independent. But Pr{A 1 A 2 A 3 } = 1 9 Pr{A 1} Pr{A 2 } Pr{A 3 } = 1 27 thus the events are not mutually independent Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 7 / 26

8 Variance: key features Definition: V ar(x) = E[(X µ) 2 ] = x (x µ) 2 Pr{X = x} where µ = E[X] = x x Pr{X = x} We call standard deviation of X the σ = V ar(x) Basic Properties: (i) V ar(x) = E[X 2 ] E 2 [X] (ii) V ar(cx) = c 2 V ar(x), where c constant. (iii) V ar(x + c) = V ar(x), where c constant. proof of (i): V ar(x) = E[(X µ) 2 ] = E[X 2 2µX + µ 2 ] = E[X 2 ] + E[ 2µX] + E[µ 2 ] = E[X 2 ] 2µE[X] + µ 2 = E[X 2 ] µ 2 Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 8 / 26

9 The additivity of variance Theorem: if X 1, X 2,..., X n ( are pairwise independent random n ) n variables, then: V ar X i = V ar(x i ) i=1 Proof: V ar(x X n ) = E[(X X n ) 2 ] E 2 [X X n ] = n n n n = E Xi 2 + X i X j µ 2 i + µ i µ j = = i=1 1 i j n n (E[Xi 2 ] µ 2 i ) + i=1 n 1 i j n i=1 i=1 1 i j n (E[X i X j ] µ i µ j ) = (since X i pairwise independent, so 1 i j n E(X i X j ) = E(X i )E(X j = µ i µ j ) n V ar(x i ) Note: As we see in the proof, the pairwise independence suffices, and mutual (full) independence is not needed. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 9 / 26 i=1

10 B. The pairwise independent sampling theorem Another Example. Birthday matching: Let us try to estimate the number of pairs of people in a room having birthday on the same day. Note 1: Matching birthdays for different pairs of students are pairwise independent, since knowing that (George, Takis) have a match tell us nothing about whether (George, Petros) match. Note 2: However, the events are not mutually independent. Indeed they are not even 3-wise independent since if (George,Takis) match and (Takis, Petros) match then (George, Petros) match! Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 10 / 26

11 Birthday matching Let us calculate the probability of having a certain number of birthday matches. Let B 1, B 2,..., B n the birthdays of n independently chosen people and let E i,j be the indicator variable for the event of a (i, j) match (i.e. B i = B j ). As said, the events E i,j are pairwise independent but not mutually independent. Clearly, Pr{E i,j } = Pr{B i = B j } = i j). Let D the number of matching pairs. Then D = 1 i<j n E i,j By linearity of expectation we have E[D] = E = E[E i,j ] = 1 i<j n E i,j 1 i<j n = (for ( ) n Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 11 / 26

12 Birthday matching Since the variances of pairwise independent variables E i,j add up, it is: V ar[d] = V ar = V ar[e i,j ] = = ( ) n ( ) 1 i<j n E i,j 1 i<j n As an example, for a class of n = 100 students, it is E[D] 14 and V ar[d] < 14( ) < 14. So by Chebyshev s inequality we have Pr{ D 14 x} 14 x 2 Letting x = 6, we conclude that with more than 50% chance the number of matching birthdays will be between 8 and 20. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 12 / 26

13 The Pairwise Independent Sampling Theorem (I) We can actually generalize and not restrict to sums of zero-one (indicator) valued variables neither to variables with the same distribution. We below state the theorem for possibly different distributions with same mean and variance (but this is done for simplicity, and the result holds for distributions with different means and/or variances as well). Theorem. Let X 1,..., X n pairwise independent variables with the same mean µ and variance σ 2. Let S n = n i=1 X i Then Pr { S n n µ } ( x 1 σ ) 2 n x Proof. Note that E[ Sn n ] = nµ n = µ, V ar[ Sn n ] = ( ) 1 2 n nσ 2 = σ2 n and apply Chebyshev s inequality. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 13 / 26

14 The Pairwise Independent Sampling Theorem (II) Note: This Theorem actually provides a precise general evaluation of how the average of pairwise independent random samples approaches their mean. If the number n of samples becomes large enough we can arbitrarily close approach the mean with confidence arbitrarily close to 100% (n > σ2 ) i.e. a x 2 large number of samples is needed for distributions of large variance and when we want to assure high concentration around the mean). Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 14 / 26

15 C. Reduced randomness at probability amplification Motivation: Randomized Algorithms, for a given input x, actually choose n random numbers ( witnesses ) and run a deterministic algorithm on the input, using each of these random numbers. intuitively, if the deterministic algorithm has a probability of error ɛ (e.g. 1 2 ), t independent runs reduce the error probability to ɛ t 1 (e.g. 2 ) and amplify the correctness t probability from 1 2 to t however, true randomness is quite expensive! What happens if we are constrained to use no more than a constant c random numbers? The simplest case is when c = 2 e.g. we choose just 2 random numbers (thus the name two-point sampling) Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 15 / 26

16 C. Reduced randomness at probability amplification Problem definition: If our randomized algorithm reduced the error probability to ɛ t with t random numbers, what can we expect about the error probability with 2 random numbers only? an obvious bound is ɛ 2 (e.g. when ɛ = 1 2 reducing the error probability from 1 2 to 1 4 ) can we do any better? it turns out that we can indeed do much better and reduce the error probability to 1 t (which is much smaller than the constant ɛ 2 ) Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 16 / 26

17 C. Reduced randomness at probability amplification High level idea: generate t ( pseudo-random ) numbers based on the chosen 2 truly random numbers and use them in lieu of t truly independent random numbers. these generated numbers are dependent on the 2 chosen numbers. Hence they are not independent, but are pairwise independent. This loss of full independence reduces the accuracy of the algorithmic process but is still quite usable in reducing the error probability. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 17 / 26

18 C. Reduced randomness at probability amplification The process (high level description): 1 Choose a large prime number p (e.g. Mersenne prime, ). 2 Define Z p as the ring of integers modulo p (e.g 0, 1, 2,..., ) 3 Choose 2 truly random numbers, a and b from Z p (e.g. a = and b = ). 4 Generate t pseudo-random numbers y i = (ai + b) mod p e.g. y 0 = y 1 = ( ) y 2 = ( ) and so on. 5 Use each of the y i s as t witnesses (in lieu of t purely independent random witnesses) Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 18 / 26

19 C. Reduced randomness at probability amplification Performance (high level discussion) As we will see: for any given error bound ɛ, the error probability is reduced from ɛ 2 to 1 t. however, instead of requiring O(log 1 ɛ ) runs on the deterministic algorithm (in the case of t independent random witnesses) we will require O( 1 ɛ ) runs in the case of 2 independent random witnesses. thus, we gain in the probability amplification but loose on some efficiency. we need significantly less true randomness. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 19 / 26

20 The class RP (I) Definition. The class RP (Random Polynomial time) consists of all languages L admitting a randomized algorithm A running in worst case polynomial time such that for any input x: Notes: x L Pr{A(x) accepts} 1 2 x / L Pr{A(x) accepts} = 0 language recognition computational decision problems the 1 2 value is arbitrary. The success probability needs just to be lower-bounded by an inverse polynomial function of the input size (a polynomial number of algorithm repetitions would boost it to constant, in polynomial time). RP actually includes Monte Carlo algorithms than can err only when x L (one-sided error) Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 20 / 26

21 The RP algorithm An RP algorithm, for given input x, actually picks a random number r from Z p and computes A(x, r) with the following properties: - x L A(x, r) = 1, for half of the possible values of r - x / L A(x, r) = 0, for all possible choices of r As said, - if we run algorithm A t times on the same input x, the error probability is 1 2 but this requires t truly random t numbers. - if we restrict ourselves to t = 2 true random numbers a, b from Z p and run A(x, a) and A(x, b), the error probability can be as high as but we can do better with t pseudo-random numbers: Let r i = a i + b (mod p), where a, b are truly random, as above, for i = 1, 2,..., t. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 21 / 26

22 Modulo rings pairwise independence (I) Let p a prime number and Z p = {0, 1, 2,..., p 1} denote the ring of the integers modulo p. Lemma 1. Given y, i Z p and choosing a, b randomly uniformly from Z p, the probability of y a i + b (mod p) is 1 p Proof. Imagine that we first choose a. Then when choosing b, it must be y a i b (mod p). Since we choose b uniformly and modulo p can take p values, the probability is clearly 1 p indeed. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 22 / 26

23 Modulo rings pairwise independence (II) Lemma 2. Given y, z, x, w Z p such that x w, and choosing a, b randomly uniformly from Z p, the probability of y a x + b (mod p) and z a w + b (mod p) is 1 p 2 Proof. It is y z a (x w) (mod p). Since x w 0, the equation holds for a unique value of a. This in turn implies a specific value for b. The probability that a, b get those two specific values is clearly 1 p 1 p = 1. p 2 Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 23 / 26

24 Modulo rings pairwise independence (III) Lemma 3. Let i, j two distinct elements of Z p,and choose a, b randomly uniformly from Z p. Then the two variables Y i = a i + b (mod p) and Y j = a j + b (mod p) are uniformly distributed on Z p and are pairwise independent. Proof. From lemma 1, it is clearly Pr{Y i = α} = 1 p, for any α Z p, so Y i, Y j indeed have uniform distribution. As for pairwise independence, note that: Pr{Y i = α Y j = β} = Pr{Y i=α Y j =β} Pr{Y j =β} = Thus, Y i, Y j are pairwise independent. 1 p 2 1 p = Pr{Y i = α} Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 24 / 26

25 Modulo rings pairwise independence (IV) Note: This is only pairwise independence. Indeed, consider the variables Y 1, Y 2 Y 3, Y 4 as defined above. Every pair of them are pairwise independent. But, if you give the value of Y 1, Y 2 then we know the values of Y 3, Y 4 immediately, since the values of Y 1 and Y 2 uniquely determine a and b, and thus we can compute all Y i variables. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 25 / 26

26 Modulo rings pairwise independence (V) Thus Y = t i=1 A(x, r i) is a sum of random variables which are pairwise independent, since the r i values are pairwise independent. Assume that x L, then E[Y ] = t 2 and V ar[y ] = t i=1 V ar[a(x, r i)] = t = t 4 The probability that all those t executions failed corresponds to the event Y = 0, and Pr{Y = 0} Pr{ Y E[Y ] E[Y ]} = Pr{ Y t 2 t 2 } V ar[y ] = t ( 2) t 2 4 = 1 ( 2) t 2 t from Chebyshev s inequality. Thus the use of pseudo-randomness (t pseudo-random numbers) allows to exploit our 2 random bits to reduce the error probability from 1 4 to 1 t. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 26 / 26

Lecture 4: Two-point Sampling, Coupon Collector s problem

Lecture 4: Two-point Sampling, Coupon Collector s problem Randomized Algorithms Lecture 4: Two-point Sampling, Coupon Collector s problem Sotiris Nikoletseas Associate Professor CEID - ETY Course 2013-2014 Sotiris Nikoletseas, Associate Professor Randomized Algorithms

More information

6.842 Randomness and Computation Lecture 5

6.842 Randomness and Computation Lecture 5 6.842 Randomness and Computation 2012-02-22 Lecture 5 Lecturer: Ronitt Rubinfeld Scribe: Michael Forbes 1 Overview Today we will define the notion of a pairwise independent hash function, and discuss its

More information

Lecture 6: Coupon Collector s problem

Lecture 6: Coupon Collector s problem Radomized Algorithms Lecture 6: Coupo Collector s problem Sotiris Nikoletseas Professor CEID - ETY Course 2017-2018 Sotiris Nikoletseas, Professor Radomized Algorithms - Lecture 6 1 / 16 Variace: key features

More information

Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds

Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds Randomized Algorithms Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds Sotiris Nikoletseas Associate Professor CEID - ETY Course 2013-2014 Sotiris Nikoletseas, Associate Professor Randomized

More information

Randomness and Computation March 13, Lecture 3

Randomness and Computation March 13, Lecture 3 0368.4163 Randomness and Computation March 13, 2009 Lecture 3 Lecturer: Ronitt Rubinfeld Scribe: Roza Pogalnikova and Yaron Orenstein Announcements Homework 1 is released, due 25/03. Lecture Plan 1. Do

More information

Random Variable. Pr(X = a) = Pr(s)

Random Variable. Pr(X = a) = Pr(s) Random Variable Definition A random variable X on a sample space Ω is a real-valued function on Ω; that is, X : Ω R. A discrete random variable is a random variable that takes on only a finite or countably

More information

Lecture 5. 1 Review (Pairwise Independence and Derandomization)

Lecture 5. 1 Review (Pairwise Independence and Derandomization) 6.842 Randomness and Computation September 20, 2017 Lecture 5 Lecturer: Ronitt Rubinfeld Scribe: Tom Kolokotrones 1 Review (Pairwise Independence and Derandomization) As we discussed last time, we can

More information

Expectation of geometric distribution

Expectation of geometric distribution Expectation of geometric distribution What is the probability that X is finite? Can now compute E(X): Σ k=1f X (k) = Σ k=1(1 p) k 1 p = pσ j=0(1 p) j = p 1 1 (1 p) = 1 E(X) = Σ k=1k (1 p) k 1 p = p [ Σ

More information

Topics in Probabilistic Combinatorics and Algorithms Winter, Basic Derandomization Techniques

Topics in Probabilistic Combinatorics and Algorithms Winter, Basic Derandomization Techniques Topics in Probabilistic Combinatorics and Algorithms Winter, 016 3. Basic Derandomization Techniques Definition. DTIME(t(n)) : {L : L can be decided deterministically in time O(t(n)).} EXP = { L: L can

More information

6.045: Automata, Computability, and Complexity (GITCS) Class 17 Nancy Lynch

6.045: Automata, Computability, and Complexity (GITCS) Class 17 Nancy Lynch 6.045: Automata, Computability, and Complexity (GITCS) Class 17 Nancy Lynch Today Probabilistic Turing Machines and Probabilistic Time Complexity Classes Now add a new capability to standard TMs: random

More information

Lecture 4: Hashing and Streaming Algorithms

Lecture 4: Hashing and Streaming Algorithms CSE 521: Design and Analysis of Algorithms I Winter 2017 Lecture 4: Hashing and Streaming Algorithms Lecturer: Shayan Oveis Gharan 01/18/2017 Scribe: Yuqing Ai Disclaimer: These notes have not been subjected

More information

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 20

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 20 CS 70 Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 20 Today we shall discuss a measure of how close a random variable tends to be to its expectation. But first we need to see how to compute

More information

Expectation of geometric distribution. Variance and Standard Deviation. Variance: Examples

Expectation of geometric distribution. Variance and Standard Deviation. Variance: Examples Expectation of geometric distribution Variance and Standard Deviation What is the probability that X is finite? Can now compute E(X): Σ k=f X (k) = Σ k=( p) k p = pσ j=0( p) j = p ( p) = E(X) = Σ k=k (

More information

Topic: Sampling, Medians of Means method and DNF counting Date: October 6, 2004 Scribe: Florin Oprea

Topic: Sampling, Medians of Means method and DNF counting Date: October 6, 2004 Scribe: Florin Oprea 15-859(M): Randomized Algorithms Lecturer: Shuchi Chawla Topic: Sampling, Medians of Means method and DNF counting Date: October 6, 200 Scribe: Florin Oprea 8.1 Introduction In this lecture we will consider

More information

1 Randomized Computation

1 Randomized Computation CS 6743 Lecture 17 1 Fall 2007 1 Randomized Computation Why is randomness useful? Imagine you have a stack of bank notes, with very few counterfeit ones. You want to choose a genuine bank note to pay at

More information

Lecture 2: A Las Vegas Algorithm for finding the closest pair of points in the plane

Lecture 2: A Las Vegas Algorithm for finding the closest pair of points in the plane Randomized Algorithms Lecture 2: A Las Vegas Algorithm for finding the closest pair of points in the plane Sotiris Nikoletseas Professor CEID - ETY Course 2017-2018 Sotiris Nikoletseas, Professor Randomized

More information

Average Case Complexity: Levin s Theory

Average Case Complexity: Levin s Theory Chapter 15 Average Case Complexity: Levin s Theory 1 needs more work Our study of complexity - NP-completeness, #P-completeness etc. thus far only concerned worst-case complexity. However, algorithms designers

More information

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 1/29/2002. Notes for Lecture 3

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 1/29/2002. Notes for Lecture 3 U.C. Bereley CS278: Computational Complexity Handout N3 Professor Luca Trevisan 1/29/2002 Notes for Lecture 3 In this lecture we will define the probabilistic complexity classes BPP, RP, ZPP and we will

More information

X = X X n, + X 2

X = X X n, + X 2 CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 22 Variance Question: At each time step, I flip a fair coin. If it comes up Heads, I walk one step to the right; if it comes up Tails, I walk

More information

Notes on Discrete Probability

Notes on Discrete Probability Columbia University Handout 3 W4231: Analysis of Algorithms September 21, 1999 Professor Luca Trevisan Notes on Discrete Probability The following notes cover, mostly without proofs, the basic notions

More information

Handout 5. α a1 a n. }, where. xi if a i = 1 1 if a i = 0.

Handout 5. α a1 a n. }, where. xi if a i = 1 1 if a i = 0. Notes on Complexity Theory Last updated: October, 2005 Jonathan Katz Handout 5 1 An Improved Upper-Bound on Circuit Size Here we show the result promised in the previous lecture regarding an upper-bound

More information

Lectures One Way Permutations, Goldreich Levin Theorem, Commitments

Lectures One Way Permutations, Goldreich Levin Theorem, Commitments Lectures 11 12 - One Way Permutations, Goldreich Levin Theorem, Commitments Boaz Barak March 10, 2010 From time immemorial, humanity has gotten frequent, often cruel, reminders that many things are easier

More information

CSE 190, Great ideas in algorithms: Pairwise independent hash functions

CSE 190, Great ideas in algorithms: Pairwise independent hash functions CSE 190, Great ideas in algorithms: Pairwise independent hash functions 1 Hash functions The goal of hash functions is to map elements from a large domain to a small one. Typically, to obtain the required

More information

CSE 502 Class 11 Part 2

CSE 502 Class 11 Part 2 CSE 502 Class 11 Part 2 Jeremy Buhler Steve Cole February 17 2015 Today: analysis of hashing 1 Constraints of Double Hashing How does using OA w/double hashing constrain our hash function design? Need

More information

Introduction to Randomized Algorithms: Quick Sort and Quick Selection

Introduction to Randomized Algorithms: Quick Sort and Quick Selection Chapter 14 Introduction to Randomized Algorithms: Quick Sort and Quick Selection CS 473: Fundamental Algorithms, Spring 2011 March 10, 2011 14.1 Introduction to Randomized Algorithms 14.2 Introduction

More information

Week 12-13: Discrete Probability

Week 12-13: Discrete Probability Week 12-13: Discrete Probability November 21, 2018 1 Probability Space There are many problems about chances or possibilities, called probability in mathematics. When we roll two dice there are possible

More information

Lecture notes on OPP algorithms [Preliminary Draft]

Lecture notes on OPP algorithms [Preliminary Draft] Lecture notes on OPP algorithms [Preliminary Draft] Jesper Nederlof June 13, 2016 These lecture notes were quickly assembled and probably contain many errors. Use at your own risk! Moreover, especially

More information

STOR Lecture 16. Properties of Expectation - I

STOR Lecture 16. Properties of Expectation - I STOR 435.001 Lecture 16 Properties of Expectation - I Jan Hannig UNC Chapel Hill 1 / 22 Motivation Recall we found joint distributions to be pretty complicated objects. Need various tools from combinatorics

More information

The space complexity of approximating the frequency moments

The space complexity of approximating the frequency moments The space complexity of approximating the frequency moments Felix Biermeier November 24, 2015 1 Overview Introduction Approximations of frequency moments lower bounds 2 Frequency moments Problem Estimate

More information

SUMMARY OF PROBABILITY CONCEPTS SO FAR (SUPPLEMENT FOR MA416)

SUMMARY OF PROBABILITY CONCEPTS SO FAR (SUPPLEMENT FOR MA416) SUMMARY OF PROBABILITY CONCEPTS SO FAR (SUPPLEMENT FOR MA416) D. ARAPURA This is a summary of the essential material covered so far. The final will be cumulative. I ve also included some review problems

More information

Homework 4 Solutions

Homework 4 Solutions CS 174: Combinatorics and Discrete Probability Fall 01 Homework 4 Solutions Problem 1. (Exercise 3.4 from MU 5 points) Recall the randomized algorithm discussed in class for finding the median of a set

More information

Discrete Random Variables

Discrete Random Variables Discrete Random Variables We have a probability space (S, Pr). A random variable is a function X : S V (X ) for some set V (X ). In this discussion, we must have V (X ) is the real numbers X induces a

More information

1 Randomized complexity

1 Randomized complexity 80240233: Complexity of Computation Lecture 6 ITCS, Tsinghua Univesity, Fall 2007 23 October 2007 Instructor: Elad Verbin Notes by: Zhang Zhiqiang and Yu Wei 1 Randomized complexity So far our notion of

More information

CS6999 Probabilistic Methods in Integer Programming Randomized Rounding Andrew D. Smith April 2003

CS6999 Probabilistic Methods in Integer Programming Randomized Rounding Andrew D. Smith April 2003 CS6999 Probabilistic Methods in Integer Programming Randomized Rounding April 2003 Overview 2 Background Randomized Rounding Handling Feasibility Derandomization Advanced Techniques Integer Programming

More information

An Introduction to Randomized algorithms

An Introduction to Randomized algorithms An Introduction to Randomized algorithms C.R. Subramanian The Institute of Mathematical Sciences, Chennai. Expository talk presented at the Research Promotion Workshop on Introduction to Geometric and

More information

Randomized algorithms. Inge Li Gørtz

Randomized algorithms. Inge Li Gørtz Randomized algorithms Inge Li Gørtz Randomized algorithms Today What are randomized algorithms? Properties of randomized algorithms Two examples: Median/Select. Quick-sort Randomized Algorithms Randomized

More information

Lecture 2 Sep 5, 2017

Lecture 2 Sep 5, 2017 CS 388R: Randomized Algorithms Fall 2017 Lecture 2 Sep 5, 2017 Prof. Eric Price Scribe: V. Orestis Papadigenopoulos and Patrick Rall NOTE: THESE NOTES HAVE NOT BEEN EDITED OR CHECKED FOR CORRECTNESS 1

More information

Lecture 2: Streaming Algorithms

Lecture 2: Streaming Algorithms CS369G: Algorithmic Techniques for Big Data Spring 2015-2016 Lecture 2: Streaming Algorithms Prof. Moses Chariar Scribes: Stephen Mussmann 1 Overview In this lecture, we first derive a concentration inequality

More information

Lecture 23: Alternation vs. Counting

Lecture 23: Alternation vs. Counting CS 710: Complexity Theory 4/13/010 Lecture 3: Alternation vs. Counting Instructor: Dieter van Melkebeek Scribe: Jeff Kinne & Mushfeq Khan We introduced counting complexity classes in the previous lecture

More information

11.1 Set Cover ILP formulation of set cover Deterministic rounding

11.1 Set Cover ILP formulation of set cover Deterministic rounding CS787: Advanced Algorithms Lecture 11: Randomized Rounding, Concentration Bounds In this lecture we will see some more examples of approximation algorithms based on LP relaxations. This time we will use

More information

Handout 1: Mathematical Background

Handout 1: Mathematical Background Handout 1: Mathematical Background Boaz Barak February 2, 2010 This is a brief review of some mathematical tools, especially probability theory that we will use. This material is mostly from discrete math

More information

Discrete Mathematics and Probability Theory Fall 2015 Note 20. A Brief Introduction to Continuous Probability

Discrete Mathematics and Probability Theory Fall 2015 Note 20. A Brief Introduction to Continuous Probability CS 7 Discrete Mathematics and Probability Theory Fall 215 Note 2 A Brief Introduction to Continuous Probability Up to now we have focused exclusively on discrete probability spaces Ω, where the number

More information

Some notes on streaming algorithms continued

Some notes on streaming algorithms continued U.C. Berkeley CS170: Algorithms Handout LN-11-9 Christos Papadimitriou & Luca Trevisan November 9, 016 Some notes on streaming algorithms continued Today we complete our quick review of streaming algorithms.

More information

1 Maintaining a Dictionary

1 Maintaining a Dictionary 15-451/651: Design & Analysis of Algorithms February 1, 2016 Lecture #7: Hashing last changed: January 29, 2016 Hashing is a great practical tool, with an interesting and subtle theory too. In addition

More information

1 Distributional problems

1 Distributional problems CSCI 5170: Computational Complexity Lecture 6 The Chinese University of Hong Kong, Spring 2016 23 February 2016 The theory of NP-completeness has been applied to explain why brute-force search is essentially

More information

Expectation, inequalities and laws of large numbers

Expectation, inequalities and laws of large numbers Chapter 3 Expectation, inequalities and laws of large numbers 3. Expectation and Variance Indicator random variable Let us suppose that the event A partitions the sample space S, i.e. A A S. The indicator

More information

Handout 1: Probability

Handout 1: Probability Handout 1: Probability Boaz Barak Exercises due September 20, 2005 1 Suggested Reading This material is covered in Cormen, Leiserson, Rivest and Smith Introduction to Algorithms Appendix C. You can also

More information

Disjointness and Additivity

Disjointness and Additivity Midterm 2: Format Midterm 2 Review CS70 Summer 2016 - Lecture 6D David Dinh 28 July 2016 UC Berkeley 8 questions, 190 points, 110 minutes (same as MT1). Two pages (one double-sided sheet) of handwritten

More information

Randomized Algorithms

Randomized Algorithms Randomized Algorithms Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Basics A new 4 credit unit course Part of Theoretical Computer Science courses at the Department of Mathematics There will be 4 hours

More information

Notes for Lecture 18

Notes for Lecture 18 U.C. Berkeley Handout N18 CS294: Pseudorandomness and Combinatorial Constructions November 1, 2005 Professor Luca Trevisan Scribe: Constantinos Daskalakis Notes for Lecture 18 1 Basic Definitions In the

More information

Lecture Examples of problems which have randomized algorithms

Lecture Examples of problems which have randomized algorithms 6.841 Advanced Complexity Theory March 9, 2009 Lecture 10 Lecturer: Madhu Sudan Scribe: Asilata Bapat Meeting to talk about final projects on Wednesday, 11 March 2009, from 5pm to 7pm. Location: TBA. Includes

More information

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

Instructor: Bobby Kleinberg Lecture Notes, 25 April The Miller-Rabin Randomized Primality Test Introduction to Algorithms (CS 482) Cornell University Instructor: Bobby Kleinberg Lecture Notes, 25 April 2008 The Miller-Rabin Randomized Primality Test 1 Introduction Primality testing is an important

More information

Lecture Hardness of Set Cover

Lecture Hardness of Set Cover PCPs and Inapproxiability CIS 6930 October 5, 2009 Lecture Hardness of Set Cover Lecturer: Dr. My T. Thai Scribe: Ying Xuan 1 Preliminaries 1.1 Two-Prover-One-Round Proof System A new PCP model 2P1R Think

More information

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

Midterm 2 Review. CS70 Summer Lecture 6D. David Dinh 28 July UC Berkeley Midterm 2 Review CS70 Summer 2016 - Lecture 6D David Dinh 28 July 2016 UC Berkeley Midterm 2: Format 8 questions, 190 points, 110 minutes (same as MT1). Two pages (one double-sided sheet) of handwritten

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 21 November 15, 2017 CPSC 467, Lecture 21 1/31 Secure Random Sequence Generators Pseudorandom sequence generators Looking random

More information

Handout 1: Mathematical Background

Handout 1: Mathematical Background Handout 1: Mathematical Background Boaz Barak September 18, 2007 This is a brief review of some mathematical tools, especially probability theory that we will use. This material is mostly from discrete

More information

Factoring. there exists some 1 i < j l such that x i x j (mod p). (1) p gcd(x i x j, n).

Factoring. there exists some 1 i < j l such that x i x j (mod p). (1) p gcd(x i x j, n). 18.310 lecture notes April 22, 2015 Factoring Lecturer: Michel Goemans We ve seen that it s possible to efficiently check whether an integer n is prime or not. What about factoring a number? If this could

More information

14.1 Finding frequent elements in stream

14.1 Finding frequent elements in stream Chapter 14 Streaming Data Model 14.1 Finding frequent elements in stream A very useful statistics for many applications is to keep track of elements that occur more frequently. It can come in many flavours

More information

CSE525: Randomized Algorithms and Probabilistic Analysis April 2, Lecture 1

CSE525: Randomized Algorithms and Probabilistic Analysis April 2, Lecture 1 CSE525: Randomized Algorithms and Probabilistic Analysis April 2, 2013 Lecture 1 Lecturer: Anna Karlin Scribe: Sonya Alexandrova and Eric Lei 1 Introduction The main theme of this class is randomized algorithms.

More information

The Parameterized Complexity of Approximate Inference in Bayesian Networks

The Parameterized Complexity of Approximate Inference in Bayesian Networks The Parameterized Complexity of Approximate Inference in Bayesian Networks Johan Kwisthout j.kwisthout@donders.ru.nl http://www.dcc.ru.nl/johank/ Donders Center for Cognition Department of Artificial Intelligence

More information

Lecture 9 - One Way Permutations

Lecture 9 - One Way Permutations Lecture 9 - One Way Permutations Boaz Barak October 17, 2007 From time immemorial, humanity has gotten frequent, often cruel, reminders that many things are easier to do than to reverse. Leonid Levin Quick

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 10 February 19, 2013 CPSC 467b, Lecture 10 1/45 Primality Tests Strong primality tests Weak tests of compositeness Reformulation

More information

Overview. CSE 21 Day 5. Image/Coimage. Monotonic Lists. Functions Probabilistic analysis

Overview. CSE 21 Day 5. Image/Coimage. Monotonic Lists. Functions Probabilistic analysis Day 5 Functions/Probability Overview Functions Probabilistic analysis Neil Rhodes UC San Diego Image/Coimage The image of f is the set of values f actually takes on (a subset of the codomain) The inverse

More information

A crash course in probability. Periklis A. Papakonstantinou Rutgers Business School

A crash course in probability. Periklis A. Papakonstantinou Rutgers Business School A crash course in probability Periklis A. Papakonstantinou Rutgers Business School i LECTURE NOTES IN Elements of Probability and Statistics Periklis A. Papakonstantinou MSIS, Rutgers Business School Piscataway,

More information

THE SOLOVAY STRASSEN TEST

THE SOLOVAY STRASSEN TEST THE SOLOVAY STRASSEN TEST KEITH CONRAD 1. Introduction The Jacobi symbol satisfies many formulas that the Legendre symbol does, such as these: for a, b Z and odd m, n Z +, (1) a b mod n ( a n ) = ( b n

More information

Lecture 11. Probability Theory: an Overveiw

Lecture 11. Probability Theory: an Overveiw Math 408 - Mathematical Statistics Lecture 11. Probability Theory: an Overveiw February 11, 2013 Konstantin Zuev (USC) Math 408, Lecture 11 February 11, 2013 1 / 24 The starting point in developing the

More information

Lecture 3 - Expectation, inequalities and laws of large numbers

Lecture 3 - Expectation, inequalities and laws of large numbers Lecture 3 - Expectation, inequalities and laws of large numbers Jan Bouda FI MU April 19, 2009 Jan Bouda (FI MU) Lecture 3 - Expectation, inequalities and laws of large numbersapril 19, 2009 1 / 67 Part

More information

CSCB63 Winter Week10 - Lecture 2 - Hashing. Anna Bretscher. March 21, / 30

CSCB63 Winter Week10 - Lecture 2 - Hashing. Anna Bretscher. March 21, / 30 CSCB63 Winter 2019 Week10 - Lecture 2 - Hashing Anna Bretscher March 21, 2019 1 / 30 Today Hashing Open Addressing Hash functions Universal Hashing 2 / 30 Open Addressing Open Addressing. Each entry in

More information

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 18

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 18 EECS 7 Discrete Mathematics and Probability Theory Spring 214 Anant Sahai Note 18 A Brief Introduction to Continuous Probability Up to now we have focused exclusively on discrete probability spaces Ω,

More information

Hash tables. Hash tables

Hash tables. Hash tables Basic Probability Theory Two events A, B are independent if Conditional probability: Pr[A B] = Pr[A] Pr[B] Pr[A B] = Pr[A B] Pr[B] The expectation of a (discrete) random variable X is E[X ] = k k Pr[X

More information

Lecture 2: Randomized Algorithms

Lecture 2: Randomized Algorithms Lecture 2: Randomized Algorithms Independence & Conditional Probability Random Variables Expectation & Conditional Expectation Law of Total Probability Law of Total Expectation Derandomization Using Conditional

More information

Homework 10 (due December 2, 2009)

Homework 10 (due December 2, 2009) Homework (due December, 9) Problem. Let X and Y be independent binomial random variables with parameters (n, p) and (n, p) respectively. Prove that X + Y is a binomial random variable with parameters (n

More information

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010 CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010 So far our notion of realistic computation has been completely deterministic: The Turing Machine

More information

Problem Set 2. Assigned: Mon. November. 23, 2015

Problem Set 2. Assigned: Mon. November. 23, 2015 Pseudorandomness Prof. Salil Vadhan Problem Set 2 Assigned: Mon. November. 23, 2015 Chi-Ning Chou Index Problem Progress 1 SchwartzZippel lemma 1/1 2 Robustness of the model 1/1 3 Zero error versus 1-sided

More information

Lecture 10 Oct. 3, 2017

Lecture 10 Oct. 3, 2017 CS 388R: Randomized Algorithms Fall 2017 Lecture 10 Oct. 3, 2017 Prof. Eric Price Scribe: Jianwei Chen, Josh Vekhter NOTE: THESE NOTES HAVE NOT BEEN EDITED OR CHECKED FOR CORRECTNESS 1 Overview In the

More information

Randomized algorithm

Randomized algorithm Tutorial 4 Joyce 2009-11-24 Outline Solution to Midterm Question 1 Question 2 Question 1 Question 2 Question 3 Question 4 Question 5 Solution to Midterm Solution to Midterm Solution to Midterm Question

More information

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST JAMES MCIVOR Today we enter Chapter 2, which is the heart of this subject. Before starting, recall that last time we saw the integers have unique factorization

More information

(x 1 +x 2 )(x 1 x 2 )+(x 2 +x 3 )(x 2 x 3 )+(x 3 +x 1 )(x 3 x 1 ).

(x 1 +x 2 )(x 1 x 2 )+(x 2 +x 3 )(x 2 x 3 )+(x 3 +x 1 )(x 3 x 1 ). CMPSCI611: Verifying Polynomial Identities Lecture 13 Here is a problem that has a polynomial-time randomized solution, but so far no poly-time deterministic solution. Let F be any field and let Q(x 1,...,

More information

20.1 2SAT. CS125 Lecture 20 Fall 2016

20.1 2SAT. CS125 Lecture 20 Fall 2016 CS125 Lecture 20 Fall 2016 20.1 2SAT We show yet another possible way to solve the 2SAT problem. Recall that the input to 2SAT is a logical expression that is the conunction (AND) of a set of clauses,

More information

Discrete Mathematics and Probability Theory Fall 2011 Rao Midterm 2 Solutions

Discrete Mathematics and Probability Theory Fall 2011 Rao Midterm 2 Solutions CS 70 Discrete Mathematics and Probability Theory Fall 20 Rao Midterm 2 Solutions True/False. [24 pts] Circle one of the provided answers please! No negative points will be assigned for incorrect answers.

More information

Pigeonhole Principle and Ramsey Theory

Pigeonhole Principle and Ramsey Theory Pigeonhole Principle and Ramsey Theory The Pigeonhole Principle (PP) has often been termed as one of the most fundamental principles in combinatorics. The familiar statement is that if we have n pigeonholes

More information

Lecture 4. P r[x > ce[x]] 1/c. = ap r[x = a] + a>ce[x] P r[x = a]

Lecture 4. P r[x > ce[x]] 1/c. = ap r[x = a] + a>ce[x] P r[x = a] U.C. Berkeley CS273: Parallel and Distributed Theory Lecture 4 Professor Satish Rao September 7, 2010 Lecturer: Satish Rao Last revised September 13, 2010 Lecture 4 1 Deviation bounds. Deviation bounds

More information

Lecture 13 (Part 2): Deviation from mean: Markov s inequality, variance and its properties, Chebyshev s inequality

Lecture 13 (Part 2): Deviation from mean: Markov s inequality, variance and its properties, Chebyshev s inequality Lecture 13 (Part 2): Deviation from mean: Markov s inequality, variance and its properties, Chebyshev s inequality Discrete Structures II (Summer 2018) Rutgers University Instructor: Abhishek Bhrushundi

More information

Lecture 4: Probability and Discrete Random Variables

Lecture 4: Probability and Discrete Random Variables Error Correcting Codes: Combinatorics, Algorithms and Applications (Fall 2007) Lecture 4: Probability and Discrete Random Variables Wednesday, January 21, 2009 Lecturer: Atri Rudra Scribe: Anonymous 1

More information

1 Probability Review. CS 124 Section #8 Hashing, Skip Lists 3/20/17. Expectation (weighted average): the expectation of a random quantity X is:

1 Probability Review. CS 124 Section #8 Hashing, Skip Lists 3/20/17. Expectation (weighted average): the expectation of a random quantity X is: CS 24 Section #8 Hashing, Skip Lists 3/20/7 Probability Review Expectation (weighted average): the expectation of a random quantity X is: x= x P (X = x) For each value x that X can take on, we look at

More information

Model Counting for Logical Theories

Model Counting for Logical Theories Model Counting for Logical Theories Wednesday Dmitry Chistikov Rayna Dimitrova Department of Computer Science University of Oxford, UK Max Planck Institute for Software Systems (MPI-SWS) Kaiserslautern

More information

the amount of the data corresponding to the subinterval the width of the subinterval e x2 to the left by 5 units results in another PDF g(x) = 1 π

the amount of the data corresponding to the subinterval the width of the subinterval e x2 to the left by 5 units results in another PDF g(x) = 1 π Math 10A with Professor Stankova Worksheet, Discussion #42; Friday, 12/8/2017 GSI name: Roy Zhao Problems 1. For each of the following distributions, derive/find all of the following: PMF/PDF, CDF, median,

More information

Randomized Complexity Classes; RP

Randomized Complexity Classes; RP Randomized Complexity Classes; RP Let N be a polynomial-time precise NTM that runs in time p(n) and has 2 nondeterministic choices at each step. N is a polynomial Monte Carlo Turing machine for a language

More information

Notes for Lecture 14 v0.9

Notes for Lecture 14 v0.9 U.C. Berkeley CS27: Computational Complexity Handout N14 v0.9 Professor Luca Trevisan 10/25/2002 Notes for Lecture 14 v0.9 These notes are in a draft version. Please give me any comments you may have,

More information

Lower Bounds for Testing Bipartiteness in Dense Graphs

Lower Bounds for Testing Bipartiteness in Dense Graphs Lower Bounds for Testing Bipartiteness in Dense Graphs Andrej Bogdanov Luca Trevisan Abstract We consider the problem of testing bipartiteness in the adjacency matrix model. The best known algorithm, due

More information

Introduction to discrete probability. The rules Sample space (finite except for one example)

Introduction to discrete probability. The rules Sample space (finite except for one example) Algorithms lecture notes 1 Introduction to discrete probability The rules Sample space (finite except for one example) say Ω. P (Ω) = 1, P ( ) = 0. If the items in the sample space are {x 1,..., x n }

More information

Example continued. Math 425 Intro to Probability Lecture 37. Example continued. Example

Example continued. Math 425 Intro to Probability Lecture 37. Example continued. Example continued : Coin tossing Math 425 Intro to Probability Lecture 37 Kenneth Harris kaharri@umich.edu Department of Mathematics University of Michigan April 8, 2009 Consider a Bernoulli trials process with

More information

Notes on Zero Knowledge

Notes on Zero Knowledge U.C. Berkeley CS172: Automata, Computability and Complexity Handout 9 Professor Luca Trevisan 4/21/2015 Notes on Zero Knowledge These notes on zero knowledge protocols for quadratic residuosity are based

More information

Lecture 7: ɛ-biased and almost k-wise independent spaces

Lecture 7: ɛ-biased and almost k-wise independent spaces Lecture 7: ɛ-biased and almost k-wise independent spaces Topics in Complexity Theory and Pseudorandomness (pring 203) Rutgers University wastik Kopparty cribes: Ben Lund, Tim Naumovitz Today we will see

More information

CS280, Spring 2004: Final

CS280, Spring 2004: Final CS280, Spring 2004: Final 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

More information

Computer Science A Cryptography and Data Security. Claude Crépeau

Computer Science A Cryptography and Data Security. Claude Crépeau Computer Science 308-547A Cryptography and Data Security Claude Crépeau These notes are, largely, transcriptions by Anton Stiglic of class notes from the former course Cryptography and Data Security (308-647A)

More information

Ma/CS 6b Class 15: The Probabilistic Method 2

Ma/CS 6b Class 15: The Probabilistic Method 2 Ma/CS 6b Class 15: The Probabilistic Method 2 By Adam Sheffer Reminder: Random Variables A random variable is a function from the set of possible events to R. Example. Say that we flip five coins. We can

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 16. A Brief Introduction to Continuous Probability

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 16. A Brief Introduction to Continuous Probability CS 7 Discrete Mathematics and Probability Theory Fall 213 Vazirani Note 16 A Brief Introduction to Continuous Probability Up to now we have focused exclusively on discrete probability spaces Ω, where the

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Announcements: Homework 6 deadline extended to April 24 th at 11:59 PM Course Evaluation Survey: Live until 4/29/2018

More information

Lecture 1: January 16

Lecture 1: January 16 CS271 Randomness & Computation Spring 2018 Instructor: Alistair Sinclair Lecture 1: January 16 Disclaimer: These notes have not been subjected to the usual scrutiny accorded to formal publications. They

More information