$\DeclareMathOperator\Pr{P}\newcommand\cPr[2]{\Pr(#1 \mid #2)}$I have a $J \times J$ matrix:  

$$
M:= \begin{bmatrix} 
\cPr{X=1}{Y=1} & \cPr{X=2}{Y = 1} & \cdots & \cPr{X=J}{Y = 1} \\
\cPr{X=1}{Y=2} & \ddots & & \vdots \\
\vdots & & \ddots & \vdots \\
\cPr{X=1}{Y=J} &\cdots & \cdots & \cPr{X=J}{Y=J}\end{bmatrix},
$$
where $X$ and $Y$ are two discrete variables taking values in $\{1, \dotsc, J\}$, and $\cPr{X=j}{Y=k}$ are the conditional probabilities that $X=j$ knowing $Y=k$.


I want to find a "simple" condition (if it exists) on these conditional probabilities $\cPr x y$ under which $\det(M) \neq 0$.


**When $J=2$**, it is in fact very simple, we have:  

$$\det(M) \neq 0 \iff \frac{\cPr{X=2}{Y=2}}{\cPr{X=1}{Y= 2}} \lessgtr \frac{\cPr{X=2}{Y=1}}{\cPr{X=1}{Y= 1}}.$$


Since the conditional probabilities sum to one for any $y$, we get that  

$$\det(M) \neq 0 \iff \frac{\cPr{X=2}{Y=2}}{1-\cPr{X=2}{Y= 2}} \lessgtr \frac{\cPr{X=2}{Y=1}}{1-\cPr{X=2}{Y= 1}}.$$


And since the function $f(x) = 1/(1-x)$ is strictly increasing on $[0,1]$ where our probabilities lie, we simply get that  

$$\det(M) \neq 0 \iff \cPr{X=2}{Y=2} \lessgtr \cPr{X=2}{Y=1}.$$


I'm trying to find a similar condition (but obviously more complex) under which it is true for the general case $J \times J$. I don't know if such a condition exists but I think it should exist, yet I've not been able to find it.



Condition on the probabilities for the $J\times J$ matrix $[ \Pr(X=j \mid Y=k) ]$ to be invertible
Indeed, the condition $\det M\ne0$ can be expressed as a certain non-independence condition, as follows.


For $i$ and $j$ in $[J]:=\{1,\dots,J\}$, let  

\begin{equation\*}
 p\_{i|j}:=P(X=i|Y=j),
\end{equation\*}
so that $M=[p\_{i|j}]\_{i,j\in[J]}$.


Suppose that $\det M=0$. Then for some real $c\_1,\dots,c\_J$ not all of which are $0$ and for all $i\in[J]$ we have
\begin{equation\*}
 \sum\_{j\in[J]}c\_j p\_{i|j}=0. \tag{1}
\end{equation\*}
Summing both sides of (1) in $i\in[J]$ and noting that $\sum\_{i\in[J]}p\_{i|j}=1$ for each $j\in[J]$, we get $\sum\_{j\in[J]}c\_j=0$ and hence
\begin{equation\*}
 \sum\_{j\in A}c\_j=-\sum\_{j\in A^c}c\_j=\frac12\sum\_{j\in[J]}|c\_j|>0, \tag{2}
\end{equation\*}
where
\begin{equation\*}
 A:=\{j\in[J]\colon c\_j>0\},\quad A^c:=[J]\setminus A. 
\end{equation\*}
For $j\in[J]$, let  

\begin{equation\*}
 p\_j:=
 \frac{|c\_j|}{\sum\_{k\in A}|c\_k|}. 
\end{equation\*}
Let then $Y$ be a random variable (r.v.) with values in $[J]$ such that for all $j\in[J]$
\begin{equation\*}
 P(Y=j)=p\_j;
\end{equation\*}
clearly, such a r.v. exists.
Then, in view of (2), we have $P(Y\in A)=P(Y\in A^c)=1/2$ and
(1) can be rewritten as $\sum\_{j\in A}p\_j p\_{i|j}=\sum\_{j\in A^c}p\_j p\_{i|j}$ and then as
\begin{equation\*}
 P(X=i,Y\in A)=P(X=i,Y\in A^c)[=\tfrac12\,P(X=i)],
\end{equation\*}
for each $i\in[J]$, which means that the r.v.'s $X$ and $1(Y\in A)$ are independent.


This reasoning is invertible, so that we get



> 
> **Proposition 1:** Let $M=[p\_{i|j}]\_{i,j\in[J]}$ be the transpose of any stochastic matrix. Then
> $\det M=0$ if and only if there exist a subset $A$ of $[J]$ and a r.v. $Y$ with values in $[J]$ such that $P(Y\in A)=1/2$ and the r.v.'s $X$ and $1(Y\in A)$ are independent, where $X$ is any r.v. with values in $[J]$ such that $P(X=i|Y=j)=p\_{i|j}$ for all $j\in[J]$ with $P(Y=j)\ne0$.
> 
> 
> 


In the particular case when $J=2$, Proposition 1 reduces to this: $\det M=0\iff p\_{1|1}=p\_{1|2}\iff p\_{2|1}=p\_{2|2}$, as desired.


