![Counting the number of elements in a stream by limited means in the artist's view Counting the number of elements in a stream by limited means in the artist's view](https://habrastorage.org/getpro/habr/upload_files/1eb/1cb/123/1eb1cb1231d035e9320cd396eef38137.jpeg)
, Qrator Labs @dimak24 . Core — hr@qrator.net.
1
- : , ; : -
. , , . , .
, ( 2). ( 3) , 1978 , . — . : , , , , .
2 ,
— . :
. , :
.
: -, , , . -,
. ,
100%. :
3
, : 1, 1/2, 1/4 ..:
, ?
, :
,
,
0: ,
,
.
.
.
. ,
. ,
.
. ,
, , .
, , .
:
,
. ,
!
![. 1: ( sample_size=100 , n n ) . 1: ( sample_size=100 , n n )](https://habrastorage.org/getpro/habr/post_images/4f7/007/8e6/4f70078e65b86f7519c22dc7a3011488.png)
![](https://habrastorage.org/getpro/habr/upload_files/98c/c5b/de3/98cc5bde36d1180d9e07199a7ed4e5c7.png)
4
: , . — < > — .
![](https://habrastorage.org/getpro/habr/upload_files/d34/c3e/6ef/d34c3e6ef35d965eb407151f61a1e705.png)
, , :
![](https://habrastorage.org/getpro/habr/upload_files/5f3/bde/3d8/5f3bde3d863939ce53f98f8e4dac2799.png)
5
. , , , . , . , , - . , , EMA , .
: . ,
,
. ,
!
,
:
![](https://habrastorage.org/getpro/habr/upload_files/dba/87a/845/dba87a84567dc87571e6e80788cc83d9.png)
6
![. 2: (M=5 ) (E=3 ) . 2: (M=5 ) (E=3 )](https://habrastorage.org/getpro/habr/upload_files/27d/123/547/27d1235474c187ff204e7a1274c7d089.png)
:
:
, 2 ,
.
.
, ( , ). ; , .
:
,
:
:
;
.
( )
.
( ) ! , ( ):
![. 3: . 3:](https://habrastorage.org/getpro/habr/upload_files/1a6/be8/726/1a6be872658609f572b7cf3b11019adc.png)
![](https://habrastorage.org/getpro/habr/upload_files/064/218/700/064218700d67ac7f8e5d7b36f4ab333c.png)
.
. . , , , . , :
![](https://habrastorage.org/getpro/habr/upload_files/f5a/692/80c/f5a69280c3ccc927ac0918642d9957d4.png)
, , :
![](https://habrastorage.org/getpro/habr/upload_files/cc4/41a/31f/cc441a31f403e7451e83f84e2a4df999.png)
, ( ,
).
, ( )
. ,
:
![](https://habrastorage.org/getpro/habr/upload_files/1ed/043/4e8/1ed0434e802acc77aef5e23473c4df43.png)
7
— ! !
, ...
8
:
. :
— , . , .
,
:
, : , , ,
:
,
.., —
,
,
:
,
..,
.
,
. , ( ). — .
( , ,
):
:
, , :
[1] Morris, R.Counting large numbers of events in small registersCommunications of the ACM, 1978 21(10), 840-842.
[2] http://gregorygundersen.com/blog/2019/11/11/morris-algorithm/ −
[3] https://habr.com/ru/company/qrator/blog/334354/ − EMA-
[4] https://habr.com/ru/post/208268/ −