Design a simple randomized algorithm

Assignment Help Data Structure & Algorithms
Reference no: EM13974737

Question 1. Given a graph G = (V, E) where |V| = n and |E| = m, let A ⊂ V be a subset of the vertices. A cut is the number of edges in the graph with one endpoint in A and one endpoint in V - A. In class we saw a randomized algorithm to compute a min-cut, which is a cut whose size is minimum over all possible cuts (i.e. over all possible subsets A). For this question, we are interested in computing a max-cut, which is a cut whose size is maximum over all possible cuts. It is known that computing a max-cut in a graph is NP-Hard. As such, we will find an approximate solution whose size is at least 1/2 the optimal size.

Consider the following simple algorithm:

Algorithm ApproxMaxCut(G=(V,E))
Let A be a random subset of V (where each subset of V is equally likely).

Let B = V-A.

Output C = all edges of E with one endpoint in A and one endpoint in B

(a) For a vertex x ∈ V , prove that P (x ∈ A) = 1/2.

(b) Prove that the expected number of edges in C is |E|/2.

(c) Explain why this is a 1/2 approximation of the optimal maximum cut?

Question 2. Suppose you have access to a function Rand(i) that returns an integer uniformly distributed in the set {0 . . . , i}. Subsequent calls to the function produce independent results. Starting with an array A containing the elements 1, . . . , n in sorted order show how to compute a random permutation of A in O(n) time. Note, you must prove that the permutation generated by your algorithm is random. I.e., you must prove that each of the n! possible permutations is equally likely.

Question 3. Let a = (a1, . . . , an) and b = (b1, . . . , bn) be two real-valued vectors of length n and let r = (r1, . . . , rn) be a random binary vector of length n. That is, the ri's are chosen independently and uniformly at random to be either 0 or 1. For a vector x, let r.x denote the sum r1x1 + r2x2 + . . . + rnxn.

(a) If a = b then r.a = r.b. Show that if a ≠ b then Pr(r.a = r.b) ≤ 1/2.

(Hint: Consider what has to happen at a particular index i such that ai ≠ bi. What is the probability that this happens?)

(b) Using the above fact (whether you could provide a proof or not), show that for two n× n matrices A and B that are not equal, Pr(Ar = Br) ≤ 1/2. (Note that Ar is an n vector that takes O(n2) time to compute.)

