How many ways to permute rows of a matrix without any all-zero columns, and why is the answer a hypergeometric function? I'm looking for an intuitive explanation for the answer I found to this question I came up with:
I have a matrix B with $m$ rows and $k$ columns, with entries taken from the set ${0,1, \ldots, n}$ (but these could be any set of $n+1 $ symbols instead of numbers). Numbers may be repeated. 
I can permute any of the rows, i.e. swap any entry with any entry on the same row, but not with an entry on another row. The only restriction is that I may not have any column containing only zeroes.
Here's some notation.
Let $z_r$ count the number of zeroes on the $r$'th row.
Further, for $c=1, \ldots n$ let $T_{rc}$ count the number of $c$'s in the $r$'th row.
Without the restriction, it's easy to see that the number of permutations is
$$P = \frac{k!^m}{\prod_{r=1}^m \prod_{c=0}^n T_{rc}!}.$$
Apparently the final answer is to multiply this number by the following hypergeometric function:
$$_mF_{m-1} [-z_1 -z_2 \ldots -z_m; -k -k \ldots -k](1).$$
I found this through a fairly brute force approach and some simplifying with Mathematica, but I don't really understand why it should be true. It can also be expressed as a finite sum of falling factorials.
Is there some combinatorical property of hypergeometric functions that explains this? Or is there a simpler way to express the answer? Or maybe my problem is a special case of a more general problem?
 A: There was a very similar question a little while ago. I came across a more general solution when working on sequence shuffling.
A more general version of your problem may arise as an iterated hypergeometric distribution: let $X_0=n_0$ and then $X_r\sim\text{Hypergeom}(X_{r-1},n_r,N_r)$.
Basically, your problem is that in each of the $m$ rows, $z_r$ out of the $k$ columns are picked at random: ie the zeroes. Let $X$ be the number of columns picked in all rows.
Let's compute the expected number of ways to pick $q$ out of the $X$ columns: ie $q$ all-zero columns.
First, there are $\binom{k}{q}$ ways to pick $q$ columns. Now, let's assume we look at one selection of $q$ columns. In row $r$, the chance of including all $q$ amongst the $z_r$ picked is $\binom{k-q}{z_r-q}/\binom{k}{z_r}$. Thus, the expected number of ways to pick $q$ out of the $X$ columns is
$$
\text{E}\left[\binom{X}{q}\right]
= \binom{k}{q}\cdot\prod_{r=1}^m \frac{\binom{k-q}{z_r-q}}{\binom{k}{z_r}}
= \binom{k}{q}\cdot\prod_{r=1}^m \frac{\binom{z_r}{q}}{\binom{k}{q}}.
$$
Now, let's express the $\text{E}[\binom{X}{q}$ a different using the probability generating function
$$
P_X(t) = \text{E}\left[t^X\right] = \sum_{i=0}^k \Pr[X=i]\, t^i.
$$
This makes
$$
P_X(1+u) = \text{E}\left[(1+u)^X\right]
= \sum_{q=0}^k \text{E}\left[\binom{X}{q}\right]\, u^q
= \sum_{q=0}^k
    \frac{\prod_{r=1}^m z_r!/(z_r-q)!}{[k!/(k-q)!]^{m-1}}
    \cdot\frac{u^q}{q!}\\
={}_mF_{m-1}(-z_1,\ldots,-z_m;-k,\ldots,-k;-u).
$$
Now, you can retrieve all of $P_X(t)$ by setting $u=t-1$ and doing a power expansion. In particular, the likelihood that no columns remain, $X=0$, is found by setting $t=0$, or $u=-1$, which gives your result.
