Ask Your Question
0

if we know that the vectors are dependant i need to determine the relation between v9 = vector([0, 0, -2, 0, 4, -2, 12, 8, -18]) and the following vectors

asked 2024-01-18 18:20:22 +0200

Bouchikhi gravatar image

updated 2024-01-18 18:47:39 +0200

The vectors:

v1 = vector([1, 0, 2, 2, 0, 4, 4, 0, 10])
v2 = vector([0, 1, 1, 3, 3, 2, 3, 2, 5])
v3 = vector([1, 2, 4, 8, 6, 8, 10, 4, 20])
v4 = vector([1, 2, 0, 4, 10, 0, 6, 20, 0])
v5 = vector([0, 1, 3, 3, 5, 10, 9, 10, 11])
v6 = vector([1, 4, 6, 10, 20, 20, 24, 40, 22])
v7 = vector([1, -1, 1, -1, -3, 2, 1, -2, 5])
v8 = vector([0, 1, -2, 1, -2, 0, 4, 0, 4])
edit retag flag offensive close merge delete

Comments

Homework? In any case, what have you tried?

John Palmieri gravatar imageJohn Palmieri ( 2024-01-18 18:47:16 +0200 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2024-01-22 20:43:58 +0200

dan_fulea gravatar image

Please always mention the own effort to solve the problem. Well, in this case it is simpler to deliver the solution then to give a hint in a comment pointing to the particularity of the situation...

OP gives us:

v1 = vector([1,  0,  2,  2,  0,  4,  4,  0,  10])
v2 = vector([0,  1,  1,  3,  3,  2,  3,  2,   5])
v3 = vector([1,  2,  4,  8,  6,  8, 10,  4,  20])
v4 = vector([1,  2,  0,  4, 10,  0,  6, 20,   0])
v5 = vector([0,  1,  3,  3,  5, 10,  9, 10,  11])
v6 = vector([1,  4,  6, 10, 20, 20, 24, 40,  22])
v7 = vector([1, -1,  1, -1, -3,  2,  1, -2,   5])
v8 = vector([0,  1, -2,  1, -2,  0,  4,  0,   4])

v9 = vector([0,  0, -2,  0,  4, -2, 12,  8, -18])

And we already have a "misplaced" situation, since the parents of the objects are

sage: v1.parent()
Ambient free module of rank 9 over the principal ideal domain Integer Ring

So sage does its best to initialize the structure in the more general setting of the ring of integers $\Bbb Z$. One can also mention the "right ring" when initializing the object, e.g. via

sage: vector(QQ, [1,  0,  2,  2,  0,  4,  4,  0,  10])
(1, 0, 2, 2, 0, 4, 4, 0, 10)
sage: vector([1,  0,  2,  2,  0,  4,  4,  0,  10], QQ)
(1, 0, 2, 2, 0, 4, 4, 0, 10)

This is not so important below, because sage will tacitly coerce. But it is always good to keep in mind to init objects in the right mathematical structure.


Now the particularity of the situation is that the given eight vectors are forming a space of dimension five.

sage: M = matrix(QQ, [v1, v2, v3, v4, v5, v6, v7, v8])
sage: M
[ 1  0  2  2  0  4  4  0 10]
[ 0  1  1  3  3  2  3  2  5]
[ 1  2  4  8  6  8 10  4 20]
[ 1  2  0  4 10  0  6 20  0]
[ 0  1  3  3  5 10  9 10 11]
[ 1  4  6 10 20 20 24 40 22]
[ 1 -1  1 -1 -3  2  1 -2  5]
[ 0  1 -2  1 -2  0  4  0  4]

sage: M.rank()
5

Now the imperative task from the title wants you to do the (home)work and find the relation. Suggesting there is one such relation. Well, there may be many of them. We need first some independent lines. Using slicing, we can get some part of the matrix quickly. So the part of the matrix using the first five (=rank) rows is of full rank?

sage: M[(0,1,2,3,4), :]
[ 1  0  2  2  0  4  4  0 10]
[ 0  1  1  3  3  2  3  2  5]
[ 1  2  4  8  6  8 10  4 20]
[ 1  2  0  4 10  0  6 20  0]
[ 0  1  3  3  5 10  9 10 11]
sage: M[(0,1,2,3,4), :].rank()
4

Nope. We need first some five rows that are independent... There are $\binom 85$ ways to pick a selection of five rows from all eight, we stop already when we find some good rows.

for sel in Combinations(range(8), 5):
    if M[sel, :].rank() == 5:
        print(sel)
        break

And we obtain:

sage: for sel in Combinations(range(8), 5):
....:     if M[sel, :].rank() == 5:
....:         print(sel)
....:         break
....: 
[0, 1, 3, 4, 7]
sage: sel
[0, 1, 3, 4, 7]

So the vectors $v_0,v_1,v_3,v_4,v_7$, i.e. v1, v2, v4, v5, v8 are building a linear independent system $S$, and generate a space $V$ of dimension five. Is v9 also in this space? How to write it linearly in terms of $S$?


To answer the above question, let us start again in the right manner. We introduce the space $W=\Bbb Q^9$, where all the given vectors are living in, associate the subspace generated by the given vectors, and ask for a basis, and if v9 is also in there.

W = VectorSpace(QQ, 9)
V = W.subspace([
      W([1,  0,  2,  2,  0,  4,  4,  0,  10])
    , W([0,  1,  1,  3,  3,  2,  3,  2,   5])
    , W([1,  2,  4,  8,  6,  8, 10,  4,  20])
    , W([1,  2,  0,  4, 10,  0,  6, 20,   0])
    , W([0,  1,  3,  3,  5, 10,  9, 10,  11])
    , W([1,  4,  6, 10, 20, 20, 24, 40,  22])
    , W([1, -1,  1, -1, -3,  2,  1, -2,   5])
    , W([0,  1, -2,  1, -2,  0,  4,  0,   4]) ])

v9 = W([0,  0, -2,  0,  4, -2, 12,  8, -18])

v9 in V

And we obtain the information:

sage: v9 in V
False

Well, in this case... we could also have the decision searching for it in the first approach...

M = matrix(QQ, [v1, v2, v3, v4, v5, v6, v7, v8]) 
N = matrix(QQ, [v1, v2, v3, v4, v5, v6, v7, v8, v9])

And we ask for the ranks:

sage: M.rank()
5
sage: N.rank()
6

So adding v9 the space gets a higher rank, no chance to linearly write v9 in terms of the other vectors...


This is maybe a good point to rethink your strategy of using computer algebra systems like sage. Always do the job in the mathematical world, then if this world needs the computational support, then ask questions one by one, is the last vector in the right space, how can one test this, if it is there, how to get in the special case a linear combination... You do not provide any information on the problem (source, level, country where it was stated, kind of examination of exercise book...) - this make every answer a (typing) pain. Please always give all you have, all you tried, all your thoughts. This makes answering the question or giving the one-line-hint much much easier.

edit flag offensive delete link more
1

answered 2024-01-24 10:06:16 +0200

Emmanuel Charpentier gravatar image

updated 2024-01-27 13:55:09 +0200

Trying to solve your problem by brute force (i. e. using basic solve in SR) : run

v1 = vector(SR, [1, 0, 2, 2, 0, 4, 4, 0, 10])
v2 = vector(SR, [0, 1, 1, 3, 3, 2, 3, 2, 5])
v3 = vector(SR, [1, 2, 4, 8, 6, 8, 10, 4, 20])
v4 = vector(SR, [1, 2, 0, 4, 10, 0, 6, 20, 0])
v5 = vector(SR, [0, 1, 3, 3, 5, 10, 9, 10, 11])
v6 = vector(SR, [1, 4, 6, 10, 20, 20, 24, 40, 22])
v7 = vector(SR, [1, -1, 1, -1, -3, 2, 1, -2, 5])
v8 = vector(SR, [0, 1, -2, 1, -2, 0, 4, 0, 4])
v9 = vector(SR, [0, 0, -2, 0, 4, -2, 12, 8, -18])
vA = vector(var("a", n=8))
M = matrix([v1, v2, v3, v4, v5, v6, v7, v8])

Then :

sage: solve((vA*M-v9).list(), vA.list())
[]

which can be confirmed by other means, if you are sceptic (a good heuristic with CASes...) :

sage: solve((vA*M-v9).list(), vA.list(), algorithm="giac")
[]
sage: solve((vA*M-v9).list(), vA.list(), algorithm="sympy")
[]
sage: solve((vA*M-v9).list(), vA.list(), algorithm="maxima")
[]
sage: mathematica([u==0 for u in (vA*M-v9)]).Solve(vA).sage()
[]

The reason of this non-solution is well explained in @dan_fulea 's answer.

Update :

An alternative way is to solve in some relevant polynomial ring. Running :

M = matrix([[1, 0, 2, 2, 0, 4, 4, 0, 10],
            [0, 1, 1, 3, 3, 2, 3, 2, 5],
            [1, 2, 4, 8, 6, 8, 10, 4, 20],
            [1, 2, 0, 4, 10, 0, 6, 20, 0],
            [0, 1, 3, 3, 5, 10, 9, 10, 11],
            [1, 4, 6, 10, 20, 20, 24, 40, 22],
            [1, -1, 1, -1, -3, 2, 1, -2, 5],
            [0, 1, -2, 1, -2, 0, 4, 0, 4]])
v9 = vector([0, 0, -2, 0, 4, -2, 12, 8, -18])
RP = PolynomialRing(QQbar, 8, "a")
# RP.inject_variables() # Useless here, may be used for further work.
A = vector(RP.gens())
J1 = RP.ideal(*(A*M-v9))

allows us to conclude that :

sage: J1.dimension()
-1

there is no solution to this problem, i. e. that $v_9$ is not a linear combination of $v_1,\dots,v_8$

HTH,

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2024-01-18 18:20:22 +0200

Seen: 232 times

Last updated: Jan 27