# Random matrix satisfying a given polynomial

This post is a wiki. Anyone with karma >750 is welcome to improve it.

If a polynomial f(x) of order n is given, can we find a random square matrix A of order m so that f(A)=0?

I tried to construct it by finding the roots of f(x) and then creating random matrix with those roots as eigenvalues. But the problem occurs when n is not equal to m. I'm unable to set the eigenvalue, dimensions suitably.

edit retag close merge delete

Let us just consider a simple example, $f(x)=x^2+1$. It is relatively simple to construct matrices of any order over $\mathbb C$ having a diagonal normal form with only $+\pm 1$ on the diagonal. But if we insist to have a $1\times 1$ or a $3\times 3$ matrix with real entries and a minimal polynom dividing $x^2+1$\dots well, there are Galois theory obstructions. For instance, for a $3\times 3$ real matrix $A$, we build its characteristic polynomial, $f_A$, say, get $f_A(A)=0$. Suppose we also have $f(A)=AA+1=0$, $f(x)=x^2+1$ as above. Then division with rest of $f_A\in \mathbb R[x]$ by $f$ cannot give a rest of degree one, or of degree zero (constant), because such a polynomial cannot have a root $\pm i$. If the rest is $0$, then the third ...(more)

( 2017-11-22 04:53:47 -0500 )edit

When you write "random", do you mean that you want to be able to sample various matrices w.r.t some distribution or do you just want to find one particular solution ?

( 2017-11-22 05:34:36 -0500 )edit

I want a particular solution. Suppose I want to get an example of a $5 \times 5$ matrix $A$ with real entries that satisfies $A^4+3A-2A+I=0$

( 2017-11-22 11:06:58 -0500 )edit

Whichi is exactly the given polynomial of degree four?

• $f=x^4+3x^3-2x+1$ or
• $f=x^4+3x^2-2x+1$ or
• $f=x^4+3x-2x+1$ ?
( 2017-11-22 11:30:52 -0500 )edit

Sorry, I typed it wrong, I meant of the first polynomial you have written. But its immaterial, I just need an example how to construct such an example. you can consider any of the above polynomial(or any other suitable polynomial) to illustrate.

( 2017-11-22 12:28:36 -0500 )edit