Content deleted Content added
m v2.05b - Bot T20 CW#61 - Fix errors for CW project (Reference before punctuation) |
Simplified the description of CVM algorithm and also cited the source for epsilon-delta guarantees. |
||
Line 51:
for a practical overview with comparative simulation results.
=== CVM Algorithm ===
Compared to other approximation algorithms for the count-distinct problem the CVM Algorithm uses sampling instead of hashing. The CVM Algorithm provides an unbiased estimator for the number of distinct elements in a stream<ref name=":0" />,
Initialize a counter, {{mvar|t}}, to zero, {{nowrap|<math> t \leftarrow 0 </math>.}}
Line 61:
{{nowrap|If <math> a </math> is in {{mvar|B}} then}}
{{nowrap|Delete <math> a </math> from {{mvar|B}}}}
{{nowrap|<math> u \leftarrow </math> random number in <math> [0, 1) </math>}}
{{nowrap|If <math> u \
Insert <math> (a, u) </math> into {{
{{nowrap|
{{nowrap|<math> (a', u') \leftarrow (a, u) </math> of max <math> u </math> in {{mvar|B}}}}
{{nowrap|
{{nowrap|return <math> |B| / p </math>.}}
|