Computer Scientists Invent an Efficient New Way to Count
https://www.quantamagazine.org/computer-scientists-invent-an-efficient-new-way-to-count-20240516/
https://www.quantamagazine.org/computer-scientists-invent-an-efficient-new-way-to-count-20240516/
8 Comments
SineIraEtStudio@midwest.social · 23 pts · 2y
Relevant section explaining the solution:
sukhmel@programming.dev · 6 pts · 2y
Randomization scares me a bit, but one can run several copies at the same time to get a better estimate, I guess. I like how you can easily obtain the granularity of an estimate after stopping, 2^k^ is increment size after k^th^ round.
I wonder, what are error distributions and how probable it is to not exceed 2^k^ of an error, maybe I should read the article, after all 😅
Thank you for an excerpt
Edit: looks like if we have (ε, δ)-approximation if distribution of data, error would be less than δ/4
lastunusedusername2@sh.itjust.works · 14 pts · 2y
Wow this is surprisingly simple.
nik9000@programming.dev · 4 pts · 2y
It really is. It'd make a wonderful assignment in a second level programming class.
We use hyperlloglog++ for this because it's mergable across nodes and threads. I haven't thought much about combining this one.
Zachariah@lemmy.world · 12 pts · 2y
steventrouble@programming.dev · 7 pts · 2y
southernbrewer@lemmy.world · 2 pts · 2y
So this is probably useful for statistics collectors in DBMSes, used for planning queries. Any other use cases jump to mind?
porgamrer@programming.dev · 2 pts · 2y
I thought it sounded kind of similar to statistical CPU profiling, where you're sampling the program counter of a given thread to see which functions actually use the most time. Maybe this idea could help increase the sample rate.
tatterdemalion@programming.dev · 1 pts · 2y
Reminds me of reservoir sampling.