# Computing unkown entries of a matrix given a desired eigenvalue

Let $$M$$ be an irreducible non-negative square matrix with spectral radius $$\lambda$$. Due to the Perron-Frobenius theorem, we know that $$\lambda > 0$$ and $$\lambda$$ is an eigenvalue of $$M$$. Also, all other eigenvalues of $$M$$ are strictly smaller than $$\lambda$$.

Now consider such a matrix with an unknown entry, e.g. $$M = \begin{pmatrix} 0 & 0 & 40 & 60 & 80\\ p & 0 & 0 & 0 & 0\\ 0 & 0.35 & 0 & 0 & 0\\ 0 & 0 & 0.16 & 0 & 0\\ 0 & 0 & 0 & 0.08 & 0 \end{pmatrix}.$$ Question: How can I determine $$p$$ such that $$\lambda = 1$$ (in general)? I'm not sure how simple finding an exact solution is, I would already be happy with a numerical solution. I thought about guessing some values for $$p$$ such that $$\lambda \approx 1$$ and using interpolation, but am not sure which interpolation would be appropriate, since I don't know how $$p$$ and $$\lambda$$ should relate to each other.

Motivation: Leslie matrices are often used to study changes of a population. The entries must be estimated and the case $$\lambda = 1$$ is the equilibrium state of the population.

It's easy to determine all values of $$p$$ for which $$M$$ has any fixed eigenvalue $$\lambda$$: simply compute the determinant of $$M-\lambda I$$, which is a linear function of $$p$$, and find the value of $$p$$ that makes this determinant equal to $$0$$. In particular, the unique value of $$p$$ for which $$1$$ is an eigenvalue of $$M$$ is $$p=625/11074 \approx 0.0564385$$, and one can then check by computer that $$1$$ is indeed the eigenvalue of largest modulus.