Skip to main content

1.7 Generating set , basis and span

Generating set and span

Consider a vector space $\mathbb{V}=(V,+,\cdot)$ and set of vectors $A=\{x_1,\ldots,x_k\} \subseteq V$. If every vector $v \in V$ can be expressed as a linear combination of $x_1,\ldots,x_k$,$A$ is called a generating set of $V$.The set of all linear combination of vectors in $A$ is called the span of $A$.If $A$ spans the vector space $V$, we write $V=span[A]$ or $V=span[x_1,\ldots,x_k]$.

Generating sets are sets of vectors that span vector (sub)spaces, i.e.,every vector can be represented as a linear combination of the vectors in the generating set. Now, we will be more specific and characterize the smallest generating set that spans a vector (sub)space.

Basis

Consider a vector space $\mathbb{V}=(V,+,\cdot)$ and $A \subseteq V$. A generating set $A$of $V$ is called minimal if there exists no smaller set $\hat{A} \subseteq A \subseteq V$ that spans $V$.Every linearly independent generating set of $V$ is minimal and is called the basis of $V$.

Let $\mathbb{V}=(V,+,\cdot)$ be a vector space and $B \subseteq V, B \ne \phi$. Then the following statements are equivalent.

  • $B$ is a basis of $V$.
  • $B$ is a minimal generating set.
  • $B$ is a maximal linearly independent set of vectors in $V$ ,i.e; adding any other vector to this set will make it linearly dependent.
  • every vector $x \in V $ is a linear combination of vectors from $B$, and every linear combination is unique i.e, with

$x=\sum_{i=1}^{k} \lambda_ib_i= \sum_{i=1}^{k} \psi_ib_i$

and $\lambda_i,\psi_i \in \mathbb{R}, b_i \in B$ it follows that $\lambda_i=\psi_i,i=1,\ldots,k$.

Example:
In $\mathbb{R}^2$ the canonical standard basis are




Remark. Every vector space V possesses a basis B. The preceding examples show that there can be many bases of a vector space V , i.e., there is no unique basis. However, all bases possess the same number of elements,the basis vectors.

We only consider finite-dimensional vector spaces V . In this case, the dimension of V is the number of basis vectors of V , and we write dim(V ).
If $U \subseteq V $ is a subspace of V , then $dim(U) \le dim(V )$ and $dim(U) =dim(V)$ if and only if $U=V$.Intuitively, the dimension of a vector space can be thought of as the number of independent directions in this vector space.

A basis of a subspace $U = span[x_1\ldots x_m] \subseteq \mathbb{R}^n$ can be found
by executing the following steps:
1. Write the spanning vectors as columns of a matrix A
2. Determine the row-echelon form of A.
3. The spanning vectors associated with the pivot columns are a basis of U.

Example:

Since the pivot columns indicate which set of vectors is linearly independent,we see from the row-echelon form that $x_1, x_2,x_4$ are linearly independent.Therefore $\{x_1,x_2,x_4\}$ is a basis of $U$.

import sympy as sp
import numpy as np
row1=[1,2,3,-1]
row2=[2,-1,-4,8]
row3=[-1,1,3,-5]
row4=[-1,2,5,-6]
row5=[-1,-2,-3,1]
M = sp.Matrix((row1,row2,row3,row4,row5))
print("Coefficient Matrix")
display(M)
print(" Echelon Form")
display(M.echelon_form())

O/P
Coefficient Matrix
$\displaystyle \left[\begin{matrix}1 & 2 & 3 & -1\\2 & -1 & -4 & 8\\-1 & 1 & 3 & -5\\-1 & 2 & 5 & -6\\-1 & -2 & -3 & 1\end{matrix}\right]$
Echelon Form
$\displaystyle \left[\begin{matrix}1 & 2 & 3 & -1\\0 & -5 & -10 & 10\\0 & 0 & 0 & -5\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right]$


Example:( University question)
A set of $n$ linearly independent vectors in $\mathbb{R}^n$ forms a basis. Does the set of vectors $(2, 4,−3),(0, 1, 1),(0, 1,−1)$ form a basis for $\mathbb{R}^3$? Explain your reasons.

Lets find out whether these vectors form a linear independent set

$\begin{bmatrix}
2 & 0 & 0\\
4 &1 & 1\\
-3 & 1 & -1
\end{bmatrix}$

$R_1=R_1/2$
$\begin{bmatrix}
1 & 0 & 0\\
4 &1 & 1\\
-3 & 1 & -1
\end{bmatrix}$

$R_2=R_2-4R_1, R_3=R_3+3R_1$
$\begin{bmatrix}
1 & 0 & 0\\
0 & 1 & 1\\
0 & 1 & -1
\end{bmatrix}$

$R_3=R_3-R_2, R_3=R_3/-2$
$\begin{bmatrix}
1 & 0 & 0\\
0 & 1 & 1\\
0 & 0 & 1
\end{bmatrix}$

