calculate probability