1,527 views
2 votes
2 votes
how many 4 digit numbers possible whose  sum is  equal to 12 ?

2 Answers

0 votes
0 votes

This is an iterative solution to this problem. Let's take 4 digit numbers involving 9 first, and then 8,7,6 etc. and find the combinations that sums upto $12$. After selecting a digit, next three digits are selected which are less than or equal to the selected one, to avoid repetition.

Numbers involving $9$ : The largest number we can involve in this case is $3$. After selecting $3$, a forced selection of two zeros remain. So we have $9,3,0,0$ selected. The possible combinations with these digits is given by $\frac{2*3*2*1}{2!}$, because we can not have $0$ in the $first$ position, and also $0$ is repeated $2$ times. In general, we can say,

the number of ways of arranging these digits is $ = \frac{(number\space of\space digits\space other\space than\space 0) * 3 * 2 * 1}{(no.\space of\space repetitions)!}$.

examples, if the digits selected are of the form


$x\space y\space z\space p\space$, then $\frac{4*3*2*1}{0!} = 24$ 
$x\space y\space z\space 0\space$, then $\frac{3*3*2*1}{0!} = 18$

$x\space x\space y\space z\space$, then $\frac{4*3*2*1}{2!} = 12$
$x\space x\space y\space 0\space$, then $\frac{3*3*2*1}{2!} = 9$

$x\space y\space 0\space 0\space$, then $\frac{2*3*2*1}{2!} = 6$

$x\space x\space x\space y\space$,  then $\frac{4*3*2*1}{3!} = 4$
$x\space x\space 0\space 0\space$, then $\frac{2*3*2*1}{2!.2!} = 3$
$x\space x\space x\space 0\space$, then $\frac{3*3*2*1}{3!} = 3$
$x\space x\space x\space x\space$, then $\frac{4*3*2*1}{4!} = 1$ Combinations possible.


In this way we can calculate all possible numbers involving 9, and hence 9 doesn't have to be considered again. Let's complete the table then and sum it up to get the answer.
 

Selected

Digit

Possible

Selection(s)

for $sum=12$

 

Form

Number of

Combinations

Possible

$9$ 3,0,0 x y 0 0 6
$9$ 2,1,0 x y z 0 18
$9$ 1,1,1 x x x y 4
    $Total$ $28$ ways
$8$ 4,0,0 x y 0 0 6
$8$ 3,1,0 x y z 0 18
$8$ 2,2,0 x x y 0 9
$8$ 2,1,1 x x y z 12
    $Total$ $42$ ways
$7$ 5,0,0 x y 0 0 6
$7$ 4,1,0 x y z 0 18
$7$ 3,2,0 x y z 0 18
$7$ 3,1,1 x x y z 12
$7$ 2,2,1 x x y z 12
    $Total$ $66$ ways
$6$ 6,0,0 x x 0 0 3
$6$ 5,1,0 x y z 0 18
$6$ 4,2,0 x y z 0 18
$6$ 4,1,1 x x y z 12
$6$ 3,3,0 x x y 0 9
$6$ 3,2,1 x y z p 24
$6$ 2,2,2 x x x y 4
    $Total$ $88$ ways
$5$ 5,2,0 x x y 0 9
$5$ 5,1,1 x x y y 6
$5$ 4,3,0 x y z 0 18
$5$ 4,2,1 x y z p 24
$5$ 3,3,1 x x y z 12
$5$ 3,2,2 x x y z 12
    $Total$ $81$ ways
$4$ 4,4,0 x x x 0 3
$4$ 4,3,1 x x y z 12
$4$ 4,2,2 x x y y 6
$4$ 3,3,2 x x y z 12
    $Total$ $33$ ways
$3$ 3,3,3 x x x x 1
    $Total$ $1$ way

So, the sum of all combinations is given by,

$28+42+66+88+81+33+1 = 342$.

0 votes
0 votes

Another solution:

For a 2 digit number, the number of ways we can make sums from 0 to 18 follows a certain pattern. There is only one way to get a sum of 0 - (0,0) and a sum of 18 - (9,9). There are two ways to get sum of 1 - (0,1) and (1,0) and for a sum of 17 - (9,8) and (8,9). Three ways possible to get a sum of 2 and 16, and so on.
The pattern is as below : 

Sum No. of ways Sum No. of ways
0 1 10 9
1 2 11 8
2 3 12 7
3 4 13 6
4 5 14 5
5 6 15 4
6 7 16 3
7 8 17 2
8 9 18 1
9 10    

Now divide the $4$ digit number into two halves.

$LHS \rightarrow$ _ _  | | _ _ $\leftarrow RHS$

To get a sum of $12$, sum of digits of $LHS + $ sum of digits of $RHS =  12$.

Let's find all the combinations and sum up to get the answer. For sums from $0$ to $9$ in the $LHS$, number of ways is one less than actual to exclude the case with leftmost $0$.

$LHS$ sum $RHS$ sum Total ways possible
0 12 (1-1) x 7 = $0$
1 11 (2-1) x 8 = $8$
2 10 (3-1) x 9 = $18$
3 9 (4-1) x 10 = $30$
4 8 (5-1) x 9 = $36$
5 7 (6-1) x 8 = $40$
6 6 (7-1) x 7 = $42$
7 5 (8-1) x 6 = $42$
8 4 (9-1) x 5 = $40$
9 3 (10-1) x 4 = $36$
10 2 9 x 3 = $27$
11 1 8 x 2 = $16$
12 0 7 x 1 = $7$

So, the total number of combinations are:

$0+8+18+30+36+40+42+42+40+36+27+16+7 = 342.$

Related questions

1 votes
1 votes
0 answers
1
Kaluti asked Jan 31, 2018
371 views
Consider two sets A and B such that: AUB $\subseteq$ A $\cap$ BThen, which of the following is incorrect?A A = { } and B={} ALWAYSB |A| = |B|C A=BD none of these
0 votes
0 votes
0 answers
3
Mayank Bansal asked Jan 29, 2019
251 views
The number of ways, we can arrange 5 books in 3 shelves ________. Given answer 2520n=3 r=5 so answer is 3-1+5 P5= 7p5= 2520 My answer 3*3*3*3*3= 243Where am I doing wrong...
0 votes
0 votes
1 answer
4
hitendra singh asked Oct 26, 2018
908 views
A -How many three digit number whose sum of digit equals 10?1- $\binom{9}{7}$2- $\binom{10}{2}$3- $\binom{10}{2}$4-NoneB- 3 dice are tossed total ways that numbers appear...