Study Group Randomized Algorithms Jun 7, 2003 Jun 14, 2003.

Slides:



Advertisements
Similar presentations
Randomized Algorithms Introduction Rom Aschner & Michal Shemesh.
Advertisements

Order Statistics Sorted
Algorithms Analysis Lecture 6 Quicksort. Quick Sort Divide and Conquer.
Approximation, Chance and Networks Lecture Notes BISS 2005, Bertinoro March Alessandro Panconesi University La Sapienza of Rome.
Graph Isomorphism Algorithms and networks. Graph Isomorphism 2 Today Graph isomorphism: definition Complexity: isomorphism completeness The refinement.
“Devo verificare un’equivalenza polinomiale…Che fò? Fò dù conti” (Prof. G. Di Battista)
Introduction to Algorithms
1 Today’s Material Medians & Order Statistics – Ch. 9.
Quick Sort, Shell Sort, Counting Sort, Radix Sort AND Bucket Sort
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Randomized Algorithms Kyomin Jung KAIST Applied Algorithm Lab Jan 12, WSAC
A Randomized Linear-Time Algorithm to Find Minimum Spanning Trees David R. Karger David R. Karger Philip N. Klein Philip N. Klein Robert E. Tarjan.
CSL758 Instructors: Naveen Garg Kavitha Telikepalli Scribe: Manish Singh Vaibhav Rastogi February 7 & 11, 2008.
Expected Running Times and Randomized Algorithms Instructor Neelima Gupta
Updated QuickSort Problem From a given set of n integers, find the missing integer from 0 to n using O(n) queries of type: “what is bit[j]
WS Algorithmentheorie 03 – Randomized Algorithms (Overview and randomised Quicksort) Prof. Dr. Th. Ottmann.
1 Introduction to Randomized Algorithms Md. Aashikur Rahman Azim.
Complexity 18-1 Complexity Andrei Bulatov Probabilistic Algorithms.
Graph Clustering. Why graph clustering is useful? Distance matrices are graphs  as useful as any other clustering Identification of communities in social.
P ROBABILISTIC T URING M ACHINES Stephany Coffman-Wolph Wednesday, March 28, 2007.
Ch. 7 - QuickSort Quick but not Guaranteed. Ch.7 - QuickSort Another Divide-and-Conquer sorting algorithm… As it turns out, MERGESORT and HEAPSORT, although.
1 Algorithms for Large Data Sets Ziv Bar-Yossef Lecture 8 May 4, 2005
Karger’s Min-Cut Algorithm Amihood Amir Bar-Ilan University, 2009.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu.
Randomized Computation Roni Parshani Orly Margalit Eran Mantzur Avi Mintz
Randomized Algorithms and Randomized Rounding Lecture 21: April 13 G n 2 leaves
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
1 Randomness in Computation Example 1: Breaking symmetry. Example 2: Finding witnesses. Example 3: Monte Carlo integration. Example 4: Approximation algorithms.
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
DAST 2005 Week 4 – Some Helpful Material Randomized Quick Sort & Lower bound & General remarks…
Karger’s Min-Cut Approximate Max-Cut Monday, July 21st 1.
Randomized Algorithms Morteza ZadiMoghaddam Amin Sayedi.
1 Introduction to Randomized Algorithms Srikrishnan Divakaran DA-IICT.
Fixed Parameter Complexity Algorithms and Networks.
1 Introduction to Randomized Algorithms Srikrishnan Divakaran DA-IICT.
1 Min-cut for Undirected Graphs Given an undirected graph, a global min-cut is a cut (S,V-S) minimizing the number of crossing edges, where a crossing.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Chapter 14 Randomized algorithms Introduction Las Vegas and Monte Carlo algorithms Randomized Quicksort Randomized selection Testing String Equality Pattern.
Order Statistics The ith order statistic in a set of n elements is the ith smallest element The minimum is thus the 1st order statistic The maximum is.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
Computation Model and Complexity Class. 2 An algorithmic process that uses the result of a random draw to make an approximated decision has the ability.
. CLASSES RP AND ZPP By: SARIKA PAMMI. CONTENTS:  INTRODUCTION  RP  FACTS ABOUT RP  MONTE CARLO ALGORITHM  CO-RP  ZPP  FACTS ABOUT ZPP  RELATION.
1 Maximal Independent Set. 2 Independent Set (IS): In a graph G=(V,E), |V|=n, |E|=m, any set of nodes that are not adjacent.
PROBABILISTIC COMPUTATION By Remanth Dabbati. INDEX  Probabilistic Turing Machine  Probabilistic Complexity Classes  Probabilistic Algorithms.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 7.
Instructor Neelima Gupta Expected Running Times and Randomized Algorithms Instructor Neelima Gupta
ICS 353: Design and Analysis of Algorithms
NP-Completness Turing Machine. Hard problems There are many many important problems for which no polynomial algorithms is known. We show that a polynomial-time.
Analysis of Algorithms Spring semester 2002 Uri Zwick
Young CS 331 D&A of Algo. Topic: Divide and Conquer1 Divide-and-Conquer General idea: Divide a problem into subprograms of the same kind; solve subprograms.
CSC317 1 Quicksort on average run time We’ll prove that average run time with random pivots for any input array is O(n log n) Randomness is in choosing.
01/16/2008 Randomized Quick Sort Algorithm Lecture Note – 1 Prepared By: Muhammed Miah.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Theory of Computational Complexity Probability and Computing Ryosuke Sasanuma Iwama and Ito lab M1.
The NP class. NP-completeness
Probabilistic Algorithms
Randomized Min-Cut Algorithm
Chapter 5. Greedy Algorithms
Randomized Algorithm (Lecture 2: Randomized Min_Cut)
Randomized Algorithms
Maximal Independent Set
Lecture 8 Randomized Algorithms
Randomized Algorithms CS648
Sorting Algorithms Ellysa N. Kosinaya.
Chapter 11 Limitations of Algorithm Power
ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS
Presentation transcript:

