# How to find sum of all numbers formed from a given set of digits

Tuesday, July 28th, 2020 ## Sum of all numbers formed from given digits:

If n distinct digits are used to make all the possible n-digit numbers, we get n! numbers. We now want to find out the sum of all these n! numbers are added together. Let us take an example and understand how it is to be done and then look it as a formula.

To find the sum of all the four digit numbers formed using the digits 2,3,4 and 5 without repetition:

We can form a total of 4! or 24 numbers. When we add all these numbers, let us look at the contribution of the digit 2 to the sum.
When 2 occurs in the thousands place in a particular number, its contribution to the total will be 2000. The number of numbers that can be formed with 2 in the thousands place is 3!, i.e., 6 numbers. Hence, when 2 in the thousands place its contribution to the sum is 3! x 2000.

Similarly, when 2 occurs in the hundreds place in a particular number, its contribution to the total will be 200 and since there are 3! Numbers with 2 in the hundreds place, the contribution 2 makes to the sum when it comes in the hundreds place is 3! x 200.

Again, when 2 occurs in the tens and units place respectively, its contribution to the sum is 3! x 20 and 3! x 2 respectively. Hence, the total contribution of 2 to the sum is 3! (2000+200+20+2) i.e. 3! x 2222. This takes care of the digit 2 completely.

In a similar manner, the contribution of the 3,4, and 5 to the sum will respectively be 3! x 3333, 3! x 4444, 3! x 5555, i.e.,

3! x (2+3+4+5) x 1111

We can now generalize the above as

If all the possible n-digit numbers using n distinct digits are formed, the sum of all the numbers so formed is equal to (n-1)! x {sum of all the digits} x {111…….} n times.

E.g:

Example 1: What would be the sum of all the numbers which can be formed by using the digits 1, 3, 5, 7 all at a time and which have no digits repeated?

Sol: Sum of the numbers formed by taking all the given n digits is ( sum of all the n digits ) x  (n-1) ! x (111…..n times).

Here n = 4. and Sum of 4 digits = 16

The sum of all the numbers which can be formed by using the digits 1, 3, 5, 7 is

= ( 16 ) x ( 4 – 1)! x ( 1111)

= 16 x 3! x 1111.

Example 2: What would be the sum of all numbers formed by the digits 2, 3, 5, 7 and 9 excluding all those numbers which will start from 5.

Sol: Firstly, we will find the sum of all numbers which can be formed using the given digits by using the above formula i.e.

(n-1)! x {sum of all the digits} x {111…….} n times

Here n= 5;

Sum of digits = 2+3++5+7+9 = 26

Hence, 4! x 26 x (11111) = 6933264

But this sum will include all those numbers which are having 5 as the first digit.

So, find the sum of all numbers which are having 5 as the first digit, using the above-mentioned concept we have:

4! x 50000= 1200000

On subtracting this from the original number we get 5733264 as an answer.

Example 3: Find the sum of all numbers that can be formed using the digits 7,9,5,6 and 2 excluding which will have 5 at first place and 6 at hundred’s digit.

Sol: Again firstly we will find the total sum of all numbers which can be formed using all digits.

Here n=5, Sum of digits: 7+9+5+6+2 = 29

Hence, 4! x 29 x (11111) =  7733256

Now, the contribution to the sum by 5 at first place would be: 4! x 50000 = 1200000

And, contribution to the sum by 6 at hundred’s digit: 4! x  600 = 14400

Subtracting these numbers sum from the original sum will give the answer i.e.

7733256 – (1200000 + 14400) = 6518856

Example 4: What would be the sum formed by using the digits 2,3,4,6,0, in which the position of 0 is fixed at the hundred’s digit.

Sol: In this question, we have to find the sum of all numbers which can be formed using the above digits in which the position of 0 is fixed at hundred’s digit i.e _ _ 0 _ _

We can simply see that fixing 0 at hundred’s position will not do any contribution by hundred’s digit i.e. to find the answer firstly we have to find the total sum and then subtract the contribution of all digits at hundred’s digit from it.

Here n= 5,

Sum of digits = 15

Total Sum: 4! x 15 x 1111 1=3999960

Now the contribution at hundred’s digit can be given by: (Sum of digits) x 111 x 24 (as there are 4 digits and 3 positions to fill which can be done by 24 ways) =  15 x111 x 24

Hence, the answer is : 3999960 – 39960 = 39959640

Note: Here 24 is 4! it’s just a coincidence, it doesn’t imply that we have to multiply to 4! to find the contribution of hundred’s digit.

Example 5: Suppose there are 5 digits 2,7,0, 5, 3. Now we have to find the sum of all those numbers in which the even’s digit would be at even position.

Sol: In a 5 digit number there would be two even positions which would be ten’s and thousand’s place. The above-given digits have two even digits, which are: 2, and 0. These should be at even position.

Now, 0 digits can’t contribute to the sum at both positions, i.e. if it would be at ten’s position there would be no contribution in the sum by ten’s digit.

Firstly, find the total sum.

Here, n= 5.

Sum of digits = 17.

Hence, sum = 4! x 17 x 11111 = 4533288

If 2 is fixed at thousand’s and ten’s position,  it means there would be no contribution of other’s digit at these positions.

Therefore, contribution of other digits at thousand’s place = (7+0+5+3) x 1111 x3! =99990

Contribution of other digits at ten’s place = (7+0+5+3) x 11 x 3! = 990

Since there would be no contribution of 0 at thousand’s and ten’s digit so we will find the total contribution of the remaining digits at these positions:

Contribution at thousand’s position: (2+3+5+7) x 1111 x 24 = 17 x 1111 x 24 = 453288

Contribution at ten’s position: (2+3+5+7) x 11×24 = 4488

Now, to find the answer subtract all these contributions from the total sum, therefore:

4533288 – (99990 + 990 + 453288+4488) = 3974532

To solve these questions you should be good in calculations, although an on-screen calculator is given in CAT still solving these questions could be time-consuming so solve only when you have enough time left.

## Other posts related to Quantitative Aptitude – Number Systems

### CAT Questions related to Quantitative Aptitude – Number Systems

All questions from CAT Exam Quantitative Aptitude – Number Systems
Quantitative Aptitude – Number Systems – Q1: If the product of three consecutive positive integers is 15600 then the sum of the squares of these integers is
Quantitative Aptitude – Number Systems – Q2: If a, b, c are three positive integers such that a and b are in the ratio 3 : 4 while b and c are in the ratio 2:1, then which one of the following is a possible value of (a + b + c)?
Quantitative Aptitude – Number Systems – Q3: The numbers 1, 2,…,9 are arranged in a 3 X 3 square grid in such a way that each number occurs once and the entries along each column, each row, and each of the two diagonals add up to the same value.

## Online Coaching Course for CAT 2020

a) 900+ Videos covering entire CAT syllabus
b) 2 Live Classes (online) every week for doubt clarification
c) Study Material & PDFs for practice and understanding
d) 10 Mock Tests in the latest pattern
e) Previous Year Questions solved on video

If you Like this post then share it!

### One response to “How to find sum of all numbers formed from a given set of digits”

1. Anon says:

Only the first part is correct. You are ignoring the contribution from other digits while eliminating digits in fixed positions

This site uses Akismet to reduce spam. Learn how your comment data is processed.