Oh well, even though this is NOT a programming problem, I'll answer it.
The question is to solve the linear system
Ax = 8x
where the 3x3 matrix A is given, and x is a 3x1 unknown vector.
A = [3 2 4;2 0 2;4 2 3];
[v,d] = eig(A)
v =
-0.4941 -0.5580 0.6667
-0.4720 0.8161 0.3333
0.7301 0.1500 0.6667
d =
-1.0000 0 0
0 -1.0000 0
0 0 8.0000
Here we see that the third eigenvalue is 8, so there is indeed a non-degenerate solution to the problem. It is of the form
k*v(:,3)
since v(:,3) is the corresponding eigenvector.
format rat
v(:,3)
ans =
2/3
1/3
2/3
Clearly this results in the solution given by the asker.
I'll note that this all works ONLY because the problem was posed in the form A*x=lambda*x, so a classical eigenvalue problem. Again, if you appreciate the mathematics behind the solution, then we can solve the problem using null:
null(A - 8*eye(3))
ans =
2/3
1/3
2/3
Of course, we could have used the symbolic toolbox.
sol = solve('3*a + 2*b + 4*c = 8*a','2*a + 2*c = 8*b','4*a + 2*b + 3*c = 8*c');
sol.a
ans =
z
sol.b
ans =
z/2
sol.c
ans =
z
Suppose instead that the problem was a completely general one? Thus, still a homogeneous linear system, but not an obvious eigenvalue problem? As an example, I'll try to solve the arbitrary linear problem
A*[a;b;c] = [a;2*b;3*c]
See that this is NOT written in the form of an eigenvalue problem. There are actually several ways we might decide to solve it. The unknowns are on BOTH sides of the equality. So just move them all to the left hand side. Semi-mathematically, we might do this as
B = A - diag([1 2 3])
B =
2 2 4
2 -2 2
4 2 0
We now try to solve the linear system
Bx = B*[a;b;c] = [0;0;0]
Do solutions to this exist? This time, they do not exist, beyond the trivial, degenerate solution, because B has full rank.
rank(B)
ans =
3
A full rank, homogeneous linear system has only the degenerate (zero) solution. Null tells us this too.
null(B)
ans =
Empty matrix: 3-by-0
The symbolic toolbox solution reflects that fact.
sol = solve('3*a + 2*b + 4*c = a','2*a + 2*c = 2*b','4*a + 2*b + 3*c = 3*c')
sol.a
ans =
0
sol.b
ans =
0
sol.c
ans =
0
Until you appreciate the mathematics of the linear systems involved, this really is NOT a programming problem, and then it is essentially one command to solve the problem, so still not really much of a programming problem.