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

  Create a decision tree diagram for selection of a cell phone

Use Microsoft Visio, PowerPoint, or Word to create a decision tree diagram for the selection of a cell phone. Address risk in your decision tree

  Devise ef?cient algorithm for computing probability

Given the probabilities r1, · · · , rn, the costs c1, · · · , cn, and the budget B, ?nd the redundancies m1, · · · , mn that are within the available budget and that maximize the probability that the system works correctly. Devise an ef?cient algo..

  Create the entity relationship diagram

Create the entity relationship diagram for your project database based on the initial data requirements.

  Creating application - two dimensional array

Make an application that either sums or averages rows or columns of a 2-dimensional array depending on user choices.

  Write down a pseudocode version of the smart bubble sort

question a write a pseudocode version of the smart bubble sort algorithm.question b perform a smart bubble sort on the

  Algorithm on dynamic programming-minimize amount of walking

Our goal is to plan this trip so that we minimize the maximum amount of walking done in a single day. Your algorithm should be based on dynamic programming and run efficiently.

  Calculate and display the cost per kilogram

You will need to design an application that will receive the weight of a parcel and calculate and display the cost per kilogram and the delivery charge for that parcel

  What are the icmp type and code numbers

Examine the corresponding ping reply packet. What are the ICMP type and code numbers? What other fields does this ICMP packet have? How many bytes are the checksum, sequence number and identifier fields?

  Determine purpose of queue in breadth-first traversal

Following refer to breadth-first traversals of graphs and trees. a. Determine the purpose of queue in breadth-first traversal?

  Design an application that gets customer account data

The No Interest Credit Company provides zero-interest loans to customers. Design an application that gets customer account data, including an account number, customer name, and balance due

  Implement a virtual memory simulator based on demand paging

Will simulate the step by step execution of the OPT algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed.

  You used the same dataset to analyze both

You used the same dataset to analyze both a between- and within-subjects design. Create a single paragraph (using the material you wrote above), that presents both sets of results.

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