(c) Let A, B and C be three n × n matrices. Describe an algorithm that runs in O(n2) time and (a) If A = B × C then the algorithm always outputs yes. (b) If A ≠ B × C then the algorithm will output no with probability at least 1/2. (Hint: Matrix multiplication, i.e., computing B × C explicitly takes too long. You'll have to find some other way.)

Question 4. Given a set P of n points in the plane, compute the pair of points x, y ∈ P such that d(x, y) ≥ d(a, b) for all pairs of points a, b ∈ P . In other words, x, y is the furthest pair. Use the following two routines as black boxes in the design of your algorithm. Given a set D of n disks, I(D) returns the intersection of these n disks in O(n log n) time. Given a point p, and I(D), the routine C(p, I(D)) determines in O(log n) time whether p ∈ I(D).

(a) Design a simple randomized algorithm to find the furthest pair in O(n log n) expected time.

(b) Explain why it is correct.

(c) Explain why the running time is O(n log n) expected time.

Question 5. Let P be a set of n points uniformly distributed in the unit square. This means that each point pi = (xi, yi) where xi and yi are uniformly distributed on the interval [0, 1]. A point is called right- empty if there are no other points in its upper right quadrant.

In other words, pi is right-empty if ∀pj ∈ {P - pi} we have xj < xi or yj < yi. In the figure below, the bold points are right-empty. The empty right quadrant is shaded for one of the points.

2469_Unit square.png

(a) Show that the expected number of right-empty points is O(log n).

(b) The convex hull of a point set is the smallest convex polygon that contains the point set. Use the above result to show that the expected number of points on the convex hull is O(log n).

Question 6. BONUS CHALLENGE QUESTION (Not required and only do if you have time): Instead of points uniformly distributed in the unit square, consider n points uniformly distributed in a triangle defined by vertices (0, 0), (1, 0), (0, 1). Give an upper bound on the expected number of right-empty points.

(Hint: The bound is much larger than log n. Try for a bound of √n. Anything that is o(n) is good.).

2280_Triangle defined by vertices.png

Reference no: EM13974737

Questions Cloud

Determine the book value of equipment for first six years : A company has acquired a paint booth (see prices). The anticipated life for the booth is 14 years but the company plans to depreciate it as a 7 year MARCS property (half year conversion). Determine the book value of the equipment for its first six ye..
Define the functions and role of law in business : Write a 700- to 1,050-word paper in which you define the functions and role of law in business and society. Discuss the functions and role of law in your past or present job or industry. Properly cite at least two references from your reading
What is the inflation rate at initial long run equilibrium : Assume that wages and prices are sticky and that we start at a long-run equilibrium. Assume that at this initial point, the growth rate of the money supply is 5%, the growth rate of the velocity of money is 4% and that the real economic growth rate i..
Regional economic integration : What is the ultimate goal of regional economic integration (REI)? Identify a potential benefit and a drawback of REI.Greece is a member of the European Union and the Eurozone and received numerous economic bailouts resulting in economic pain.
Design a simple randomized algorithm : Design a simple randomized algorithm to find the furthest pair in O(n log n) expected time - Explain why it is correct and design a simple randomized algorithm to find the furthest pair in O(n log n) expected time.
Substituting skilled welders with robot welding machines : A manufacturing company wants to decrease its labor costs by substituting skilled welders with robot welding machines. If the company marginal tax rate is 36% is the investment a good idea?
Leniency programs target at busting secret cartels : Many antitrust authorities throughout the world have implemented leniency programs target at busting secret cartels. These programs offer immunity from prosecution to firms who blow the whistle on their co-cartel conspirators. Show how the leniency p..
Encrypt the plaintext sendmoremoney with the key stream : Explores the use of a one-time pad version of the Vigenère cipher. In this scheme, the key is a stream of random numbers between 0 and 26. For example, if the key is 3 19 5..., then the first letter of plaintext is encrypted with a shift of 3 lett..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  How do i created the pseudocode

Using the UML diagram and variable list , create Pseudocode for the program.

  Determine the impedances of elements in laplace domain

Redraw the schematics with the impedance of each of the element shown in Laplace domain. Then determine the overall impedance of the entire circuit between the two ends of the shown circuit and express it in Laplace domain as a ratio of two polyno..

  You and your eight-year-old nephew elmo decide to play a

you and your eight-year-old nephew elmo decide to play a simple card game. atthe beginning of the game the cards are

  I this assignment you will implement the compact

in this assignment you will implement the compact representation of the compressed suffix trie adt for dna analyses.a

  Write adjacency-list representation for complete binary tree

Provide the adjacency-list representation for complete binary tree on 7 vertices. Provide the equivalent adjacency - matrix representation. Suppose that vertices are numbered from 1 to 7 as in binary heap?

  Calculations on rows and columns of an array

Make a menu bar with a document menu that includes a Perform Action command and an Exit command. The Perform Action command calculates either the sum or the average of rows or columns in array and displays result in a message box.

  What is the worst case of avl tree?

the binary tree can look like a linked list in the worst case. What is the worst case of AVL tree? To get an idea, do the following: What is the minimum # of nodes in each of the AVL trees with heights 2, 3, 4, and 5?Explain please.

  Ways in which soa reduces the total cost of ownership

Analyze five (5) ways in which SOA reduces the total cost of ownership (TCO). Examine five (5) ways in which using XML enables data and information exchange between clients and servers using Web Services in an SOA environment

  Operation when you use the quick union algorithm

Show the contents of the id array after each union operation when you use the quick union algorithm (Program below) to solve the connectivity problem for the sequence 0-2, 1-4, 2-5, 3-6, 0-4, 6-0, and 1-3.

  Write the implementation of a data structure

Write an implementation of a data structure S that supports the following operations: Insert(S, x): insert the key x into S only if it is not already there.

  Design a representation of display screen

Create a form that lists possible potatoes and toppings in a manner that is easy for counter servers and kitchen crew to scan, and can also be used as input for the inventory reorder system.

  Write algorithm which divides n objects of u into k clusters

Suggest the algorithm which divides n objects of U into k clusters, making use of MST of a graph. Give a simple argument of correctness and bound on the running time of the algorithm you are proposing.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd