a) If t is a real variable, then the line through the endpoints of p and q is
(p - q) t + p
That is, p - q is the vector pointing from the tip of q to the tip of p (recall the "triangle law" for vector addition). Then (p - q) t is a line through the origin parallel to p - q. Adding p to this line translates it so that it will pass through p.
So one formulation of the line's equation is
r(t) = ((3, -1, 1) - (7, 1, 3)) t + (3, -1, 1)
… = (-4, -2, -2) t + (3, -1, 1)
… = (-4t + 3, -2t - 1, -2t + 1)
which is identical to the equation you found, with t = -k.
b) OA is the line segment connecting the origin O and the point A on the line we found in part (a).
a is then the vector pointing from the origin to A. If OA is perpendicular to the line, then the dot product of a with the direction vector p - q must be zero.
a • (p - q) = 0
(a₁, a₂, a₃) • (-4, -2, -2) = 0
-4a₁ - 2a₂ - 2a₃ =0
2a₁ + a₂ + a₃ = 0
Let s(t) denote the line containing a. Then
s(t) = (a₁, a₂, a₃) t
r(t) and s(t) intersect exactly once for some value of t such that
(a₁, a₂, a₃) t = (-4, -2, -2) t + (3, -1, 1)
(a₁ + 4, a₂ + 2, a₃ + 2) t = (3, -1, 1)
Now we solve for the components of a such that the conditions we found are all met:
[tex]\begin{cases}2a_1 + a_2 + a_3 = 0 \\ (a_1 + 4)t = 3 \\ (a_2 + 2)t = -1 \\ (a_3 + 2)t = 1\end{cases}[/tex]
and you would find the two lines intersect when t = 1/2, and so
a = (2, -4, 0)