Problem Given a $m*n$ matrix, $m\le n$ calculate how many configurations satisfies the following three constraints.
- Each cell is either 0 or 1.
- For each column, there is exactly one cell be 1.
- For the $i$~th row, there should be no more than $f(i)$ 1s. $f(i)$ is a function.
This seems like an exercise, I do not know whether there is a name on it. Any reference is appreciated.
I want to derive a formula for it. It seems like a dynamic programming is available.
Example. $n=m=3$, $f(1)=1, f(2)=0, f(3)=3$. Then the answer is 3.
This problem was asked at TCS@SE first, and was suggested to migrate to Math@SE.