Great Theoretical Ideas in Computer Science

Size: px
Start display at page:

Download "Great Theoretical Ideas in Computer Science"

Transcription

1 Great Theoretical Ideas in Computer Science Lecture 20: Randomized Algorithms November 5th, 2015

2 So far Formalization of computation/algorithm Computability / Uncomputability Computational complexity Graph theory and graph algorithms NP-completeness. Identifying intractable problems. Making use of intractable problems (in Social choice). Dealing with intractable problems: Approximation algs. Online algs.

3 Next

4 Randomness and the universe Does the universe have true randomness? Newtonian physics suggests that the universe evolves deterministically. Quantum physics says otherwise.

5 Randomness and the universe Does the universe have true randomness? God does not play dice with the world. - Albert Einstein Einstein, don t tell God what to do. - Niels Bohr

6 Randomness and the universe Does the universe have true randomness? Even if it doesn t, we can still model our uncertainty about things using probability. Randomness is an essential tool in modeling and analyzing nature. It also plays a key role in computer science.

7 Randomness in computer science Randomized algorithms Does randomness speed up computation? Statistics via sampling e.g. election polls Nash equilibrium in Game Theory Nash equilibrium always exists if players can have probabilistic strategies. Cryptography A secret is only as good as the entropy/uncertainty in it.

8 Randomness in computer science Randomized models for deterministic objects e.g. the www graph Quantum computing Randomness is inherent in quantum mechanics. Machine learning theory Data is generated by some probability distribution. Coding Theory Encode data to be able to deal with random noise.

9 Randomness and algorithms How can randomness be used in computation? Where can it come into the picture? Given some algorithm that solves a problem - What if the input is chosen randomly? - What if the algorithm can make random choices?

10 Randomness and algorithms How can randomness be used in computation? Where can it come into the picture? Given some algorithm that solves a problem - What if the input is chosen randomly? - What if the algorithm can make random choices?

11 Randomness and algorithms What is a randomized algorithm? A randomized algorithm is an algorithm that is allowed to flip a coin. (it can make decisions based on the output of the coin flip.) In : A randomized algorithm is an algorithm that is allowed to call: - RandInt(n) (we ll assume these take O(1) time) - Bernoulli(p)

12 Randomness and algorithms An Example def f(x): y = Bernoulli(0.5) if(y == 0): while(x > 0): print( What up? ) x = x - 1 return x+y For a fixed input (e.g. x = 3) - the output can vary - the running time can vary

13 Randomness and algorithms For a randomized algorithm, how should we: - measure its correctness? - measure its running time? If we require it to be - always correct, and - always runs in time O(T (n)) then we have a deterministic alg. with time compl. O(T (n)). (Why?)

14 Randomness and algorithms So for a randomized algorithm to be interesting: - it is not correct all the time, or - it doesn t always run in time O(T (n)), (It either gambles with correctness or running time.)

15 Types of randomized algorithms Given an array with n elements (n even). A[1 n]. Half of the array contains 0s, the other half contains 1s. Goal: Find an index that contains a 1. repeat: k = RandInt(n) if A[k] = 1, return k repeat 300 times: k = RandInt(n) if A[k] = 1, return k return Failed Doesn t gamble with correctness Gambles with run-time Gambles with correctness Doesn t gamble with run-time

16 Types of randomized algorithms repeat 300 times: k = RandInt(n) if A[k] = 1, return k return Failed Pr[failure] = Worst-case running time: O(1) This is called a Monte Carlo algorithm. (gambles with correctness but not time)

17 Types of randomized algorithms repeat: k = RandInt(n) if A[k] = 1, return k Pr[failure] = Worst-case running time: 0 can t bound (could get super unlucky) Expected running time: O(1) (2 iterations) This is called a Las Vegas algorithm. (gambles with time but not correctness)

18 Given an array with n elements (n even). A[1 n]. Half of the array contains 0s, the other half contains 1s. Goal: Find an index that contains a 1. Deterministic Monte Carlo Las Vegas Correctness always w.h.p. always Run-time (n) O(1) O(1) w.h.p. w.h.p. = with high probability

19 Formal definition: Monte Carlo algorithm Let f :! be a computational problem. Suppose A is a randomized algorithm such that: 8x 2, 8x 2, Pr[A(x) 6= f(x)] apple #stepsa(x) takes is apple T ( x ). (no matter what the random choices are) Then we say A is a T (n)-time Monte Carlo algorithm for f with probability of error.

