sriharsha4444Thanks, I think this is the necessary insight in order to be able to solve in 2 minutes without luck. Great work finding the logic there. Amazing that you have to stop thinking about the last 2 numbers in order to find the realisation that each pair of ab corresponds to exactly one of the options for cd, so you can include all permutations for ab. Nice.
sriharsha4444
divisible by 12 means, it has to be divisible by 4 and also 3.
First, checking for divisible by 4 is easy and narrows the options, (to be divisible by 4, the last two digits have to be divisible by 4), so the options are:
_,_,32
_,_,52
_,_,72
Out of these, to be divisible by 3, each of them have some deficits:
_,_,32 -> sum is 5 -> so need 1
_,_,52 -> sum is 7 -> so need 2
_,_,72 -> sum is 9 -> so need 0
Now, for the first two places, no matter whichever combination you take, if you do %3 for their sum, they have to give back 0, 1 or 2 as remainder. (which is obvious / trivial from number theory that when you take a number and divide by n, the possible remainders are 0...n-1) for ex:
let's say you took, 57 for first two positions: 5+7 is 12 -> so remainder with 3 is 0
let's say you took, 23 for first two positions: 2+3 is 5 -> so remainder with 3 is 2
let's say you took, 55 for first two positions: 5+5 is 10 -> so remainder with 3 is 1
Now, the spark moment:
if you take any two single digit primes for first two spots -> they will give a remainder between (0, 1 and 2) when divided by 3
if you take the 3 numbers which passed the divisible by 4 criteria for the last two spots -> they have either a deficit of (0, 1 or 2)
thus, you can match all the first two spots with one of the last two spots that are divisible by 4
For ex: take a random fill for the first two digits:
say 23 -> sum is 5 -> remainder with 3 is 1. So it has 1 extra to donate. So it will fit with _,_,32 (since for _,_,32 -> sum is 5 -> so needs 1 to be divisible by 3)
another ex:
say 77 -> sum is 14 -> remainder with 3 is 2. So it has 2 extra to donate. So it will fit with _,_,52 (since _,_,52 needs 2 to be divisible by 3)
another ex:
say 33 -> sum is 6 -> remainder with 3 is 0. So it has nothing extra to donate. So it will fit with _,_,72 (since _,_,72 doesn't need anything to be divisible by 3)
So this way all the combinations for the first two places will fit in without overlapping nor without missing anything with one of the last two spots that are divisible by 4
Since repetition is allowed, number of combinations for first two places would therefore be:
4 * 4 => numerator (again all of these 16 numbers would fit with one of the _,_,32 or _,_,52 or _,_,72)
all possibilities with repetition allowed:
4 * 4 * 4 * 4 => denominator
ans: 1/16
It is a very hard problem. I only got this revelation after trying to understand the pattern in the solution and also the goal of how can we solve this in under 2 minutes without listing out all the numbers manually.