Ace - AI Tutor
Ask Our Educators
Textbooks
My Library
Flashcards
Scribe - AI Notes
Notes & Exams
Download App
Kunjal Sujal Shah

Kunjal Sujal S.

Divider

Questions asked

INSTANT ANSWER

Instead of one linear function to amortize a difference of \( \Delta \) between two clocks in \( \alpha \) time units, we use two linear functions to amortize \( \Delta \) in two stages as follows. The first stage is of length \( \alpha_{1} \) time units during which half of the difference (i.e., \( \Delta / 2 \) ) is amortized linearly. The remaining difference of \( \Delta / 2 \) is amortized linearly in the second stage which is of length \( \alpha_{2} \) time units. Thus, \( \Delta \) is amortized in \( \alpha_{1}+\alpha_{2} \) time units. Derive the formula for the logical clock of the slave for this two-stage amortization scheme. Assume that time \( =0 \) at synchronization which is defined to be the time at which the slave receives the time-stamp from the master and starts amortizing the difference between the two clocks.

View Answer
divider
INSTANT ANSWER

For any flow network G = (V, E) and any cut (S, T) of G, we define the cardinality of cut (S, T) as |{(u, v) ∈ E | u ∈ S ∧ v ∈ T}|. Consider the following decision problem: Given an integer k and a flow network G with integer edge capacities, does G have a minimum-capacity cut with cardinality at most k? Prove that this decision problem can be solved in polynomial time. Hint: Apply a suitable transformation to the edge capacities of G

View Answer
divider
INSTANT ANSWER

4. The Department of Commuter Silence at Shampoo-Banana University has a flexible curriculum with a complex set of graduation requirements. The department offers \( n \) different courses, and there are \( m \) different requirements. Each requirement specifies a subset of the \( n \) courses and the number of courses that must be taken from that subset. The subsets for different requirements may overlap, but each course can only be used to satisfy at most one requirement. For example, suppose there are \( n=5 \) courses \( A, B, C, D, E \) and \( m=2 \) graduation requirements: - You must take at least 2 courses from the subset \( \{A, B, C\} \). - You must take at least 2 courses from the subset \( \{C, D, E\} \). Then a student who has only taken courses \( B, C, D \) cannot graduate, but a student who has taken either \( A, B, C, D \) or \( B, C, D, E \) can graduate. Describe and analyze an algorithm to determine whether a given student can graduate. The input to your algorithm is the list of \( m \) requirements (each specifying a subset of the \( n \) courses and the number of courses that must be taken from that subset) and the list of courses the student has taken.

View Answer
divider
INSTANT ANSWER

4. Let \( G \) be a directed graph, where every vertex \( v \) has an associated height \( h(v) \), and for every edge \( u \rightarrow v \) we have the inequality \( h(u)>h(v) \). Assume all heights are distinct. The span of a path from \( u \) to \( v \) is the height difference \( h(u)-h(v) \). Describe and analyze an algorithm to find the maximum span of a path in \( G \) with at most \( k \) edges. Your input consists of the graph \( G \), the vertex heights \( h(\cdot) \), and the integer \( k \). Report the running time of your algorithm as a function of \( V, E \), and \( k \). For example, given the following labeled graph and the integer \( k=3 \) as input, your algorithm should return the integer 8 , which is the span of the downward path \( 9 \rightarrow 6 \rightarrow 5 \rightarrow 1 \). [Hint: This is a very different question from problem 2.]

View Answer
divider
INSTANT ANSWER

Problem 4: NP-Completeness [30 points] Suppose an auction house has \( n \) items for auction, \( a_{1}, a_{2}, \ldots, a_{n} \). Each item can only go to one bidder. There are \( m \) bidders, and each of those bidders can place bids for one or more items. That is, the \( i^{\text {th }} \) bid specifies some subset of items, \( S_{i} \) and the amount of money \( c_{i} \) the bidder is willing to pay for that subset of items. Each bid is therefore a pair \( \left(S_{i}, c_{i}\right) \). Consider and algorithm that accepts and rejects bids. If a bid \( i \) is accepted, the bidder gets to take all of the items in the set \( S_{i} \) and must pay the auction house \( c_{i} \) dollars. It therefore naturally follows that the sets \( S_{i} \) and \( S_{j} \) of two accepted bids \( i \) and \( j \) cannot have any items in common. Ultimately, the auction house wants to make at least \( C \) dollars. More precisely we define the Auction House Problem as follows: Auction House: Given \( n \) items for auction \( \left(a_{1}, a_{2}, \ldots, a_{n}\right) \) and \( m \) bids (each a pair \( \left(S_{i}, c_{i}\right) \) ), determine whether there is a set of bids that the auction house can accept to get at least \( C \) dollars. Prove that the Auction House problem is NP-Complete.

View Answer
divider
INSTANT ANSWER

Prove that for any positive constant \epsilon, there exists a positive constant c such that if cnlogn balls are thrown independently and uniformly at random into n bins, then with the probability atleast 1-(n)^10, ratio of maximum to minimum bin load is at most 1+\epsilon.

View Answer
divider
INSTANT ANSWER

Give a polynomial time randomized algorithm for the weighted max-1-or-2 sat that produces a solution with expected total weight at least 3/4th of the optimal weight.

View Answer
divider
INSTANT ANSWER

Design and analyse a polynomial time 3-approx algorithm for maximum cardinality 3d Matching problem

View Answer
divider
INSTANT ANSWER

Design and analyse a simple greedy 2-approximation algorithm for the NP-hard maximum cut problem.

View Answer
divider
INSTANT ANSWER

How do we formulate an instance of fractional knapsack problem as a linear program? Why can't we use a similar approach to reduce the standard knapsack problem to a linear program?

View Answer
divider