Find the number of permutations of (1,2,3...n) possessing the following feature:
The number n is the only local maximum e.g. 123465, 123564, 654321,
as opposed to 651432, 261354.
(In reply to
Simpler solution by Jer)
One method uses the binary of whether any given number comes before or after the maximum; the other uses whether the next n gets added just before or just after the old maximum. Both seem equally simple to me.
|
Posted by Charlie
on 2015-10-02 09:57:08 |