vectorized probability function