Descibe geometrically (line, plane, or all of $\mathbb{R}^3$) all linear combinations of
(a) $\begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} $ and $\begin{bmatrix} 3 \\ 6 \\ 9 \end{bmatrix} $
Here we see that $v_2 = 3v_1$, therefore these two vectors are collinear. Their linear combinations describe a line through the origin and $v_1$ (which also contains $v_2$).
(b) $\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} $ and $\begin{bmatrix} 0 \\ 2 \\ 3 \end{bmatrix} $
These two vectors are not collinear. There is no constant $k$ such that $v_2 = kv_1$. Therefore these two vectors describe a plane that contains the origin, $v_1$ and $v_2$.
(c) $\begin{bmatrix} 2 \\ 0 \\ 0 \end{bmatrix} $ and $\begin{bmatrix} 0 \\ 2 \\ 2 \end{bmatrix} $ and $\begin{bmatrix} 2 \\ 2 \\ 3 \end{bmatrix} $
None of these three vectors can be described as a linear combination of the others, therefore they describe the entire $\mathbb{R}^3$ space.
Draw $v = \begin{bmatrix} 4 \\ 1 \end{bmatrix}$ and $w = \begin{bmatrix} -2 \\ 2 \end{bmatrix}$ and $v+w$ and $v-w$ in a single xy plane.
from matplotlib import pyplot as plt
import numpy as np
import math
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111)
ax.axis(xmin=-10, xmax=10, ymin=-10, ymax=10)
ax.spines['left'].set_position(('data', 0.0))
ax.spines['bottom'].set_position(('data', 0.0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
def plot_vector(v,s):
arrow = ax.arrow(0,0, v[0], v[1], width=0.1, head_width=0.5)
ax.annotate(s,(v[0],v[1]), size=20)
v= [4,1]
w= [-2,2]
plot_vector(v, 'v')
plot_vector(w, 'w')
plot_vector([v[0]+w[0],v[1]+w[1]], 'v+w')
plot_vector([v[0]-w[0],v[1]-w[1]], 'v-w')
Given $v+w = \begin{bmatrix} 5 \\ 1 \end{bmatrix}$ and $v-w = \begin{bmatrix} 1 \\ 5 \end{bmatrix}$ compute and draw $v$ and $w$.
$$\begin{aligned} v+w &= \begin{bmatrix} 5 \\ 1 \end{bmatrix} \\ w &= \begin{bmatrix} 5 \\ 1 \end{bmatrix} - v\\ \end{aligned}$$$$\begin{aligned} v-w &= \begin{bmatrix} 1 \\ 5 \end{bmatrix} \\ v-(\begin{bmatrix} 5 \\ 1 \end{bmatrix} - v) &= \begin{bmatrix} 1 \\ 5 \end{bmatrix}\\ 2v &= \begin{bmatrix} 1 \\ 5 \end{bmatrix} + \begin{bmatrix} 5 \\ 1 \end{bmatrix} = \begin{bmatrix} 6 \\ 6 \end{bmatrix} \\ v &= \begin{bmatrix} 3 \\ 3 \end{bmatrix} \end{aligned}$$$$\begin{aligned} w &= \begin{bmatrix} 5 \\ 1 \end{bmatrix} - \begin{bmatrix} 3 \\ 3 \end{bmatrix} = \begin{bmatrix} 2 \\ -2 \end{bmatrix} \end{aligned}$$from matplotlib import pyplot as plt
import numpy as np
import math
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111)
ax.axis(xmin=-6, xmax=6, ymin=-6, ymax=6)
ax.spines['left'].set_position(('data', 0.0))
ax.spines['bottom'].set_position(('data', 0.0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
def plot_vector(v,s):
arrow = ax.arrow(0,0, v[0], v[1], width=0.1, head_width=0.5)
ax.annotate(s,(v[0],v[1]), size=20)
v= [3,3]
w= [2,-2]
plot_vector(v, 'v')
plot_vector(w, 'w')
plot_vector([v[0]+w[0],v[1]+w[1]], 'v+w')
plot_vector([v[0]-w[0],v[1]-w[1]], 'v-w')
From $v = \begin{bmatrix} 2 \\ 1 \end{bmatrix}$ and $w = \begin{bmatrix} 1 \\ 2 \end{bmatrix}$ find $3v + w$ and $cv + dw$
$$ 3v + w = \begin{bmatrix} 3(2) + 1 \\ 3(1) + 2 \end{bmatrix} = \begin{bmatrix} 7 \\ 5 \end{bmatrix} $$$$ cv + dw = \begin{bmatrix} 2c + d \\ c + 2d \end{bmatrix} $$$\newcommand{\vecd}[2]{\begin{bmatrix} #1 \\ #2 \end{bmatrix} }$ $\newcommand{\vect}[3]{\begin{bmatrix} #1 \\ #2 \\ #3 \end{bmatrix} }$
Given $u = \vect{1}{2}{3}, v = \vect{-3}{1}{-2}, w = \vect{2}{-3}{-1}$ compute $u+v+w$ and $2u+2v+w$, how do we know they lie on a plane?
$$\begin{aligned} u+v+w &= \vect{1-3+2}{2+1-3}{3-2-1} = \vect{0}{0}{0} \\ 2u+2v+w &= \vect{2 - 6 + 2}{4 + 2 - 3}{6-4-1} = \vect{-2}{3}{1} \end{aligned}$$Because $u+v+w=0$ therefore $w = -u - v$, so $w$ is a linear combination of the other two vectors. $u$ and $v$ are not collinear, therefore they describe a plane.
Every combination of $v = (1,-2, 1)$ and $w = (0,1,-1)$ has components that add up to what? Find $c$ and $d$ such that $cv+dw = (3,3,-6)$. Why is $(3,3,6)$ impossible?
$$ \sum(k_1v + k_2w) = \sum((k_1,-2k_1,k_1) + (0,k_2,-k_2)) = k_1 -2k_1 + k_2 + k_1 - k_2) = 0$$$$ cv + dw = (c, -2c+d, c - d) = (3,3,-6)$$$$ c = 3 $$$$ \begin{aligned} c-d &= -6 \\ 3-d &= -6 \\ d = 9 \end{aligned} $$$(3,3,6)$ is impossible because its components dont add up to zero.
In the xy plane mark all nine of these linear combinations:
$$ c \vecd{2}{1} + d \vecd{0}{1} : c = 0,1,2, d = 0,1,2 $$from matplotlib import pyplot as plt
import numpy as np
import math
%matplotlib inline
xs = []
ys = []
for c in [0,1,2]:
for d in [0,1,2]:
xs.append(2 * c + 0 * d)
ys.append(c + d)
plt.scatter(xs,ys);
A parallelogram of $v$ and $w$ has a diagonal $v+w$, what is its other diagonal? What is the sum of the two diagonals?
The other diagonal is either $v-w$ or $w-v$
The sum is either $2v$ or $2w$
Three corners of a parallelogram are $(1,1), (4,2), (1,3)$, what are the four other possible corners? Plot them.
They are $a + (b-a) + (c-a) = -a + b + c$ for each of the three points as $a$
So:
$$-(1,1) + (4,2) + (1,3) = (4, 4)$$$$(1,1) - (4,2) + (1,3) = (-2, 2)$$$$(1,1) + (4,2) - (1,3) = (4, 0)$$%matplotlib inline
plt.scatter([1,4,1],[1,2,3], color='#008000');
plt.scatter([4,-2,4],[4,2,0], color='#000080');
Which point of the unit cube is $i+j$ ? Which point is the vector sum of $i$ and $j$ and $k$. Describe all points in the unit cube.
$i+j = (1,1,0)$
$i+j+k = (1,1,1)$
$(a,b,c)$ is in the unit cube iff $0 \le a \le 1$ and $0 \le b \le 1$ and $0 \le c \le 1$
What are the corners of the unit cube? What is the center point of the unit cube? What is the center point of the faces of a unit cube? How many edges does it have?
Corners: $(0,0,0), (0,0,1), (0,1,0), (0,1,1), (1,0,0), (1,0,1), (1,1,0), (1,1,1)$
Center: $(\frac{1}{2},\frac{1}{2},\frac{1}{2})$
Face centers: $(\frac{1}{2},\frac{1}{2},0), (\frac{1}{2},\frac{1}{2},1), (\frac{1}{2},0,\frac{1}{2}), (\frac{1}{2},1,\frac{1}{2}), (0,\frac{1}{2},\frac{1}{2}), (1,\frac{1}{2},\frac{1}{2})$
In xyz space, where is the plane of all linear combinations of $i$ and $i+j$ ?
It is the same as the plane of $i$ and $j$, which is the xy plane through the origin.
(a) What is the sum of the vectors that go from the clock center to 1hr, 2hr, ..., 12hr?
As each vector has an inverse, they will total to the zero vector.
(b) If 2hr vector is removed, why do they total to 8hr?
Because the remaining vectors, apart from 8hr, have inverses, so they total to zero, leaving only the 8hr in the sum. (8hr is inverse of 2hr vector).
(c) What are the x, y components of the 2hr vector?
$2hr = (\cos(\frac{\pi}{6}), \sin(\frac{\pi}{6})) = (\frac{\sqrt{3}}{2}, \frac{1}{2})$
Suppose the clock vectors start from 6hr rather than origin? What do they add to now?
Its equivalent to subtracting a 6hr vector from each element of the previous sum, which would be the zero vector plus $12(-6hr) = -12(0,-1) = (0,12)$
Given vectors v and w, mark $\frac{1}{2}v + \frac{1}{2}w$, $\frac{3}{4}v + \frac{1}{4}w$, $\frac{1}{4}v + \frac{1}{4}w$ and $v + w$
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111)
ax.axis(xmin=-1, xmax=10, ymin=-1, ymax=10)
ax.spines['left'].set_position(('data', 0.0))
ax.spines['bottom'].set_position(('data', 0.0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
def plot_vector(v,s):
ax.arrow(0,0, v[0], v[1], width=0.1, head_width=0.5);
ax.annotate(s,(v[0],v[1]), size=20)
v= [1,5]
w= [5,1]
plot_vector(v, 'v')
plot_vector(w, 'w')
xs = [v[0]+w[0], 0.5*(v[0]) + 0.5*(w[0]), 0.75*(v[0]) + 0.25*(w[0]), 0.25*(v[0]) + 0.25*(w[0])]
ys = [v[1]+w[1], 0.5*(v[1]) + 0.5*(w[1]), 0.75*(v[1]) + 0.25*(w[1]), 0.25*(v[1]) + 0.25*(w[1])]
ax.scatter(xs, ys);
Mark the point $-v + 2w$ and any other combination $cv + dw$ with $c + d = 1$
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111)
ax.axis(xmin=-10, xmax=10, ymin=-10, ymax=10)
ax.spines['left'].set_position(('data', 0.0))
ax.spines['bottom'].set_position(('data', 0.0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
def plot_vector(v,s):
ax.arrow(0,0, v[0], v[1], width=0.1, head_width=0.5);
ax.annotate(s,(v[0],v[1]), size=20)
v= [1,5]
w= [5,1]
plot_vector(v, 'v')
plot_vector(w, 'w')
ax.scatter([-v[0]+2*w[0]], [-v[1]+2*w[1]]);
ax.plot([-99*v[0]+100*w[0], 100*v[0]-99*w[0]],[-99*v[1]+100*w[1], 100*v[1]-99*w[1]]);
class vec2(tuple):
def __new__(self, x, y):
return tuple.__new__(vec2, (float(x),float(y)))
def __add__(self, o):
return vec2(self[0] + o[0], self[1] + o[1])
def __sub__(self, o):
return self + (-1)* o;
def __mul__(self, o):
return vec2(self[0] * o, self[1] * o)
def __rmul__(self, o):
return vec2(o * self[0], o * self[1])
Locate $\frac{1}{3}v + \frac{1}{3}w$ and $\frac{2}{3}v + \frac{2}{3}w$. The combinations $cv+cw$ fill out what line?
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111)
ax.axis(xmin=-10, xmax=10, ymin=-10, ymax=10)
ax.spines['left'].set_position(('data', 0.0))
ax.spines['bottom'].set_position(('data', 0.0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
def plot_vector(v,s):
ax.arrow(0,0, v[0], v[1], width=0.1, head_width=0.5);
ax.annotate(s,(v[0],v[1]), size=20)
def plot_points(vs):
ax.scatter([v[0] for v in vs], [v[1] for v in vs]);
def plot_line(a,b):
ax.plot([a[0],b[0]],[a[1],b[1]])
v= vec2(1,5)
w= vec2(5,1)
plot_vector(v, 'v')
plot_vector(w, 'w')
plot_points([1/3*v + 1/3*w, 2/3*v + 2/3*w])
plot_line(-100*v -100*w, 100*v + 100*w)
Restricted by $0 \le c \le 1$ and $0 \le d \le 1$, shade all combinations cv + dw
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111)
ax.axis(xmin=-1, xmax=10, ymin=-1, ymax=10)
ax.spines['left'].set_position(('data', 0.0))
ax.spines['bottom'].set_position(('data', 0.0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
def plot_vector(v,s):
ax.arrow(0,0, v[0], v[1], width=0.1, head_width=0.5);
ax.annotate(s,(v[0],v[1]), size=20)
def plot_points(vs):
ax.scatter([v[0] for v in vs], [v[1] for v in vs]);
def plot_line(a,b):
ax.plot([a[0],b[0]],[a[1],b[1]])
def plot_polygon(vs):
x = [v[0] for v in vs]
y = [v[1] for v in vs]
plt.fill(x,y)
v= vec2(1,5)
w= vec2(5,1)
plot_vector(v, 'v')
plot_vector(w, 'w')
plot_polygon([vec2(0,0), v, v+w, w])
Restricted only by $c \ge 0$ and $d \ge 0$ draw the "cone" of all combinations $cv + dw$
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111)
ax.axis(xmin=-1, xmax=10, ymin=-1, ymax=10)
ax.spines['left'].set_position(('data', 0.0))
ax.spines['bottom'].set_position(('data', 0.0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
def plot_vector(v,s):
ax.arrow(0,0, v[0], v[1], width=0.1, head_width=0.5);
ax.annotate(s,(v[0],v[1]), size=20)
def plot_points(vs):
ax.scatter([v[0] for v in vs], [v[1] for v in vs]);
def plot_line(a,b):
ax.plot([a[0],b[0]],[a[1],b[1]])
def plot_polygon(vs):
x = [v[0] for v in vs]
y = [v[1] for v in vs]
plt.fill(x,y)
v= vec2(1,5)
w= vec2(5,1)
plot_vector(v, 'v')
plot_vector(w, 'w')
plot_polygon([vec2(0,0), 100*v, 100*w])
class vec3(tuple):
def __new__(self, x, y, z):
return tuple.__new__(vec3, (float(x),float(y), float(z)))
def __add__(self, o):
return vec3(self[0] + o[0], self[1] + o[1], self[2] + o[2])
def __sub__(self, o):
return self + (-1)* o;
def __mul__(self, o):
return vec3(self[0] * o, self[1] * o, self[2] * o)
def __rmul__(self, o):
return vec3(o * self[0], o * self[1], o * self[2])
Locate $\frac{1}{3}u + \frac{1}{3}v + \frac{1}{3}w$ and $\frac{1}{2}u + \frac{1}{2}w$
Given $cu + dv + ew$ what are the restrictions on $c, d, e$ that require staying inside triangle formed by $u, v, w$
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.axis(xmin=-1, xmax=10, ymin=-1, ymax=10)
ax.set_zlim(-1,10)
def plot_points(vs):
ax.scatter([v[0] for v in vs], [v[1] for v in vs], [v[2] for v in vs]);
u = vec3(6,3,2)
v = vec3(3,7,1)
w = vec3(2,5,7)
plot_points([vec3(0,0,0), u,v,w])
plot_points([(1/3)*u+(1/3)*v+(1/3)*w, (1/2)*u + (1/2)*w])
To stay in the triangle, $c$, $d$ and $e$ need to be non-negative and $c + d + e = 1$. (Related: barycentric coordinates)
The three sides of the triangle are $v-u$, $w-v$ and $u-w$. What is the sum? Draw this for $(3,1), (-1,1), (-2,-2)$
Sum is zero vector as this describes a clockwise path around triangle. Also $v-u + w-v + u-w = v-v + w-w + u-u = 0$
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111)
ax.axis(xmin=-5, xmax=5, ymin=-5, ymax=5)
ax.spines['left'].set_position(('data', 0.0))
ax.spines['bottom'].set_position(('data', 0.0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
def plot_vector(v,w, s):
ax.arrow(v[0],v[1], w[0]-v[0], w[1]-v[1], width=0.1, head_width=0.5);
ax.annotate(s,(1/2)*v + (1/2)*w, size=20)
u=vec2(3,1)
v=vec2(-1,1)
w=vec2(-2,-2)
plot_vector(u,v,"v-u")
plot_vector(v,w,"w-v")
plot_vector(w,u,"u-w")
Describe the shape of all $cu + dv + ew$ where $c, d, e$ are non-negative and $c + d + e \le 1$
It is a tetrahedron with verticies at the origin and $u$, $v$ and $w$
Does $u$, $v$, $w$ span $R^3$ ? When do they not?
Yes they span. They would not if they were on same plane through the origin. If so, they would span a plane. If they are collinear through a line through the origin, they would span that line.
Which vectors are combinations of $u$ and $v$ and also combinations of $v$ and $w$?
That would be the intersection of the plane through origin, $u$ and $v$ and the plane through origin, $v$ and $w$, which is the line through $v$. Which is also all $kv$.
What is a $u$, $v$, $w$ that only fills a line? What is a value of $u$, $v$, $w$ that only fills a plane?
$(1,1,1), (2,2,2), (3,3,3)$ and $(1,1,1),(1,1,-1),(0,0,2)$
What combination of $c\vecd{1}{2} + d\vecd{3}{1}$ produces $\vecd{14}{8}$
How many verticies does a cube have in 4d? How many 3D faces? How many edges?
Find vectors $v$ and $w$ so that $v + w = (4,5,6)$ and $v-w = (2,5,8)$. How many unknowns?
There are six unknowns and six equations.
$$\begin{aligned} v + w - (v - w) &= (4,5,6) - (2,5,8) \\ 2w &= (2,0,-2) \\ w &= (1,0,-1) \\ \end{aligned}$$$$\begin{aligned} v + w &= (4,5,6) \\ v = (4,5,6) - (1,0,-1) \\ v = (3,5,7) \end{aligned}$$Find two combinations of $u = (1,3)$ and $v=(2,7)$ and $w=(1,5)$ that produce $b=(0,1)$. Will any three vectors always combine to two combinations of $b$?
No, the vectors $(1,0), (2,0), (3,0)$ cannot be combined to b.
The vectors $(1,0),(2,0),(0,-2)$ can only be combined in one way to b $(-\frac{1}{2}(0,-2) = b)$
The linear combination of $v = (a,b)$ and $w = (c,d)$ fill the plane unless what?
Find four 4d vectors that can be combined to fill the 4d plane.
Unless $\frac{a}{b} = \frac{c}{d} \implies ad = bc$
$(1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1)$
Write down three equations for $c$, $d$, $e$ so that $cu + dv + ew = b$. Find $c,d,e$ for this b?
$u = (2,-1,0), v = (-1,2,-1), w = (0,-1,2), b = (1,0,0)$