Two new functions in mathematical.py, originally from naivebayes files