Building an equation (inverse combinatorics?), then identifying the optimal pattern

26 Views Asked by At

I have identified an equation, but now I am wanting to know if there is a means of identifying the most efficient pattern to provide the numbers that meet the requirements. Here is the problem:

A number N with the number of digits being D contains another smaller number X with a fewer number of digits d. - For example, the number 12 contains a 2. 2 is one digit and 12 is two digits.

The order of the numbers must go from left to right and be consecutive. - For example digits 321 would contain the smaller number 21, but not the smaller number 12.

The smaller number x is a random number containing d digits. You will select several larger numbers N with a fixed number of digits D. The goal is to select as few numbers as possible. If the larger number was 10 digits, and the smaller number was 2 digits, how many numbers would you need to ensure that all 2 digit combinations were achieved?

This equation is:

$10^d$ = the possible domain of X.

$D-d+1$ = Number of times X could appear in N

$\dfrac {10^d} {d-d+1}$ = how many N's are needed to guarantee that X is contained within N.

What pattern will be needed to ensure the fewest number of N's are used? Will there be a constraint that requires using more than the minimum number of N's?

For a 2 digit number, there are 10^2 combinations (100 possibilities ->$ X ^ d$)

The number of times the answer might appear in any number is: $D - d + 1$, or 9 times.

The function: $f(N) = \dfrac{10^d}{D - d + 1}$

All answers in the function are rounded to the ceiling. For 10 digit (D) numbers (N), you would need 12 of them to guarantee that you have the 2 digit (d) number (X).

What pattern would solve the problem for any number of digits D in N and any number of digits d in X? This means producing the 12 numbers that satisfy the specific question, and then being able to solve for any other numbers.