hellscream wrote:
Could you tell me the way to calculate the sum which the repetition is allowed? For example: from 1,2,3,4. how can we calculate the sum of four digit number that formed from 1,2,3,4 and repetition is allowed?
The logic is no different from 'no repetition allowed' question. The only thing different is the number of numbers you can make.
How many numbers can you make using the four digits 1, 2, 3 and 4 if repetition is allowed?
You can make 4*4*4*4 = 256 numbers (there are 4 options for each digit)
1111
1112
1121
... and so on till 4444
By symmetry, each digit will appear equally in each place i.e. in unit's place, of the 256 numbers, 64 will have 1, 64 will have 2, 64 will have 3 and 64 will have 4.
Same for 10s, 100s and 1000s place.
Sum = 1000*(64*1 + 64*2 + 64*3 + 64*4) + 100*(64*1 + 64*2 + 64*3 + 64*4) + 10*(64*1 + 64*2 + 64*3 + 64*4) + 1*(64*1 + 64*2 + 64*3 + 64*4)
= (1000 + 100 + 10 + 1)(64*1 + 64*2 + 64*3 + 64*4)
= 1111*64*10 = 711040
or use the formula given by Bunuel above:
Sum of all the numbers which can be formed by using the digits (repetition being allowed) is:\(n^{n-1}\)*Sum of digits*(111...n times)
=\(4^3*(1+2+3+4)*(1111) = 711040\) (Same calculation as above)
. It worked for this question. My question is will it work for all such types of questions?
"The fool didn't know it was impossible, so he did it."