Calculating percentage and probability