There are 5 prizes, for when you match the last digit, last 2 digits and so on.
1 number: 1 in 10 (if you only have one ID number)
2 numbers: 1 in 100
3 numbers: 1 in 1,000
4 numbers: 1 in 10,000
5 numbers: 1 in 100,000
In general, for every alternate ID you have (from traded pokemon) you improve your chances. The exception is if two IDs end with the same numbers.
#11111 and #11112 would give you 2 in 10 odds of the last prize.
#11111 and #33311 would only give you 1 in 10 odds of the last prize, because the last digit is the same.
So if you have 10 traded pokemon with all different final digits, then you will always win a prize!