Thursday, August 15, 2024

Vectors+ 09 Example of Hilbert Space: UNIZOR.COM - Math+ & Problems - Ve...

Notes to a video lecture on http://www.unizor.com

Vectors+ 09
Examples of Hilbert Spaces


Let's illustrate our theory of Hilbert spaces with a few examples.

Example 1

Consider a set V of all polynomials of real argument x defined on a segment [0,1].
It's a linear vector space with any polynomial acting as a vector in this space because all the previously mentioned axioms for an abstract vector space are satisfied:
(A1) Addition of any two polynomials a(x) and b(x) is commutative
a(x),b(x)V: a(x) + b(x) = b(x) + a(x)
(A2) Addition of any three polynomials a(x), b(x) and c(x) is associative
a(x),b(x),c(x)V: [a(x)+b(x)]+c(x) =
= a
(x)+
[b(x)+c(x)]
(A3) There is one polynomial that is equal to 0 for any argument in segment [0,1] called null-polynomial, denoted 0(x) (that is, 0(x)=0 for any x of a domain [0,1]), with a property of not changing the value of any other polynomial a(x) if added to it
a(x)V: a(x) + 0(x) = a(x)
(A4) For any polynomial a(x) there is another polynomial called its opposite, denoted as −a(x), such that the sum of a polynomial and its opposite equals to null-polynomial (that is a polynomial equaled to zero for all arguments)
a(x)V−a(x)V: a(x)+(−a(x))=0(x)

(B1) Multiplication of any scalar (element of a set of all real numbers) α by any polynomial a(x) is commutative
a(x)V, ∀real α: α·a(x) = a(x)·α
(B2) Multiplication of any two scalars α and β by any polynomial a(x) is associative
a(x)V, ∀real α,β:
(α·β)·a(x) = α·(β·a(x))
(B3) Multiplication of any polynomial by scalar 0 results in null-polynomial
a(x)V: 0·a(x) = 0(x)
(B4) Multiplication of any polynomial by scalar 1 does not change the value of this polynomial a(x)
a(x)V: 1·a(x) = a(x)
(B5) Multiplication is distributive relatively to addition of polynomials. ∀a(x),b(x)V, ∀real α:
α·(a(x)+b(x)) = α·a(x)+α·b(x)
(B6) Multiplication is distributive relatively to addition of scalars.
a(x)V, ∀real α,β: (α+β)·a(x) = α·a(x)+β·a(x)

Let's define a scalar product of two polynomials as an integral of their algebraic product on a segment [0,1].
To differentiate a scalar product of two polynomials from their algebraic product under integration we will use notation [a(x)·b(x)] for a scalar product.
[a(x)·b(x)] = [0,1] a(x)·b(x) dx

This definition of a scalar product satisfies all the axioms we set for a scalar product in an abstract vector space.
(1) For any polynomial a(x) from V, which is not a null-polynomial, its scalar product with itself is a positive real number
a(x)V, a(x)≠0(x):
[0,1] a(x)·a(x) dx > 0
(2) For null-polynomial 0(x) its scalar product with itself is equal to zero
[0,1] 0(x)·0(x) dx = 0
(3) Scalar product of any two polynomials a(x) and b(x) is commutative because an algebraic multiplication of polynomials is commutative
a(x),b(x)V:
[0,1] a(x)·b(x) dx = [0,1] b(x)·a(x) dx
(4) Scalar product of any two polynomials a(x) and b(x) is proportional to their magnitude
a(x),b(x)V, for any real γ:
[0,1] ·a(x))·b(x) dx =
= γ·[0,1] a(x)·b(x) dx
(5) Scalar product is distributive relatively to addition of polynomials. ∀a(x),b(x),c(x)V:
[0,1](a(x)+b(x))·c(x) dx=
= [0,1] a(x)·c(x) dx + [0,1] b(x)·c(x) dx

Based on above axioms that are satisfied by polynomials with scalar product defined as we did, we can say that this set is pre-Hilbert space.
The only missing part to be a complete Hilbert space is that this set does not contain limits to certain sequences.
Indeed, we can approximate many smooth non-polynomial functions with sequences of polynomials (recall, for example, Taylor series).

However, the Cauchy-Schwartz-Bunyakovsky inequality was proven for any abstract vector space with scalar product (pre-Hilbert space), and we can apply it to our set of polynomials.
According to this inequality, the following is true for any pair of polynomials:
[a(x)·b(x)]² ≤ [a(x)·a(x)]·[b(x)·b(x)]
or, using our explicit definition of a scalar product,
[[0,1] a(x)·b(x) dx]² ≤
≤ [[0,1] (x) dx]·[[0,1] (x) dx]

Just out of curiosity, let's see how it looks for a(x)=xm and b(x)=xn.
In this case
a(x)·b(x) = xm+n
a²(x) = x2m
b²(x) = x2n
Calculating all the scalar products
[0,1] x(m+n) dx = 1/(m+n+1)
[0,1] x2m dx = 1/(2m+1)
[0,1] x2n dx = 1/(2n+1)
Now the Cauchy-Swartz-Bunyakovsky inequality looks like
1/(m+n+1)² ≤ 1/[(2m+1)(2n+1)]