20 Formal definition: Las Vegas algorithm Let f :! be a computational problem. Suppose A is a randomized algorithm such that: 8x 2, 8x 2, A(x) =f(x) E[# steps A(x) takes] apple T ( x ) Then we say A is a T (n)-time Las Vegas algorithm for f.

21 NEXT ON THE MENU Example of a Monte Carlo Algorithm: Min Cut Example of a Las Vegas Algorithm: Quicksort

22 Example of a Monte Carlo Algorithm: Min Cut Gambles with correctness. Doesn t gamble with running time.

23 Cut Problems Max Cut Problem (Ryan O Donnell s favorite problem): Given a graph G =(V,E), color the vertices red and blue so that the number of edges with two colors (e = {u,v}) is maximized. S V S red blue

24 Cut Problems Max Cut Problem (Ryan O Donnell s favorite problem): Given a graph G =(V,E), find a non-empty subset S V such that number of edges from S to V S is maximized. S V S size of the cut = # edges from S to V S.

25 Cut Problems Min Cut Problem (my favorite problem): Given a graph G =(V,E), find a non-empty subset S V such that number of edges from S to V S is minimized. S V S size of the cut = # edges from S to V S.

26 Contraction algorithm for min cut Let s see a super simple randomized algorithm Min-Cut.

27 Contraction algorithm for min cut a b e c d Select an edge randomly: Green edge selected. Contract that edge. Size of min-cut: 2

28 Contraction algorithm for min cut a b d e c Select an edge randomly: Size of min-cut: 2 Green edge selected. Contract that edge. (delete self loops)

29 Contraction algorithm for min cut a b d e c Select an edge randomly: Size of min-cut: 2 Purple edge selected. Contract that edge. (delete self loops)

30 Contraction algorithm for min cut a b d e c Select an edge randomly: Size of min-cut: 2 Purple edge selected. Contract that edge. (delete self loops)

31 Contraction algorithm for min cut a b d e c Select an edge randomly: Size of min-cut: 2 Blue edge selected. Contract that edge. (delete self loops)

32 Contraction algorithm for min cut a b c d e Select an edge randomly: Size of min-cut: 2 Blue edge selected. Contract that edge. (delete self loops)

33 Contraction algorithm for min cut a b c d e Select an edge randomly: Size of min-cut: 2 Blue edge selected. Contract that edge. (delete self loops) When two vertices remain, you have your cut: {a, b, c, d} {e} size: 2

34 Contraction algorithm for min cut a b e c d Select an edge randomly: Size of min-cut: 2 Green edge selected. Contract that edge. (delete self loops)

35 Contraction algorithm for min cut a b d e c Select an edge randomly: Size of min-cut: 2 Green edge selected. Contract that edge. (delete self loops)

36 Contraction algorithm for min cut a b d e c Select an edge randomly: Size of min-cut: 2 Yellow edge selected. Contract that edge. (delete self loops)

37 Contraction algorithm for min cut a b e d c Select an edge randomly: Size of min-cut: 2 Yellow edge selected. Contract that edge. (delete self loops)

38 Contraction algorithm for min cut a b e d c Select an edge randomly: Size of min-cut: 2 Red edge selected. Contract that edge. (delete self loops)

39 Contraction algorithm for min cut a c b e d Select an edge randomly: Size of min-cut: 2 Red edge selected. Contract that edge. (delete self loops)

40 Contraction algorithm for min cut a c b e d Select an edge randomly: Size of min-cut: 2 Red edge selected. Contract that edge. (delete self loops) When two vertices remain, you have your cut: {a} {b,c,d,e} size: 3

41 contract contract contract contract G = G 0! G 1! G 2!! G n 2 n vertices 2 vertices n 2 iterations Observation: For any i : A cut in of size k corresponds exactly to G i a cut in G of size k.

42 a b G e c d a G i b e d c

43 Poll Let k be the size of a minimum cut. Which of the following are true (can select more than one): For G = G 0, For every G i, k apple min v k apple min v deg G (v) deg Gi (v) For every G i, k min v deg Gi (v) For G = G 0, k min v deg G (v)

44 Poll For every G i, k apple min deg Gi (v) v i.e., for every G i and every v 2 G i, k apple deg Gi (v) Why? A single vertex v forms a cut of size deg(v). a This cut has size deg(a) =3. G i c b e d Same cut exists in original graph. So k apple 3.

45 Contraction algorithm for min cut Theorem: Let G =(V,E) be a graph with n vertices. The probability that the contraction algorithm will output a min-cut is 1/n 2. Should we be impressed? - The algorithm runs in polynomial time. - There are exponentially many cuts. (~ ~ 2 n ) - There is a way to boost the probability of success to 1 1 (and still remain in polynomial time) e n

46 Proof of theorem Fix some minimum cut. F = k V = n E = m S V S F Will show Pr[algorithm outputs F ] 1/n 2 (Note Pr[success] Pr[algorithm outputs F ])

47 Proof of theorem Fix some minimum cut. F = k V = n E = m S V S F When does the algorithm output F? What if it never picks an edge in Then it will output F. F to contract? What if the algorithm picks an edge in Then it cannot output F. F to contract?

48 Proof of theorem Fix some minimum cut. F = k V = n E = m S V S F Pr[algorithm outputs F ]= Pr[algorithm never contracts an edge in F ] = Pr[E 1 \ E 2 \ \ E n 2 ] E i = an edge in F is contracted in iteration i.

49 Proof of theorem Let E i = an edge in F is contracted in iteration i. Goal: Pr[E 1 \ E 2 \ \E n 2 ] chain rule Pr[E 1 \ E 2 \ \ E n 2 ] 1/n 2. =Pr[E 1 ] Pr[E 2 E 1 ] Pr[E 3 E 1 \ E 2 ] Pr[E n 2 E 1 \ E 2 \ \E n 3 ] Pr[E 1 ] =1 Pr[E 1 ] =1 # edges in F total # edges =1 k m want to write in terms of k and n

50 Proof of theorem Let = an edge in F is contracted in iteration i. E i Goal: Pr[E 1 \ E 2 \ \ E n 2 ] 1/n 2. V S Observation: 8v 2 V : k apple deg(v) v S X Recall: v2v Pr[E 1 ]=1 deg(v) =2m =) 2m kn kn =) m kn 2 1 = 1 k m k kn/2 2 n

51 Proof of theorem Let = an edge in F is contracted in iteration i. E i Goal: Pr[E 1 \ E 2 \ \ E n 2 ] 1/n 2. Pr[E 1 \ E 2 \ \E n 2 ] 2 1 Pr[E 2 E 1 ] Pr[E 3 E 1 \ E 2 ] n Pr[E n 2 E 1 \ E 2 \ \E n 3 ] Pr[E 2 E 1 ] =1 Pr[E 2 E 1 ] =1 k # remaining edges want to write in terms of k and n

52 Proof of theorem Let = an edge in F is contracted in iteration i. E i Goal: Pr[E 1 \ E 2 \ \ E n 2 ] 1/n 2. Let be the graph after iteration 1. G 0 =(V 0,E 0 ) Observation: 8v 2 V 0 : k apple deg G 0(v) X deg G 0(v) =2 E 0 =) 2 E 0 k(n 1) v2v 0 k(n 1) Pr[E 2 E 1 ]=1 k E 0 1 =) E 0 k k(n 1)/2 k(n 1) 2 2 = 1 n 1

53 Proof of theorem Let = an edge in F is contracted in iteration i. E i Goal: Pr[E 1 \ E 2 \ \ E n 2 ] 1/n 2. Pr[E 1 \ E 2 \ \E n 2 ] n 2 n 1 Pr[E 3 E 1 \ E 2 ] Pr[E n 2 E 1 \ E 2 \ \E n 3 ]

