dimitri92 wrote:
I am sorry I don't have the OA. But I think it is solvable without the OA
What is the sum of all 4-digit numbers that can be formed using the digits 1,2,3,4 where repetition of digits is allowed?
As each digit of four digit number (abcd) can take 4 options (1, 2, 3, 4) total there can be 4^4 numbers.
Obviously each digit (a, b, c, and d) will take the value of 1, 2, 3, 4 equal number of times, so each digit will take the value of 1, 2, 3, 4 - \(\frac{4^4}{4}=4^3=64\) times: units digit will take the values of 1, 2, 3, 4 - 64 times and the same with tens, hundreds, thousands digits.
So the sum would be 64*(1+2+3+4)+64*10*(1+2+3+4)+64*100*(1+2+3+4)+64*1000*(1+2+3+4)=64*10*(1+10+100+1000)=711040.
Actually there is the direct formula for this kind of problems. Of course it's better to understand the concept, then to memorize the formula but in case someone is interested here it is:
1. Sum of all the numbers which can be formed by using the \(n\) digits
without repetition is:
(n-1)!*(sum of the digits)*(111…..n times).
2. Sum of all the numbers which can be formed by using the \(n\) digits (
repetition being allowed) is:
\(n^{n-1}\)*(sum of the digits)*(111…..n times).
Hope it helps.[/quote]
Hi Bunuel,
Can we say that the sum of the numbers will be 1111 to 4444 ? since the repetition of the digits are allowed.
I think this range would cover all the numbers. Then we can simply use the formula for arithmetic mean to calculate the sum ? Please correct my thinking if wrong.[/quote]
Yes, the numbers range from 1111 to 4444: 1111, 1112, 1113, 1114, 1121, 1121, ..., 4444. But the numbers are NOT evenly spaced so you cannot get the sum by multiplying the mean by the number of terms.
Does this make sense?[/quote]
I am no Math Expert. Can you please correct my below approach?
We know the smallest number we can make is 1111 and the largest number we can
make is 4444.
We also know that our numbers will be evenly distributed in the middle (i. e. 1112 is
balanced by 4443; 1113 is balanced by 4442). So, we can solve using the average
formula.
Finally, we know that there are 4*4*4*4 = 256 numbers in our set.
Average = sum of terms/# of terms
sum of terms = average * # of terms
sum of terms = (1111+4444)/2 * 256 = 5555/2 * 256 = 5555*128 = 711040