Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Like this presentation? Why not share!

- Randomized Algorithm by Kanishka Khandelwal 2503 views
- Topic 1.4: Randomized Algorithms by KM Bappi 867 views
- Randomized algorithms ver 1.0 by Dr. C.V. Suresh Babu 1180 views
- Lecture 6-cs648 Randomized Algorithms by Anshul Yadav 417 views
- DESIGN AND ANALYSIS OF ALGORITHMS by Gayathri Gaayu 9255 views
- Lecture 2-cs648 by Rajiv Omar 363 views

1,164 views

Published on

a full presentation on randomized algorithm

No Downloads

Total views

1,164

On SlideShare

0

From Embeds

0

Number of Embeds

2

Shares

0

Downloads

0

Comments

0

Likes

2

No embeds

No notes for slide

- 1. Randomized Algorithm By Shoaib Khan IMCA/4511/12 3rd Semester
- 2. • It is defined as an algorithm that is allowed to access a source of independent, unbaised random bits. • The "worst case" is typically so unlikely to occur that it cannot be ignored .
- 3. Why randomized algorithms ? • Simplicity: This is the first reason for using randomized algorithms. There are numerous example where an easy randomized algorithm can match the performance of a deterministic algorithm. • Speed: The best known randomized algorithm are faster than the best known deterministic algorithm.
- 4. Las Vegas Algorithm • A Las Vegas algorithm is a randomized algorithm that always gives correct results, that is, it always produces the correct result or it informs about the failure. In other words, a Las Vegas algorithm does not gamble with the correctness of the result, it gambles only with the resources used for the computation. A simple example is randomized quicksort. • Randomized quick sort :randomized quicksort algorithm makes random choices during execution.
- 5. Randomized quick sort algo :Function RANDOMIZED-QUICKSORT(A, p, q) 1. if (p >=q) then 2. return 3. else 4. Choose a number, say r, uniformly and at random from the set {p,p+1,...,q}. 5. Swap A[p] and A[r]. 6. j = PARTITION(A, p, q). 7. Quicksort(A, p, j-1). 8. Quicksort(A, j+1, q). 9. end The complexity of randomized quick sort algorithm is O(n2).
- 6. Monte carlo algorithm • A randomized algorithm may produce incorrect results, but with bounded error probability. • For decision problems there are two kind of monte carlo algorithms: Two side error : If there is non zero probability error.when its output is either yes or no. One side error : When the probability that its error is zero for atleast one of possible output.
- 7. Min cut algorithm Let G = (V,E) be a connected , undirected multigraph with n vertices.A multigragh may contain multiple edges between any pair ofvertices.A cut in G is a set of edges whose removal results in G being broken into two or more components. A min-cut is a cut of minimum cardinality. For instance, say this graph represents a network, and we want to know how ”robust” it is in the sense of the the minimum number of links whose failure causes the network to become disconnected.The minimum cut problem is to find a cut of minimum size. Algorithm Min-Cut Input: Connected, undirected multigragh G(V,E). Output: Size of the min-cut. 1. while |V| >= 2 do 2. Pick an edge e randomly and contract it. 3. Remove Self Loops. 4. end while 5. Return
- 8. Thank you

No public clipboards found for this slide

Be the first to comment