54 Proof of theorem Let = an edge in F is contracted in iteration i. E i Goal: Pr[E 1 \ E 2 \ \ E n 2 ] 1/n 2. Pr[E 1 \ E 2 \ \E n 2 ] n 2 1 n n n (n 4) 2 n (n 3) = n 2 n n 3 n 4 n 5 n 1 n 2 n = 2 n(n 1) 1 n 2

55 Contraction algorithm for min cut Theorem: Let G =(V,E) be a graph with n vertices. The probability that the contraction algorithm will output a min-cut is 1/n 2. Should we be impressed? - The algorithm runs in polynomial time. - There are exponentially many cuts. (~ ~ 2 n ) - There is a way to boost the probability of success to 1 1 (and still remain in polynomial time) e n

56 Contraction algorithm for min cut Theorem: Let G =(V,E) be a graph with n vertices. The probability that the contraction algorithm will output a min-cut is 1/n 2. Should we be impressed? - The algorithm runs in polynomial time. - There are exponentially many cuts. (~ ~ 2 n ) - There is a way to boost the probability of success to 1 1 (and still remain in polynomial time) e n

57 Boosting phase Run the algorithm t times using fresh random bits. Output the smallest cut among the ones you find. G G G G Contraction Algorithm Contraction Algorithm Contraction Algorithm Contraction Algorithm F 1 F 2 F 3 F t Output the minimum among F i s. larger t =) better success probability What is the relation between t and success probability?

58 Boosting phase What is the relation between t and success probability? Let A i = in the i th repetition, we don t find a min cut. Pr[error] = Pr[don t find a min cut] =Pr[A 1 \ A 2 \ \ A t ] ind. events =Pr[A 1 ]Pr[A 2 ] Pr[A t ] t apple 1 =Pr[A 1 ] t 1 n 2

59 Pr[error] apple 1 Boosting phase 1 n 2 t Extremely useful inequality: 8x 2 R : 1+x apple e x

60 Pr[error] apple 1 Boosting phase 1 n 2 t Extremely useful inequality: 8x 2 R : 1+x apple e x Let x = 1/n 2 Pr[error] apple (1 + x) t apple (e x ) t = e xt = e t/n2 t = n 3 =) Pr[error] apple e n3 /n 2 =1/e n =) Pr[success] 1 1 e n

61 Conclusion for min cut We have a polynomial time algorithm that solves the min cut problem with probability 1 1/e n. Theoretically, not equal to 1. Practically, equal to 1.

62 Important Note Boosting is not specific to Min-cut algorithm. We can boost the success probability of Monte Carlo algorithms via repeated trials.

63 Example of a Las Vegas Algorithm: Quicksort Doesn t gamble with correctness. Gambles with running time.

64 Quicksort Algorithm On input S =(x 1,x 2,...,x n ) - If n apple 1, return S

65 Quicksort Algorithm On input S =(x 1,x 2,...,x n ) - If n apple 1, return S - Pick uniformly at random a pivot x m

66 Quicksort Algorithm On input S =(x 1,x 2,...,x n ) - If n apple 1, return S - Pick uniformly at random a pivot x m

67 Quicksort Algorithm On input S =(x 1,x 2,...,x n ) - If n apple 1, return S Pick uniformly at random a pivot x m Compare x m to all other x s Let S 1 = {x i : x i <x m }, S 2 = {x i : x i >x m }

68 Quicksort Algorithm S 1 On input S =(x 1,x 2,...,x n ) - If n apple 1, return S Pick uniformly at random a pivot x m Compare x m to all other x s Let S 1 = {x i : x i <x m }, S 2 = {x i : x i >x m }

69 Quicksort Algorithm S 1 S 2 On input S =(x 1,x 2,...,x n ) - If n apple 1, return S Pick uniformly at random a pivot x m Compare x m to all other x s Let S 1 = {x i : x i <x m }, S 2 = {x i : x i >x m }

70 Quicksort Algorithm S 1 S 2 On input S =(x 1,x 2,...,x n ) - If n apple 1, return S Pick uniformly at random a pivot x m Compare x m to all other x s Let S 1 = {x i : x i <x m }, S 2 = {x i : x i >x m } Recursively sort S 1 and S 2.

71 Quicksort Algorithm S 1 S 2 On input S =(x 1,x 2,...,x n ) - If n apple 1, return S Pick uniformly at random a pivot x m Compare x m to all other x s Let S 1 = {x i : x i <x m }, S 2 = {x i : x i >x m } Recursively sort S 1 and S 2.

72 Quicksort Algorithm S 1 S 2 On input S =(x 1,x 2,...,x n ) - If n apple 1, return S Pick uniformly at random a pivot x m Compare x m to all other x s Let S 1 = {x i : x i <x m }, S 2 = {x i : x i >x m } Recursively sort S 1 and S 2. Return [S 1,x m,s 2 ]

73 Quicksort Algorithm This is a Las Vegas algorithm: - always gives the correct answer - running time can vary depending on our luck It is not too difficult to show that the expected run-time is apple 2n ln n = O(n log n). In practice, it is basically the fastest sorting algorithm!

74 Final remarks Randomness adds an interesting dimension to computation. Randomized algorithms can be faster and much more elegant than their deterministic counterparts. There are some interesting problems for which: - there is a poly-time randomized algorithm, - we can t find a poly-time deterministic algorithm. Another (morally) million dollar question: Does every efficient randomized algorithm have an efficient deterministic counterpart? Is P = BPP?

Design and Analysis of Algorithms (VII)

Design and Analysis of Algorithms (VII) Design and Analysis of Algorithms (VII) An Introduction to Randomized Algorithms Guoqiang Li School of Software, Shanghai Jiao Tong University Randomized Algorithms algorithms which employ a degree of

More information

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748 COT 6936: Topics in Algorithms! Giri Narasimhan ECS 254A / EC 2443; Phone: x3748 giri@cs.fiu.edu http://www.cs.fiu.edu/~giri/teach/cot6936_s12.html https://moodle.cis.fiu.edu/v2.1/course/view.php?id=174

More information

Randomized algorithms have several advantages over deterministic ones. We discuss them here:

Randomized algorithms have several advantages over deterministic ones. We discuss them here: CS787: Advanced Algorithms Lecture 6: Randomized Algorithms In this lecture we introduce randomized algorithms. We will begin by motivating the use of randomized algorithms through a few examples. Then

