Given that the points A(0,1,−1),B(3,p,q) and C(1,4,1) are collinear.Let the point B divide the line segment AC in the ratio k:1, then by section formula the coordinates of the point B are
(k+0k+1,4k+1k+1,k−2k+1)
But the coordinates of the point B are (3,p,q), so we have,
k+0k+1=3,4k+1k+1=p,k−2k+1=q
⇒k=3k+3,4k+1k+1=p,k−2k+1=q
⇒k−3k=3,4k+1k+1=p,k−2k+1=q
⇒−2k=3,4k+1k+1=p,k−2k+1=q
⇒k=−32,4k+1k+1=p,k−2k+1=q
⇒k=−32,4×−32+1−32+1=p,−32−2−32+1=q
⇒k=−32,−6+1−3+22=p,−3−42−3+22=q
⇒k=−32,−5−12=p,−72−12=q
∴k=−32,p=10,q=7