This problem is from Algorithms, problem 2
The Problem Given two sorted list of numbers $X$[1..$n$] and $Y$[1..n]. we need to come up with a O($\log n$) time algorithm to find the median of the 2$n$ lists.'
My question is regarding the case where median($X$) is less than the median($Y$).
Here is the proof that the authors(gave) that any element in $X$ less than median($X$) cannot be the median of the two lists.
- Let $A$ be an element in $X$ with $A \lt$ median($X$). Then there will be less than $\frac12n$ elements less than $A$ (in $X$)
- Since A $\lt$ median($X$) $\lt$ median($Y$) there are less than $\frac12n$ elements less than $A$ (in $Y$)
Because of 1 and 2, the median cannot be any element in $X$ that is less than median($X$)
I agree with every step in the proof and with that statement. However, here is the diagram of possibilities where the median of the two lists can be

Based off that proof, I understand why all the elements below the median of $X$ and in $X$ cannot be the median of the two lists. But what justification did author use to eliminate median($X$) as a possibility? It wasn't included in the shaded region.
If you look at the algorithm in the solution you linked you can see that median($X$) is not excluded if median($X$) = median($Y$).
If median($X$) $\lt$ median($Y$) and $A$ = median($X$) then you get
In total this still gives less than $n$ elements of value less than $A$ in $X \cup Y$. Thus, median($X$) cannot be the median of both lists unless median($X$) = median($Y$).