More information

1 Minimum Cut Problem

1 Minimum Cut Problem CS 6 Lecture 6 Min Cut and Karger s Algorithm Scribes: Peng Hui How, Virginia Williams (05) Date: November 7, 07 Anthony Kim (06), Mary Wootters (07) Adapted from Virginia Williams lecture notes Minimum

More information

CPSC 536N: Randomized Algorithms Term 2. Lecture 10

CPSC 536N: Randomized Algorithms Term 2. Lecture 10 CPSC 536N: Randomized Algorithms 011-1 Term Prof. Nick Harvey Lecture 10 University of British Columbia In the first lecture we discussed the Max Cut problem, which is NP-complete, and we presented a very

More information

Lecture 1 Aug. 26, 2015

Lecture 1 Aug. 26, 2015 CS 388R: Randomized Algorithms Fall 015 Prof. Eric Price Lecture 1 Aug. 6, 015 Scribe: Ashish Bora, Jessica Hoffmann 1 Overview In this lecture, we get a first taste of randomized algorithms, from definition

More information

Lecture 1 August 31, 2017

Lecture 1 August 31, 2017 CS 388R: Randomized Algorithms Fall 017 Lecture 1 August 31, 017 Prof. Eric Price Scribe: Garrett Goble, Daniel Brown NOTE: THESE NOTES HAVE NOT BEEN EDITED OR CHECKED FOR CORRECTNESS 1 Randomized Algorithms

More information

Introduction to Randomized Algorithms

Introduction to Randomized Algorithms Introduction to Randomized Algorithms Gopinath Mishra Advanced Computing and Microelectronics Unit Indian Statistical Institute Kolkata 700108, India. Organization 1 Introduction 2 Some basic ideas from

More information

Lecture 1: A Monte Carlo Minimum Cut Algorithm

Lecture 1: A Monte Carlo Minimum Cut Algorithm Randomized Algorithms Lecture 1: A Monte Carlo Minimum Cut Algorithm Sotiris Nikoletseas Professor CEID - ETY Course 2017-2018 Sotiris Nikoletseas, Professor A Monte Carlo Minimum Cut Algorithm 1 / 32

More information

Outline. CS38 Introduction to Algorithms. Approximation Algorithms. Optimization Problems. Set Cover. Set cover 5/29/2014. coping with intractibility

Outline. CS38 Introduction to Algorithms. Approximation Algorithms. Optimization Problems. Set Cover. Set cover 5/29/2014. coping with intractibility Outline CS38 Introduction to Algorithms Lecture 18 May 29, 2014 coping with intractibility approximation algorithms set cover TSP center selection randomness in algorithms May 29, 2014 CS38 Lecture 18

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 22.1 Introduction We spent the last two lectures proving that for certain problems, we can

More information

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Algorithms and Game Theory Date: 12/3/15

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Algorithms and Game Theory Date: 12/3/15 600.363 Introduction to Algorithms / 600.463 Algorithms I Lecturer: Michael Dinitz Topic: Algorithms and Game Theory Date: 12/3/15 25.1 Introduction Today we re going to spend some time discussing game

More information

Randomized Algorithms

Randomized Algorithms Randomized Algorithms Textbook: Randomized Algorithms, by Rajeev Motwani and Prabhakar Raghavan. 1 Randomized Algorithms A Randomized Algorithm uses a random number generator. its behavior is determined

More information

UCT Algorithm Circle: Probabilistic Algorithms

UCT Algorithm Circle: Probabilistic Algorithms UCT Algorithm Circle: 24 February 2011 Outline 1 2 3 Probabilistic algorithm A probabilistic algorithm is one which uses a source of random information The randomness used may result in randomness in the

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

More information

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14 600.363 Introduction to Algorithms / 600.463 Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14 23.1 Introduction We spent last week proving that for certain problems,

More information

15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015

15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015 15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015 While we have good algorithms for many optimization problems, the previous lecture showed that many

More information

Randomized Algorithms Week 4: Decision Problems

Randomized Algorithms Week 4: Decision Problems Randomized Algorithms Week 4: Decision Problems Rao Kosaraju 4.1 Decision Problems Definition 1. Decision Problem: For a language L over an alphabet, given any x, is x L. Definition 2. Las Vegas Algorithm:

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization Frank de Zeeuw EPFL 2012 Today Introduction Graph problems - What combinatorial things will we be optimizing? Algorithms - What kind of solution are we looking for? Linear Programming

More information

The complement of PATH is in NL

The complement of PATH is in NL 340 The complement of PATH is in NL Let c be the number of nodes in graph G that are reachable from s We assume that c is provided as an input to M Given G, s, t, and c the machine M operates as follows:

More information

Greedy Approximations

Greedy Approximations CS 787: Advanced Algorithms Instructor: Dieter van Melkebeek Greedy Approximations Approximation algorithms give a solution to a problem in polynomial time, at most a given factor away from the correct

More information

Approximation Algorithms

Approximation Algorithms 15-251: Great Ideas in Theoretical Computer Science Spring 2019, Lecture 14 March 5, 2019 Approximation Algorithms 1 2 SAT 3SAT Clique Hamiltonian- Cycle given a Boolean formula F, is it satisfiable? same,

More information

CS 231: Algorithmic Problem Solving

CS 231: Algorithmic Problem Solving CS 231: Algorithmic Problem Solving Naomi Nishimura Module 7 Date of this version: January 28, 2019 WARNING: Drafts of slides are made available prior to lecture for your convenience. After lecture, slides

More information

princeton univ. F 15 cos 521: Advanced Algorithm Design Lecture 2: Karger s Min Cut Algorithm

