Solveeit Logo

Question

Question: let N=abcdefghij be a10 digit natural nuber uch that a<=b<=c<=d<=e<=f<=g<=h<=i>=j let m be number of...

let N=abcdefghij be a10 digit natural nuber uch that a<=b<=c<=d<=e<=f<=g<=h<=i>=j let m be number of such numbers such that all digits belong to {1,2,3,4,5} let n be number of such numbes formued usong all the diits 1,2,3,4,5. m+n?

Answer

3863

Explanation

Solution

We are given a 10-digit natural number

N=abcdefghijN = a\,b\,c\,d\,e\,f\,g\,h\,i\,j

with the restrictions

abcdefghia\le b\le c\le d\le e\le f\le g\le h\le i and iji\ge j.

All digits are chosen from the set {1,2,3,4,5}\{1,2,3,4,5\}.

Define:

  • mm = number of such numbers (with digits from {1,2,3,4,5}\{1,2,3,4,5\}) satisfying the above order-conditions.
  • nn = number of such numbers (again with the above order-conditions) that use all the digits 1,2,3,4,51,2,3,4,5 at least once.

We want to compute m+nm+n.

Step 1. Counting mm

A. Count the first 9 digits

Since the first 9 digits are non-decreasing and come from 5 digits, the total number of ways is given by the stars and bars formula:

Total9=(5+919)=(139)=(134)=715\text{Total}_{9} = \binom{5+9-1}{9} = \binom{13}{9} = \binom{13}{4} = 715.

However, the final digit jj is not free; it must satisfy jij\le i where ii (the 9th digit) depends on the chosen 9-tuple.

B. Count by conditioning on the 9th digit

For each non-decreasing 9-tuple the 9th digit (say kk, with k{1,2,3,4,5}k\in\{1,2,3,4,5\}) is fixed. Then jj can be any digit in {1,2,,k}\{1,2,\dots,k\} (there are kk choices).

Now, we need to sum over the cases when the last digit (of the 9-tuple) is exactly kk.

Let f(k)f(k) = number of non-decreasing sequences of length 9 from {1,2,3,4,5}\{1,2,3,4,5\} with 9th digit exactly kk.

One way to count f(k)f(k) is to note:

f(k)=(9+k19)all sequences using 1,2,,k(9+k29)sequences using 1,2,,k1f(k)= \underbrace{\binom{9+k-1}{9}}_{\text{all sequences using }1,2,\dots,k} - \underbrace{\binom{9+k-2}{9}}_{\text{sequences using }1,2,\dots,k-1}.

For each kk, the total contribution is kf(k)k\cdot f(k). Hence,

m=k=15k[(9+k19)(9+k29)]m = \sum_{k=1}^{5} k\left[\binom{9+k-1}{9} - \binom{9+k-2}{9}\right].

Let’s calculate term-by-term:

  • For k=1k=1:

    f(1)=(99)(89)=10=1f(1)= \binom{9}{9}-\binom{8}{9} =1-0=1, contribution= 11=11\cdot1=1.

  • For k=2k=2:

    f(2)=(109)(99)=101=9f(2)= \binom{10}{9}-\binom{9}{9}=10-1=9, contribution= 29=182\cdot9=18.

  • For k=3k=3:

    f(3)=(119)(109)=(112)(101)=5510=45f(3)= \binom{11}{9}-\binom{10}{9} = \binom{11}{2}-\binom{10}{1}=55-10=45, contribution= 345=1353\cdot45=135.

  • For k=4k=4:

    f(4)=(129)(119)=(123)(112)=22055=165f(4)= \binom{12}{9}-\binom{11}{9} = \binom{12}{3}-\binom{11}{2}=220-55=165, contribution= 4165=6604\cdot165=660.

  • For k=5k=5:

    f(5)=(139)(129)=(134)(123)=715220=495f(5)= \binom{13}{9}-\binom{12}{9} = \binom{13}{4}-\binom{12}{3}=715-220=495, contribution= 5495=24755\cdot495=2475.

Summing all contributions:

m=1+18+135+660+2475=3289m = 1+18+135+660+2475 = 3289.

Step 2. Counting nn

Here we count those sequences from mm that use all the digits {1,2,3,4,5}\{1,2,3,4,5\} at least once.

Let AdA_d be the set of sequences (satisfying our order conditions) that do not contain digit dd. Using inclusion-exclusion, if we define for a set S{1,2,3,4,5}S\subseteq \{1,2,3,4,5\} of missing digits, note that when the allowed set has rr digits, the count (in place of mm) is, by a similar argument, a function f(r)f(r) with:

  • f(5)=3289f(5)=3289 (we computed this).

  • f(4)f(4): This is the count when the digits come from any 4-element subset. Repeating the above process (or by analogy) we obtain:

    f(4)=1+18+135+660=814f(4)= 1+18+135+660 = 814.

  • f(3)=1+18+135=154f(3)= 1+18+135 = 154.

  • f(2)=1+18=19f(2)= 1+18 = 19.

  • f(1)=1f(1)= 1.

Now by inclusion-exclusion,

n=f(5)(51)f(4)+(52)f(3)(53)f(2)+(54)f(1)n = f(5) - \binom{5}{1}f(4) + \binom{5}{2}f(3) - \binom{5}{3}f(2) + \binom{5}{4}f(1),

since f(0)=0f(0)=0.

Plugging in:

n=32895814+101541019+51n = 3289 -5\cdot814 +10\cdot154 -10\cdot19 +5\cdot1.

Calculate:

5814=40705\cdot814 = 4070, 10154=154010\cdot154 = 1540, 1019=19010\cdot19=190, 51=55\cdot1=5.

Thus,

n=32894070+1540190+5=(32894070)+1540190+5=781+1540190+5n = 3289 -4070 +1540 -190 +5 = (3289 -4070) +1540 -190 +5 = -781 +1540 -190 +5.

781+1540=759-781+1540 =759, 759190=569759-190 =569, 569+5=574569+5=574.

So, n=574n = 574.

Step 3. Final Answer

m+n=3289+574=3863m+n = 3289 + 574 = 3863.

Therefore, the final answer is 3863. The question type is integer and the difficulty is medium.