Study Group Randomized Algorithms Jun 7, 2003 Jun 14, 2003

Randomized Algorithms A randomized algorithm is defined as an algorithm that is allowed to access a source of independent, unbiased random bits, and it is then allowed to use these random bits to influence its computation. Input Output Algorithm Random bits

Monte Carlo and Las Vegas There are two kinds of randomized algorithms: –Monte Carlo: A Monte Carlo algorithm runs for a fixed number of steps for each input and produces an answer that is correct with a bounded probability –Las Vegas: A Las Vegas algorithm always produces the correct answer, but its runtime for each input is a random variable whose expectation is bounded.

Question Is the max-cut algorithm that we discussed previously a Monte Carlo or Las Vegas algorithm? We will see two other examples today.

Randomized Quick Sort In traditional Quick Sort, we will always pick the first element as the pivot for partitioning. The worst case runtime is O(n 2 ) while the expected runtime is O(nlogn) over the set of all input. Therefore, some input are born to have long runtime, e.g., an inversely sorted list.

Randomized Quick Sort In randomized Quick Sort, we will pick randomly an element as the pivot for partitioning. The expected runtime of any input is O(nlogn).

Analysis of Randomized QS Let s(i) be the i th smallest element in the input list S. X ij is a random variable such that X ij = 1 if s(i) is compared with s(j); X ij = 0 otherwise. Expected runtime t of randomized QS is: E[X ij ] is the expected value of X ij over the set of all random choices of the pivots, which is equal to the probability p ij that s(i) will be compared with s(j).

Analysis of Randomized QS We can represent the whole sorting process by a binary tree T: Notice that s(i) will be compared with s(j) where i<j if and only if s(i) or s(j) is the first one among the set {s(i), s(i+1), …, s(j)} to be selected as the pivot. Note that p ij = 2/(j-i+1). Why? st pivot 2 nd pivot 3 rd pivot 4 th pivot 5 th pivot

Analysis of Randomized QS Therefore, the expected runtime t: Note that Randomized QS is a Las Vegas algorithm.

Randomized Min-cut Given an undirected, connected multi- graph G(V,E), we want to find a cut (V 1,V 2 ) such that the number of edges between V 1 and V 2 is minimum. This problem can be solved optimally by applying the max-flow min-cut algorithm O(n 2 ) time by trying all pairs of source and destination.

Randomized Min-cut In randomized Min-cut, we repeatedly do the following: Pick randomly an edge e(u,v). Merge u and v, and remove all the edges between u and v. For example: until there are only 2 vertices left. We will report the cut between these 2 vertices as the min-cut. uv x y z u,v x y z

Analysis of Randomized Min-cut Let k be the min-cut of the given graph G(E,V) where |V|=n. Then |E| ≥ kn/2. The probability q 1 of picking one of those k edges in the first merging step ≤ 2/n The probability p 1 of not picking any of those k edges in the first merging step ≥ (1-2/n) Repeat the same argument for the first n-2 merging steps. Probability p of not picking any of those k edges in all the merging steps ≥ (1-2/n)(1-2/(n-1))(1-2/(n-2))…(1-2/3)

Analysis of Randomized Min-cut Therefore, the probability of finding the min-cut: If we repeat the whole procedure n 2 /2 times, the probability of not finding the min-cut is at most Randomized Min-cut is a Monte Carlo Algorithm.

Question What will happen if we apply a similar approach to find the max-cut instead? Will it be better or worse than the previous method of random assignment?

Complexity Classes There are some interesting complexity classes involving randomized algorithms: –Randomized Polynomial time (RP) –Zero-error Probabilistic Polynomial time (ZPP) –Probabilistic Polynomial time (PP) –Bounded-error Probabilistic Polynomial time (BPP)

RP Definition: The class RP consists of all languages L that have a randomized algorithm A running in worst-case polynomial time such that for any input x in ∑*:

RP Independent repetitions of the algorithms can be used to reduce the probability of error to exponentially small. Notice that the success probability can be changed to an inverse polynomial function of the input size without affecting the definition of RP. Why?

ZPP Definition: The class ZPP is the class of languages which have Las Vegas algorithms running in expected polynomial time. ZPP = RP ∩ co-RP. Why? (Note that a language L is in co-X where X is a complexity class if and only if it’s complement ∑*-L is in X.)

PP Definition: The class PP consists of all languages L that have a randomized algorithm A running in worst-case polynomial time such that for any input x in ∑*:

PP To reduce the error probability, we can repeat the algorithm several times on the same input and produce the output which occurs in the majority of those trials. However, the definition of PP is quite weak since we have no bound on how far from ½ the probabilities are. It may not be possible to use a small number (e.g., polynomial no.) of repetitions to obtain a significantly small error probability.

Question Consider a randomized algorithm with 2- sided error as in the definition of PP. Show that a polynomial no. of independent repetitions of this algorithm needs not suffice to reduce the error probability to ¼. (Hint: Consider the case where the error probability is ½ - ½ n. )

BPP Definition: The class BPP consists of all languages L that have a randomized algorithm A running in worst-case polynomial time such that for any input x in ∑*:

BPP For this class of algorithms, the error probability can be reduced to ½ n with only a polynomial number of iterations. In fact, the probability bounds ¾ and ¼ can be changed to ½ +1/p(n) and ½ -1/p(n) respectively where p(n) is a polynomial function of the input size n without affecting the definition of BPP. Why?