princeton univ. F 15 cos 521: Advanced Algorithm Design Lecture 2: Karger s Min Cut Algorithm princeton univ. F 5 cos 5: Advanced Algorithm Design Lecture : Karger s Min Cut Algorithm Lecturer: Pravesh Kothari Scribe:Pravesh (These notes are a slightly modified version of notes from previous offerings

More information

Partha Sarathi Mandal

Partha Sarathi Mandal MA 515: Introduction to Algorithms & MA353 : Design and Analysis of Algorithms [3-0-0-6] Lecture 39 http://www.iitg.ernet.in/psm/indexing_ma353/y09/index.html Partha Sarathi Mandal psm@iitg.ernet.in Dept.

More information

COSC 311: ALGORITHMS HW1: SORTING

COSC 311: ALGORITHMS HW1: SORTING COSC 311: ALGORITHMS HW1: SORTIG Solutions 1) Theoretical predictions. Solution: On randomly ordered data, we expect the following ordering: Heapsort = Mergesort = Quicksort (deterministic or randomized)

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17 5.1 Introduction You should all know a few ways of sorting in O(n log n)

More information

6 Randomized rounding of semidefinite programs

6 Randomized rounding of semidefinite programs 6 Randomized rounding of semidefinite programs We now turn to a new tool which gives substantially improved performance guarantees for some problems We now show how nonlinear programming relaxations can

More information

CSE 203A: Karger s Min-Cut Algorithm (Lecture Date: 5/11/06)

CSE 203A: Karger s Min-Cut Algorithm (Lecture Date: 5/11/06) CSE 03A: Karger s Min-Cut Algorithm (Lecture Date: 5/11/06) Evan Ettinger May 19, 006 1 General Min-Cut Problem There are typically main types of cut problems. The s-t cut problem asks how we can find

More information

RAM with Randomization and Quick Sort

RAM with Randomization and Quick Sort Yufei Tao ITEE University of Queensland So far all our algorithms are deterministic, namely, they do not involve any randomization. In computer science, randomized algorithms play a very important role.

More information

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis Lecture 16 Class URL: http://vlsicad.ucsd.edu/courses/cse21-s14/ Lecture 16 Notes Goals for this week Graph basics Types

More information

A Randomized Algorithm for Minimum Cuts

A Randomized Algorithm for Minimum Cuts Randomized lgorithm for Minimum uts ndreas Klappenecker randomized algorithm is an algorithm that receives, in addition to its input, a stream of random bits which is used to make random choices. The random

More information

Welcome to the course Algorithm Design

Welcome to the course Algorithm Design Welcome to the course Algorithm Design Summer Term 2011 Friedhelm Meyer auf der Heide Lecture 13, 15.7.2011 Friedhelm Meyer auf der Heide 1 Topics - Divide & conquer - Dynamic programming - Greedy Algorithms

More information

Treaps. 1 Binary Search Trees (BSTs) CSE341T/CSE549T 11/05/2014. Lecture 19

Treaps. 1 Binary Search Trees (BSTs) CSE341T/CSE549T 11/05/2014. Lecture 19 CSE34T/CSE549T /05/04 Lecture 9 Treaps Binary Search Trees (BSTs) Search trees are tree-based data structures that can be used to store and search for items that satisfy a total order. There are many types

More information

val(y, I) α (9.0.2) α (9.0.3)

val(y, I) α (9.0.2) α (9.0.3) CS787: Advanced Algorithms Lecture 9: Approximation Algorithms In this lecture we will discuss some NP-complete optimization problems and give algorithms for solving them that produce a nearly optimal,

More information

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises...

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises... Modules 6 Hamilton Graphs (4-8 lectures) 135 6.1 Introduction................................ 136 6.2 Necessary conditions and sufficient conditions............. 137 Exercises..................................

More information

Fast Sorting and Selection. A Lower Bound for Worst Case

Fast Sorting and Selection. A Lower Bound for Worst Case Lists and Iterators 0//06 Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 0 Fast Sorting and Selection USGS NEIC. Public domain government

More information

Lecturers: Sanjam Garg and Prasad Raghavendra March 20, Midterm 2 Solutions

Lecturers: Sanjam Garg and Prasad Raghavendra March 20, Midterm 2 Solutions U.C. Berkeley CS70 : Algorithms Midterm 2 Solutions Lecturers: Sanjam Garg and Prasad aghavra March 20, 207 Midterm 2 Solutions. (0 points) True/False Clearly put your answers in the answer box in front

More information

Approximation Algorithms

Approximation Algorithms Chapter 8 Approximation Algorithms Algorithm Theory WS 2016/17 Fabian Kuhn Approximation Algorithms Optimization appears everywhere in computer science We have seen many examples, e.g.: scheduling jobs

More information

6.856 Randomized Algorithms

6.856 Randomized Algorithms 6.856 Randomized Algorithms David Karger Handout #4, September 21, 2002 Homework 1 Solutions Problem 1 MR 1.8. (a) The min-cut algorithm given in class works because at each step it is very unlikely (probability

More information

4 Greedy Approximation for Set Cover

4 Greedy Approximation for Set Cover COMPSCI 532: Design and Analysis of Algorithms October 14, 2015 Lecturer: Debmalya Panigrahi Lecture 12 Scribe: Allen Xiao 1 Overview In this lecture, we introduce approximation algorithms and their analysis

More information

CS364A: Algorithmic Game Theory Lecture #19: Pure Nash Equilibria and PLS-Completeness

CS364A: Algorithmic Game Theory Lecture #19: Pure Nash Equilibria and PLS-Completeness CS364A: Algorithmic Game Theory Lecture #19: Pure Nash Equilibria and PLS-Completeness Tim Roughgarden December 2, 2013 1 The Big Picture We now have an impressive list of tractability results polynomial-time

More information

Last week: Breadth-First Search

Last week: Breadth-First Search 1 Last week: Breadth-First Search Set L i = [] for i=1,,n L 0 = {w}, where w is the start node For i = 0,, n-1: For u in L i : For each v which is a neighbor of u: If v isn t yet visited: - mark v as visited,

More information

CSCI-B609: A Theorist s Toolkit, Fall 2016 Sept. 6, Firstly let s consider a real world problem: community detection.

CSCI-B609: A Theorist s Toolkit, Fall 2016 Sept. 6, Firstly let s consider a real world problem: community detection. CSCI-B609: A Theorist s Toolkit, Fall 016 Sept. 6, 016 Lecture 03: The Sparsest Cut Problem and Cheeger s Inequality Lecturer: Yuan Zhou Scribe: Xuan Dong We will continue studying the spectral graph theory

More information

COMP 161 Lecture Notes 16 Analyzing Search and Sort

