A count involving number of subspaces Let $V$ be an $n$ dimensional vector space over a finite field with $q$ elements and $W$ be a fixed $k$ dimensional subspaces of $V$. How to find the number of distinct subspaces $X$ of $V$ such that $W+X=V$? (Here + may or may not be the direct sum)
I tried like this: $X$ are precisely those subspaces in which $dim(X)=n-k+r$ and $dim(W \cap X)=r$ where $0 \leq r \leq k-1$. For a fixed $r \in [0,k-1]$, the number of subspaces $X$ is $$N_r=\dfrac{(q^k-1)(q^k-q)\cdots(q^k-q^{r-1})(q^n-q^k)(q^n-q^{k+1})\cdots(q^n-q^{n-1})}{(q^r-1)(q^r-q)\cdots(q^r-q^{r-1})(q^{n-k}-1)(q^{n-k}-q)\cdots(q^{n-k}-q^{n-k-1})}$$ and thus the required count will be $$\sum_{r=0}^{k-1} N_r.$$
However when I am checking with specific examples I am getting different counts. Please help.
 A: I got $\frac{q^{(n-k)}(q^{k+1}-1)}{q-1}$ for the total number of $X$ where I also included $X = V$. So if you want to count only the proper subspaces $X$ of $V$ you have to substract 1 from the above number.
My strategy is the following. First of all w.l.o.g. we can assume that $W$ is the spanned by $e_1,e_2,\cdots,e_k$, where $e_1,\cdots,e_k,\cdots,e_n$ is a basis of $V$, which I am going to call the canonical basis of $V$. I am going to compute the number $N_r$ that you defined in your OP. To compute $N_r$ I consider the action of the linear group $GL(V)$ acting on subspaces. Let $GL(V)_W$ be the subgroup of $GL(V)$ that stabilize $W$. Namely, $g \in GL(V)_W$ iff $g(W) = W$.
Here is the important claim:
Let $X,Y$ two subspaces of the same dimension such that $X + W = Y + W = V$ and $\dim(X \cap W) = \dim(Y \cap W)$ then there is $g \in GL(V)_W$ such that $$g(X) = Y$$ 
I leave to you the proof of the claim.
Then  $N_r = \frac{\# GL(V)_W}{\# E_r}$ where $E_r \subset GL(V)_W$ is the subgroup which stabilizes a concrete $X_r$ e.g. $X_r$ spanned by $e_1,\cdots,e_r,e_{k+1},\cdots,e_n$. Now $g \in GL(V)_W$ iff its block matrix w.r.t. the canonical basis is $$g =   \left( \begin{array}{cc}
A & C  \\
0 & B  \\ \end{array} \right) $$
where $A \in GL(\mathbb{F}_q^k), B \in GL(\mathbb{F}_q^{n-k})$ and $C \in \mathbb{F}^{k,n-k}$. If $g$ belongs to $E_r$ then the matrix $C$ must have the block form $$C = \left( \begin{array}{c}
E \\
0  \end{array} \right) $$ 
where $E \in \mathbb{F}^{r,n-k} $.
Then $N_r = \frac{\# GL(V)_W}{\# E_r} = \frac{\#GL(\mathbb{F}_q^k) . GL(\mathbb{F}_q^{n-k}). \# \mathbb{F}^{k,n-k}}{\#GL(\mathbb{F}_q^k) . GL(\mathbb{F}_q^{n-k}). \# \mathbb{F}^{r,n-k}} = q^{(n-k)(k-r)}$.
By summing these $N_r$ you get the total number I wrote above.
