how do I parametrise a stochastic matrix I have a matrix $\mathbf{t}$ that maps one $d$ dimensional probability distribution to another $\mathbf{t}^T x = q$, i.e. with $\sum\limits_i t_{ij} x_i = q_j$ and $\sum\limits_j t_{ij} = 1$ $\forall$ $i$. Given that I know $x$ and $q$, how manay parameters do I need to specify $\mathbf{t}$? For example, take the case where $d=2$, using $\sum\limits_i t_{ij} x_i = q_j$ and $\sum\limits_j t_{ij} = 1$ $\forall$ $i$ I can parametrise $\mathbf{t}$ in terms of any one of its elements. $x=(x_1,x_2)$ and $q=(q_1,q_2)$, choosing the element $t_{22}$ I get 
\begin{align}
t_{11} &= \frac{q_1 - (t_{21} x_2)}{x_1}=\frac{q_1 - x_2 (1-t_{22})}{x_1} \\
t_{12} &= 1-t_{11} = 1-\frac{q_1 - x_2 (1-t_{22})}{x_1} \\
t_{21} &= 1-t_{22} \\
t_{22} &= t_{22}
\end{align}
so I only need to specify a single element in the $d=2$ case to parametrise the matrix $\mathbf{t}$. How do I extend this to the case $d=3$? and higher dimensions? And what is the specific parametrisation in terms of the remaining degrees of freedom, as in the above case but for $d=3,4,\cdot\cdot\cdot$
 A: Beware! In your explanation of why your $2 \times 2$ matrix can be parameterized by $t_{22}$, you divide through by $x_1$, which is to say that you assume that $x_1 \neq 0$. 
Instead, you can explicitly write out your conditions on the elements of $\mathbf{t}$ in a matrix equation:
$$
\left[
\begin{matrix}
x_1 & x_2 & 0 & 0 \\
0 & 0 & x_1 & x_2 \\
1 & 0 & 1 & 0 \\
0 & 1 & 0 & 1
\end{matrix}
\right]
\left[
\begin{matrix}
t_{11} \\ t_{21} \\ t_{12} \\ t_{22}
\end{matrix}
\right]
=
\left[
\begin{matrix}
q_1 \\ q_2 \\ 1 \\ 1
\end{matrix}
\right]
$$
Generally, we can write
$$
\left[
\begin{matrix}
x^T & & 0 \\
& \ddots &  \\
0 & & x^T \\
I & \cdots & I
\end{matrix}
\right]
\left[
\begin{matrix}
\mathbf{t}_1 \\
\vdots \\
\mathbf{t}_n
\end{matrix}
\right]
=
\left[
\begin{matrix}
q_1 \\ \vdots \\ q_n \\
1 \\ \vdots \\ 1
\end{matrix}
\right]
$$
More compactly, we can write
$$
\left[
\begin{matrix}
I \otimes x^T \\ 1^T \otimes I
\end{matrix}
\right]
\text{vec}(\mathbf{t})
=
\left[
\begin{matrix}
q \\ 1
\end{matrix}
\right]
$$
Where $I \in \mathbb{R}^{d \times d}$ is the identity, $1 \in \mathbb{R}^d$ is a vector of all $1$s, and $\otimes$ is the Kronecker product. We're essentially asking for the rank of
$$
A:=
\left[
\begin{matrix}
I \otimes x^T \\ 1^T \otimes I
\end{matrix}
\right]
$$
Then the number of free parameters necessary for specifying $\mathbf{t}$ is $d^2 - \text{rank}(A)$.
It's easier to compute $\text{rank}(A)$ by looking at $A^T$, i.e., looking at $A$'s row rank. $A^T$ looks like
$$
\left[
\begin{matrix}
x & & 0 & I \\
& \ddots & \vdots \\
0 & & x & I
\end{matrix}
\right]
$$
$A^T$ is not full column rank: $A^T [\begin{matrix} 1 & -x \end{matrix}]^T = 0$. You can prove $\text{rank}(A) \geq 2d -1$ by moving the stack of identities to just after the first column:
$$
\left[
\begin{matrix}
x_1 & I & 0 & \cdots & 0 \\
0 & I & x_2 & & 0\\
\vdots & \vdots & & \ddots & \\
0 & I & 0 & & x_n 
\end{matrix}
\right]
$$
Now the last $2d - 1$ columns form a lower triangular matrix and so are linearly independent (more rigorously, they form a matrix whose rows can be permuted such that the matrix is lower triangular and with all non-zeros on the diagonal).
So $\text{rank}(A^T) = \text{rank}(A) = 2d-1$ and $\mathbf{t}$ is specified by $d^2 - 2d + 1 = (d-1)^2$ free parameters.
I wonder if there's a simpler way to prove this? The $(d-1)^2$ free parameters suggests that $\mathbf{t}$ can be defined by its top $d-1 \times d-1$ minor? I wonder if there's any relation to affine algebra, where matrices are usually constrained in that way...
A: In general, if $T$ is a $n\times n$ stochastic matrix we can parametrize each row with $n-1$  elements and hence $T$ has $n(n-1)$ parameters. 
