Live data from Hacker News

Interactive Demo of Bloom Filters

jasondavies.com

21–30 of 56 posts

Re: Interactive Demo of Bloom Filters

#21
post #19

I think CS education would be improved if these concepts didn't have mysterious names. Respect to Bloom, but the programming median might be raised if Bloom filters were called something stupid obvious like Hash Array Filler-upper Tables. We might not even need to spend time making visualizations to explain them.

I have no idea why you think the name helps remove the need for a visualization. Besides I think "filter" is more apt than "table"—it doesn't store anything per se.

Re: Interactive Demo of Bloom Filters

#22

This is great, but think "Probably is in there" should be replaced with "Might be in there".

For this toy example, sure. But extend it from a 2byte table to, for example, a 50MB table and use many more hashes. The larger the table, and the more hash functions you use, the smaller the false positive error becomes. If you have a limited dataset that you want to test against, you can set these params to have a near 0% false positive rate, at the expense of a much larger table

Re: Interactive Demo of Bloom Filters

#23
post #14
post #12

Earlier quoted context omitted.

hey, curious why your variables in the go version are so terse? makes following along a little tough!

It is Go 'style'. The abstractions are supposed to be self explanatory and simple and thus the variable names do not have to serve as documentation.

I think it is Go style to name things that come in as interfaces with short names. When you have an io.Writer, there's very little else you can name it other than "w" that would have any additional meaning or utility. When you have a variable or struct field of a concrete type, it can and should have a meaningful name, even in Go.

Ironically, I see several "input io.Reader" sort of things in that code, where as "number of hash functions" is k. A few minutes with go-rename would clean that right up, though.

Go to https://golang.org/pkg/net/http/#Client and use your browser to search for the string "struct {" and have a look. https://golang.org/pkg/os/ is another page with a number of struct declarations.

Re: Interactive Demo of Bloom Filters

#24
post #19

I think CS education would be improved if these concepts didn't have mysterious names. Respect to Bloom, but the programming median might be raised if Bloom filters were called something stupid obvious like Hash Array Filler-upper Tables. We might not even need to spend time making visualizations to explain them.

What is this mysteriously-named Hash Array? Perhaps you're talking about a Contiguous Allocation with Well-Shuffled Value-Derived Indexes?

Re: Interactive Demo of Bloom Filters

#26
post #19

I think CS education would be improved if these concepts didn't have mysterious names. Respect to Bloom, but the programming median might be raised if Bloom filters were called something stupid obvious like Hash Array Filler-upper Tables. We might not even need to spend time making visualizations to explain them.

I have no idea why you think the name helps remove the need for a visualization. Besides I think "filter" is more apt than "table"—it doesn't store anything per se.

I never needed a picture to understand a hash table once I knew what a hash function was. If it were called a McCready table, that's one more trip to Wikipedia, plus one more every time I forget.

Re: naming: It's a table of hash function results. It probabilistically stores a set. I don't see any filter here, though one use of the technique is indeed in filtering a list, though there are plenty more.

Re: Interactive Demo of Bloom Filters

#27
post #24
post #19

I think CS education would be improved if these concepts didn't have mysterious names. Respect to Bloom, but the programming median might be raised if Bloom filters were called something stupid obvious like Hash Array Filler-upper Tables. We might not even need to spend time making visualizations to explain them.

What is this mysteriously-named Hash Array? Perhaps you're talking about a Contiguous Allocation with Well-Shuffled Value-Derived Indexes?

You know what both a Hash and Array are, as would ~100% of the people who care about Bloom filters.

Re: Interactive Demo of Bloom Filters

#28
post #19

I think CS education would be improved if these concepts didn't have mysterious names. Respect to Bloom, but the programming median might be raised if Bloom filters were called something stupid obvious like Hash Array Filler-upper Tables. We might not even need to spend time making visualizations to explain them.

I have no idea why you think the name helps remove the need for a visualization. Besides I think "filter" is more apt than "table"—it doesn't store anything per se.

How about "probabilistic hash filter" as a name?

... this naming stuff it hard

Re: Interactive Demo of Bloom Filters

#29
post #18

If you want a simple explanation of bloom filters: To add to filter: 1) Get multiple hashes of the data. You can use the same hash function and increment the data each hash, or use multiple hash functions. You can do any amount of hashes from 1 to infinity, each filter size and dataset size has a sweet spot. 2) Mod (remainder) each hash by the filter size. The filter size can be any size, 1 to the maximum hash from y…

> a filter larger than your dataset is obviously useless

This isn't obvious to me, can you explain?

Re: Interactive Demo of Bloom Filters

#30
post #27
post #24

Earlier quoted context omitted.

What is this mysteriously-named Hash Array? Perhaps you're talking about a Contiguous Allocation with Well-Shuffled Value-Derived Indexes?

You know what both a Hash and Array are, as would ~100% of the people who care about Bloom filters.

His point still stands, though. :)

Those who already know what a Bloom Filter is would probably the find the name more convenient than having to say a short description every time. Those that are just learning programming might argue that Hash, Array, Boolean, String, etc. would be understood faster if they had more descriptive names.

Having a short, distinctive name helps in differentiating and reasoning about the different objects. Think of an everyday programming-related discusion that includes hashes, arrays, and strings, and think about making the following substitutions:

- Hash : Contiguous Allocation with Well-Shuffled Value-Derived Indexes

- Array : Contiguous Allocation of Same Typed Values

- String : Contiguous Allocation of Character Values

- Boolean : Either True or False Value

Post reply on HN