https://arxiv.org/pdf/1805.09695.pdf ]]>

Since the largest set cannot rise, we always have , and from this it follows that the correlation will be nonnegative for . Moreover, this is the regime we really care about for weak FUNC since for we have by Reimer’s result that the average set size is at least and hence some element appears in at least sets.

]]>The families created aren’t necessarily union-closed. The code only takes unions of _pairs_ of sampled sets. (It also discards the original sample.)

The following seems to work correctly. For efficiency, I’ve used bistrings (binary integers) to represent the sets.

Manipulate[

randomSampleInts = RandomInteger[2^m – 1, r];

ucFamilyInts =

Nest[DeleteDuplicates[BitOr @@@ Subsets[#, {1, 2}]] &,

randomSampleInts, IntegerLength[r, 2]];

ucFamilyBits = IntegerDigits[#, 2, m] & /@ ucFamilyInts;

elementCounts = Total@ucFamilyBits;

Column[{

Row[{"Base set is ", Range@m}],

Row[{"Cardinality of union closed family of subsets is ",

Length[ucFamilyInts]}],

Row[{"Counts are ", elementCounts}],

Row[{"Ordered freqs are ",

ListPlot[elementCounts, Filling -> Axis, ImageSize -> {400, 200},

PlotRange -> {0, Length[ucFamilyInts]},

GridLines -> {{}, {Length[ucFamilyInts],

Length[ucFamilyInts]/2}}]}],

Row[{"Union closed family is ",

Sort[Join @@ Position[#, 1] & /@ ucFamilyBits]}]

}]

, {{m, 9, "Base set cardinality"}, 0, 19, 1}

, {{r, 5, "Random sample size"}, 0, 100, 1}]