Suppose $A$ and $B$ are two $n \times n$ real symmetric matrices, and $A$ is positive semidefinite. For what values of $k \in \mathbb R$ is matrix $kA-B$ positive semidefinite (we write as $kA-B \succeq 0$)? If $A$ is positive definite, we may find an $n \times n$ nonsingular matrix $D$ such that $A = D^T D$. As a result, $kA-B \succeq 0$ is equivalent to $$kI \succeq (D^{-1})^T B D^{-1}$$ or $$k \geq \lambda_{\max}((D^{-1})^TBD^{-1}))$$ But how to deal with the situation when $A$ is singular but still positive semidefinite? I know for certain that in this case we must impose additional constraints on matrix $B$. In particular, let the columns of matrix $N$ consist of a basis of the null space of $A$, then we must have that $N^T B N \preceq 0$ (i.e., $N^T B N$ is negative semidefinite). But what is the lower bound on $k$? Thanks.