How to find a positive semidefinite matrix $Y$ such that $YB =0$ where $B$ is given $B$ is an $n\times m$ matrix, $m\leq n$.
I have to find an $n\times n$ positive semidefinite matrix $Y$ such that $YB = 0$. 
Please help me figure out how can I find the matrix $Y$.

Use Singular Value Decomposition! Note $YB=0$ implies each row of $Y$ is in the left null space of matrix $B$. SVD is a good tool to find the left or right null space of a given matrix.
Let $r$ be the rank of matrix $B$. Then an SVD of $B$ is like
$$B=U\Sigma V^T$$
where $U=(u_1,...,u_{r-1},u_r,...,u_n)\in\mathbb{R}^{n\times n}$ and $V\in\mathbb{R}^{m\times m}$ are orthogonal matrices.
It is easy to check $u_i^TB=0$ for $i=r+1,...,n$. Choose $U_1=(u_{r+1},...,u_n)^T\in\mathbb{R}^{n-r\times n}$, then $U_1B=0$. Choose $Y=U_1^TU_1\in\mathbb{R}^{n\times n}$, then $Y$ is a positive semidefinite matrix with rank as $n-r$ and $YB=0$.
