Count-distinct problem: Difference between revisions

Content deleted Content added
Pychron (talk | contribs)
Added back the algorithm D' as an improvement of algorithm D.
Pychron (talk | contribs)
m Algorithm D' was still actually algorithm X. I've changed it to D' now.
Line 86:
{{nowrap|If <math> u \leq p </math> then}}
Insert <math> (a_t, u) </math> into {{mvar|B}}
{{nowrap|While <math> |B| = s \wedge u < p </math> then}}
Remove every element of <math>(a', B u')</math> withof probability{{mvar|B}} with <math> u' > \frac{1p}{2} </math>
{{nowrap|<math> p \leftarrow \frac{p}{2} </math>}}
{{nowrap|End While}}
If <math> u < p </math> then
Insert <math> (a_t, u) </math> into {{mvar|B}}
{{nowrap|End For}}
{{nowrap|return <math> |B| / p </math>.}}