Counting FA/TP rate using binary search