$R_2=R_2-R_3$
$\begin{bmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 1
\end{bmatrix}$

It is noted that the three vectors are linearly independent and hence form the basis in $\mathbb{R}^3$

Determine the basis for a vector space $U \subseteq R^3$ spanned by the vectors (university question)
$x1=\begin{bmatrix}
1\\
0\\
1
\end{bmatrix} x2= \begin{bmatrix}
-1\\
2\\
1\end{bmatrix}x3=\begin{bmatrix}
0\\
1\\
1\end{bmatrix}$
Represent these vectors as column of a matrix and perform row reduction. The pivot columns indicate linearly independent vectors and they form the basis of the vector space.
$\begin{bmatrix}
1 & -1 & 0\\
0 & 2 & 1\\
1 & 1 & 1
\end{bmatrix}$
 
$R3=R3-R1$ 
$\begin{bmatrix}
1 & -1 & 0\\
0 & 2 & 1\\
0 & 2  & 1
\end{bmatrix}$
 
$R3=R3-R2$ 
$\begin{bmatrix}
1 & -1 & 0\\
0 & 2 & 1\\
0 & 0  & 0
\end{bmatrix}$
 
 
$R1=R1+R2$ 
$\begin{bmatrix}
1 & 1 & 1\\
0 & 2 & 1\\
0 & 0  & 0
\end{bmatrix}$
 
$R2=R2/2$ 
$\begin{bmatrix}
1 & 1 & 1\\
0 & 1 & 1/2\\
0 & 0  & 0
\end{bmatrix}$
 
 
$R1=R1-R2$ 
$\begin{bmatrix}
1 & 0 & 1/2\\
0 & 1 & 1/2\\
0 & 0  & 0
\end{bmatrix}$
 It is notes that the first two columns are the pivot columns. The third vector can be represented as the linear combination of the first two vectors. So the basis is

$Basis=\begin{bmatrix}
1\\
0\\
1
\end{bmatrix} \begin{bmatrix}
-1\\
2\\
1\end{bmatrix}$
 

Comments

Popular posts from this blog

Mathematics for Machine Learning- CST 284 - KTU Minor Notes - Dr Binu V P

  Introduction About Me Syllabus Course Outcomes and Model Question Paper University Question Papers and Evaluation Scheme -Mathematics for Machine learning CST 284 KTU Overview of Machine Learning What is Machine Learning (video) Learn the Seven Steps in Machine Learning (video) Linear Algebra in Machine Learning Module I- Linear Algebra 1.Geometry of Linear Equations (video-Gilbert Strang) 2.Elimination with Matrices (video-Gilbert Strang) 3.Solving System of equations using Gauss Elimination Method 4.Row Echelon form and Reduced Row Echelon Form -Python Code 5.Solving system of equations Python code 6. Practice problems Gauss Elimination ( contact) 7.Finding Inverse using Gauss Jordan Elimination  (video) 8.Finding Inverse using Gauss Jordan Elimination-Python code Vectors in Machine Learning- Basics 9.Vector spaces and sub spaces 10.Linear Independence 11.Linear Independence, Basis and Dimension (video) 12.Generating set basis and span 13.Rank of a Matrix 14.Linear Mapping...

4.3 Sum Rule, Product Rule, and Bayes’ Theorem

 We think of probability theory as an extension to logical reasoning Probabilistic modeling  provides a principled foundation for designing machine learning methods. Once we have defined probability distributions corresponding to the uncertainties of the data and our problem, it turns out that there are only two fundamental rules, the sum rule and the product rule. Let $p(x,y)$ is the joint distribution of the two random variables $x, y$. The distributions $p(x)$ and $p(y)$ are the corresponding marginal distributions, and $p(y |x)$ is the conditional distribution of $y$ given $x$. Sum Rule The addition rule states the probability of two events is the sum of the probability that either will happen minus the probability that both will happen. The addition rule is: $P(A∪B)=P(A)+P(B)−P(A∩B)$ Suppose $A$ and $B$ are disjoint, their intersection is empty. Then the probability of their intersection is zero. In symbols:  $P(A∩B)=0$  The addition law then simplifies to: $P(...

5.1 Optimization using Gradient Descent

Since machine learning algorithms are implemented on a computer, the mathematical formulations are expressed as numerical optimization methods.Training a machine learning model often boils down to finding a good set of parameters. The notion of “good” is determined by the objective function or the probabilistic model. Given an objective function, finding the best value is done using optimization algorithms. There are two main branches of continuous optimization constrained and unconstrained. By convention, most objective functions in machine learning are intended to be minimized, that is, the best value is the minimum value. Intuitively finding the best value is like finding the valleys of the objective function, and the gradients point us uphill. The idea is to move downhill (opposite to the gradient) and hope to find the deepest point. For unconstrained optimization, this is the only concept we need,but there are several design choices. For constrained optimization, we need to intr...