トラッキングエラーと新しい動的計画アルゴリズム

最近人口知能を使用する発生証券の値を計算する方式に関わる論文を読んでいます。 システムの性能を計るために「トラッキングエラー」の測定を使っています。 トラッキングエラーは連続の関数と離散の関数の出力の差を表します。Basically, in the area of delta hedging, a continuous hedge is assumed to result in a net stock, bond, and option position of 0. However, since hedging can be done only at discrete intervals (e.g. daily), some error results. 
昨日トップコーダーの問題に挑戦しましたがまだ悩んでいます。問題にはプレーリストの数を数えなければいけません。Given N, P, and m, where N is the number of songs, P is the size of the playlist (songs may be duplicated), and m is the number of songs which can be skipped, the objective is to count the number of distinct playlists mod 1000000007. m=0の場合動的計画法を実施します。However, for m>0, I have yet to devise a solution. For m=0, the code iterates over all possible values x of num occurrences of the song occurring most often and for N>2, DP(N,P,0) = SUM(x)(DP(N-1,P-X,0).