A bit of context: working on a problem about channel coding. Through a channel we are sending a random variable $X_n$, a code, and at the other side we see $Y$ (both discrete). Then we perform an estimation of ML to decide which $X_n$ was sent, but we can make a mistake and detect $X_{n'}$ instead.
Anyway, conditioning to $X$ and $Y$, the probability of an error is
$$ P \left( p(Y|X_{n'})>p(Y|X_n)|X_n,Y \right) $$
To this I want to apply Markov's inequality
$$ \frac{E(A)}{t} \geq P(A>t) $$
But I'm not sure on how should I treat the conditionals. Any help would be appreciated.
Is $p(Y|X_{n'})$ the conditional probability of $Y$ given $X_{n'}$? Then, $p(Y|X_{n'})$ is a non-negative random variable (more precisely, a non-negative measurable function with respect to the sigma-algebra generated by $X_{n'}$). So, if $p(Y|X_n)>0$, we have $$ P \left( p(Y|X_{n'})>p(Y|X_n)\bigg|X_n,Y \right){}\leq{}\dfrac{\mathbb{E}\left[p(Y|X_{n'})\bigg|X_n,Y\right]}{p(Y|X_n)}\,. $$