Condition on the probabilities for the $J\times J$ matrix $[ \Pr(X=j \mid Y=k) ]$ to be invertible $\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.
 A: 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.
