Let $A$ be a list of $n$ numbers in range $[1,100]$ (numbers can repeat). I'm looking for the number of permutations of $A$ which start with a non-decreasing part, where this part ends with the first instance of the highest number, call this "index $i$" (1 based)from the left. After $i$, the remaining permutation is an arbitrary arrangement.
Examples
For $n=1$ and $A=\{9\}$, we have $1$ way only.
For $n=2$ and $A=\{2,5\}$, we have $2!$ ways in total.
- For $i=1$ we have $1$ way $(5,2)$ only.
- For $i=2$ we have $1$ way $(2,5)$ only.
If we were given , $A=\{5,5\}$, we have 2 ways totally:
- For $i=1$ we have one way, namely $(5,5)$, where the first $5$ coincides with first occurrence of $5$ in $A$, and
- For $i=2$ we have one way, namely $(5,5)$, where the second $5$ coincides with first occurrence of $5$ in $A$
For $n=3$ and $A=\{1, 4, 3\}$, we have $3!$ ways in total.
- For $i=1$, we have $2!$ permutations starting with $4$, namely $(4,3,1)$ and $(4,1,3)$.
- For $i=2$ , $2!$ ways $(1,4,3)$ and $(3,4,1)$ in which $4$ is at $2$nd place.
- For $i=3$ , $2!$ ways $(1,3,4)$ and $(3,1,4)$ ending with $4$.
To be exact : the number of permutations, without replacement, of given $n$ numbers such that the numbers up to $i$th place from left (say index) are in non-decreasing order, $i$-th place is occupied by first instance of largest number and rest can be random...
p.s. I cannot be more specific...