# Bloom Filter Approach for Autonomous Data Acquisition in the Edge-Based MCS Scenario +
## 4 Results and Discussion
### Evaluation of BF Parameters
It is self-evident that when \(n\) increases and the probability of false positives \(p\) decreases, the error rate will also decrease because the BF vector size is larger, and more hash functions are used for the mapping of elements (e.g., for \(n=50\) and \(p=0.1\) vector size is 239 bits and number of hash functions is only 3, while for \(n=200\) and \(p=0.001\) vector size is 2875 bits and number of hash functions is 10). As mobile phones also need to monitor Bloom filter structure in a distributed MCS architecture, we want to keep the vector size as small as possible while maintaining the number of hash functions to avoid losing too much data. Our analysis of a real dataset shows that this requirement can be met when the expected number of inserted elements \(n\) is 100 and the probability of false positives \(p\) is 0.001 (resulting in vector size of 1437 bits and ten hash functions), as the percentage of lost data readings will be around zero regardless of the BF validity period, as shown in Figure 6c,d, where the error rate is 0.006% and 0.008%, respectively. Therefore, we use those values as BF input parameters in the remainder of our evaluation described in Section 4.2. Note that we did not use complex evaluation metrics such as area under the ROC curve (AUC) to evaluate BF because it does not apply to our approach as the BF data structure by definition does not contain false negatives, which is part of the receiver operating characteristic (ROC) curve. Figure 4: Ratio between all and distinct data readings in the period from 4 p.m. to 6:50 p.m. Finally, for each BF associated with an active \(km\) MGRS area, we analyze how many bits in the BF structure are set to 1, as setting too many bits to 1 can lead to an increased number of false positives, which can result in the lost data readings in our MCS service, i.e., measurements can be discarded because they were marked as redundant. Figure 7 presents the number of bits that have value of 1 when \(n\) equals 50 and parameter \(p=0.1\) (Figure 7a) and \(p=0.001\) (Figure 7b). We measured the BF occupancy (number of bits set to 1) for different time windows during 24 h to obtain the distribution of the number of bits that are set to 1. It is important to note that the total size of BF is 239 bits when the parameter \(p=0.1\), and \(m\) is 718 bits for the scenario when the parameter \(p=0.001\). We can see that the structure occupancy for each observed BF validity period is not close to the maximal number of false positives, which is the case for the scenario when the parameter \(p=0.001\) is close to the maximal number of false positives. Figure 5: The influence of parameter \(n\) on the number of lost elements. Figure 6: Percentage of elements that were lost during a 24 h period for different BF validity periods. number of bits. As expected, the results show that when the BF validity period is just 1 min, the structure occupancy rate is the lowest compared to longer BF validity periods because the least number of elements is encoded in the filter, and there is no significant difference in the BF structure occupancy for longer BF validity periods. In addition, it is interesting to observe that the cumulative distribution of occupancy per BF validity period is not primarily affected by the probability of false positives \(p\), i.e., Figure 7b does not change its shape significantly compared to Figure 7a. That means that the occupancy ratio remains stable despite the increase in the BF size (only absolute numbers correlated to the number of hash functions are affected). Even though the presented graphs show that the maximal number of bits set to 1 is not going beyond 40 (Figure 7a) and 132 (Figure 7b), one should note that there are some points located outside the whiskers of the box plot (i.e., above the ninth decile which are not depicted on the graph).