Spent Sunday afternoon prototyping probabilistic counting ⚡
Whenever I am reading a paper I always look for something that I can quickly code and build a deeper understanding of the concepts.
This week, I was reading the paper on the Flajolet Martin algorithm, which efficiently counts the distinct elements in a stream of data in a single pass and uses very minimal additional space.
I quickly coded a quick prototype to see if this works and if yes then how off is approximate counting as compared to absolute answer?
You can see in the attached graph, that the approximate count distinct is very close to the actual one and it so beautifully follows the curve. Here’s my detailed write-up and source code for you to refer to.
give it a read - https://lnkd.in/gs8j7VHk source code - https://lnkd.in/ghKF8k9p
pro tip: instead of learning concepts theoretically, be hands-on and try to implement whatever you are learning.
nothing beats being hands-on.
⚡ I keep writing and sharing my practical experience and learnings every day, so if you resonate then follow along. I keep it no fluff.
youtube.com/c/ArpitBhayani