0%

Problem 631


Problem 631


Constrained Permutations

Let (p1p2pk) denote the permutation of the set 1,,k that maps pii. Define the length of the permutation to be k; note that the empty permutation () has length zero.

Define an occurrence of a permutation p=(p1p2pk) in a permutation P=(P1P2Pn) to be a sequence 1t1<t2<<tkn such that pi<pj if and only if Pti<Ptj for all i,j1,,k.

For example, (1243) occurs twice in the permutation (314625): once as the 1st, 3rd, 4th and 6th elements (3 46 5), and once as the 2nd, 3rd, 4th and 6th elements ( 146 5).

Let f(n,m) be the number of permutations P of length at most n such that there is no occurrence of the permutation (1243) in P and there are at most m occurrences of the permutation (21) in P.

For example, f(2,0)=3, with the permutations (), (1), (1,2) but not (2,1).

You are also given that f(4,5)=32 and f(10,25)=294 400.

Find f(1018,40) modulo 1 000 000 007.


带约束的排列

(p1p2pk)表示将集合 1,,k 按照pii映射的排列。记这样的排列的长度为k;注意空排列()的长度视为0。

考虑排列P=(P1P2Pn)和较短的排列p=(p1p2pk),如果存在序列1t1<t2<<tkn ,使得对任意i,j1,,kpi<pj 当且仅当Pti<Ptj,则称pP出现了一次。

例如,排列(1243)在排列(314625)中出现了两次:第一次由第1、3、4、6个元素组成,即 (3 46 5);第二次由第2、3、4、6个元素组成,即( 146 5)

考虑所有长度不超过n的排列P,其中,没有排列(1243)出现,且排列(21)出现至多m次的排列总数记为f(n,m)

例如,f(2,0)=3,这三种排列分别是()(1)(1,2),而(2,1)不满足要求。

已知f(4,5)=32,以及f(10,25)=294 400

f(1018,40)并对1 000 000 007取余。


Gitalking ...