$$ A=\begin{bmatrix}|&|&|&|\\\vec p+\vec q&\vec q+\vec r&\vec p+\vec r&4\vec r\\|&|&|&|\end{bmatrix} $$
$$ C=\begin{bmatrix}|&|&|\\\vec p+2\vec q&3\vec q-\vec r&2\vec p+7\vec q-\vec r\\|&|&|\end{bmatrix} $$
$$ D=\begin{bmatrix}|&|&|&|\\\vec p+\vec q&\vec q+\vec r&\vec p-\vec r&2\vec p+\vec q-\vec r\\|&|&|&|\end{bmatrix}. $$
Solution
The rank is the number of vectors in a basis for the column space. We will keep linearly independent columns and express the remaining columns as linear combinations of them. Recall that vectors are linearly independent if none can be written as a linear combination of the others.
\(A\): rank 3. The first column, \(\vec p+\vec q\), is nonzero: otherwise \(\vec p=-\vec q\), contradicting the independence of \(\vec p,\vec q,\vec r\).
The second column cannot be a multiple of the first. If \(\vec q+\vec r=c(\vec p+\vec q)\), then
$$ \vec r=c\vec p+(c-1)\vec q, $$
which would write \(\vec r\) as a linear combination of \(\vec p\) and \(\vec q\).
The third column cannot be a linear combination of the first two either. Suppose
$$ \vec p+\vec r=a(\vec p+\vec q)+b(\vec q+\vec r) =a\vec p+(a+b)\vec q+b\vec r. $$
The coefficients of \(\vec p,\vec q,\vec r\) on the two sides must match: if any coefficient differed, rearranging would express that vector as a linear combination of the other two. The \(\vec p\) and \(\vec r\) coefficients require \(a=b=1\), but then the \(\vec q\) coefficient is \(a+b=2\), whereas it is \(0\) on the left. This is impossible.
Thus the first three columns are linearly independent. The fourth is a linear combination of them:
$$ 4\vec r=-2(\vec p+\vec q)+2(\vec q+\vec r)+2(\vec p+\vec r). $$
The first three columns therefore form a basis for the column space, so \(\boxed{\operatorname{rank}(A)=3}\).
\(B\): rank 1. The second column is four times the first. The first column, \(2\vec p-\vec q\), is nonzero, since otherwise \(\vec q=2\vec p\). Thus the first column alone is a basis for the column space, and \(\boxed{\operatorname{rank}(B)=1}\).
\(C\): rank 2. The first column, \(\vec p+2\vec q\), is nonzero, since otherwise \(\vec p=-2\vec q\). The second column cannot be a multiple of it: if \(3\vec q-\vec r=c(\vec p+2\vec q)\), then
$$ \vec r=-c\vec p+(3-2c)\vec q, $$
contradicting the independence of \(\vec p,\vec q,\vec r\). The first two columns are therefore linearly independent. The third is twice the first plus the second:
$$ 2\vec p+7\vec q-\vec r=2(\vec p+2\vec q)+(3\vec q-\vec r). $$
Thus the first two columns form a basis for the column space, and \(\boxed{\operatorname{rank}(C)=2}\).
\(D\): rank 2. The first two columns are \(\vec p+\vec q\) and \(\vec q+\vec r\), which we showed are linearly independent when analyzing \(A\). The third and fourth columns are linear combinations of these two:
$$ \vec p-\vec r=(\vec p+\vec q)-(\vec q+\vec r), $$
$$ 2\vec p+\vec q-\vec r=2(\vec p+\vec q)-(\vec q+\vec r). $$
Thus the first two columns form a basis for the column space, and \(\boxed{\operatorname{rank}(D)=2}\).