TITLE: What's the best way to find a perpendicular vector?
QUESTION [13 upvotes]: Let's say I have a vector like this: $⟨-2,7,4⟩$
What's the best way to find a perpendicular vector for this?
Right now I'm doing $-2x+7y+4z=0$
And plugging in random values for $x$, $y$, and $z$ until I get $0$. This can't be right, right?

REPLY [3 votes]: And plugging in random values for x, y, and z until I get 0. This can't be right, right?

You have a linear equation. You can solve it using any of the methods that exist for solving systems of linear equations. For instance, since you have three variables and one equation, there are two degrees of freedom for the solution space. You can pick any two variables as free variables and solve the third in terms of those two. For instance, if you choose $x$ and $y$ as the free variables, then you have $4z = 2x-7y$, or $z = \frac x 2-\frac {7y}4$. This tells you that you can pick any values for $x$ and $y$ to get a solution. For instance, if $x = 10$, $y = 4$, then $z= 3$, giving the vector $(10, 4, 3)$. So you can plug in random values for two of the varaibles, and get the third using math.