COMP 161 Lecture Notes 16 Analyzing Search and Sort COMP 161 Lecture Notes 16 Analyzing Search and Sort In these notes we analyze search and sort. Counting Operations When we analyze the complexity of procedures we re determine the order of the number of

More information

K 4 C 5. Figure 4.5: Some well known family of graphs

K 4 C 5. Figure 4.5: Some well known family of graphs 08 CHAPTER. TOPICS IN CLASSICAL GRAPH THEORY K, K K K, K K, K K, K C C C C 6 6 P P P P P. Graph Operations Figure.: Some well known family of graphs A graph Y = (V,E ) is said to be a subgraph of a graph

More information

Probabilistic (Randomized) algorithms

Probabilistic (Randomized) algorithms Probabilistic (Randomized) algorithms Idea: Build algorithms using a random element so as gain improved performance. For some cases, improved performance is very dramatic, moving from intractable to tractable.

More information

Randomized Algorithms, Hash Functions

Randomized Algorithms, Hash Functions Randomized Algorithms, Hash Functions Lecture A Tiefenbruck MWF 9-9:50am Center 212 Lecture B Jones MWF 2-2:50pm Center 214 Lecture C Tiefenbruck MWF 11-11:50am Center 212 http://cseweb.ucsd.edu/classes/wi16/cse21-abc/

More information

11.1 Facility Location

11.1 Facility Location CS787: Advanced Algorithms Scribe: Amanda Burton, Leah Kluegel Lecturer: Shuchi Chawla Topic: Facility Location ctd., Linear Programming Date: October 8, 2007 Today we conclude the discussion of local

More information

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Dynamic Programming I Date: 10/6/16

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Dynamic Programming I Date: 10/6/16 600.463 Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Dynamic Programming I Date: 10/6/16 11.1 Introduction Dynamic programming can be very confusing until you ve used it a

More information

31.6 Powers of an element

31.6 Powers of an element 31.6 Powers of an element Just as we often consider the multiples of a given element, modulo, we consider the sequence of powers of, modulo, where :,,,,. modulo Indexing from 0, the 0th value in this sequence

More information

You ve already read basics of simulation now I will be taking up method of simulation, that is Random Number Generation

You ve already read basics of simulation now I will be taking up method of simulation, that is Random Number Generation Unit 5 SIMULATION THEORY Lesson 39 Learning objective: To learn random number generation. Methods of simulation. Monte Carlo method of simulation You ve already read basics of simulation now I will be

More information

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch] NP Completeness Andreas Klappenecker [partially based on slides by Jennifer Welch] Dealing with NP-Complete Problems Dealing with NP-Completeness Suppose the problem you need to solve is NP-complete. What

More information

Introduction to Graph Theory

Introduction to Graph Theory Introduction to Graph Theory Tandy Warnow January 20, 2017 Graphs Tandy Warnow Graphs A graph G = (V, E) is an object that contains a vertex set V and an edge set E. We also write V (G) to denote the vertex

More information

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 600.469 / 600.669 Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 9.1 Linear Programming Suppose we are trying to approximate a minimization

More information

1 Probabilistic analysis and randomized algorithms

1 Probabilistic analysis and randomized algorithms 1 Probabilistic analysis and randomized algorithms Consider the problem of hiring an office assistant. We interview candidates on a rolling basis, and at any given point we want to hire the best candidate

More information

Approximation Basics

Approximation Basics Milestones, Concepts, and Examples Xiaofeng Gao Department of Computer Science and Engineering Shanghai Jiao Tong University, P.R.China Spring 2015 Spring, 2015 Xiaofeng Gao 1/53 Outline History NP Optimization

More information

6.842 Randomness and Computation September 25-27, Lecture 6 & 7. Definition 1 Interactive Proof Systems (IPS) [Goldwasser, Micali, Rackoff]

6.842 Randomness and Computation September 25-27, Lecture 6 & 7. Definition 1 Interactive Proof Systems (IPS) [Goldwasser, Micali, Rackoff] 6.84 Randomness and Computation September 5-7, 017 Lecture 6 & 7 Lecturer: Ronitt Rubinfeld Scribe: Leo de Castro & Kritkorn Karntikoon 1 Interactive Proof Systems An interactive proof system is a protocol

More information

Sorting. Sorting. Stable Sorting. In-place Sort. Bubble Sort. Bubble Sort. Selection (Tournament) Heapsort (Smoothsort) Mergesort Quicksort Bogosort

Sorting. Sorting. Stable Sorting. In-place Sort. Bubble Sort. Bubble Sort. Selection (Tournament) Heapsort (Smoothsort) Mergesort Quicksort Bogosort Principles of Imperative Computation V. Adamchik CS 15-1 Lecture Carnegie Mellon University Sorting Sorting Sorting is ordering a list of objects. comparison non-comparison Hoare Knuth Bubble (Shell, Gnome)

More information

Lecture 9: Sorting Algorithms

Lecture 9: Sorting Algorithms Lecture 9: Sorting Algorithms Bo Tang @ SUSTech, Spring 2018 Sorting problem Sorting Problem Input: an array A[1..n] with n integers Output: a sorted array A (in ascending order) Problem is: sort A[1..n]

More information

13 Randomized Minimum Cut

13 Randomized Minimum Cut Jaques: But, for the seventh cause; how did you find the quarrel on the seventh cause? Touchstone: Upon a lie seven times removed: bear your body more seeming, Audrey: as thus, sir. I did dislike the cut

More information

Computational Complexity and Implications for Security DRAFT Notes on Infeasible Computation for MA/CS 109 Leo Reyzin with the help of Nick Benes

Computational Complexity and Implications for Security DRAFT Notes on Infeasible Computation for MA/CS 109 Leo Reyzin with the help of Nick Benes Computational Complexity and Implications for Security DRAFT Notes on Infeasible Computation for MA/CS 109 Leo Reyzin with the help of Nick Benes The Study of Computational Complexity Let s summarize what

More information

CPSC 536N: Randomized Algorithms Term 2. Lecture 4

