How to find basis for this set? let $A$ be a $5 \times 7$ matrix
and let
$$K_A  = \left\{ X \in \mathbb{R}^7 | AX = [0, 0, 0, 0, 0 ]^T \right\}$$
If I am given the matrix $A$, how do I find the basis for $K_A$?
Find an orthonormal basis $b_1, \dots, b_k$ of $K_A^\perp$. To do this, notice that the rows of $A$ span $K_A^\perp$. Thus, we can apply Gram-schmidt process to them to get such a basis.
Extend $b_1, \dots, b_k$ to a basis $b_1, \dots, b_k, c_1, \dots, c_r$ of $\mathbb{R}^7$, for example by appending random vectors $c_1, \dots, c_r$ sampled from the standard Gaussian distribution.
Apply Gram-Schmidt process to the basis $b_1, \dots, b_k, c_1, \dots, c_r$. In the resulting list of vectors, the last $r$ vectors will constitute an orthonormal basis of $K_A$.
Find an orthonormal basis $b_1, \dots, b_k$ of $K_A^\perp$. To do this, notice that the rows of $A$ span $K_A^\perp$. Thus, we can apply Gram-schmidt process to them to get such a basis.
Extend $b_1, \dots, b_k$ to a basis $b_1, \dots, b_k, c_1, \dots, c_r$ of $\mathbb{R}^7$, for example by appending random vectors $c_1, \dots, c_r$ sampled from the standard Gaussian distribution.
Apply Gram-Schmidt process to the basis $b_1, \dots, b_k, c_1, \dots, c_r$. In the resulting list of vectors, the last $r$ vectors will constitute an orthonormal basis of $K_A$.