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 Question Paper July 2021 and evaluation scheme Question Paper June 2022 and evaluation scheme 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 and Matri

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(A∪B)=P(A)+P(B)$  wh

1.1 Solving system of equations using Gauss Elimination Method

Elementary Transformations Key to solving a system of linear equations are elementary transformations that keep the solution set the same, but that transform the equation system into a simpler form: Exchange of two equations (rows in the matrix representing the system of equations) Multiplication of an equation (row) with a constant  Addition of two equations (rows) Add a scalar multiple of one row to the other. Row Echelon Form A matrix is in row-echelon form if All rows that contain only zeros are at the bottom of the matrix; correspondingly,all rows that contain at least one nonzero element are on top of rows that contain only zeros. Looking at nonzero rows only, the first nonzero number from the left pivot (also called the pivot or the leading coefficient) is always strictly to the right of the  pivot of the row above it. The row-echelon form is where the leading (first non-zero) entry of each row has only zeroes below it. These leading entries are called pivots Example: $\begin