The validity of this inequality is not obvious, so it would be nice to check if it's really true for any m and n.
To check it, let's transform it into an equivalent inequality between denominators with reversed sign of inequality
(m+n+1)² ≥ (2m+1)(2n+1)
Opening all the parenthesis leads us to this equivalent inequality
m²+n²+1+2mn+2m+2n ≥
≥ 4mn+2m+2n+1

After obvious simplification the resulting inequality looks like
m²+n²−2mn ≥ 0
which is always true because the left side equals to (m−n.
All transformations were invariant and reversible, which proves the original inequality.


Example 2

Elements of our new vector space are infinite sequences of real numbers {xn} (n changes from 1 to ∞) for which series Σn∈[1,∞) xn² converges to some limit.

Addition and multiplication by a scalar are defined as addition and multiplication individual members of the sequences involved.
These operations preserve the convergence of sum of squares of elements.

Scalar product is defined as
{xn}·{yn} = Σn∈[1,∞) xn·yn
In some sense this is an expansion of N-dimensional Euclidean space to infinite number of dimensions, as long as a scalar product is properly defined, which in our case is assured because of convergence of the sum of squares of the elements.
Indeed, this definition makes sense because each member of a sum that defines a scalar product is bounded
|xn·yn| ≤ ½(xn² + yn²)
and the sum of right side of this inequality for all n∈[1,∞) converges.

This set is Hilbert space (we skip the proof that this space is complete for brevity), its properties are very much the same as properties of N-dimensional Euclidean space.
All the axioms of Hilbert space are satisfied.
As a consequence, the Cauchy-Shwartz-Bunyakovsky inequality is [{xn}·{yn}]² ≤ [{xn}·{xn}]·[{yn}·{yn}]

Problem A

Given a set of all real two-dimensional vectors (a1,a2) with standard definitions of addition and multiplication by a scalar (real number)
(a1,a2) + (b1,b2) = (a1+b1,a2+b2)
λ·(a1,a2) = (λ·a1,λ·a2)
So, it's a linear vector space.

The scalar product we will define in a non-standard way:
(a1,a2)·(b1,b2) =
= a1·b1 + 2·a1·b2 + 2·a2·b1 + a2·b2


Is this vector space a Hilbert space?

Hint A
Check if a scalar product of some vector by itself is zero, while the vector is not a null-vector.

Solution A
Let's examine all vectors that have the second component equal to 1 and find the first component x, which breaks the rule of scalar product of a vector with itself to be positive, unless the vector is a null-vector
(x,1)·(x,1) = 0

According to our non-standard definition of a scalar product, this means the following for a1=b1=x and a2=b2=1
x·x + 2·x·1 + 2·1·x + 1·1 = 0
x² + 4·x + 1 = 0
x1 = −2 + √3
x2 = −2 − √3
So, both vectors (x1,1) and (x2,1) have the property that the scalar product of a vector by itself gives zero, while the vectors themselves are not null-vectors.
Indeed, for vector (x1,1) this scalar product with itself is
(x1,1)·(x1,1) = (−2+√3,1)·(−2+√3,1) =
= (4−4√3+3)+4·(−2+√3)+1 = 0

Therefore, thus defined scalar product does not satisfy the axiom for a scalar product in Hilbert space, and our space is not Hilbert's.

Problem B

Prove the parallelogram law in Hilbert space V
a,bV:
||a−b||² + ||a+b||² = 2||a||² + 2||b||²

Note B
For vectors in two-dimensional Euclidean space this statement geometrically mean that sum of squares of two diagonals in a parallelogram equals to sum of squares of all its sides.
The parallelogram law can be proven geometrically in this case, using, for example, the Theorem of Cosines.

Hint B
The definition of a norm or magnitude of a vector x in Hilbert space is
||x|| = √(x·x)
Using this, all you need to prove the parallelogram law is to open parenthesis is the magnitudes of a−b and a+b.

Saturday, August 10, 2024

Vectors+ 08 Hilbert Space: UNIZOR.COM - Math+ & Problems - Vectors

Notes to a video lecture on http://www.unizor.com

Vectors+ 08 - Hilbert Space

Let's continue building our abstract theory of vector spaces introduced in the previous lecture Vectors 07 of this Vectors chapter of this course Math+ & Problems on UNIZOR.COM.

Our next addition is a scalar product of two elements of an abstract vector space.
In case of N-dimensional Euclidian space with two vectors
R(R1,R2,...,RN) and
S(S1,S2,...,SN)
we defined scalar product as
R·S = R1·S1+R2·S2+...+RN·SN

Thus defined, the scalar product had certain properties and characteristics that we have proven based on this definition.
In case of abstract vectors spaces, the scalar product is not explicitly defined, but, instead, defined as any function of two vectors from our vector space that satisfies certain axioms that resemble the properties and characteristics of a scalar product of two vectors in N-dimensional Euclidian space.

Let's assume, we have a vector space V and a scalar space S associated with it - a set of all real numbers in our case.
All axioms needed for V and S to be a vector space were described in the previous lecture mentioned above.
Now we assume that for any two vectors a and b from V there exists a real number called their scalar product denoted a·b that satisfies the following set of axioms.

(1) For any vector a from V, which is not a null-vector, its scalar product with itself is a positive real number
aV, a≠0: a·a > 0
(2) For null-vector 0 its scalar product with itself is equal to zero
a=0: a·a = 0
(3) Scalar product of any two vectors a and b is commutative
a,bV: a·b = b·a
(4) Scalar product of any two vectors a and b is proportional to their magnitude
a,bV, ∀γS: (γ·a)·b = γ·(a·b)
(5) Scalar product is distributive relatively to addition of vectors. ∀a,b,cV: (a+b)·c = a·c+b·c

As before, a square root from a scalar product of a vector by itself will be called magnitude or length, or norm of this vector
||a|| = √(a·a)

Using the above defined scalar product, we can define a distance between vectors a and b as an absolute value of a magnitude of vector a+(−b), which we will write as a−b.
||a−b|| = √(a−b)·(a−b)

A vector space with a scalar product defined above is called a pre-Hilbert space.

To be a Hilbert space, we need one more condition - the completeness of vector space, which means that every converging in a certain way sequence of vectors has a vector that is the limit of this sequence within the same vector space.
More rigorously, the convergence is defined in terms of Cauchy criterion. It states that a sequence of vectors {ai} converges if
for any ε>0 there is a natural number N such that the distance between am and an is less than ε for any m,n ≥ N
ε>0N: m,n > N => ||am−an||<ε


Problem A
Prove that a scalar product of null-vector with any other is zero.

Proof A
aV: 0·a = (0·a)·a = 0·(a·a) = 0
End of proof.


Problem B
Prove that a scalar product changes the sign, if one of its components is replaced with its opposite.

Proof B
[Problem C from the previous lecture Vectors 07 stated that −a=−1·a]
a,bV: (−a)·b = (−1·a)·b = −1·(a·b)
End of proof.


Problem C
Prove the Cauchy-Schwartz-Bunyakovsky inequality
a,bV: (a·b)² ≤ (a·a)·(b·b).

Proof C
If either a or b equals to null-vector, we, obviously, get zero on both sides of inequality, which satisfies the sign .
Assume, both vectors are not-null.
Consider any non-zero γ and non-negative scalar product of a+γb by itself
0 ≤ (a+γ·b)·(a+γ·b)
Use commutative and distributive properties to open all parenthesis
0 ≤ a·a+·a·b+γ²·b·b
Set γ=−(a·b)/[(b·b)]
With this the inequality above takes form
0 ≤ a·a−2·(a·b)²/(b·b)+(a·b)²/(b·b)
Multiplying this inequality by a positive b·b, we obtain
0 ≤ (a·a)·(b·b)−2·(a·b)²+(a·b)²
which transforms into
(a·b)² ≤ (a·a)·(b·b)
End of proof.

Thursday, August 8, 2024

Vectors+ 07 Abstract Vector Space: UNIZOR.COM - Math+ & Problems - Vectors

Notes to a video lecture on http://www.unizor.com

Vectors+ 07 - Abstract Vector Space

This lecture represents a typical mathematical approach to move from a relatively simple and concrete object to some abstraction that allows to transfer properties of the original simple object to many others without proving these properties for each particular case.

Let's start with a simple prototype - a two-dimensional Euclidian plane with coordinates and vectors we studied before. Coordinates are real numbers, vectors can be added to each other and multiplied by a real numbers resulting in some other vector.

Our first step towards abstraction was to move to N-dimensional space, which retains most of the properties of two-dimensional one. However, this is not the exact step towards abstraction, because we still considered a concrete object - an N-dimensional space and demonstrated its properties.

The real abstraction is to choose any object that satisfies certain axioms and derive the properties from these axioms without referring to any concrete object.
Here is what can be done in this direction.

First of all, we introduce an abstract set V, whose elements will be called vectors. It's modelled after an N-dimensional Euclidean space as a prototype, but, in theory, it can be any set satisfying the rules below.

We also consider a set S, whose elements will be called scalars. Its prototype is a set of all real numbers used for multiplication by vectors to change their magnitude, and for our purposes, to concentrate attention on vectors, we will consider this set of scalars to be exactly that, a set of all real numbers. However, it can be some other set, like all complex numbers.

We postulate that these sets satisfy the following rules.

(A) The operation of addition is defined for each pair of vectors in V that establishes a correspondence of this pair of vectors to a new vector called their sum. What's important, we don't define this operation, we don't establish any process it should follow. The only requirement is that this operation must satisfy the following axioms.
(A1) Addition of any two vectors a and b is commutative
a,bV: a + b = b + a
(A2) Addition of any three vectors a, b and c is associative
a,b,cV: (a + b) + c = a + (b + c)
(A3) There is one vector called null-vector, denoted 0, with a property of not changing the value of any other vector a if added to it
aV: a + 0 = a
(A4) For any vector a there is another vector called its opposite, denoted as −a, such that the sum of a vector and its opposite equals to null-vector
aV ∃(−a)∈V: a + (−a) = 0
Note: in many cases an expression a+(−b) will be shortened to a−b. Sign '−' here does not mean a new operation of subtraction, but just an indication of addition with an opposite element.

(B) The operation of multiplication of vector by scalar is defined for each vector in V and each scalar in S, taken in any order. This operation establishes a correspondence of this vector and this scalar to a new vector called the product of a vector and a scalar.
This operation must satisfy the following axioms.
(B1) Multiplication of any scalar α by any vector a is commutative
aV, ∀αS: α·a = a·α
(B2) Multiplication of any two scalars α and β by any vector a is associative
aV, ∀α,βS: (α·β)·a = α·(β·a)
(B3) Multiplication of any vector by scalar 0 results in null-vector
aV: 0·a = 0
(B4) Multiplication of any vector by scalar 1 does not change the value of this vector a
aV: 1·a = a
(B5) Multiplication is distributive relatively to addition of vectors. ∀a,bV, ∀αS: α·(a+b) = α·a+α·b
(B6) Multiplication is distributive relatively to addition of scalars.
aV, ∀α,βS: (α+β)·a = α·a+β·a


Problem A
Prove that there must be only one null-vector in vector space V.

Proof A
Assume there are two null-vectors 01 and 02.
Since 02 is null-vector, its addition to 01 does not change 01.
01 + 02 = 01
Since 01 is null-vector, its addition to 02 does not change 02.
02 + 01 = 02
Since addition is commutative, left sides in the two equations above are equal.
01 + 02 = 02 + 01
Therefore, the right sides are equal:
01 = 02
End of proof.


Problem B
Prove that for any vector there must be only one opposite to it vector in vector space V.

Proof B
Assume that for some vector a there are two opposite vectors (−a)1 and (−a)2.
Since (−a)1 is an opposite to vector a, its addition to a results in null-vector.
Therefore,
((−a)1+a) + (−a)2 = 0 + (−a)2 = (−a)2
Since (−a)2 is an opposite to vector a, its addition to a results in null-vector.
Therefore,
(−a)1 + (a+(−a)2) = (−a)2 + 0 = (−a)2
Since addition is associative, left sides in the two equations above are equal.
Therefore, the right sides are equal:
(−a)1 = (−a)2
End of proof.


Problem C

Prove that for any vector its product with scalar −1 results in an opposite vector.

Proof C
Since vector multiplication by scalar is distributive,
(1+(−1))·a = 1·a + (−1)·a = a + (−1)·a
On the other hand, the same initial statement can be transformed differently
(1+(−1))·a = 0·a = 0
Since left sides in the two equations above are equal, right sides are equal as well
a + (−1)·a = 0
Therefore, (−1)·a satisfies the definition of a vector opposite to a. But, as has been proven in Problem B, there must be only one vector opposite to a, which we denoted as (−a).
Hence, (−1)·a = (−a)
End of proof.

Tuesday, August 6, 2024

Vectors+ 06 More N-vectors: UNIZOR.COM - Math+ &Problems - Vectors

Notes to a video lecture on http://www.unizor.com

Vectors+ 06
Cauchy-Schwarz-Bunyakovsky Inequality


This inequality is also known as Cauchy-Bunyakovsky or Cauchy-Schwarz inequality.
We will consider this inequality only for a case of N-dimensional real vectors, where it states that scalar product of two vectors is less or equal to a product of their magnitudes
R·S ≤ ||R||·||S||
In terms of components,
R (R1,R2,...,RN)
S (S1,S2,...,SN)
R·S = R1·S1+R2·S2+...+RN·SN
||R|| = √R1²+R2²+...+RN²
||S|| = √S1²+S2²+...+SN²
To prove the above inequality, it is sufficient to prove it for squares of both left and right parts, since the right part is always positive, while the left (smaller or equal) can take negative values as well. This allows to get rid of the square roots.

Let's prove that
(R·S)² ≤ (||R||·||S||)²
In coordinate form we have to prove that
(R1·S1+R2·S2+...+RN·SN)² ≤
(R1²+R2²+...+RN²)·(S1²+S2²+...+SN²)


Proof
Consider a quadratic polynomial for an unknown variable x
P(x) = (R1·x+S1)²+(R2·x+S2)²+...
...+(RN·x+SN

This quadratic polynomial is, obviously, non-negative, as it contains only non-negative components added together.
This same polynomial can be regrouped by opening parenthesis and presented as
P(x) = (R1²+R2²+...+RN²)· +
+ 2·(R1·S1+R2·S2+...+RN·SNx +
+ (S1²+S2²+...+SN²) =
= A + Bx + C

where
A = ||R||²
B = 2·R·S
C = ||S||²
In order to have a non-negative polynomial, its necessary and sufficient to have its discriminant to be non-positive.
Therefore,
B²−4·A·C ≤ 0
(2·R·S)² − 4·||R||²·||S||² ≤ 0
(R·S)² ≤ ||R||²·||S||²
End of Proof.


Consequences

1. Triangle inequality
Triangle inequality deals with a magnitude of three vectors R, S and their sum R+S that completes a triangle in N-dimensional space.
In particular, the Triangle inequality states that in any triangle sum of two sides as greater or equal than the third one.
As we know,
||R+S||² = (R+S)·(R+S) =
= R·R + S·S + 2·R·S
[applying the Cauchy-Schwartz inequality to the third term]
≤ ||R||² + ||S||² +2·||R||·||S|| =
= (||R||+||S||)²

Therefore, ||R+S|| ≤ ||R||+||S|| which is the Triangle inequality.

2. The cosine between vectors
We have defined a cosine of the angle between vectors R and S in N-dimensional space as
cos(φ) = R·S/(||R||·||S||).
Because of the Cauchy-Schwartz inequality the above expression is always between −1 and 1 and, therefore, can be a cosine of some angle. So, our definition of an angle in N-dimensional space makes total sense.

Monday, August 5, 2024

Vectors+ 05 More about N-vectors: UNIZOR.COM - Math+ & Problems - Vectors

Notes to a video lecture on http://www.unizor.com

Vectors+ 05
More N-dimensional Vectors


Theory

Let's summarize the characteristics of N-dimensional vectors.
First of all an N-dimensional vector is an ordered set of N real numbers (R1,R1,...,RN) that we will use as a single object R.
Real numbers Rn where n∈[1,N] will be referred as components of R.
Unless specifically noted, we will assume that the word vector in this lecture means N-dimensional vector.

1. Addition
Any two vectors can be added together giving another vector according to a simple rule
R (R1,R2,...,RN) + S (S1,S2,...,SN) =
= T
(R1+S1,R2+S2...,RN+SN,)
Addition of vectors is, obviously, commutative. It follows from the commutative property of the addition of real numbers.
R + S = S + R because
Rn + Sn = Sn + Rn
for n∈[1,N]
Also, addition of vectors is associative. It follows from the associative property of the addition of real numbers.
(R + S) + T = R + (S + T) because
(Rn + Sn) + Tn = Rn + (Sn + Tn)
for n∈[1,N]

2. Null-vector
Vector 0 (0,0,...,0) plays the same role for vector addition as real number 0 with other real numbers, namely, adding null-vector to any vector does not change that vector
R + 0 = 0 + R = R
which directly follows from the rules of addition of vectors and properties of real number 0.
For any non-null vector
R (R1,R2,...,RN)
there is an opposite vector with the signs of all components reversed
R (−R1,−R2,...,−RN)
that, if added to R, results in a null-vector sum
R + (R) = 0

3. Multiplication by a scalar
Any vector can be multiplied by a scalar, which is defined as all components of this vector to be multiplied by this scalar.
R (R1,R2,...,RN)·f = T (R1·f,R2·f...,RN·f)
Analogously, multiplication of a scalar by a vector is
f·R (R1,R2,...,RN) = T (f·R1,f·R2...,f·RN)
which, obviously, is the same as multiplication of a vector by a constant because of commutative properties of multiplication of real numbers.

4. Scalar (dot) product of two vectors
Any two vectors can form a scalar product giving a scalar according to a simple rule
R (R1,R2,...,RN) · S (S1,S2,...,SN) =
= R1·S1+R2·S2+...+RN·SN

Obviously, it's commutative because of commutative properties of multiplication of real numbers.

5. Magnitude of a vector
For any vector
R (R1,R2,...,RN)
we define its magnitude (length) ||R|| in a way to be similar to 2- and 3- dimensional cases:
||R|| = (R·R) = √R1²+R2²+...+RN².

6. Orthogonality
We will call two vectors orthogonal to each other, if their scalar product is zero.

7. Basis
The following set of N vectors
i(1) (1,0,...,0)
i(2) (0,1,...,0)
...
i(N) (0,0,...,1)
consists of mutually orthogonal vectors of unit length.
This directly follows from the definitions of scalar product and magnitude of vectors.
Indeed,
i(m)·i(n) = 0 for m,n∈[1,N] and m≠n
(i(m)·i(m)) = 1 for each m∈[1,N]
They are called unit vectors.
These unit vectors form orthogonal basis because any vector
R (R1,R2,...,RN)
can be represented as the linear combination of these unit vectors
R = R1·i(1) + R2·i(2) +...+ RN·i(N)

8. Angle
For two-dimensional vectors
U ·V = u·v·cos(φ)
where u is the magnitude of vector U,
v is the magnitude of vector V and
φ is the angle between them in any direction since cos(φ)=cos(−φ).
Accordingly, as explained in the previous lecture, we define an angle between two N-dimensional vectors as
cos(φ) = (U·V)/(||U||·||V||)


Problem A

Prove that multiplication of a vector by a scalar is distributive.
That is,
(a) f·(R + S) = f·R + f·S
(b) (f + g)·R = f·R + g·R


Problem B

Prove that scalar product of two vectors is distributive.
That is,
R·(S + T) = R·S + R·T


Problem C

Two three-dimensional vectors are given
OA (2,3,4)
OB (−2,1,3)
Imagine a triangle in three-dimensional space ΔOAB formed by these two vectors and their difference:
OBOA = AB
Determine the lengths of three sides of this triangle, cosines of its angles and check the Theorem of Cosine in it.

Solution

According to definition of a difference of two vectors, vector AB is (−2−2,1−3,3−4)=(−4,−2,−1).

Now we can calculate all magnitudes.
OA = √2²+3²+4² = √29
OB = √(−2)²+1²+3² = √14
AB = √(−4)²+(−2)²+(−1)² = √21

Scalar products are
OA·OB =
=
2·(−2)+3·1+4·3 = 11

OA·AB =
=
2·(−4)+3·(−2)+4·(−1) = −18

OB·AB =
=
(−2)·(−4)+1·(−2)+3·(−1) = 3


Before calculating the cosines of angle of ΔOAB let's draw this triangle in the plane it belongs to.
We have calculated its sides, so it should look like this

Angle ∠AOB is an angle between vectors OA and OB.
cos(∠AOB) = (OA·OB)/(OA·OB) =
= 11/√(29·14)


Angle ∠OAB is NOT an angle between vectors OA and AB. It is, actually, an angle between vectors AO (opposite to OA, the vector of the same length but opposite direction) and AB.
The vector AO, as opposite to OA(2,3,4), is a set of real values (−2,−3,−4) and, therefore, its scalar product with AB is
AO·AB =
=
(−2)·(−4)+(−3)·(−2)+(−)4·(−1) =
= 18

Therefore,
cos(∠OAB) = (AO·AB)/(AO·OB) =
= 18/√(29·21) = 18/√(29·21)


Angle ∠OBA is vertical (and, therefore, equal) to an angle between vectors OB and AB.
cos(∠OBA) = (OB·AB)/(OB·AB) =
= 3/√(14·21)


Let's check the Theorem of Cosines.

AB²=OA²+OB²−OA·AB·cos(∠AOB) =
= 29 + 14 − 2·√(29·14)·11/√(29·14) =
= 29 + 14 − 22 = 21
∴ CORRECT

OA²=OB²+AB²−OB·AB·cos(∠OBA) =
= 14 + 21 − 2·√(14·21)·3/√(14·21) =
= 14 + 21 − 6 = 29
∴ CORRECT

OB²=OA²+AB²−OA·AB·cos(∠OAB) =
= 29 + 21 − 2·√(29·21)·18/√(29·21) =
= 29 + 21 − 36 = 14
∴ CORRECT

Thursday, August 1, 2024

Vectors+ 04 - N-dimensional Vectors: UNIZOR.COM - Math+ & Problems - Vec...

Notes to a video lecture on http://www.unizor.com

Vectors+ 04
N-dimensional Vectors


Theory

1. A single real number R can be represented as a point A on a straight coordinate line having some fixed point O called the origin, unit of measurement and a particular direction from point O chosen as positive.
In this case point A is defined so that its distance from the origin O equals to |R| in chosen units of measurement and the sign of R corresponding to a defined positive or negative direction from the origin.
At the same time this number R can be represented as a vector that stretches along the coordinate line from one point to another having the magnitude of absolute value |R| and the direction corresponding to a defined positive or negative direction from the origin.
So, a single real number R is represented as a point A on a coordinate line or as a vector R on this line.
All these representations of a single real number we call one-dimensional.
In the vector representation real number R=1 can be represented by a vector from the origin of coordinates O to point on a distance of 1 unit of measurement in a positive direction. We will call this vector a unit vector i.
If we stretch vector i by a factor of R, taking in consideration the correspondence between the sign of R and direction on a line, we will reach point A.
That's why we can state
R = R·i

2. A pair of two real numbers (R1,R2) can be represented as a point A on a coordinate plane with some fixed point O called the origin of coordinates, two perpendicular lines with chosen positive direction on each going through the origin O called abscissa and ordinate with some unit of measurement along these lines.
In this case point A is defined so that
(a) its distance from the ordinate along a line parallel to the abscissa equals to |R1| in chosen units of measurement and the sign of R1 corresponding to a defined positive or negative direction along the abscissa;
(b) its distance from the abscissa along a line parallel to the ordinate equals to |R2| in chosen units of measurement and the sign of R2 corresponding to a defined positive or negative direction along the ordinate.
At the same time this pair of numbers (R1,R2) can be represented as a vector that stretches from the origin of coordinate to point A defined above or any other vector on a plane with the same magnitude and direction.
So, a pair of real numbers (R1,R2) is represented as a point A on a coordinate plane or as a vector R from the origin O to point A, or any other vector of the same magnitude and direction.
All these representations of a pair of real numbers we call two-dimensional.

In the vector representation a pair of real numbers (R1=1,R2=0) is represented by vector from the origin along the abscissa to point I1 on a distance of 1 unit of measurement in a positive direction. We will call this vector a abscissa unit vector i.
Similarly, the vector representation a pair of real numbers (R1=0,R2=1) is represented by vector from the origin along the ordinate to point I2 on a distance of 1 unit of measurement in a positive direction. We will call this vector an ordinate unit vector j.
If we stretch vector i by a factor of R1, taking in consideration the correspondence between the sign of R1 and direction on the abscissa, and similarly stretch vector j by a factor of R2 and add these two vectors by the rules of addition of vectors, we will reach point A.
That's why we can state
R = R1·i + R2·j
which is a representation of vector R through unit vectors i and j and coordinates R1 and R2.

Using the above representation of a vector, it's easy to derive a formula for a scalar product of two two-dimensional vectors.
R = R1·i + R2·j
S = S1·i + S2·j
R·S = R1·S1·(i·i) + R1·S2·(i·j) +
+
R2·S1·(j·i) + R2·S2·(j·j)


According to definition of a scalar product, (i·i)=1, (i·j)=0, (j·i)=0, (j·j)=1
Therefore, R·S = R1·S1 + R2·S2

Perpendicularity of vectors R and S can be checked by examining the coordinate expression for their scalar product R1·S1+R2·S2. If it's equal to zero, the vectors are perpendicular to each other.

A cosine of an angle φ between two two-dimensional vectors can be determined as
cos(φ) = (R·S) / (|R|·|S|)
where in numerator we use scalar product of two vectors and in denominator - a product of their magnitudes.

3. Exactly as in a previous two-dimensional case, we can represent a triplet of real numbers (R1,R2,R3) as a point A in the three-dimensional space, a vector R from the origin of coordinates to that point or as a vector sum of three mutually perpendicular vectors, each positioned along one of the coordinate axes
R = R1·i + R2·j + R3·k
where i, j and k are unit vectors along three mutually perpendicular axes of coordinates.

Using the above representation of a vector, it's easy to derive a formula for a scalar product of two three-dimensional vectors.
R = R1·i + R2·j + R3·k
S = S1·i + S2·j + S3·k
R·S = R1·S1 + R2·S2 + R3·S3

Perpendicularity of vectors R and S can be checked by examining the coordinate expression for their scalar product R1·S1+R2·S2+R3·S3. If it's equal to zero, the vectors are perpendicular to each other.

A cosine of an angle φ between two two-dimensional vectors can be determined as
cos(φ) = (R·S) / (|R|·|S|)
where in numerator we use scalar product of two vectors and in denominator - a product of their magnitudes.

4. Now we will generalize the same concept to N-dimensional case.
An ordered set of N real numbers (R1,R2,...,RN) we will call an N-dimensional vector, which can be interpreted as a point in N-dimensional coordinate space.
An important operations on vectors known from 2- and 3-dimensional cases can be easily expanded to N-dimensional case:

(a) Addition of two N-dimensional vectors resulting in a new N-dimensional vector:
R(1) + R(2) = R(2) + R(1) = R
(R1(1),...,RN(1)) + (R1(2),...,RN(2)) =
= (R1(1)+R1(2),...,RN(1)+RN(2))

(b) Multiplication of an N-dimensional vector by a real number q resulting in a new N-dimensional vector:
q·R = R·q = S
q·(R1,...,RN) = (q·R1,...,q·RN)

(c) Scalar (dot) product of two N-dimensional vectors resulting in a scalar:
R(1) · R(2) = R(2) · R(1) = C
(R1(1),...,RN(1)) · (R1(2),...,RN(2)) =
= R1(1)·R1(2)+...+RN(1)·RN(2) = C

(d) N-dimensional Angle
If a scalar product of two N-dimensional vectors R(1) and R(2) equals to zero, they are called perpendicular to each other.
In general, an angle φ between these two N-dimensional vectors can be defined as
cos(φ) = (R(1)·R(2)) / (|R(1)|·|R(2)|)
where in numerator we use scalar product of two vectors and in denominator - a product of their magnitudes.

(e) Linear dependency
Certain number K of N-dimensional vectors R(1),...,R(K) is called linearly dependent if there are K multipliers q1,...,qK, not all of which are equal to zero, such that
q1·R(1)+...+qK·R(K) = 0
where 0 is a null-vector - an N-dimensional vector with all components zero.
The negation of linear dependency is linear independency.


Problem A

Prove that in N-dimensional space exists a set of N linearly independent vectors.

Solution A
We can prove the existence by suggesting a concrete set of vectors that satisfies the requirements of a problem.
Consider these N vectors in N-dimensional space
i(1) = (1,0,...,0),
i(2) = (0,1,...,0),
...
i(N) = (0,0,...,1)
They are linearly independent.
Indeed, assume there exist multipliers q1,...,qK, not all of which are equal to zero, such that
q1·i(1)+...+qN·i(N) = 0
But expression on the left is vector
S = (q1,...,qN)
So, if it's equal to null-vector, all components are zero, which contradicts the assumption about linear dependency of these vectors.
Hence, these N vectors are linearly independent.


Problem B

Represent any vector in N-dimensional space as a linear combination of the set of linearly independent N vectors presented in the solution of the previous problem.

Solution B
Take any N-dimensional vector R = (R1,...,RN)
and set of linearly independent N-dimensional vectors
i(1) = (1,0,...,0),
i(2) = (0,1,...,0),
...
i(N) = (0,0,...,1)
It is obvious that
R = R1·i(1)+R2·i(2)+...+RN·i(N)


Problem C

R(1), R(2),... ,R(N) are N linearly independent vectors in N-dimensional vector space, where for each k∈[1,N] vector R(k) is a set of real numbers (R1(k),R2(k),...,RN(k)).
Represent any vector V(V1,V2,...,VN) in this N-dimensional space as a linear combination of these vectors R(k), where k∈[1,N].

Solution C

We are looking for a representation that in vector form looks like
V = x1·R(1) + x2·R(2) +...+ xN·R(N)
where for k∈[1,N] all xk are unknown real numbers.
Let's state this equation in coordinate form
V1 = R1(1)·x1+R1(2)·x2+...+R1(N)·xN
V2 = R2(1)·x1+R2(2)·x2+...+R2(N)·xN
...
VN = RN(1)·x1+RN(2)·x2+...+RN(N)·xN
This system of linear equations has unique solution if the NN matrix of coefficients Ri(j) has a non-zero determinant. This was explained in the Math 4 Teens course on UNIZOR.COM (see Matrices part of the course, chapters Matrix Determinant and Matrix Solution).
Exactly the same criteria of non-zero determinant is a necessary and sufficient condition for a set of vectors to be linearly independent.
Since the linear independence of vectors R(1), R(2),... ,R(N) is given, the system of linear equations has a unique solution for unknown coefficients xi.

Answer C
From the coordinates of all N vectors R(j) (j∈[1,N]) and coordinates Vi (i∈[1,N]) of vector V construct a system of N linear equations.
It's solutions gives the coefficients xj we are looking for.

Definition

N linearly independent vectors in N-dimensional vector space are called basis, if any vector of this vector space can be represented as a linear combination of these N linearly independent vectors.
From the Problems A, B follows that a set of vectors
i(1) = (1,0,...,0),
i(2) = (0,1,...,0),
...
i(N) = (0,0,...,1)
is a basis.
So is a set of vectors R(1), R(2),... ,R(N) of Problem C.

Sunday, July 28, 2024

Vectors+ 03 - Direction Cosines: UNIZOR.COM - Math+ & Problems - Vectors

Notes to a video lecture on http://www.unizor.com

Vectors+ 03 - Direction Cosines

Problem A

Find three-dimensional vector V(v1,v2,v3) by its magnitude (modulus, length) l and three direction cosines of angles it forms with three axes of coordinates cos(α), cos(β) and cos(γ), where
α is an angle between V and X-axis,
β is an angle between V and Y-axis,
γ is an angle between V and Z-axis.

Solution A

Consider a unit vector along X-axis i(1,0,0).
Its scalar (dot) product with vector V(v1,v2,v3) is
V(v1,v2,v3i(1,0,0) = v1
On the other hand, this scalar product is equal to
V·i = |V|·|i|·cos(α) = l·cos(α)
Therefore,
v1 = l·cos(α)
Analogously, considering scalar product of vector V(v1,v2,v3) with unit vectors j(0,1,0) on Y-axis, we'll get
v2 = l·cos(β)
Similarly, considering scalar product of vector V(v1,v2,v3) with unit vectors k(0,0,1) on Z-axis, we'll get
v3 = l·cos(γ)


Problem B

A triangle on a coordinate plane is given by coordinates of its three vertices A(a1,a2), B(b1,b2), C(c1,c2).
Find point X(x1,x2) on segment AB that divides this segment in a ratio p/q.


Note B
Use vector algebra.

Solution B

Consider every segment on the picture above as a vector with a direction specified by the order of vertices used in notation.
For example, CA is a vector from vertex C to vertex A.
As a vector, its coordinates are (a1−c1,a2−c2).
Also, notice that vectors AX and XB are collinear, hence the ratio between the length of segment AX to the length of XB is the same as the ratio of vectors AX and XB.

Using this approach, we can form the following equations
CX = CA + AX
CX + XB = CB
AX = p·XB
The above system of three vector equations is a linear one and contains three unknown vectors: CX, AX and XB.

Simple transformations will immediately yield the solution.
Resolving the second equation for CX and substituting into the first one result in a system of two equations
CBXB = CA + AX
AX = p·XB

Using the last equation to express AX in terms of XB as AX = (p/q)·XB, we get a single linear equation with one unknown
CBXB = CA + (p/q)·XB

The solution for XB is
XB = (CBCA) / (1+p/q)

Expressing the above equation in coordinate form allows to find coordinates of point X(x1,x2).
b1−x1 = [(b1−c1) − (a1−c1)] / (1+p/q)
from which follows
x1 = b1[(b1−c1) − (a1−c1)] / (1+p/q)
or
x1 = [(p/q)·b1+a1] / (1+p/q)
or
x1 = (q·a1 + p·b1) / (p+q)
Analogously,
x2 = (q·a2 + p·b2) / (p+q)