Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168690
Image: ubuntu2004
# Section 1.3
# 11 (This is an alternate approach that showcases Sage's power. It's useful for checking, but not great for actually learning about linear combinations.)
a1 = vector(QQ,[1,-2,0]) a2 = vector(QQ,[0,1,2]) a3 = vector(QQ,[5,-6,8]) b = vector(QQ,[2,-1,6]) a1,a2,a3,b
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\left(1,\,-2,\,0\right), \left(0,\,1,\,2\right), \left(5,\,-6,\,8\right), \left(2,\,-1,\,6\right)\right)
b in span((a1,a2,a3))
\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}
# A more constructive way, and the way that I would expect on an exam, is the following: # We need a1x1 + a2x2 + a3x3 = b. # This has the same solutions as the augmented matrix system:
M = matrix(QQ, [[1,0,5,2],[-2,1,-6,-1],[0,2,8,6]]); M
\newcommand{\Bold}[1]{\mathbf{#1}}\left(105221610286\begin{array}{rrrr} 1 & 0 & 5 & 2 \\ -2 & 1 & -6 & -1 \\ 0 & 2 & 8 & 6 \end{array}\right)
M.rref()
\newcommand{\Bold}[1]{\mathbf{#1}}\left(105201430000\begin{array}{rrrr} 1 & 0 & 5 & 2 \\ 0 & 1 & 4 & 3 \\ 0 & 0 & 0 & 0 \end{array}\right)
# Since there exists a solution to the linear system (i.e. it is consistent), b is in the span of a1,a2,a3. (I.e. b is a linear combination of a1, a2, and a3.)