CPSC 536N: Randomized Algorithms Term 2. Lecture 4 CPSC 536N: Randomized Algorithms 2011-12 Term 2 Prof. Nick Harvey Lecture 4 University of British Columbia In today s lecture we will see two applications of negative binomially distributed random variables.

More information

10.4 Linear interpolation method Newton s method

10.4 Linear interpolation method Newton s method 10.4 Linear interpolation method The next best thing one can do is the linear interpolation method, also known as the double false position method. This method works similarly to the bisection method by

More information

Lecture 18. What we ve done and what s to come

Lecture 18. What we ve done and what s to come Lecture 18 What we ve done and what s to come Announcements Final exam: 3:30 6:30pm, Wednesday 12/13, 320-105. You may bring two double-sided sheets of notes Format: similar to the midterm Resources Practice

More information

Theory and Frontiers of Computer Science. Fall 2013 Carola Wenk

Theory and Frontiers of Computer Science. Fall 2013 Carola Wenk Theory and Frontiers of Computer Science Fall 2013 Carola Wenk We have seen so far Computer Architecture and Digital Logic (Von Neumann Architecture, binary numbers, circuits) Introduction to Python (if,

More information

Graph Theory and Optimization Approximation Algorithms

Graph Theory and Optimization Approximation Algorithms Graph Theory and Optimization Approximation Algorithms Nicolas Nisse Université Côte d Azur, Inria, CNRS, I3S, France October 2018 Thank you to F. Giroire for some of the slides N. Nisse Graph Theory and

More information

Graph Algorithms. Chromatic Polynomials. Graph Algorithms

Graph Algorithms. Chromatic Polynomials. Graph Algorithms Graph Algorithms Chromatic Polynomials Graph Algorithms Chromatic Polynomials Definition G a simple labelled graph with n vertices and m edges. k a positive integer. P G (k) number of different ways of

More information

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19:

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19: CS270 Combinatorial Algorithms & Data Structures Spring 2003 Lecture 19: 4.1.03 Lecturer: Satish Rao Scribes: Kevin Lacker and Bill Kramer Disclaimer: These notes have not been subjected to the usual scrutiny

More information

EECS 2011M: Fundamentals of Data Structures

EECS 2011M: Fundamentals of Data Structures M: Fundamentals of Data Structures Instructor: Suprakash Datta Office : LAS 3043 Course page: http://www.eecs.yorku.ca/course/2011m Also on Moodle Note: Some slides in this lecture are adopted from James

More information

Algorithm Analysis. (Algorithm Analysis ) Data Structures and Programming Spring / 48

Algorithm Analysis. (Algorithm Analysis ) Data Structures and Programming Spring / 48 Algorithm Analysis (Algorithm Analysis ) Data Structures and Programming Spring 2018 1 / 48 What is an Algorithm? An algorithm is a clearly specified set of instructions to be followed to solve a problem

More information

CS 137 Part 8. Merge Sort, Quick Sort, Binary Search. November 20th, 2017

CS 137 Part 8. Merge Sort, Quick Sort, Binary Search. November 20th, 2017 CS 137 Part 8 Merge Sort, Quick Sort, Binary Search November 20th, 2017 This Week We re going to see two more complicated sorting algorithms that will be our first introduction to O(n log n) sorting algorithms.

More information

CSCI 5454 Ramdomized Min Cut

CSCI 5454 Ramdomized Min Cut CSCI 5454 Ramdomized Min Cut Sean Wiese, Ramya Nair April 8, 013 1 Randomized Minimum Cut A classic problem in computer science is finding the minimum cut of an undirected graph. If we are presented with

More information

Randomized Graph Algorithms

Randomized Graph Algorithms Randomized Graph Algorithms Vasileios-Orestis Papadigenopoulos School of Electrical and Computer Engineering - NTUA papadigenopoulos orestis@yahoocom July 22, 2014 Vasileios-Orestis Papadigenopoulos (NTUA)

More information

Stanford University CS359G: Graph Partitioning and Expanders Handout 18 Luca Trevisan March 3, 2011

Stanford University CS359G: Graph Partitioning and Expanders Handout 18 Luca Trevisan March 3, 2011 Stanford University CS359G: Graph Partitioning and Expanders Handout 8 Luca Trevisan March 3, 20 Lecture 8 In which we prove properties of expander graphs. Quasirandomness of Expander Graphs Recall that

More information

Min-Cut and Randomization

Min-Cut and Randomization Min-Cut and Randomization Algorithm Design Kleinberg and Tardos, section 13. Notes by Scoπ Alfeld 17.11.08 1: Min-Cut We define the problem of Min-Cut as follows. Given an undirected graph G = {V, E} with

More information

13 Distribution Ray Tracing

13 Distribution Ray Tracing 13 In (hereafter abbreviated as DRT ), our goal is to render a scene as accurately as possible. Whereas Basic Ray Tracing computed a very crude approximation to radiance at a point, in DRT we will attempt

More information

The Probabilistic Method

The Probabilistic Method The Probabilistic Method Po-Shen Loh June 2010 1 Warm-up 1. (Russia 1996/4 In the Duma there are 1600 delegates, who have formed 16000 committees of 80 persons each. Prove that one can find two committees

More information

Review of course COMP-251B winter 2010

Review of course COMP-251B winter 2010 Review of course COMP-251B winter 2010 Lecture 1. Book Section 15.2 : Chained matrix product Matrix product is associative Computing all possible ways of parenthesizing Recursive solution Worst-case running-time

More information

INDIAN STATISTICAL INSTITUTE

INDIAN STATISTICAL INSTITUTE INDIAN STATISTICAL INSTITUTE Mid Semestral Examination M. Tech (CS) - II Year, 202-203 (Semester - IV) Topics in Algorithms and Complexity Date : 28.02.203 Maximum Marks : 60 Duration : 2.5 Hours Note:

More information

UML CS Algorithms Qualifying Exam Spring, 2004 ALGORITHMS QUALIFYING EXAM

UML CS Algorithms Qualifying Exam Spring, 2004 ALGORITHMS QUALIFYING EXAM NAME: This exam is open: - books - notes and closed: - neighbors - calculators ALGORITHMS QUALIFYING EXAM The upper bound on exam time is 3 hours. Please put all your work on the exam paper. (Partial credit

More information

Topic: Local Search: Max-Cut, Facility Location Date: 2/13/2007

Topic: Local Search: Max-Cut, Facility Location Date: 2/13/2007 CS880: Approximations Algorithms Scribe: Chi Man Liu Lecturer: Shuchi Chawla Topic: Local Search: Max-Cut, Facility Location Date: 2/3/2007 In previous lectures we saw how dynamic programming could be

More information

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 1 Review Dr. Ted Ralphs IE316 Quiz 1 Review 1 Reading for The Quiz Material covered in detail in lecture. 1.1, 1.4, 2.1-2.6, 3.1-3.3, 3.5 Background material

More information

Extremal Graph Theory: Turán s Theorem

Extremal Graph Theory: Turán s Theorem Bridgewater State University Virtual Commons - Bridgewater State University Honors Program Theses and Projects Undergraduate Honors Program 5-9-07 Extremal Graph Theory: Turán s Theorem Vincent Vascimini

More information

Graph theory - solutions to problem set 1

Graph theory - solutions to problem set 1 Graph theory - solutions to problem set 1 1. (a) Is C n a subgraph of K n? Exercises (b) For what values of n and m is K n,n a subgraph of K m? (c) For what n is C n a subgraph of K n,n? (a) Yes! (you

More information

10. EXTENDING TRACTABILITY

10. EXTENDING TRACTABILITY 0. EXTENDING TRACTABILITY finding small vertex covers solving NP-hard problems on trees circular arc coverings vertex cover in bipartite graphs Lecture slides by Kevin Wayne Copyright 005 Pearson-Addison

More information

Lecture 4 Median and Selection

Lecture 4 Median and Selection Lecture 4 Median and Selection Announcements! HW1 due Friday. HW2 posted Friday. I m going to try to either take a short break around 11:20. If you need to leave at 11:20, please wait for that break so

More information

AXIOMS FOR THE INTEGERS

AXIOMS FOR THE INTEGERS AXIOMS FOR THE INTEGERS BRIAN OSSERMAN We describe the set of axioms for the integers which we will use in the class. The axioms are almost the same as what is presented in Appendix A of the textbook,

More information

Chapter 8. NP-complete problems

Chapter 8. NP-complete problems Chapter 8. NP-complete problems Search problems E cient algorithms We have developed algorithms for I I I I I finding shortest paths in graphs, minimum spanning trees in graphs, matchings in bipartite

More information

1 Better Approximation of the Traveling Salesman

1 Better Approximation of the Traveling Salesman Stanford University CS261: Optimization Handout 4 Luca Trevisan January 13, 2011 Lecture 4 In which we describe a 1.5-approximate algorithm for the Metric TSP, we introduce the Set Cover problem, observe

More information

Graph Theory Day Four

Graph Theory Day Four Graph Theory Day Four February 8, 018 1 Connected Recall from last class, we discussed methods for proving a graph was connected. Our two methods were 1) Based on the definition, given any u, v V(G), there

More information

Approximation Algorithms: The Primal-Dual Method. My T. Thai

Approximation Algorithms: The Primal-Dual Method. My T. Thai Approximation Algorithms: The Primal-Dual Method My T. Thai 1 Overview of the Primal-Dual Method Consider the following primal program, called P: min st n c j x j j=1 n a ij x j b i j=1 x j 0 Then the

More information

Solving Linear Recurrence Relations (8.2)

Solving Linear Recurrence Relations (8.2) EECS 203 Spring 2016 Lecture 18 Page 1 of 10 Review: Recurrence relations (Chapter 8) Last time we started in on recurrence relations. In computer science, one of the primary reasons we look at solving

More information

Introduction to Algorithms

Introduction to Algorithms Introduction to Algorithms 6.046J/18.401 Lecture 21 Prof. Piotr Indyk P vs NP (interconnectedness of all things) A whole course by itself We ll do just two lectures More in 6.045, 6.840J, etc. Introduction

More information

CS154, Lecture 18: 1

CS154, Lecture 18: 1 CS154, Lecture 18: 1 CS 154 Final Exam Wednesday December 13, 12:15-3:15 pm Skilling Auditorium You re allowed one double-sided sheet of notes Exam is comprehensive (but will emphasize post-midterm topics)

More information

Exact Sampling for Hardy- Weinberg Equilibrium

Exact Sampling for Hardy- Weinberg Equilibrium Exact Sampling for Hardy- Weinberg Equilibrium Mark Huber Dept. of Mathematics and Institute of Statistics and Decision Sciences Duke University mhuber@math.duke.edu www.math.duke.edu/~mhuber Joint work

More information

1 Achieving IND-CPA security

1 Achieving IND-CPA security ISA 562: Information Security, Theory and Practice Lecture 2 1 Achieving IND-CPA security 1.1 Pseudorandom numbers, and stateful encryption As we saw last time, the OTP is perfectly secure, but it forces

More information

Linear Programming Motivation: The Diet Problem

Linear Programming Motivation: The Diet Problem Agenda We ve done Greedy Method Divide and Conquer Dynamic Programming Network Flows & Applications NP-completeness Now Linear Programming and the Simplex Method Hung Q. Ngo (SUNY at Buffalo) CSE 531 1

More information

Heuristic Optimization Today: Linear Programming. Tobias Friedrich Chair for Algorithm Engineering Hasso Plattner Institute, Potsdam

Heuristic Optimization Today: Linear Programming. Tobias Friedrich Chair for Algorithm Engineering Hasso Plattner Institute, Potsdam Heuristic Optimization Today: Linear Programming Chair for Algorithm Engineering Hasso Plattner Institute, Potsdam Linear programming Let s first define it formally: A linear program is an optimization

More information

Comparison Based Sorting Algorithms. Algorithms and Data Structures: Lower Bounds for Sorting. Comparison Based Sorting Algorithms

Comparison Based Sorting Algorithms. Algorithms and Data Structures: Lower Bounds for Sorting. Comparison Based Sorting Algorithms Comparison Based Sorting Algorithms Algorithms and Data Structures: Lower Bounds for Sorting Definition 1 A sorting algorithm is comparison based if comparisons A[i] < A[j], A[i] A[j], A[i] = A[j], A[i]

More information