You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/bloom/primer.adoc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ The implementation of a classical Bloom filter consists of an array of _m_ bits,
48
48
Inserting an element _x_ reduces to selecting _k_ positions pseudorandomly (with the help
49
49
of _k_ independent hash functions) and setting them to one.
50
50
51
-
image::bloom_insertion.png[align=center, title="Insertion in a classical Bloom filter with _k_ = 6 different hash functions. Inserting _x_ reduces to setting to one the bits at positions 10, 14, 43, 58, 1, and 39 as indicated by _h_~1~(_x_), ..., _h_~6~(_x_)."]
51
+
image::bloom_insertion.png[align=center, title="Insertion in a classical Bloom filter with _k_ = 6 different hash functions. Inserting _x_ reduces to setting to one the bits at positions 10, 14, 43, 58, 1, and 39 as indicated by _h_~1~(_x_), ..., _h_~6~(_x_)."]
52
52
53
53
To check if an element _y_ is in the filter, we follow the same procedure and see if
54
54
the selected bits are all set to one. In the example figure there are two unset bits, which
@@ -65,7 +65,7 @@ when the array is sparsely populated, a higher value of _k_ improves (decreases)
65
65
as there are more chances that we hit a non-set bit; however, if _k_ is very high
66
66
the array will have more and more bits set to one as new elements are inserted, which
67
67
eventually will reach a point where we lose out to a filter with a lower _k_ and
68
-
thus a smaller proportions of set bits. For given values of _n_ and _m_, the optimum _k_ is
68
+
thus a smaller proportion of set bits. For given values of _n_ and _m_, the optimum _k_ is
69
69
{small}stem:[\lfloor k_{\text{opt}}\rfloor]{small-end} or
70
70
{small}stem:[\lceil k_{\text{opt}}\rceil]{small-end}, with
71
71
@@ -123,4 +123,4 @@ multiblock filters and then block filters. Execution speed will roughly go
123
123
in the reverse order. When considering block/multiblock filters with
124
124
multi-insertion, the number of available configurations grows quickly and
125
125
you will need to do some experimenting to locate your preferred point in the
0 commit comments