One of the properties of the Alpha Algorithm used for cache management within a sketch is that the value of Theta Long is always up-to-date. There may be dirty hash values in the cache, but the Alpha Algorithm estimation function ignores them.

In Theta Sketches, the default Update Hash Seed 9001 is a prime number that was chosen very early on in experimental testing. Choosing a seed is somewhat arbitrary, and this particular seed is not superior to other seeds.

In performing set operations on two sketches it is critical that the same hash function and seed was used for both sketches, otherwise the assumed 1:1 relationship between the original source key value and the hashed bit string would be violated. Once you have developed a history of stored sketches you are stuck with your chosen seed. So don't change it! Update Hash Seed

Note that *isEmpty()* does not always mean that theta is 1.0 because if *p* < 1.0, theta will be set
equal to *p* during construction.
Also, a cache of zero values (*getRetainedEntries(true) = 0*) does not mean that the sketch is *Empty* since
set intersection or difference operations can result in a sketch with zero values.
If the sourcing sketches had seen data then a resulting intersection or difference sketch will be *not Empty*
and have valid upper and lower bounds even if the cache has zero values. In other words, the resulting sketch represents
a valid distribution of data that just happens to have zero samples collected from it.

Note also that a virgin Intersection object will return *isEmpty() == false*. This is because a virgin Intersection object represents
the Universe Set, which is clearly not empty.

These are subtle distinctions and exist for mathematical correctness. Excluding sketches that just have *getRetainedEntries(true) = 0*
from set operations them could result in impacting the accuracy of results.

The reason it is called "nominal" is that depending on the specific algorithm of the sketch, the actual
number of entries retained by the sketch after the sketch goes into *estimation mode*
may differ from the configured value. For the *AlphaSketch* the number of retained entries statistically varies
but has a mean of *k*. For the *QuickSelect* sketches, the number of retained entries will statistically
vary from *k* to almost *2*k*.

Each sketch type also has a minimum acceptable value for this value. For QuickSelect Sketches this value is 16 and for Alpha Sketches this value is 512. Specifying a value less than this minimum value just results in the minimum value being used.

getUpperBound(1) returns the estimated quantile(0.841) of the distribution.

getLowerBound(1) returns the estimated quantile(0.158) of the distribution.

getUpperBound(2) returns the estimated quantile(0.977) of the distribution.

getLowerBound(2) returns the estimated quantile(0.023) of the distribution.

getUpperBound(3) returns the estimated quantile(0.9986) of the distribution.

getLowerBound(3) returns the estimated quantile(0.0013) of the distribution.

However, for sketches with small configured values of *Nominal Entries < 4096* for Theta or *lgConfigK < 12* for HLL,
the error distribution of the sketch becomes quite asymmetric and cannot be approximated with a Gaussian. In these cases the interpretation of
*numStdDev* is that of an index that returns the quantile of the sketch error distribution that corresponds to fractional normalized rank
of the standard normal distribution at the specified *numStdDev*.

Thus, getUpperBound(1) and getLowerBound(2) represent the 68.3% confidence bounds,
getUpperBound(2) and getLowerBound(2) represent the 95.4% confidence bounds, and
getUpperBound(3) and getLowerBound(3) represent the 99.7% confidence bounds.

For some sketches where the error distribution is not Gaussian, special mathematical approximation methods are used. See Sketch Accuracy.

`(k+1)th order statistic`

from the hash table with a complexity of One of the benefits of using the QuickSelect algorithm for the cache management of the sketch is
that the number of valid hashes ranges from
nominal entries
to the current *REBUILD_THRESHOLD*, which is nominally 15/16 * *cacheSize*.
This means that without the user forcing
a *rebuild()*, the sketch, on average, may be about 50% larger than
nominal entries, about 19% more accurate, and faster.

"X1" means no resizing is allowed and the sketch will be intialized at full size.

"X2" means the internal cache will start very small and double in size until the target size is reached.

Similarly, "X4" is a factor of 4 and "X8 is a factor of 8.

This mode is particularly useful when merging large numbers of degenerate sketches.

In order to provide some protection against accidental mixing of sketches that were generated with different seeds a short, 16-bit, Seed Hash is stored with the sketch image. When heapifying or wrapping an UpdateSketch image, which can be either a byte array or a Memory object, the user must provide the original seed either directly or indirectly by assuming the DEFAULT_UPDATE_SEED. The provided seed will be hashed and validated against the internal short Seed Hash and an error will be thrown if the seed hashes do not match. The Set Operations classes, Union, Intersection and AnotB also require the user to provide the seed either directly or indirectly.

An internal check will be made to make sure that the provided seed does not hash to a 16-bit value of zero.
If it does produce zero, an error will be thrown and the user must provide a different seed value.

See also Default Update Seed.

`θ ≈ `*k/N*, 0 < θ ≤ 1.0

, and θ = (double) thetaLong / Long.MAX_VALUE;.
See thetaLong.
0 <

- InsertedCountIncremented: Inserted, not full, retained_entries_count incremented.
- InsertedCountNotIncremented: Inserted, not full, retained-entries-count not incremented because a dirty value was overridden.
- RejectedDuplicate: Rejected as duplicate.
- RejectedNullOrEmpty: Rejected because input was null or empty. Only for update objects.
- RejectedOverTheta: Rejected because the computed hash was over the current value of thetaLong.