If the values 0.00631 , 0.0002378 and 0.00571 are the expected results from the divisions, make sure that you are not doing whole divisions. That is, make sure that the numerator or denominator is floating or doubling.
Instead
double fraction = someInt / someOtherInt;
You can do
double fraction = (double) someInt / someOtherInt;
In your particular case, you can try something like
(double) Collections.frequency(list, list.get(i)) / list.size();
source share