a.
ALGORITHM RANK [Given an object of order v. Output its rank r in the lexicographically arranged list of all objects of order v]:
Set r 4- 0. Walk forward on the path, on each edge e augmenting r by f(e). Halt at the terminal vertex.
b.
ALGORITHM UNRANK [Given an order v and an integer r, 0 ~ r ~ b(v) -- 1. Output the object co of rank r among those of order v]: Begin at v with r' = r. Having arrived at w with r', exit along the highest e for whichf(e) < r' and set r' 4- r' -- f(e). Continue from fin(e) with r'. Halt at the terminal vertex with 0
4. Ranking/Unranking Subsets. Let A be a set of n elements and set Sk(A) be the collection of all k-element subsets of A. Recall that |Sk(A)I - (a.) (8 points) Describe a ranking algorithm to rank a...
3. (20 pts) Let ụ be a finite set, and let S = {Si, S , S,n} be a collection of subsets of U. Given an integer k, we want to know if there is a sub-collection of k sets S' C S whose union covers all the elements of U. That is, S k, and Us es SU. Prove that this problem is NP-complete. 992 m SES, si 3. (20 pts) Let ụ be a finite set, and let...
. Let C be a collection of open subsets of R. Thus, C is a set whose elements are open subsets of R. Note that C need not be finite, or even countable. (a) Prove that the union U S is also an open subset of R. SEC (b) Assuming C is finite, prove that the intersection n S is an open subset of R. SEC (c) Give an example where C is infinite and n S is not open....
,n2} with ISI = n. 4. Let n be a positive integer with n > 20, and let S {1, 2, -I with a) Show that S possesses two dilferent 3-element subsets, the sums of whose elements are equal. (b) Show that S possesses two disjoint subsets, the sums of whose elements are equal ,n2} with ISI = n. 4. Let n be a positive integer with n > 20, and let S {1, 2, -I with a) Show that...
7. Let A, , An be non-empty subsets of a finite set Ω. If 1 k n and Ek is the set of elements in Ω which belong to at least k of the Ai's show that Pal i-1 7. Let A, , An be non-empty subsets of a finite set Ω. If 1 k n and Ek is the set of elements in Ω which belong to at least k of the Ai's show that Pal i-1
4. Let n be a positive integer with n > 20, and let S (1,2.. n21 with IS- (a) Show that S possesses two different 3-element subsets, the sums of whose elements are equal b) Show that S possesses two disjoint subsets, the sums of whose elements are equal. 4. Let n be a positive integer with n > 20, and let S (1,2.. n21 with IS- (a) Show that S possesses two different 3-element subsets, the sums of whose...
Let X be a finite set and F a family of subsets of X such that every element of X appears in at least one subset in F. We say that a subset C of F is a set cover for X if X =U SEC S (that is, the union of the sets in C is X). The cardinality of a set cover C is the number of elements in C. (Note that an element of C is a...
Topology (a) For each subset A of NV0), define eA є loo such that the k-th component of eA is 1 if k є A and 0 otherwise. Define B-(Bde (eA; 1/2) : A N\ {0)). Recall I. (i) If AメB are subsets of N \ {0), find the value of doc (eA, eB). (ii) Show that B is a collection of disjoint open balls in 100. iii) By quoting relevant results, justify whether or not the collection B is...
Let X be a set and let T be the family of subsets U of X such that X\U (the complement of U) is at most countable, together with the empty set. a) Prove that T is a topology for X. b) Describe the convergent sequences in X with respect to this topology. Prove that if X is uncountable, then there is a subset S of X whose closure contains points that are not limits of the sequences in S....
1. a) Describe an O(m)-time algorithm that, given a set of S of n distinct numbers and a positive integer k c n, determines the top k numbers in s b) Describe an O(n)-time algorithm that, given a set of S of n distinct numbers and a positive integer k < n, determines the smallest k numbers in S.
9. [10 points) Consider the following algorithm: procedure Algorithm(n: positive integer; ddd: distinet integers) for k:=1 to n-1 for 1-1 to n-k print(k, I, di,da...-1,dn) if ds dti then interchange dy and d (a) Assume that this algorithm receives as input the integer n 6 and the input sequence 하하하하하하, Miss ^-ruteae rehen i12|3141516 Fill out the table below: ds ds (b) Assume that the algorithm receives the same input values as in part a). Once the algorithm finishes, what...