Fun with quantum mechanics
Given an operator $\hat{Q}$ such that
\[\begin{align} \hat{Q} = \sum_{k=1}^{d} q_k|q_l\rangle\langle q_k| \end{align}\]
where $q_1 < q_2 < \dots < q_{d-1} < q_d$. What’s the minimum distance between $\rho$ and $|q_d\rangle\langle q_d|$, given that
\[\begin{align} \langle \hat{Q} \rangle = q_d - \epsilon > q_{d-1}. \end{align}\]
The distance between $\rho$ and $|q_k\rangle\langle q_k|$ is characterized by
\[\begin{align} F = \langle q_k | \rho | q_k \rangle \end{align}\]
Let us now suppose $\rho$ represents a pure state, $\rho = |\phi\rangle\langle\phi|$; in such case,
\[\begin{align} F &= \langle q_d | \phi \rangle \langle \phi | q_d \rangle\newline &= \langle \phi | q_d \rangle \langle q_d | \phi \rangle\newline &= \dfrac{1}{q_d}\left(\langle \phi |\left(\hat{Q} - \sum_{k=1}^{d-1} q_k |q_k\rangle\langle q_k | \right)|\phi\rangle\right)\newline &= \dfrac{1}{q_d}\left(\langle \hat{Q} \rangle_\phi - \sum_{k=1}^{d-1} q_k \langle\phi|q_k \rangle\langle q_d | \phi \rangle \right)\newline &= \dfrac{1}{q_d}\left(q_d - \epsilon - \sum_{k=1}^{d-1} q_k |\langle\phi|q_k \rangle|^2\right)\newline &= 1 - \dfrac{\epsilon}{q_d} - \sum_{k=1}^{d-1} \dfrac{q_k}{q_d} |\langle\phi|q_k \rangle|^2 \newline &\equiv 1 - \dfrac{\epsilon}{q_d} - A \end{align}\]
Now we investigate $A$. The upper bound is
\[\begin{align} \max A &\leq \max \sum_{k=1}^{d-1}\dfrac{q_{d-1}}{q_d} |\langle \phi | q_k\rangle|^2\newline &= \dfrac{q_{d-1}}{q_d}\max \sum_{k=1}^{d-1} |\langle \phi | q_k\rangle|^2 \end{align}\]
Notice that we always have $|\phi\rangle = \sum_{k=1}^d c_k |q_k\rangle$, the maximum of $\sum_{k=1}^{d-1}|\langle\phi|q_k\rangle|^2=1$ is reached once $|\phi\rangle \equiv |q_i\rangle, \forall i = 1, 2,\dots,d-1$. Hence
\[\begin{align} \max A \leq \dfrac{q_{d-1}}{q_d} \end{align}\]
What about the lower bound?
\[\begin{align} \max A \geq \sum_{k=1}^{d-1} \dfrac{q_k}{q_d}|\langle\tilde{\phi}|q_k\rangle|^2 \end{align}\]
where $\tilde{\phi}$ is an arbitrary state that we can construct. The best solution is to construct $\phi$ such that $\phi=q_{d-1}$
\[\begin{align} \max A &\geq \sum_{k=1}^{d-1} \dfrac{q_k}{q_d}|\langle{q_{d-1}}|q_k\rangle|^2\newline &= \dfrac{q_{d-1}}{q_d} \end{align}\]
Hence $\max A = {q_{d-1}}/{q_d}$ (pure state $\rho$). Now we consider a more general case. Let us say we have an arbitrary mixed state $\rho=\sum_{j=1}^{N}p_j|\phi_j\rangle\langle\phi_j|$
The fidelity in this case follows straightforwardly,
\[\begin{align} F &= \langle q_k |\left(\sum_{j=1}^N p_j |\phi_j\rangle\langle\phi_j|\right)|q_k\rangle\newline &= \sum_{j=1}^N p_j \langle\phi_j|q_k\rangle\langle q_k |\phi_j\rangle\newline &= \dfrac{1}{q_d}\sum_{j=1}^N p_j \langle\phi_j|\left(\hat{Q}-\sum_{k=1}^{d-1}q_k|q_k\rangle\langle q_k|\right)|\phi_j\rangle\newline &= \dfrac{1}{q_d}\sum_{j=1}^N p_j \langle\phi_j|\hat{Q}|\phi_j\rangle -\sum_{j=1}^{N}\sum_{k=1}^{d-1}\dfrac{p_j q_k}{q_d}\langle\phi_j|q_k\rangle\langle q_k|\phi_j\rangle\newline &= 1 - \dfrac{\epsilon}{q_d} - A \end{align}\]
Let us now consider the lower bound and upper bound of $A$. First, the upper bound
\[\begin{align} \max A &\leq \max \sum_{j=1}^N\sum_{k=1}^{d-1} p_j\dfrac{q_{d-1}}{q_d} |\langle\phi_j|q_k\rangle|^2\newline &= \dfrac{q_{d-1}}{q_d}\max \sum_{j=1}^N p_j \sum_{k=1}^{d-1} |\langle\phi_j|q_k\rangle|^2\newline &= \dfrac{q_{d-1}}{q_d} \end{align}\]
Similar trick for the lower bound,
\[\begin{align} \max A \geq \sum_{j=1}^N\sum_{k=1}^{d-1} p_j \dfrac{q_k}{q_d} |\langle\tilde{\phi}_j|q_k\rangle|^2 \end{align}\]
where $\tilde{\phi}_j$ is an arbitrary state we can construct. The question is, can we construct a state that pushes
\[\sum_{j=1}^N\sum_{k=1}^{d-1} p_j \dfrac{q_k}{q_d} |\langle\tilde{\phi}_j|q_k\rangle|^2\]
up as high as possible? Yes, let $\tilde{\phi}_1=q_{d-1}$ and at the same time $p_1=1\ (p_2=p_3=\dots=p_N=0)$, so that
\[ \begin{align} \max A &\geq \sum_{j=1}^N\sum_{k=1}^{d-1} p_j \dfrac{q_k}{q_d} |\langle\tilde{\phi}_j|q_k\rangle|^2\newline &= \dfrac{q_{d-1}}{q_d} \end{align} \]
Hence $\max A = {q_{d-1}}/{q_d}$ (an arbitrary mixed state $\rho$).
In conclusion, the minimum distance between $|q_d\rangle$ and a mixed state $\rho$ can only be as low as
\[\begin{align} F = 1-\dfrac{\epsilon+q_{d-1}}{q_d} \end{align}\]