Basically I have to implement a bloom filter and test it with char 'a' to 'z' and 'A' to 'Z' (easy and done).
Then I have to test for false positives but the requirements say to use "aa" to "ZZ" (strings) to count the false positives (not done).
Any idea what that means?
false positive requires actual set of data, I think what your professor meant was: add 'a'-'z','A'-'Z' to the filter (actual data) now, check for all the strings "aa"-"ZZ", count the number of false positives (all positives will be false, since none of them are in the data) and extract the ratio: #false_positives/#strings_in_range("aa","ZZ")
EDIT: at comments @Bill asked how to iterate over "aa"-"ZZ", here is a simple code snap of how to do it.
Set<String> set = new HashSet<String>();
for (Character c = 'a';c<='z';c++) {
String lower = c.toString();
String upper = c.toString().toUpperCase();
for (Character k = 'a';k<='z';k++) {
set.add(lower + k.toString());
set.add(lower + k.toString().toUpperCase());
set.add(upper + k.toString());
set.add(upper + k.toString().toUpperCase());
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With