Given the expression $aJe^Tp1=pe1$, is there a matrix solution for $p$ ? There should be an infinite number of solutions, as I've already solved it without matrices for n=3. But I dont know if there is a more succinct way using matrices. The solution I have works when I evaluate the expression $aJe^Tp1=pe1$ numerically.
${a}$ is an nxn diagonal matrix where all $0 \lt a_{ii} \lt 1 $ and $\sum a_{ii} =1 $
$p$ is an nxn diagonal matrix where all $ p_{ii} \gt 0 $
$e$ is an nxn matrix where all $ e_{ij} \ge 0 $
$J$ is an nxn matrix of 1s
$1$ is a nx1 column vector of 1s
I don't know much algebra, but I know enough (I think) to know that I can't get rid of the $1$ vectors since they don't have an inverse, and multiplying by $1^T$ won't do much good because $J$ is not invertible either. So I am quite confused. And it is not that important, but I am curious about it.
Use uppercase/lowercase for matrix/vector variables to write the problem as $$\eqalign{ \def\o{{\tt1}} \def\diag{\operatorname{diag}} \def\Diag{\operatorname{Diag}} \def\c#1{\color{red}{#1}} &PEJ = AJE^TPJ \\ &P = \Diag(p),\quad A &= \Diag(a),\quad I &= \Diag(\o),\quad J=\o\o^T \\ &p = \diag(P),\quad a &= \diag(A),\quad \o &= \diag(I),\quad J=J^T \\ }$$ This identity involving the Hadamard product $(\odot)$ $$\eqalign{ \diag(R\cdot\Diag(p)\cdot Q) = (Q^T\odot R)\cdot p \\ }$$ allows the problem to be written as a standard matrix-vector equation $$\eqalign{ (JE^T\odot I)\,p &= (J\odot AJE^T)\,p \;=\; (AJE^T)\,p \\ (\c{AJE^T-JE^T\odot I})\,p &= \c{M}p \;=\; 0 \\ }$$ So the vector $p$ must lie in the nullspace of $M$, i.e. $$\eqalign{ p &= (I-M^+M)w \\ }$$ where $M^+$ is the pseudoinverse and $w$ is an arbitrary vector.
This solution is not unique, but the constraint $\sum_kp_k={\tt1}$ yields a unique solution.