Closed-Form Solution for Permutation Table For given $N,n\in\mathbb N$ I am looking for a formula that generates all $N\choose{n}$ combinations in the following way:
E.g. take  $N=3,n=1$. Then there are ${3\choose1}=3$ combinations such that
1| - + +
2| + - +
3| + + -

or $N=4,n=0$. Then there are ${4\choose0}=1$ combinations such that
1| + + + +

or $N=4,n=1$. Then there are ${4\choose1}=4$ combinations such that
1| - + + +
2| + - + +
3| + + - +
4| + + + -

or $N=4,n=2$. Then there are ${4\choose2}=6$ combinations such that
1| - - + +
2| - + - +
3| - + + -
4| + - - +
5| + - + -
6| + + - -

So $n$ determines the number of - in each combination (each having $N$ elements). The final order of the combinations does not matter (i.e. whether - - + + or + - + - comes first is irrelevant). 
But is there a formula for $f_{i,k,n,N}$ (either taking value $-1$ or $+1$) such that we get the set of combinations:
$$\left\{(f_{i,k,n,N}\ \text{with}\ i=1,2,\ldots N)\in\mathbb \{-1,1\}^N \mathrel{\bigg|} k=1,2,\ldots, {N\choose n}\right\}$$
Perhaps something like $f_{i,k,n,N}=(-1)^{i+k+\ldots}$ ?
 A: Let $f_{i, k, n, N} = (-1)^{g(i, k, n, N)}$ for $g(i, k, n, N) \in \{\,0, 1\,\}$. Then we can take
$$g(1, k, n, N) = \left[k > \binom{N - 1}{n}\right],\\
g(2, k, n, N) = \left[k - g(1, k, n, N)\binom{N - 1}{n} > \binom{N - 2}{n - g(1, k, n, N)}\right]$$
and so on:
$$g(i, k, n, N) = \left[k - \sum_{j = 1}^{i - 1}g(j, k, n, N)\binom{N - j}{n - \sum_{\ell = 1}^{j - 1}g(\ell, k, n, N)} > \binom{N - i}{n - \sum_{\ell = 1}^{i - 1}g(\ell, k, n, N)}\right].$$
This formula is recursive, but this recurrence is inside the $k$th combination.
The other way to write the same is the following:
$$g(1, k, n, N) = \left[k > \binom{N - 1}{n}\right],\\
g(i, k, n, N) = g\left(i - 1, k - g(1, k, n, N)\binom{N - 1}{n}, n - g(1, k, n, N), N - 1\right) \text{ for } 2 \le i \le n.$$
The sense of this relation is pretty straightforward: we don't take the first element in the first $\binom{N - 1}{n}$ combinations and take it in all others.
Then we continue to build the remaining part of combination.
P. S. $[P]$ is $1$ if $P$ is true and $0$ otherwise. This is rather widespread Iverson notation.
