0

How many $x \in \mathbb{Z}$, with $ 104050607080 \leq x \leq 908070605040$ , can be formed using the digits of $106506506503$, such that $x$ is divisible by $20$ and contains the string "$036$" as a substring?

I am reposting this exercise (already answered here) because I wonder if there is a less-time consuming approach. My professor told me that a solution by complement, for this exercise, is too much time-consuming and further it would requires to analyse too many cases. He suggested to count directly the substrings that satisfy those conditions but honestly I have no clue how to do this. How can exercise be solved more quickly?

Edit:

  • Please note that substring can only appear once.
  • Please note that the leftmost digit of any positive integer is not permitted to equal 0.
  • Please also note that I am not allowed to use computational tools otherwise I would have solved this exercise in C++ or Java.

Solution Outline (as my professor requested)

  1. Available Digits:

    • We can only use the digits of the number ( 106506506503 ). The digits are: ( 1, 0, 6, 5, 0, 6, 5, 0, 6, 5, 3 ).
    • Thus, we have the digit frequencies:
      • Three ( 0 )'s
      • Three ( 6 )'s
      • Three ( 5 )'s
      • One ( 1 )
      • One ( 3 )
  2. Divisibility by 20:

    • For ( x ) to be divisible by 20, the number must end in "00", as divisibility by 20 implies the number is divisible by both 5 and 4. This imposes the following restrictions:
      • The last two digits must be "00".
      • Therefore, at least two ( 0 )'s must be used at the end of ( x ).
  3. Contains Substring "036":

    • The number ( x ) must also contain the string "036" somewhere in its digits. This introduces another restriction:
      • We must reserve the digits "036" somewhere within the number ( x ).
  4. Total Number of Digits:

    • The total length of ( x ) can be at most 12 digits because the number ( 106506506503 ) consists of 12 digits.
    • Since two digits are used for the "00" at the end and three digits are reserved for "036", we are left with ( 12 - 5 = 7 ) digits to fill with the remaining available digits.
  5. Combinatorial Setup:

    • We now calculate how many valid combinations of digits can be formed, given the constraints.
    • The process involves the following combinatorial choices:
      1. We first place the "036" somewhere in the number ( x ), excluding the last two positions (which are occupied by "00").
      2. Then, we fill in the remaining ( 7 ) positions using the available digits ( {1, 6, 5, 5, 6, 5, 6} ).
  6. Calculating the Number of Valid Combinations:

    • Using binomial coefficients, we calculate the number of ways to arrange the remaining digits.
  7. Subtraction of Invalid Cases:

    • The solution subtracts certain invalid cases where either the substring "036" does not appear, or the number is not divisible by 20.
    • The total valid cases ( A ) are computed and invalid cases ( B ) are subtracted from it, yielding the final result ( A - B ).

Conclusion

By following this process, we compute the number of valid integers ( x ) that meet the given conditions. The approach combines the constraints of divisibility by 20, the inclusion of the substring "036", and the combinatorics of arranging the digits of ( 106506506503 ).

Can someone help me now in applying this process?

zaxunobi
  • 217
  • I don't see this as a Stars and Bars problem. Perhaps I am overlooking something. Anyway, in general, the Inclusion-Exclusion approach is to be preferred over the direct approach, because the Inclusion-Exclusion approach is very straightforward, and less likely to result in an analytical error. Of course, the direct approach is do-able. You can ignore the upper bound, and the string can not start with either 100... or 103... ...see next comment – user2661923 Sep 27 '24 at 05:01
  • The string must end in either 00 or 60, and must contain 0360 somewhere. If the direct approach is used, then (absent any elegant approach that I am overlooking) the problem becomes a manual exercise in careful counting. – user2661923 Sep 27 '24 at 05:12
  • @user2661923 sorry, you're right, I edited the original post. No elegant approach as far as I know. Would you mind giving me an example on the exact steps of careful counting for the given exercise? – zaxunobi Sep 27 '24 at 06:49
  • 1
    @user2661923: I like your approach, but seen the rather bizarre choice of boundaries for this question, I would rather describe it as an exercise in programming than manual counting :-) – Dominique Sep 27 '24 at 08:01
  • 1
    For what it's worth, virtually every MathSE posted question that I have seen, that followed this article on MathSE protocol has been upvoted rather than downvoted. I am not necessarily advocating this protocol. Instead, I am merely stating a fact: if you scrupulously follow the linked article, skipping/omitting nothing, you virtually guarantee a positive response. – user2661923 Sep 27 '24 at 08:19
  • @Dominique sadly we are not allowed to solve this programmatically. – zaxunobi Sep 27 '24 at 13:54
  • @user2661923 I've updated my question, please check it out! – zaxunobi Oct 11 '24 at 16:49
  • It appears the question changes midstream in the OP. Wait, the number must not only be in the prescribed range and be divisible by $20$ and use $036$ as a substring, but [reading right below "solution outline/available digits"] we cannot use the digits $2,4,7,8,9$? Please clarify. [I had to vote "Needs details/clarity"] – Mike Oct 11 '24 at 16:55
  • @Mike How exactly does my question change? Yes, correct, we can't use those digits because they are not in the set of available digits. – zaxunobi Oct 11 '24 at 17:13
  • I apologize I reread the top paragraph – Mike Oct 11 '24 at 17:18
  • It seems to me that regardless of whether Inclusion-Exclusion or the direct approach is used, the solution will require very tedious examination of various cases. I don't see any elegant approach. – user2661923 Oct 11 '24 at 19:34
  • @user2661923 it's much faster though this way, it counts strings that satisfy the divisibility and subtract from them the violation of the lower bound. – zaxunobi Oct 12 '24 at 05:05

0 Answers0