Function probability + tests