Elven mystical numbers

Before the problem itself, it would be a good idea to explain what an "Elven mystical number" is ( EMN in the further text). Each EMN has the following properties:

  • (1) Number of digits is odd

  • (2) The middle digit is the peak and it is the greatest digit in number, also it appears only once

  • (3) Going from the peak to one of the ends, numbers decrease or stay the same

  • (4) These numbers are also palindromes

Now, when the EMN is not so mystical, the question is, how many 11-digit EMN s exist?

Details and assumptions:

  • Middle digit is at the same "distance" from left and right end, so in 5-digit number, middle digit is the 3 r d 3^{rd} one.

  • Example of EMN s: 12321, 7778777, 111575111, ...

  • Example of non- EMN s: 11111 (rule (2)), 123321 (rule (1) and (2)), 1325231 (rule (3)), 1237521 (rule (4))

  • If we have 11-digit number, whose first digit is null, then we actually don't have an 11-digit number.


If there is any question related to "Elven Mystical Number", it can be asked here .


The answer is 1716.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Jesse Nieminen
Jul 9, 2016

Generalization

Let's find a general formula for the number of n n -digit EMN s, where n n is an odd positive integer.

The properties of EMN imply that the set of all n n -digit EMN s forms a bijection with the set of all n + 1 2 \dfrac{n+1}{2} -digit integers
whose digits are in non-decreasing order and the last digit is the largest digit. Thus, it is sufficient to find the number of latter ones.

Again, a new bijection can be formed because such n + 1 2 \dfrac{n+1}{2} -digit integers can be represented as sequences of n + 1 2 \dfrac{n+1}{2} # s and 9 + s, where # s are the numbers and number of + before a particular # is the digit which is in that place. For instance 125 125 is the same as +#+#+++#++++ .

The problem is now the same as finding the number of ways to arrange 9 + s and n + 1 2 \dfrac{n+1}{2} # s, where 2 2 of the + s are fixed (only 1 1 is fixed if n = 1 n = 1 ) to ensure that the first digit is at least 1 1 and that the last digit is larger than any other digit.

Now we have to find the number of arrangements of 7 + s and n + 1 2 \dfrac{n+1}{2} # s
which can easily be calculated to be ( n + 15 2 7 ) \displaystyle{{\dfrac{n+15}{2}} \choose {7}} , when n > 1 n > 1 using Stars and Bars .

If n = 1 n = 1 , the number of EMN s is 1 1 more than that.

Answer

Plugging n = 11 n = 11 to the general formula gives the answer of ( 13 7 ) = 1716 \displaystyle{{13} \choose 7} = \boxed{1716} .

Fun fact (very likely it is not fun at all): I did not know that this could be generalized. I did not even try to generalize it.

Anyhow, I really like the idea. I am impressed, honestly. I have upvoted it.

Milan Milanic - 4 years, 11 months ago
Milan Milanic
Jul 7, 2016

Relevant wiki: Combinations - Problem Solving

Solution:

One way is to calculate for each middle digit (peak), so if 9 9 is the middle digit, how many combinations for other digits are there and so on....

Second way: On how many ways can 6 digits be chosen? The order in which numbers are selected is irrelevant, because after selection, they will be sorted (so the rule (3) is fulfilled). So 6 digits can be chosen on 14 C 6 14C6 ways, 14 C 6 = 14 ! 6 ! × 8 ! 14C6 = \frac{14!}{6! \times 8!} [1]. To satisfy rule (2), it is needed to subtract all the combinations in which the greatest number is chosen more than once.

If 5 digits are chosen, after which the greatest one of them is added once, the result is 6 digits where the greatest one definitely appears more than once. The number of these unsatisfying combination is 13 C 5 = 13 ! 5 ! × 8 ! 13C5 = \frac{13!}{5! \times 8!} [2]

When [1] is subtracted by [2], the number of satisfying combinations is 1716 \boxed{1716}

I did by the first way. Second one's nice! Nice prob.

Keshav Tiwari - 4 years, 11 months ago

I don't understand. Why 14C6? Would you mind explaining? :)

Aiden Khoo - 4 years, 11 months ago

Log in to reply

I used here one juicy method, I cannot recall where did I learn it or what is its name and brilliant wiki will probably provide better explanation than I, but I will give my best to explain it:

We need to choose 6 6 numbers and the order of choosing is irrelevant (1 1 1 1 1 2 will be the same as 1 1 1 2 1 1). So the best way to avoid mistakes, is to sort them from the start. We can choose among 9 9 numbers, so we will use something I like to call "borders" and we will need 8 borders to separate those 9 (if we choose among 3 numbers, we need 2 borders). So the problem is turned into a new problem: how can you place 8 borders and 6 blank spaces. That is done on 14C6 (or 14C8) different ways. After the placement of borders, we "write" the appropriate numbers in blank spaces between the borders.

Example: border is |, blank space will be _ (space char is inconvinient I think)

This combination: | _ _ | _ | _ | | | _ | | _ represents selection of numbers: 223479.

I hope this try of explanation will be somewhat useful to you :)

I think the appropriate wiki is this , which I found after all this explaining. So you can check it out too.

Milan Milanic - 4 years, 11 months ago

Log in to reply

Ahh i see. Thanks a lot for your explanation and the wiki!

Aiden Khoo - 4 years, 11 months ago

regarding the first way, can you tell me the generalization for number of combinations in terms of the value of the middle digit? thanks!!!

Willia Chang - 4 years, 11 months ago

Log in to reply

I am not sure what is asked to be honest. But I will do what I understood. If I misunderstood (which is very likely), feel free to point it out.

If we choose number 9 9 for middle digit, other 5 numbers can be choosen among 8 numbers (from 1 to 8), which will require 7 "borders". That is 12C5. If middle one is 8, that is 11C5 So for 11-digit number solution will be i = 2 9 ( i + 5 5 ) \sum _{ i=2 }^{ 9 }{ \left( \begin{matrix} i+5 \\ 5 \end{matrix} \right) } .

Now, for 11-digit number, that number down is 5, but even that can be generalized.

So for n n -digit number, where n n is odd, solution is i = 2 9 ( i + n 1 2 n 1 2 ) \sum _{ i=2 }^{ 9 }{ \left( \begin{matrix} i+\frac { n-1 }{ 2 } \\ \frac { n-1 }{ 2 } \end{matrix} \right) }

i i represents the middle digit in the sums above. Also, if we have one-digit number, then the solution is 9, because only then middle digit can be number 1.

Milan Milanic - 4 years, 11 months ago

Log in to reply

ah...ic thanks!!!

Willia Chang - 4 years, 11 months ago
Keshav Tiwari
Jul 12, 2016

The integral equation approach.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...