Edit or run this notebook

Notebook 3 – Math 2121, Fall 2021

In today's notebook we'll try to get some feeling for vectors in R2 and R3 and their linear combinations. We'll also think about what a solution to a vector equation means. The code here involves a lot of new plotting functions in Julia.

17.2 Î¼s

Running this notebook (optional)

If you have Pluto up and running, you can access the notebook we are currently viewing by entering this link (right click -> Copy Link) in the Open from file menu in Pluto.

1.7 ms
457 Î¼s

Vectors in R2

Let's start out by drawing some vectors in R2.

8.7 Î¼s

Create some vectors in R2

u1 = v1 = w1 =

u2 = v2 = w2 =

131 ms

The vectors we created:

7.9 Î¼s
u = [   4]     v = [ -10]     w = [   2]
    [   8]         [   6]         [  -9]
3.1 ms

Display: u v w

13.9 ms
4.0 ms

The vector u is shown in blue, v in orange, and w in green.

The right hand graph shows the sum of the displayed vectors on the left as the solid arrow. The dotted arrows are just copies of u, v, and w moved around.

10.2 Î¼s

Linear combinations

Now that we have chosen some vectors u, v, w, let's think about the meaning of the linear combination au+bv+cw where a,b,c∈R are scalars.

23.3 Î¼s

Choose some scalars in R

a = b = c =

78.0 Î¼s

The scalars we chose:

4.6 Î¼s
a = 1     b = -1.4     c = 0
9.6 Î¼s
5.8 ms

Varying a among positive values scales the length of the arrow that represents the vector u.

If a is negative then this scalaing reverses the direction of u.

The same thing happens to the arrows representing v and w when we change b and c.

7.7 Î¼s

Vector equations

Let's now think of a,b,c as the variables x1=a and x2=b and x3=c.

Choose a target vector t=[t1t2]∈R2.

What does a solution to the equation x1u+x2v+x3w=t mean?

The solutions x=[x1x2x3] to this equation are the same as the solutions to the linear system whose augmented matrix is A=[u1v1w1t1u2v2w2t2].

8.5 Î¼s

Let's create a random target vector t.

5.2 Î¼s
target
2×1 Matrix{Float64}:
 -19.6
  11.3
5.6 Î¼s

Here's our coefficient matrix.

5.9 Î¼s
coefficient_matrix
2×3 Matrix{Int64}:
 4  -10   2
 8    6  -9
27.3 Î¼s
Loading...
ii
Loading...