If the order of the lottery number matters, then each lottery number is called a permutation of numbers, and the formula we use to calculate the probability of winning the lottery when this is the case is as follows: a n P r , where nPr is the number of permutations possible of the lottery number, and. ( n − r ) ! .