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 can i verify that my algorithm has not missed

) I only understand the first sentence of these instructions. How do I modify my program to find those 50 roots and, yes, how can I verify that my algorithm has not missed any of the roots?

  Determine schedule that obtains maximum amount of profit

Assume you have one machine and a set of n jobs a1, a2, ..., an to process on that machine. Determine the schedule that obtains the maximum amount of profit. Compute the running time of your algorithm?

  What is the time complexity of your algorithm

You may describe your algorithm using pseudo-code, but you must describe youralgorithm in English. What is the time complexity of your algorithm?

  System analyst

A huge, well regarded supplier of key raw materials to your corporation's production process requires a year-end summary report of totals purchased from it.

  Generate 25 random characters for each string

You are to compare two sorting algorithms and to compare two searching algorithms by running and collecting data on each. Your data for sorting and searching will be strings of 25 characters in length.

  Java program to assign passengers seats in airplane

Prepare a Java program to assign passengers seats in an airplane. Suppose a small airplane with seats numbered as follows:

  Data warehouse and operational databases

Every big organization has large documents or databases containing data used in operating the business. Does a data warehouse differ from these operational files or databases?

  What are the properties of an algorithm

What is a first-in-first-out data structure ? Write algorithms to perform the following operations on it - create, insertion, deletion, for testing overflow and empty conditions.

  Ancient world on later societies

Reflect on how the ancient world(Mesopotamia,Greece, and Rome) contributed significant ideas about government, law, religion, and the role of the individual to later societies.

  Evaluate the reliability of the data mining algorithms

the development of complex algorithms that can mine mounds of data that have been collected from people and digital

  Identify nodes that are cut-off

Use Alpha-Beta Search to compute the final value of the root node for the tree below. Use depth-first, left-to-right progression. Be sure to: identify nodes that are cut-off

  Algorithm for finding smallest element in unsorted array

Consider the following algorithm for finding the smallest element in an unsorted array: RANDOMMIN(A[1 .. n]). What is the exact expected number of executions of line ( )?

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