Let matrix $A$ be some $n \times n$ stochastic matrix: the sum of the entries in each column sum up to $1$. It is easy to see that if $\mathbf{x}$ is some stochastic vector then $\mathbf{q} = A \mathbf{x}$ is itself a stochastic vector.
My question is as follows, suppose we are given $\mathbf{q}$ and $A$. Are there sufficient conditions on $A$ that guarantee $\mathbf{x}$ is a stochastic vector (where naturally $\mathbf{x} = A^{-1}\mathbf{q}$ when $A$ is invertible)?
Obviously if $A$ is the identity matrix, then my statement holds, but what more can be said?
Edit: As noted below by Igor Rivin, this holds if $\mathbf{q}$ is a multiple of the Perron-Frobenius eigenvector of $A$. I then ask, what if it is not a multiple of the dominant eigenvector? (Since it is easy to see that this condition is not necessary).
Your $q$ must be a multiple of the Perron-Frobenius eigenvector of $A.$