Show that these equations are linearly dependent using Mathematica

Click For Summary

Homework Help Overview

The discussion revolves around determining the linear dependence of a set of equations using Mathematica. The original poster attempts to solve a system of four equations with three unknowns but encounters issues with receiving no output from the software.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Some participants question the feasibility of a solution given the number of equations and unknowns. Others suggest removing one equation to check for a non-zero determinant in the matrix. There are also discussions about using different functions in Mathematica, such as Reduce, to analyze the system's consistency.

Discussion Status

The conversation includes various attempts to understand the problem, with some participants providing insights on the implications of linear independence and the nature of the equations. A participant shares their experience with an alternative tool, SageMath, and notes an error encountered when trying to solve a specific equation, which contributes to the ongoing exploration of the topic.

Contextual Notes

There is mention of a potential error in the choice of one of the vectors, which may have led to the observed linear independence and inconsistency in the equations. The discussion reflects on the nature of redundancy and inconsistency in systems of equations.

Lambda96
Messages
233
Reaction score
77
Thread moved from the technical forums to the schoolwork forums
TL;DR Summary: solve linear systems of equations

Hi,

I am supposed to solve the following problem with Mathematica

Bildschirmfoto 2023-10-31 um 14.30.58.png

This is the tutorial we received on how to solve linear systems with Mathematica:
Bildschirmfoto 2023-10-31 um 14.31.49.png

I then tried the whole thing for the task, but unfortunately Mathematica doesn't give me any values, just an empty output. Unfortunately, I do not know what I did wrong, because I followed the instructions 1-to-1.

Bildschirmfoto 2023-10-31 um 14.37.50.png
 
Physics news on Phys.org
You have four equations and three unknowns. Are you sure that there is a solution?

You could remove one equation and see if the matrix has a non-zero determinant. If so, solve those equations and see if it also solves the equation that you removed.
 
  • Like
Likes   Reactions: topsquark and Lambda96
There isn't a solution. Mathematica is correctly identifying the fact that there is no solution. You can also use Reduce instead of Solve, and the result of Reduce is False, indicating that the equation is inconsistent.
 
  • Like
Likes   Reactions: topsquark, Lambda96 and FactChecker
Try solving <br /> C_1 \mathbf{a} + C_2 \mathbf{b} + C_3 \mathbf{c} + C_4 \mathbf{d} = \mathbf{0}. If \mathbf{a}, \mathbf{b}, \mathbf{c}, \mathbf{d}, are linearly independent then the only solution is C_1=C_2=C_3=C_4=0[/itex]; if there is a non-zero solution with C_4 \neq 0 then you have \lambda_i = C_i/C_4.
 
  • Like
Likes   Reactions: topsquark and Lambda96
Thread solved. Just for the fun of it I tried the exercise on https://sagecell.sagemath.org/
and with trial and error found the incantation

Code:
a= vector([10,-4,56,20])
b=vector([-4,7,10,-45])
c=vector([24,-8,3,1])
d=vector([59,1,4,-6])

# declaring a matrix is the other way
aa = matrix (QQ,[[10,-4,24],[-4,7,-8],[56,10,3],[20,-45,1]]);aa

# test: a vector that gives a solution for Ax = e
e=a+2*b+3*c;e
aa.solve_right(e)

# now for real
#aa.solve_right(d)

that evaluates to
Code:
(1, 2, 3)

and when I remove the # in front of the last line aa.solve_right(d), the result when 'evaluate' is pressed:
Code:
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In [1], line 14
     11 aa.solve_right(e)
     13 # now for real
---> 14 aa.solve_right(d)

File /home/sc_serv/sage/src/sage/matrix/matrix2.pyx:913, in sage.matrix.matrix2.Matrix.solve_right()
    911
    912         if not self.is_square():
--> 913             X = self._solve_right_general(C, check=check)
    914         else:
    915             try:

File /home/sc_serv/sage/src/sage/matrix/matrix2.pyx:1036, in sage.matrix.matrix2.Matrix._solve_right_general()
   1034     # Have to check that we actually solved the equation.
   1035     if self*X != B:
-> 1036         raise ValueError("matrix equation has no solutions")
   1037 return X
   1038

ValueError: matrix equation has no solutions

which isn't the most user-friendly thing I can think of, but the last line answers the question ...
Disclaimer: I know next to nothing about mathematica and python (old Fortran addict) but am really impressed by these powerful modern tools !

##\ ##
 
Last edited:
  • Like
Likes   Reactions: topsquark, Lambda96, FactChecker and 1 other person
Thanks FactChecker, Dale, pasmith and BvU for your help 👍👍👍👍 I just got the message from my lecturer that he chose the vector d incorrectly, which is why the vectors are so linearly independent and why the equation has no solution 🙃
 
  • Like
Likes   Reactions: FactChecker and Dale
Lambda96 said:
which is why the vectors are so linearly independent and why the equation has no solution 🙃
To be more exact, just like the simple example: x=1; x=2, the vectors are linearly dependent but the equations are inconsistent. When there are more equations than there are unknowns, either the equations are redundant and have a solution or they are inconsistent and do not have a solution. x=1; 2x=2 would be redundant. x=1; x=2 is inconsistent.
PS. If there are several more equations than unknowns, then some may be redundant and others may be inconsistent.
 
  • Like
Likes   Reactions: Lambda96

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
18
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
5
Views
2K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K