home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!ames!agate!dog.ee.lbl.gov!network.ucsd.edu!news.acns.nwu.edu!uicvm.uic.edu!u53644
- From: U53644@uicvm.uic.edu
- Newsgroups: sci.math
- Subject: Re: ? Quick algorithm for random covering sets ?
- Message-ID: <92210.014509U53644@uicvm.uic.edu>
- Date: 28 Jul 92 06:45:09 GMT
- References: <SQUASH.92Jul17215435@bourbaki.msri.org>
- Organization: University of Illinois at Chicago
- Lines: 47
-
- I'm not quite sure of what the original poster is looking for in terms of a
- probability distribution on the power set of $1,...,N, but one approach that
- comes to mind is the following.......
-
- 1. Choose some probability p in the interval (0,1)
- 2. Randomly select some number between 1 and N (the tentative number
- of sets chosen). Call it K.
- 3. For each number from 1 to K, set up an array (1 x N), and randomly
- fill it with 0's and 1's (latter with probability p).
- (1 signifies inclusion, 0 exclusion)
- 4. To find the intersection of our sets : multiply the arrays
- componentwise. (We now have the array for the intersection).
- 5. Take this new array, and subtract each of its' components from 1
- to get the array for the complement of the intersection.
- 6. Now, multiply this array (the one for the complement of the
- intersection) by the one for the K-th set to exclude the
- intersection from the K-th set.
- 7. Now, take the 'complements' of the arrays for sets 1 through K :
- again, subtract each component of an array from 1 to get the
- corresponding element of the 'complementary array'.
- 8. Once again, multiply the 'complementary arrays' together
- componentwise to form the array for the intersection of the
- complements of the sets. We now have an array corresponding to
- the set of all elements of $1,...,N not in any of the K sets.
- 9. Add this array componentwise to the one for the K-th set.
-
- Then, just use the usual algorithms to pick out which places in our arrays are
- filled with 1's (if the n-th element of the m-th array is 1, print n. If not,
- let n be replaced by n+1 and repeat. If n>N, replace m by m+1 and n by 1. If
- m>K, stop, if not go to first direction in parantheses).
-
- No promises are offered as to the uniformity of the resulting sampling
- procedure. One might even things out a bit by setting the weights (when one
- selects K) for the various values of K proportional to the number of possible
- distinct collections of K sets satisfying the conditions. Having done so, one
- might also preselect the numbers of elements for sets 1 through K-1, setting
- weights in an analagous fashion (randomly setting entries to 1 or 0 until one
- either uses up one's allotment of 1's or 0's for a given array, then filling
- in the rest of the array with whatever is left (1's if 1 needs more 1's : i.e.
- one has already excluded as many elements from the set as one can and still
- have the desired number of elements. 0's if one has already included as many
- elements as desired). One then fills in set K as before.
-
- So I guess that it depends on what one wants, and how much effort is
- acceptable.
-
- Joseph B. Dunphy
-