## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

C OURSE : CPS230

Problem 1: Consider the points {1, 2, . . . , n} on the real line; and suppose there is a particle with charge qj at each of these points j. (Each charge can be either positive or negative.) The total net force on particle j, by Coulomb’s Law, is equal to, Fj =

i<j

Cqi qj − (j − i)2

i>j

Cqi qj (j − i)2

Design an algorithm that computes all the forces Fj in O(n log n) time. Problem 2: Recall that a priority search tree is a binary tree in which every node has both a search key and a priority, arranged so that the tree is simultaneously a binary search tree for the keys and a min-heap for the priorities. A heater is a priority search tree in which the priorities are given by the user, and the search keys are distributed uniformly and independently at random in the real interval [0, 1]. Intuitively, a heater is a sort of dual treap. The following problems consider an n-node heater T whose node priorities are the integers from 1 to n. We identify nodes in T by their priorities; thus, ‘node 5’ means the node in T with priority 5. The min-heap property implies that node 1 is the root of T . Finally, let i and j be integers with 1 ≤ i < j ≤ n. (a) Prove that in a random permutation of the (i + 1)-element set {1, 2, ..., i, j}, elements i and j are adjacent with probability 2/(i + 1). (b) Prove that node i is an ancestor of node j with probability 2/(i + 1). (Hint: Use part (a)!) (c) What is the probability that node i is a descendant of node j? (Hint: Dont use part (a)!) (d) What is the exact expected depth of node j? (e) Describe and analyze an algorithm to insert a new item into a heater. Express the expected running time of the algorithm in terms of the rank of the newly inserted item.

Problem 3: Let G = (V, E) be a weighted directed graph; the weight of each edge is non-negative. For any edge e ∈ E, let G \ e denote the graph obtained by deleting e from G. Suppose the shortest path σ from vertex s to vertex t in G passes through every vertex of G. Describe an algorithm to compute the shortest-path distance from s to t in G \ e, for every edge e of G, in O(E log V ) time. Your algorithm should output a set of E shortest-path distances, one for each edge of the input graph. (Hint: If we delete an edge of the original shortest path, how do the old and new shortest paths overlap?) Problem 4: Let G = (V, E) be an undirected graph with 2n vertices. A perfect matching of G is a set M ⊆ E of n vertex-disjoint edges, i.e., each vertex appears only once in M . Suppose we

Due November 3, 2009

Page 1

We deﬁne a variable xe for each edge e ∈ E and deﬁne a 2n × 2n matrix A(x) as follows: A(x) = (aij )2n×2n where xe if e = (i. It is known (called Tutte’s theorem) that G has a perfect matching if and only if det A(x) is not identically 0. −xe if e = (j. Describe a Monte Carlo algorithm to test whether G has a perfect matching. j). j} ∈ E. 2009 Page 2 .A SSIGNMENT 4 C OURSE : CPS230 orient each edge of G arbitrarily. the algorithm should return the correct answer with probability least 1 − 1/n. Due November 3. Prove the correctness of your algorithm. and let G denote the resulting directed graph. i). and analyze its running time. aij = 0 if {i.

- 46841_PDKU- 2000 Chartrand Aequationes Math Partiton Dimesion Graph.pdfuploaded byBaiq Supriani
- 1 - 1 - Application- Internet Routing (11 Min)uploaded bymaster2020
- Algorithmic Graphuploaded byMike Hare
- Uthesis.psuploaded byAnonymous901
- lec1003 (1)uploaded bySwapneel Jadhav
- prog6uploaded byvarunsingh214761
- Dynamic Programming 4uploaded byRavi Tej
- 07NetworkFlowII.pdfuploaded byChinna Swamy
- WUuploaded byhoanghatmai
- Group {1, −1, i, −i} Cordial Labeling of Product Related Graphsuploaded byInternational Journal of Advanced Scientific Research and Development
- p221-gabowuploaded byWisllay Vitrio
- Skill Characterization Based on Betweennessuploaded bySamet Tonyalı
- The Grammar According to Westuploaded byduytrung3006
- 553_553uploaded byUbiquitous Computing and Communication Journal
- 6689_01_rms_20130307.pdfuploaded byrichardchan001
- Transformation of the Graph of a Functionuploaded bycitisolo
- GT Math 3012 Homework 2uploaded byKwane
- ieee-it-07.pdfuploaded byMARCELO
- Mark Wexler- Matrix Models on Large Graphsuploaded byGijke3
- bla bla bla new 2014uploaded byGeorgiana Geo
- 35 Integration Full Part 1 of 5uploaded bySubrahmanyam Sana
- CoursOPT-07-08uploaded byMziou Hammadi
- 7.Desislava Kukovauploaded byAlhames First
- 13-Unit13uploaded byJohn Arthur
- Chap06 Newuploaded byJo Shop
- Calculusuploaded byAbhishek Singh Ujjain
- Alarm Correlationuploaded byasmahati
- Energy Optimal Real-Time Navigation System Application to a Hybriduploaded byLumen_Strumpf
- Space Syntax Glossary Bjorn Klarqvist 1993uploaded byarchivedout
- USE OF EIGENVALUES AND EIGENVECTORS TO ANALYZE BIPARTIVITY OF NETWORK GRAPHSuploaded byCS & IT

Close Dialog## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Loading