summaryrefslogtreecommitdiff
path: root/Introduction_To_Linear_Algebra_by_Gilbert_Strang
diff options
context:
space:
mode:
authorPrashant S2019-10-04 12:27:32 +0530
committerGitHub2019-10-04 12:27:32 +0530
commitac2986488a9731cff5cbb517d8f0ef98e2561d64 (patch)
tree7bb3f64824627ef179d5f341266a664fd0b69011 /Introduction_To_Linear_Algebra_by_Gilbert_Strang
parentcbb2770fb2f88246175add29623103a56ba338b8 (diff)
parentb3f3a8ecd454359a2e992161844f2fb599f8238a (diff)
downloadR_TBC_Uploads-master.tar.gz
R_TBC_Uploads-master.tar.bz2
R_TBC_Uploads-master.zip
Merge pull request #1 from prashantsinalkar/masterHEADmaster
Added R TBC
Diffstat (limited to 'Introduction_To_Linear_Algebra_by_Gilbert_Strang')
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.1/Ex1_1.R6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.1/Ex1.2_1.R14
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.2/Ex1.2_2.R11
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.5/Ex1.2_5.R11
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.a/Ex1_1.2A.R17
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.b/Ex1_1.2B.R10
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.c/Ex1_1.2C.R6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.3.a/Ex1_1.3A.R4
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.1.1/Ex10.1_1.r13
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.2.1/EX10.2_1.r13
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.1.1/Ex2.1_1.r27
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.1.a/Ex2_2.1a.r11
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.2.a/Ex2_2.2a.r14
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.1/Ex2.3_1.r12
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.2/Ex2.3_2.r9
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.b/Ex2_2.3b.r18
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.c/Ex2_2.3C.R18
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.1/Ex2.4_1.R6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.2/Ex2.4_2.R6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.a/Ex2_2.4A.R8
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.b/Ex2_2.4B.R9
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.c/Ex2_2.4C.R6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.2/Ex2.5_2.r6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.3/Ex2.5_3.r14
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.4/Ex2.5_4.r16
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.5/Ex2.5_5.r16
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.a/Ex2_2.5A.r6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.b/Ex2_2.5B.r12
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.c/Ex2_2.5C.r16
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.1/Ex2.6_1.r13
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.2/Ex2.6_2.r13
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3/Ex2.6_3.r19
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.a/Ex2_2.6A.r12
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.b/Ex2_2.6B.r17
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.1/Ex2.7_1.r12
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.4/Ex2.7_4.r8
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.a/Ex2_2.7A.r11
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.b/Ex2_2.7B.r25
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.2/Ex3.2_2.r59
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.3/Ex3.2_3.r69
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.4/Ex3.2_4.r60
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.a/Ex3_3.2A.r14
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.b/Ex3_3.2b.r73
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.3.a/Ex3_3.3A.r64
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.3.c/Ex3_3.3C.r69
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.2/Ex3.4_2.r67
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.a/Ex3_3.4A.r72
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.c/Ex3_3.4C.r72
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.5.1/Ex3.5_1.r16
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.1/Ex3.6_1.r17
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.2/Ex3.6_2.r16
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.a/Ex3_3.6A.r70
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.3/Ex4.1_3.r10
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.a/Ex4_4.1A.r11
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.b/Ex4_4.1B.r71
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.1/Ex4.2_1.r23
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.2/Ex4.2_2.r17
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.3/Ex4.2_3.r27
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.a/Ex4_4.2A.r32
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.b/Ex4_4.2B.r15
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.1/Ex4.3_1.r27
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.2/Ex4.3_2.r27
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.3/Ex4.3_3.r29
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.a/Ex4_4.3A.r31
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.b/Ex4_4.3B.r31
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.4.4/Ex4.4_4.r21
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.4.5/Ex4.4_5.r27
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.1/Ex5.2_1.r10
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.5/Ex5.2_5.r6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.7/Ex5.2_7.r4
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.1/Ex5.3_1.r13
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.3/Ex5.3_3.r6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.7/Ex5.3_7.r14
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.8/Ex5.3_8.r15
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.9/Ex5.3_9.r15
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.a/Ex5_5.3A.r28
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.b/Ex5_5.3B.r46
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.1/Ex6.1_1.r19
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.2/Ex6.1_2.r13
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.3/Ex6.1_3.r8
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.4/Ex6.1_4.r81
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.a/Ex6_6.1A.r31
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.b/Ex6_6.1B.r19
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.1/Ex6.2_1.r20
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.2/Ex6.2_2.r16
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.b/Ex6_6.2B.r33
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.1/Ex6.3_1.r22
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.2/Ex6.3_2.r18
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.6/Ex6.3_6.r18
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.b/Ex6_6.3B.r18
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.1/Ex6.4_1.r14
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.4/Ex6.4_4.r23
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.b/Ex6_6.4B.r32
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.5.1/Ex6.5_1.r18
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.1/Ex6.6_1.r17
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.2/Ex6.6_2.r10
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.3/Ex6.6_3.r9
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.a/Ex6_6.6A.r9
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.7.3/Ex6.7_3.r8
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.7.4/Ex6.7_4.r8
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.1/Ex7.3_1.r7
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.2/Ex7.3_2.r13
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.3/Ex7.3_3.r12
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.4/Ex7.3_4.r12
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.a/Ex7_7.3A.r24
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.1.1/Ex8.1_1.r14
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.1.2/Ex8.1_2.r15
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.2.1/Ex8.2_1.r15
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.1/Ex8.3_1.r8
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.3/Ex8.3_3.r11
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.4/Ex8.3_4.r10
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.5/Ex8.3_5.r10
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.5.2/Ex8.5_2.r19
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.6.2/Ex8.6_6.r6
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.2.2/Ex9.2_2.r11
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.2.3/Ex9.2_3.r7
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.3.1/Ex9.3_1.r20
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/README.txt18
118 files changed, 2455 insertions, 0 deletions
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.1/Ex1_1.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.1/Ex1_1.R
new file mode 100644
index 00000000..29aa56a6
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.1/Ex1_1.R
@@ -0,0 +1,6 @@
+#Example : 1 Chapter : 1 pageno : 1
+v<-matrix(c(1,1),2,1,TRUE)
+w<-matrix(c(2,3),2,1,TRUE)
+z<-v+w
+z
+
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.1/Ex1.2_1.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.1/Ex1.2_1.R
new file mode 100644
index 00000000..ae9dccf2
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.1/Ex1.2_1.R
@@ -0,0 +1,14 @@
+#Example : 1 Chapter : 1.2 pgno:-11
+
+#Computing the dotproduct of two vectors
+dotproduct<-function(x,y){
+ res<-0
+ for(i in 1:length(x)){
+ res<-res+x[i]*y[i]
+ }
+ res
+}
+v<-matrix(c(4,2),nrow=2,ncol=1,byrow = T)
+w<-matrix(c(-1,2),nrow=2,ncol=1,byrow=T)
+r<-dotproduct(v,w)
+print(paste("Dot product of given vectors is",r))
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.2/Ex1.2_2.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.2/Ex1.2_2.R
new file mode 100644
index 00000000..1f023173
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.2/Ex1.2_2.R
@@ -0,0 +1,11 @@
+#Example : 2 Chapter : 1.2 pgno:-11
+
+#Computing the dotproduct of two vectors
+dotproduct<-function(x,y){
+ dp<-sum(x*y)
+ return(dp)
+}
+weight<-matrix(c(4,2),nrow=2,ncol=1,byrow = T)
+distance<-matrix(c(-1,2),nrow=2,ncol=1,byrow=T)
+center_point<-dotproduct(weight,distance)
+center_point \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.5/Ex1.2_5.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.5/Ex1.2_5.R
new file mode 100644
index 00000000..d4e5a915
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.5/Ex1.2_5.R
@@ -0,0 +1,11 @@
+#Example : 5 Chapter : 1.2 pageno : 16
+
+v<-c(2,1)
+w<-c(1,2)
+dotproduct<-sum(v*w)
+magn_v<-sqrt(sum(v*v))
+magn_w<-sqrt(sum(w*w))
+cos_angle<-dotproduct/(magn_v*magn_w)
+print(paste("Cosine of the angle between the given vectors is",cos_angle))
+
+
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.a/Ex1_1.2A.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.a/Ex1_1.2A.R
new file mode 100644
index 00000000..08e3cba5
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.a/Ex1_1.2A.R
@@ -0,0 +1,17 @@
+#Example : 1.2A Chapter : 1.2 Pageno : 17
+#Finds whether Schwartz and traingular inequality between the given vectors are satisfied
+#Finds the Cosine of the angle between the given vectors
+v<-c(3,4)
+w<-c(4,3)
+dp=sum(v*w)
+magn_v=sqrt(sum(v*v))
+magn_w=sqrt(sum(w*w))
+if(dp<=magn_v*magn_w){
+ print("Schwartz inequality is satisfied for the given vectors")
+}
+z=v+w
+magn_sum=sqrt(sum(z*z))
+if(magn_sum<=magn_v+magn_w){
+ print("Traingular inequality is satisfied for the given vectors")
+}
+print(paste("Cosine of the angle between the given vectors is ",dp/(magn_v*magn_w)))
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.b/Ex1_1.2B.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.b/Ex1_1.2B.R
new file mode 100644
index 00000000..f6c244f7
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.b/Ex1_1.2B.R
@@ -0,0 +1,10 @@
+#Example : 1.2B Chapter : 1.2 Pageno:-18
+v<-c(3,4)
+V<-v/sqrt(sum(v*v))
+print(paste("The Unit vector in the direction of the given vector is ", V[1]," ",V[2]))
+u<-c(-4,3)
+if(sum(u*v)==0){
+ print("The vectors u and v are perpendicular to each other")
+}
+U = u/sqrt(sum(u*u))
+print(paste("The unit vector in the direction of u is",U[1]," ",U[2])) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.c/Ex1_1.2C.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.c/Ex1_1.2C.R
new file mode 100644
index 00000000..78b288fc
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.2.c/Ex1_1.2C.R
@@ -0,0 +1,6 @@
+#Example : 1.2C Chapter : 1.2 Pageno : 18
+A<-matrix(c(2,-1,-1,2),ncol=2)
+b<-c(1,0)
+x<-solve(A,b)
+print("The solution of system is :")
+print(x) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.3.a/Ex1_1.3A.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.3.a/Ex1_1.3A.R
new file mode 100644
index 00000000..3b47cc4f
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH1/EX1.3.a/Ex1_1.3A.R
@@ -0,0 +1,4 @@
+#Example : 1.3A Chapter : 1.3 Pageno : 27
+A=matrix(c(1,0,0,-1,1,0,1,-1,1),ncol=3,byrow=T)
+A1=solve(A) # to find the inverse of the matrix
+A1 \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.1.1/Ex10.1_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.1.1/Ex10.1_1.r
new file mode 100644
index 00000000..f40f7507
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.1.1/Ex10.1_1.r
@@ -0,0 +1,13 @@
+# Example : 1 Chapter : 10.1 Page No: 496
+# r of complex numbers
+rad2deg <- function(rad) {
+ (rad * 180) / (pi)
+}
+z<-complex(real=1,imaginary=1)
+z1<-Conj(z)
+print("r of z and its conjugate are")
+print(Mod(z))
+print(Mod(z1))
+print("The argument of z and its conjugate in degrees are")
+print(paste(rad2deg(Arg(z)),"degrees")) # in radians which is equal to 45 degree
+print(paste(rad2deg(Arg(z1)),"degrees"))
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.2.1/EX10.2_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.2.1/EX10.2_1.r
new file mode 100644
index 00000000..2c71d894
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.2.1/EX10.2_1.r
@@ -0,0 +1,13 @@
+# Example : 1 Chapter : 10.2 Page No: 502
+# Orthogonal Complex vectors
+i<-complex(real=0,imaginary=1)
+u<-matrix(c(1,i),ncol=1)
+ut<-t(u)
+#take conjugate of ut
+ut[1,2]<-Conj(ut[1,2])
+v<-matrix(c(i,1),ncol=1)
+print("inner product of u and v is conj(u tanspose )* v is ")
+innerproduct<-ut%*%v
+print(innerproduct)
+print("As innerproduct is zero , they are orthogonal complex vectors")
+
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.1.1/Ex2.1_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.1.1/Ex2.1_1.r
new file mode 100644
index 00000000..9afb84ce
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.1.1/Ex2.1_1.r
@@ -0,0 +1,27 @@
+#Example : 1 Chapter : 2.1 Pageno : 37
+#Multiplication by rows and cols dotproduct.
+multiply<-function(A,x){
+ b<-c()
+ for(i in 1:3){
+ b<-c(b,sum(A[i,]*x[,1]))
+ }
+ b<-matrix(b,ncol=1)
+ print(paste("Multiplying matrices by dotproduct of rows and cols"))
+ print(A)
+ print("*")
+ print(x)
+ print("=")
+ print(b)
+}
+
+
+I<-matrix(c(1,0,0,0,1,0,0,0,1),ncol=3,byrow=T)
+x<-matrix(c(4,5,6),ncol=1)
+A=matrix(c(1,1,1,0,0,0,0,0,0),ncol=3)
+multiply(A,x)
+A<-matrix(c(1,0,0,0,1,0,0,0,1),nrow=3,ncol=3,byrow=T)
+multiply(A,x)
+
+
+
+
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.1.a/Ex2_2.1a.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.1.a/Ex2_2.1a.r
new file mode 100644
index 00000000..6d8a1e7c
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.1.a/Ex2_2.1a.r
@@ -0,0 +1,11 @@
+# Example : 2.1A Chapter : 2.1 Pageno : 39
+#Solving the equations by Column picture
+#Column Picture : solution is the linear combination of columns of A that makes b
+A=matrix(c(1,2,3,3,2,5,2,2,6),ncol=3)
+b=c(-3,-2,-5)
+x<-solve(A,b)
+x
+#if b=(4,4,8)
+b=c(4,4,8)
+x<-solve(A,b)
+x \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.2.a/Ex2_2.2a.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.2.a/Ex2_2.2a.r
new file mode 100644
index 00000000..f543583e
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.2.a/Ex2_2.2a.r
@@ -0,0 +1,14 @@
+#Example : 2.2A Chapter : 2.2 page no : 50
+#Pivots and Multipliers in converting matrix to upper traingular system
+matrix(c(1,-1,0,-1,2,-1,0,-1,2),ncol=3)->A
+A
+print(paste("First pivot is",A[1,1]))
+l21<-A[2,1]/A[1,1]
+print(paste("Multiplier L21 to convert the second row first element to 0 is",l21))
+A[2,]<-A[2,]-l21*A[1,]
+A
+print(paste("The second pivot is ",A[2,2]))
+l32<-A[3,2]/A[2,2]
+A[3,]<-A[3,]-l32*A[2,]
+print("The equivalent Upper traingular system for the matrix A is ")
+A \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.1/Ex2.3_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.1/Ex2.3_1.r
new file mode 100644
index 00000000..7dcd7475
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.1/Ex2.3_1.r
@@ -0,0 +1,12 @@
+# Example : 1 Chapter : 2.3 page no : 57
+#Matrix multiplication as dotproduct of row and column
+A<-matrix(c(3,4,5,6),nrow=2,ncol=2,byrow=T)
+x<-c(2,1)
+B<-A%*%x
+B
+Ax<-c()
+for(i in 1:2){
+ Ax<-c(Ax,sum(A[i,]*x))
+}
+Ax<-matrix(Ax,ncol=1)
+Ax \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.2/Ex2.3_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.2/Ex2.3_2.r
new file mode 100644
index 00000000..21725a98
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.2/Ex2.3_2.r
@@ -0,0 +1,9 @@
+#Example : 2 Chapter : 2.3 pageno : 58
+#Purpose of Elimination matrices
+I<-matrix(c(1,0,0,0,1,0,0,0,1),ncol=3)
+E31<-matrix(c(1,0,-4,0,1,0,0,0,1),ncol=3)
+b<-matrix(c(1,3,9),ncol=1)
+Ib<-I%*%b
+print(Ib)
+Eb<-E31%*%b
+print(Eb)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.b/Ex2_2.3b.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.b/Ex2_2.3b.r
new file mode 100644
index 00000000..6dc8d2ee
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.b/Ex2_2.3b.r
@@ -0,0 +1,18 @@
+#Example : 2.3b Chapter : 2.3 Pageno : 61
+#Multiplication with Elimination and Permutation matricies
+Ab<-matrix(c(1,4,0,2,8,3,2,9,2,1,3,1),ncol=4)
+E21<-matrix(c(1,0,0,-4,1,0,0,0,1),ncol=3,byrow=T)
+P32<-matrix(c(1,0,0,0,0,1,0,1,0),ncol=3,byrow=T)
+E21Ab<-E21%*%Ab
+print(E21Ab)
+P32E21Ab<-P32%*%E21Ab
+print(P32E21Ab)
+P32E21<-P32%*%E21
+print(P32E21)
+P32E21Ab<-P32E21%*%Ab
+print(P32E21Ab)
+#Solution for this system is
+b<-P32E21Ab[,4]
+P32E21Ab<-P32E21Ab[,-4]
+x<-solve(P32E21Ab,b)
+print(x) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.c/Ex2_2.3C.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.c/Ex2_2.3C.R
new file mode 100644
index 00000000..2531ce7f
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.3.c/Ex2_2.3C.R
@@ -0,0 +1,18 @@
+# Example : 2.3C Chapter : 2.3 Pageno : 62
+# Multiplying Matrices in two different ways
+A<-matrix(c(3,1,2,4,5,0),ncol=2)
+B<-matrix(c(2,1,4,1),ncol=2)
+AB<-A%*%B
+print(AB)
+#Multiplying matrices A and B as Rows of A times columns of B as dot product
+for(r in 1:dim(A)[1]){
+ for(c in 1:dim(B)[2]){
+ AB[r,c]<-sum(A[r,]*B[,c])
+ }
+}
+print(AB)
+#Multiplying Matrices A and B as Columns of A times rows of B
+AB1<-matrix(A[,1],ncol=1)%*%matrix(B[1,],nrow=1)
+AB2<-matrix(A[,2],ncol=1)%*%matrix(B[2,],nrow=1)
+AB<-AB1+AB2
+print(AB) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.1/Ex2.4_1.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.1/Ex2.4_1.R
new file mode 100644
index 00000000..b615e378
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.1/Ex2.4_1.R
@@ -0,0 +1,6 @@
+# Example : 1 Chapter : 2.4 Pageno : 68
+#Multiplication of Square matrices
+A<-matrix(c(1,2,1,-1),ncol=2)
+B<-matrix(c(2,3,2,4),ncol=2)
+AB<-A%*%B
+print(AB) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.2/Ex2.4_2.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.2/Ex2.4_2.R
new file mode 100644
index 00000000..358e1d56
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.2/Ex2.4_2.R
@@ -0,0 +1,6 @@
+#Example : 2 Chapter : 2.4 Page no : 68
+#Column times Row
+A<-matrix(c(0,1,2),ncol=1)
+B<-matrix(c(1,2,3),nrow=1)
+AB<-A%*%B
+print(AB) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.a/Ex2_2.4A.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.a/Ex2_2.4A.R
new file mode 100644
index 00000000..aedb5d7f
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.a/Ex2_2.4A.R
@@ -0,0 +1,8 @@
+#Example : 2.4A Chapter : 2.4 Page no : 72
+#Square of Pascal Matrix is HyperCube Matrix
+L<-matrix(c(1,1,1,1,0,1,2,3,0,0,1,3,0,0,0,1),ncol=4)
+H<-L%*%L
+print("Square of Pascal Matrices is:")
+print(H)
+H1<-H%*%matrix(c(1,1,1,1),ncol=1)
+print(H1) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.b/Ex2_2.4B.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.b/Ex2_2.4B.R
new file mode 100644
index 00000000..1c497162
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.b/Ex2_2.4B.R
@@ -0,0 +1,9 @@
+#Example : 2.4B Chapter:2.4 Pageno : 74
+
+B<-matrix(c(1,0,1,1),ncol=2)
+C<-matrix(c(0,0,1,0),ncol=2)
+BC<-B%*%C
+CB<-C%*%B
+print(BC)
+print(CB)
+print("Commutative property does not hold for matrix multiplication but by chance here it happened BC=CB") \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.c/Ex2_2.4C.R b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.c/Ex2_2.4C.R
new file mode 100644
index 00000000..1e656640
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.4.c/Ex2_2.4C.R
@@ -0,0 +1,6 @@
+#Example : 2.4C Chapter : 2.4 Pageno : 74
+#3-step paths for the given directed graph
+A<-matrix(c(1,1,1,0),ncol=2)
+A3<-A%*%A%*%A
+print("3 step paths between each pair of nodes in the given directed graph is :")
+print(A3) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.2/Ex2.5_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.2/Ex2.5_2.r
new file mode 100644
index 00000000..672d518b
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.2/Ex2.5_2.r
@@ -0,0 +1,6 @@
+# Example : 2 Chapter : 2.5 Pageno : 82
+# Inverse of an Elimination Matrix
+E<-matrix(c(1,-5,0,0,1,0,0,0,1),ncol=3)
+E1<-solve(E)
+print("The inverse of the given elimination matrix is")
+print(E1) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.3/Ex2.5_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.3/Ex2.5_3.r
new file mode 100644
index 00000000..905de16e
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.3/Ex2.5_3.r
@@ -0,0 +1,14 @@
+# Example : 3 Chapter : 2.5 Pageno : 83
+# Inverse of product of matrices
+E<-matrix(c(1,-5,0,0,1,0,0,0,1),ncol=3)
+E1<-solve(E)
+F<-matrix(c(1,0,0,0,1,-4,0,0,1),ncol=3)
+F1<-solve(F)
+print(F1)
+FE<-F%*%E
+print(FE)
+print("Inverse of FE ")
+FE1<-solve(FE)
+print(FE1)
+print("Inverse of FE can also be E-1*F-1 ")
+print(E1%*%F1)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.4/Ex2.5_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.4/Ex2.5_4.r
new file mode 100644
index 00000000..bc1c40ee
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.4/Ex2.5_4.r
@@ -0,0 +1,16 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 4 Chapter : 2.5 Pageno : 85
+# Inverse of matrix by guass jordan elimination matrix
+library(pracma)
+A<-matrix(c(2,4,3,7),ncol=2)
+I<-eye(2)
+AI<-cbind(A,I)
+R<-rref(AI)
+X<-R[,c(3:4)]
+print("Inverse of A is")
+print(X) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.5/Ex2.5_5.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.5/Ex2.5_5.r
new file mode 100644
index 00000000..96705fcb
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.5/Ex2.5_5.r
@@ -0,0 +1,16 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 5 Chapter : 2.5 Pageno : 86
+# Inverse of Lower traingular matrix is also a lower traingular matrix
+library(pracma)
+L<-matrix(c(1,3,4,0,1,5,0,0,1),ncol=3)
+I<-eye(3)
+LI<-cbind(L,I)
+R<-rref(LI)
+L1<-R[,c(4:6)]
+print("Inverse of L is")
+print(L1) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.a/Ex2_2.5A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.a/Ex2_2.5A.r
new file mode 100644
index 00000000..73cd5729
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.a/Ex2_2.5A.r
@@ -0,0 +1,6 @@
+# Example : 2.5A Chapter : 2.5 Pageno : 87
+# Inverse of difference matrix is Sum matrix
+A<-matrix(c(1,-1,0,0,1,-1,0,0,1),ncol=3)
+A1<-solve(A)
+print("Inverse of the difference matrix is singular ")
+print(A1)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.b/Ex2_2.5B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.b/Ex2_2.5B.r
new file mode 100644
index 00000000..2266f6ca
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.b/Ex2_2.5B.r
@@ -0,0 +1,12 @@
+# Example : 2.5B Chapter : 2.5 Pageno : 88
+# Inverse of the given matrices
+B<-matrix(c(4,8,3,7),ncol=2)
+C<-matrix(c(6,6,6,0),ncol=2)
+S<-matrix(c(1,1,1,0,1,1,0,0,1),ncol=3)
+B1<-solve(B)
+C1<-solve(C)
+S1<-solve(S)
+print("Inverses of given matrices ")
+print(B1)
+print(C1)
+print(S1) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.c/Ex2_2.5C.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.c/Ex2_2.5C.r
new file mode 100644
index 00000000..8c89a3cf
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.5.c/Ex2_2.5C.r
@@ -0,0 +1,16 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 2.5C Chapter : 2.5 Pageno : 88
+# Inverse of the Pascal matrix by gauss jordan elimination method
+library(pracma)
+L<-matrix(c(1,1,1,1,0,1,2,3,0,0,1,3,0,0,0,1),ncol=4)
+I<-eye(4)
+LI<-cbind(L,I)
+IL1<-rref(LI)
+L1<-IL1[,c(5:8)]
+print("Inverse of given Pascal matrix is")
+print(L1) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.1/Ex2.6_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.1/Ex2.6_1.r
new file mode 100644
index 00000000..7b249bb5
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.1/Ex2.6_1.r
@@ -0,0 +1,13 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 1 Chapter : 2.6 Pageno : 96
+# LU Factorisation
+library(pracma)
+A<-matrix(c(2,1,0,1,2,1,0,1,2),ncol=3)
+print("LU factorisation of A is")
+print(lu(A))
+# The answers may vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.2/Ex2.6_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.2/Ex2.6_2.r
new file mode 100644
index 00000000..a7ed2f09
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.2/Ex2.6_2.r
@@ -0,0 +1,13 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 2 Chapter : 2.6 Pageno : 96
+# LU Factorisation
+library(pracma)
+A<-matrix(c(1,1,0,0,1,2,1,0,0,1,2,1,0,0,1,2),ncol=4)
+print("LU factorisation of A is")
+print(lu(A))
+# The answers may vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3/Ex2.6_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3/Ex2.6_3.r
new file mode 100644
index 00000000..5cfa3b38
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3/Ex2.6_3.r
@@ -0,0 +1,19 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3 Chapter : 2.6 Pageno : 98
+# Forward Elimination
+library(pracma)
+A<-matrix(c(1,4,2,9),ncol=2)
+b<-c(5,21)
+L<-lu(A)$L
+U<-lu(A)$U
+c<-solve(L,b)
+x<-solve(U,c)
+print("The solution is ")
+print(x)
+
+# The answers may vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.a/Ex2_2.6A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.a/Ex2_2.6A.r
new file mode 100644
index 00000000..483a0914
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.a/Ex2_2.6A.r
@@ -0,0 +1,12 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 2.6A Chapter : 2.6 Pageno : 101
+# LU factorisation
+library(pracma)
+P<-matrix(c(1,1,1,1,1,2,3,4,1,3,6,10,1,4,10,20),ncol=4)
+print("LU factorisation of P")
+print(lu(P)) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.b/Ex2_2.6B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.b/Ex2_2.6B.r
new file mode 100644
index 00000000..928e8b65
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.b/Ex2_2.6B.r
@@ -0,0 +1,17 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 2.6B Chapter : 2.6 Pageno : 102
+# Forward Elimination
+library(pracma)
+P<-matrix(c(1,1,1,1,1,2,3,4,1,3,6,10,1,4,10,20),ncol=4)
+b<-c(1,0,0,0)
+L<-lu(P)$L
+U<-lu(P)$U
+c<-solve(L,b)
+x<-solve(U,c)
+print("The solution is ")
+print(x) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.1/Ex2.7_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.1/Ex2.7_1.r
new file mode 100644
index 00000000..025c7589
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.1/Ex2.7_1.r
@@ -0,0 +1,12 @@
+# Example : 1 Chapter : 2.7 Pageno : 108
+# Inverses and Transposes
+A<-matrix(c(1,6,0,1),ncol=2)
+AT<-t(A)
+A1<-solve(A)
+print("The inverse and transpose of the matrix are ")
+print(A1)
+print(AT)
+print("Transpose of A-1 is ")
+print(t(A1))
+print("Invere of A transpose is")
+print(solve(AT)) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.4/Ex2.7_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.4/Ex2.7_4.r
new file mode 100644
index 00000000..f02ef37a
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.4/Ex2.7_4.r
@@ -0,0 +1,8 @@
+# Example : 4 Chapter : 2.7 Pageno : 110
+# Product of matrix and its trnspose gives symmetric matrix
+R<-matrix(c(-1,0,1,-1,0,1),ncol=3)
+RT<-t(R)
+print("R * t(R)")
+print(R%*%RT)
+print("t(R) * R")
+print(RT%*%R) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.a/Ex2_2.7A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.a/Ex2_2.7A.r
new file mode 100644
index 00000000..34dc004b
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.a/Ex2_2.7A.r
@@ -0,0 +1,11 @@
+# Example : 2.7A Chapter : 2.7 Pageno : 114
+# Multiplication by Permutation matrices
+P<-matrix(c(0,0,1,1,0,0,0,1,0),ncol=3)
+A<-matrix(c(1,4,5,4,2,6,5,6,3),ncol=3)
+Q<-t(P)
+PA<-P%*%A
+PAQ<-PA%*%Q
+print("P*A")
+print(PA)
+print("P*A*Q")
+print(PAQ) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.b/Ex2_2.7B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.b/Ex2_2.7B.r
new file mode 100644
index 00000000..a8c7033f
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.7.b/Ex2_2.7B.r
@@ -0,0 +1,25 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 2.7B Chapter : 2.7 Pageno : 115
+# Symmetric Factorisation
+library(pracma)
+A<-matrix(c(1,4,5,4,2,6,5,6,3),ncol=3)
+L<-lu(A)$L
+D<-lu(A)$U
+for(i in 1:3){
+ j<-i+1
+ while(j<=3){
+ D[i,j]<-0
+ j<-j+1
+ }
+}
+LT<-t(L)
+print("Symmetric factorisation of A=LDLT")
+print(L)
+print(D)
+print(LT)
+print(L%*%D%*%LT) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.2/Ex3.2_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.2/Ex3.2_2.r
new file mode 100644
index 00000000..fda61595
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.2/Ex3.2_2.r
@@ -0,0 +1,59 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 2 Chapter : 3.2 Page No: 132
+# Find the Nullspace of given singular matrix
+
+library(pracma)
+nullspacebasis <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ return(N)
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ #Basis for the nullspace of given matrix
+ return(N)
+}
+A<-matrix(c(1,3,2,6),nrow=2,ncol=2)
+N<-nullspacebasis(A)
+print("Basis vectors for nullspace of given matrix is")
+N \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.3/Ex3.2_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.3/Ex3.2_3.r
new file mode 100644
index 00000000..49568620
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.3/Ex3.2_3.r
@@ -0,0 +1,69 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3 Chapter : 3.2 Page No: 133
+# Find the Nullspace of given matrices A,B,C
+
+library(pracma)
+nullspacebasis <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ return(N)
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ #Basis for the nullspace of given matrix
+ return(N)
+}
+
+A<-matrix(c(1,3,2,8),ncol=2,nrow=2)
+N<-nullspacebasis(A)
+print("Basis vectors of the nullspace of matrix A is")
+N
+B<-rbind(A,2*A)
+N1<-nullspacebasis(B)
+print("Basis vectors of the nullspace of matrix B is")
+N1
+C<-cbind(A,2*A)
+C
+N2<-nullspacebasis(C)
+print("Basis vectors of the nullspace of matrix C is")
+N2 \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.4/Ex3.2_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.4/Ex3.2_4.r
new file mode 100644
index 00000000..ccf644a4
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.4/Ex3.2_4.r
@@ -0,0 +1,60 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 4 Chapter : 3.2 Page No: 136
+# Find the Nullspace of given Upper traingular matrix
+
+library(pracma)
+nullspacebasis <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ return(N)
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ #Basis for the nullspace of given matrix
+ return(N)
+}
+
+U<-matrix(c(1,0,5,0,7,9),nrow=2)
+N<-nullspacebasis(U)
+print("Basis vectors for the Nullspace of given upper traingular matrix is ")
+N \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.a/Ex3_3.2A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.a/Ex3_3.2A.r
new file mode 100644
index 00000000..a181d2de
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.a/Ex3_3.2A.r
@@ -0,0 +1,14 @@
+# Example : 3.2A Chapter : 3.2 Page No: 139
+# Find the Matrix having the given special solutions
+s1<-c(-3,1,0,0)
+s2<-c(-2,0,-6,1)
+R<-diag(4)
+R<-R[-4,]
+#As 1st column is pivot column it is not needed to change
+#As 3rd column is next pivot column , row reduced echolon form has 1 in second row of third column
+R[,3]<-R[,2]
+#Two free columns are modified acording to special solutions
+R[,2]<-c(-1*s1[1],0,0)
+R[,4]<-c(-1*s2[1],-1*s2[3],0)
+print("matrix having given special solutions")
+print(R) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.b/Ex3_3.2b.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.b/Ex3_3.2b.r
new file mode 100644
index 00000000..f6b24099
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.2.b/Ex3_3.2b.r
@@ -0,0 +1,73 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3.2B Chapter : 3.2 Page No: 140
+# Find the Specialsolution, Pivotcolumns, freecolumns and Reduced row echelon form for each given matrix
+
+library(pracma)
+solution <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ N<-c()
+ }
+ else{
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ }
+ #Basis for the nullspace of given matrix
+ print("Special solutions are given by the basis vectors of null space")
+ print(N)
+ print("Pivot columns are")
+ print(pivotcol)
+ print("Free columns or free variables are")
+ print(freecol)
+ print("Row reduced echelon form is")
+ print(R)
+}
+A1<-matrix(c(0,0,0,0,0,0,0,0),nrow=2)
+print("For the matrix A1")
+solution(A1)
+A2<-matrix(c(3,1,6,2),nrow=2)
+print("For the matrix A2")
+solution(A2)
+A3<-cbind(A2,A2)
+print("For the matrix A3")
+solution(A3) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.3.a/Ex3_3.3A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.3.a/Ex3_3.3A.r
new file mode 100644
index 00000000..5dbfb740
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.3.a/Ex3_3.3A.r
@@ -0,0 +1,64 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3.3A Chapter : 3.3 Page No: 149
+# Find the row reduced echelon form, rank and special solution for given matrix
+
+library(pracma)
+solution <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ N<-c()
+ }
+ else{
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ }
+ print("Row reduced echelon form is")
+ print(R)
+ print("Rank of the Matrix is")
+ print(y)
+ print("Special solutions for given matrix are given by")
+ print(N)
+}
+
+A<-matrix(c(1,-1,0,0,-1,2,-1,0,0,-1,2,-1,0,0,-1,1),nrow=4)
+solution(A)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.3.c/Ex3_3.3C.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.3.c/Ex3_3.3C.r
new file mode 100644
index 00000000..8b9d419d
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.3.c/Ex3_3.3C.r
@@ -0,0 +1,69 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3.3C Chapter : 3.3 Page No: 151
+# Find the special solutions and row reduced echelon forms
+
+library(pracma)
+solution <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ N<-c()
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ print("row reduced echelon form is")
+ print(R)
+ print("Special solution is ")
+ print(N)
+}
+#c is not equal to 4
+A<-matrix(c(1,3,4,2,6,8,1,3,2),ncol=3)
+solution(A)
+#c=4
+A4<-matrix(c(1,3,4,2,6,8,1,3,4),ncol=3,nrow=3)
+solution(A4)
+#c is not equal to 0
+B<-matrix(c(1,1,1,1),nrow=2)
+solution(B)
+#c = 0
+B0<-matrix(c(0,0,0,0),nrow=2)
+solution(B0)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.2/Ex3.4_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.2/Ex3.4_2.r
new file mode 100644
index 00000000..e14008d0
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.2/Ex3.4_2.r
@@ -0,0 +1,67 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 2 Chapter : 3.4 Page No: 158
+# Find the particular solution and special solution of the given system
+
+library(pracma)
+nullspacebasis <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ return(N)
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ #Basis for the nullspace of given matrix
+ return(N)
+}
+A<-matrix(c(1,1,1,2,1,-1),nrow=2)
+b<-c(3,4)
+s<-nullspacebasis(A)
+Ab<-cbind(A,b)
+Rd<-rref(Ab)
+p<-Rd[,4]
+p<-c(p,0)
+print("Particualar solution is")
+print(p)
+print("special solution is ")
+print(s)
+print("The complete solution = particular solution + special solution")
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.a/Ex3_3.4A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.a/Ex3_3.4A.r
new file mode 100644
index 00000000..f38ad725
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.a/Ex3_3.4A.r
@@ -0,0 +1,72 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3.4A Chapter : 3.4 Page No: 160
+# Find the Complete solution of the given system
+
+library(pracma)
+completesolution <- function(A,b){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ N<-c()
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ s<-N
+ Ab<-cbind(A,b)
+ Rd<-rref(Ab)
+ temp<-Rd[,n+1]
+ p<-c(1:n)
+ for(i in 1:length(freecol)){
+ p[freecol[i]]<-0
+ }
+ for(i in 1:length(pivotcol)){
+ p[pivotcol[i]]<-temp[i]
+ }
+ print("The special solution is")
+ print(s)
+ print("The particular solution is")
+ print(p)
+ print("Complete solution = Particular solution + Special solution")
+}
+A<-matrix(c(1,2,3,2,4,6,3,8,7,5,12,13),nrow=3)
+b<-c(0,6,-6)
+completesolution(A,b)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.c/Ex3_3.4C.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.c/Ex3_3.4C.r
new file mode 100644
index 00000000..1d77f3aa
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.4.c/Ex3_3.4C.r
@@ -0,0 +1,72 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3.4C Chapter : 3.4 Page No: 162
+# Find the Complete solution of the given system
+
+library(pracma)
+completesolution <- function(A,b){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ N<-c()
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ s<-N
+ Ab<-cbind(A,b)
+ Rd<-rref(Ab)
+ temp<-Rd[,n+1]
+ p<-c(1:n)
+ for(i in 1:length(freecol)){
+ p[freecol[i]]<-0
+ }
+ for(i in 1:length(pivotcol)){
+ p[pivotcol[i]]<-temp[i]
+ }
+ print("The special solution is")
+ print(s)
+ print("The particular solution is")
+ print(p)
+ print("Complete solution = particular solution + Special solution")
+}
+A<-matrix(c(1,2,4,2,4,8,1,4,6,0,8,8),nrow=3)
+b<-c(4,2,10)
+completesolution(A,b) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.5.1/Ex3.5_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.5.1/Ex3.5_1.r
new file mode 100644
index 00000000..a3f3cf30
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.5.1/Ex3.5_1.r
@@ -0,0 +1,16 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 1 Chapter : 3.5 Page No: 170
+# Columns of given matrix are dependent
+library(pracma)
+A<-matrix(c(1,2,1,0,1,0,3,5,3),nrow=3)
+if(Rank(A)!=ncol(A)){
+ print("The columns of A are dependent")
+}
+print("As the columns of A are dependent ,there is a nonzero solution to Ax=0")
+x<-matrix(c(-3,1,1),ncol=1)
+print(A%*%x)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.1/Ex3.6_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.1/Ex3.6_1.r
new file mode 100644
index 00000000..6e7450fc
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.1/Ex3.6_1.r
@@ -0,0 +1,17 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 1 Chapter : 3.6 Page No: 188
+# Dimensions and rank of matrix
+library(pracma)
+solution<-function(A){
+ print(paste("Number of rows , m=",nrow(A)))
+ print(paste("Number of columns,n=",ncol(A)))
+ print(paste("Rank of the given matrix",Rank(A)))
+}
+A<-matrix(c(1,2,3),nrow=1)
+solution(A)
+
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.2/Ex3.6_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.2/Ex3.6_2.r
new file mode 100644
index 00000000..71b3fefd
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.2/Ex3.6_2.r
@@ -0,0 +1,16 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 2 Chapter : 3.6 Page No: 188
+# Dimensions and rank of matrix
+library(pracma)
+solution<-function(A){
+ print(paste("Number of rows , m=",nrow(A)))
+ print(paste("Number of columns,n=",ncol(A)))
+ print(paste("Rank of the given matrix",Rank(A)))
+}
+A<-matrix(c(1,2,2,4,3,6),nrow=2)
+solution(A)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.a/Ex3_3.6A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.a/Ex3_3.6A.r
new file mode 100644
index 00000000..9bf248a9
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH3/EX3.6.a/Ex3_3.6A.r
@@ -0,0 +1,70 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3.6A Chapter : 3.6 Page No: 190
+# Four Fundamental Spaces of given matrix
+
+library(pracma)
+nullspacebasis <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ return(N)
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ #Basis for the nullspace of given matrix
+ return(N)
+}
+l<-matrix(c(1,2,5,0,1,0,0,0,1),ncol=3)
+u<-matrix(c(1,0,0,3,0,0,0,1,0,5,6,0),ncol=4)
+A<-l%*%u
+print("Row space Basis of A")
+print(u[1,])
+print(u[2,])
+print("COlumn space Basis of A ")
+print(l[,1])
+print(l[,2])
+print("Null space Basis of A")
+N<-nullspacebasis(A)
+print(N)
+print("Null space Basis of A transpose")
+NT<-nullspacebasis(t(A))
+print(NT)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.3/Ex4.1_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.3/Ex4.1_3.r
new file mode 100644
index 00000000..be7a53ff
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.3/Ex4.1_3.r
@@ -0,0 +1,10 @@
+# Example : 3 Chapter : 4.1 Page No: 197
+# Rows of given matrix are perpendicular to the vector in nullspace
+A<-matrix(c(1,5,3,2,4,7),nrow=2)
+x<-c(1,1,-1)
+for(i in 1:nrow(A)){
+ dot_product<-sum(A[i,]*x)
+ if(dot_product==0){
+ print(paste("Row ",i,"is perpendicular to x"))
+ }
+} \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.a/Ex4_4.1A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.a/Ex4_4.1A.r
new file mode 100644
index 00000000..1bfe0abc
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.a/Ex4_4.1A.r
@@ -0,0 +1,11 @@
+# Example : 4.1A Chapter : 4.1 Page No: 201
+# Dimensions of the subspaces in the given space
+dim_R<-9
+dim_S<-6
+print("Possible dimensions of the subspaces orthogonal to S")
+x<-dim_R-dim_S
+orthogonal_dimensions<-c(0:x)
+print(orthogonal_dimensions)
+print(paste("possible dimensions of orthogonal complement subspaces to S",dim_R-dim_S))
+print(paste("The smallest matrix A in S is ",dim_S," by ",dim_R))
+print(paste("The Null space matrix N is ",dim_R," by ",dim_R-dim_S))
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.b/Ex4_4.1B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.b/Ex4_4.1B.r
new file mode 100644
index 00000000..21632e76
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.1.b/Ex4_4.1B.r
@@ -0,0 +1,71 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 4.1B Chapter : 4.1 Page No: 201
+# Null space Basis of a plane subspace
+library(pracma)
+nullspacebasis <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ return(N)
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ #Basis for the nullspace of given matrix
+ return(N)
+}
+
+A<-matrix(c(1,-3,-4),ncol=3)
+print("Given Plane x-3y-4z=0 is a null space of following 1*3 matrix")
+print(A)
+#to make matrix copatible for our function
+A<-rbind(A,c(0,0,0),c(0,0,0))
+N<-nullspacebasis(A)
+print("SPecial solutions or nullspace basis of given plane subspace is")
+print(N)
+A<-A[-c(2,3),]
+print("Row space is ")
+print(A)
+temp<-cbind(N,c(1,-3,-4))
+x<-c(1,1,-1)
+print("vector 6,4,5 is split into vn + vs as 1 of each vector in nullspace basis and -1 of rowspace basis")
+v<-temp%*%x
+print(v) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.1/Ex4.2_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.1/Ex4.2_1.r
new file mode 100644
index 00000000..84b15c6d
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.1/Ex4.2_1.r
@@ -0,0 +1,23 @@
+# Example : 1 Chapter : 4.2 Page No: 208
+# Projection of the vector onto line
+
+#Answers to this problem are displayed in the form of x/y in textbook
+#Here the same answers are in decimal formats
+
+projection<-function(b,a){
+ xhat<-(sum(a*b))/(sum(a*a))
+ p<-xhat*a
+ return(p)
+}
+b<-c(1,1,1)
+a<-c(1,2,2)
+p<-projection(b,a)
+print("The projection vector p i.e., b on a is ")
+print(p)
+e<-b-p
+print("The error vector is ")
+print(e)
+if(sum(e*a)==0){
+ print("Vector e is perpendicular to a")
+}
+#The answer may slightly vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.2/Ex4.2_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.2/Ex4.2_2.r
new file mode 100644
index 00000000..134d20fa
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.2/Ex4.2_2.r
@@ -0,0 +1,17 @@
+# Example : 2 Chapter : 4.2 Page No: 209
+# Find the projection matrix onto the line
+
+projection_matrix<-function(a){
+ a<-matrix(c(a),ncol=1)
+ P<-a%*%t(a)
+ temp<-t(a)%*%a
+ temp<-1/temp
+ t<-temp[1,1]
+ P<-t*P
+ return(P)
+}
+a<-c(1,2,2)
+P<-projection_matrix(a)
+print("The projection matrix is ")
+print(P)
+#The answer may slightly vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.3/Ex4.2_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.3/Ex4.2_3.r
new file mode 100644
index 00000000..7e621c84
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.3/Ex4.2_3.r
@@ -0,0 +1,27 @@
+# Example : 3 Chapter : 4.2 Page No: 211
+# Find the best possible solution, projection vector and projection matrix
+
+solution<-function(A,b){
+ ATA<-t(A)%*%A
+ b<-matrix(c(b),ncol=1)
+ ATb<-t(A)%*%b
+ xhat<-solve(ATA,ATb)
+ p<-A%*%xhat
+ e<-b-p
+ ATA1<-solve(ATA)
+ P<-A%*%ATA1
+ P<-P%*%t(A)
+ print("The best possible solution is ")
+ print(xhat)
+ print("The projection vector is ")
+ print(p)
+ print("The error vector e is")
+ print(e)
+ print("The projection matrix is ")
+ print(P)
+}
+
+A<-matrix(c(1,1,1,0,1,2),ncol=2)
+b<-c(6,0,0)
+solution(A,b)
+#The answer may slightly vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.a/Ex4_4.2A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.a/Ex4_4.2A.r
new file mode 100644
index 00000000..9d44f4f5
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.a/Ex4_4.2A.r
@@ -0,0 +1,32 @@
+# Example : 4.2A Chapter : 4.2 Page No: 213
+# Projection onto the line and onto the plane
+
+projection_line<-function(a,b){
+ p<-((sum(a*b))/(sum(a*a)))*a
+ e<-b-p
+ print("The projection vector is ")
+ print(p)
+ print("The error vector is ")
+ print(e)
+}
+
+projection_plane<-function(A,b){
+ b<-matrix(c(b),ncol=1)
+ ATA<-t(A)%*%A
+ ATA1<-solve(ATA)
+ P<-A%*%ATA1
+ P<-P%*%t(A)
+ p<-P%*%b
+ e<-b-p
+ print("The projection vector is ")
+ print(p)
+ print("The error vector is ")
+ print(e)
+}
+
+b<-c(3,4,4)
+a<-c(2,2,1)
+projection_line(a,b)
+A<-matrix(c(a,1,0,0),ncol=2)
+projection_plane(A,b)
+#The answer may slightly vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.b/Ex4_4.2B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.b/Ex4_4.2B.r
new file mode 100644
index 00000000..3fa8dab9
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.2.b/Ex4_4.2B.r
@@ -0,0 +1,15 @@
+# Example : 4.2B Chapter : 4.2 Page No: 213
+# Find best Possible solution
+
+solution<-function(A,b){
+ ATA<-t(A)%*%A
+ ATb<-t(A)%*%b
+ x<-solve(ATA,ATb)
+ return(x)
+}
+
+A<-matrix(c(1,1,1),ncol=1)
+b<-matrix(c(70,80,120),ncol=1)
+x<-solution(A,b)
+print("The best possible solution is ")
+print(x) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.1/Ex4.3_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.1/Ex4.3_1.r
new file mode 100644
index 00000000..13017941
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.1/Ex4.3_1.r
@@ -0,0 +1,27 @@
+# Example : 1 Chapter : 4.3 Page No: 218
+# Fit a straight line
+solution<-function(A,b){
+ ATA<-t(A)%*%A
+ ATb<-t(A)%*%b
+ xhat<-solve(ATA,ATb)
+ return(xhat)
+}
+fit_line<-function(D){
+ num_of_points<-nrow(D)
+ t<-c()
+ for(i in 1:num_of_points){
+ t<-c(t,1)
+ }
+ t<-c(t,D[,1])
+ A<-matrix(c(t),ncol=2)
+ b<-D[,2]
+ b<-matrix(c(b),ncol=1)
+ x<-solution(A,b)# The system has no solution, we need to find the best solution
+ return(x)
+}
+Data<-matrix(c(0,6,1,0,2,0),ncol=2,byrow=T)
+x<-fit_line(Data)
+C<-x[1]
+D<-x[2]
+print(paste("The best straight line is b= ",C," + ",D,"t"))
+
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.2/Ex4.3_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.2/Ex4.3_2.r
new file mode 100644
index 00000000..59596010
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.2/Ex4.3_2.r
@@ -0,0 +1,27 @@
+# Example : 2 Chapter : 4.3 Page No: 222
+# Fit a straight line
+solution<-function(A,b){
+ ATA<-t(A)%*%A
+ ATb<-t(A)%*%b
+ xhat<-solve(ATA,ATb)
+ return(xhat)
+}
+fit_line<-function(D){
+ num_of_points<-nrow(D)
+ t<-c()
+ for(i in 1:num_of_points){
+ t<-c(t,1)
+ }
+ t<-c(t,D[,1])
+ A<-matrix(c(t),ncol=2)
+ b<-D[,2]
+ b<-matrix(c(b),ncol=1)
+ x<-solution(A,b)# The system has no solution, we need to find the best solution
+ return(x)
+}
+Data<-matrix(c(-2,0,2,1,2,4),ncol=2)
+x<-fit_line(Data)
+C<-x[1]
+D<-x[2]
+print(paste("The best straight line is b= ",C," + ",D,"t"))
+#The answer may slightly vary due to rounding off values. \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.3/Ex4.3_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.3/Ex4.3_3.r
new file mode 100644
index 00000000..37f87356
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.3/Ex4.3_3.r
@@ -0,0 +1,29 @@
+# Example : 3 Chapter : 4.3 Page No: 224
+# Fit a Parabola
+solution<-function(A,b){
+ ATA<-t(A)%*%A
+ ATb<-t(A)%*%b
+ xhat<-solve(ATA,ATb)
+ return(xhat)
+}
+fit_parabola<-function(D){
+ num_of_points<-nrow(D)
+ t<-c()
+ for(i in 1:num_of_points){
+ t<-c(t,1)
+ }
+ t<-c(t,D[,1])
+ t<-c(t,D[,1]*D[,1])
+ A<-matrix(c(t),ncol=3)
+ b<-D[,2]
+ b<-matrix(c(b),ncol=1)
+ x<-solution(A,b)# The system has no solution, we need to find the best solution
+ return(x)
+}
+Data<-matrix(c(0,1,2,6,0,0),ncol=2)
+x<-fit_parabola(Data)
+C<-x[1]
+D<-x[2]
+E<-x[3]
+print(paste("The best Parabola that fitt in is b= ",C,"+",D,"t+",E,"t2"))
+
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.a/Ex4_4.3A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.a/Ex4_4.3A.r
new file mode 100644
index 00000000..7cc53f33
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.a/Ex4_4.3A.r
@@ -0,0 +1,31 @@
+# Example : 4.3A Chapter : 4.3 Page No: 225
+# Fit a straight line
+
+#1,2,3 solutions can be done without any need of computation
+solution<-function(A,b){
+ ATA<-t(A)%*%A
+ ATb<-t(A)%*%b
+ xhat<-solve(ATA,ATb)
+ return(xhat)
+}
+fit_line<-function(D){
+ num_of_points<-nrow(D)
+ t<-c()
+ for(i in 1:num_of_points){
+ t<-c(t,1)
+ }
+ t<-c(t,D[,1])
+ A<-matrix(c(t),ncol=2)
+ b<-D[,2]
+ b<-matrix(c(b),ncol=1)
+ x<-solution(A,b)# The system has no solution, we need to find the best solution
+ return(x)
+}
+t<-c(1:10)
+b<-c(0,0,0,0,0,0,0,0,0,40)
+Data<-matrix(c(t,b),ncol=2)
+x<-fit_line(Data)
+C<-x[1]
+D<-x[2]
+print(paste("The best straight line is b= ",C," + ",D,"t"))
+#The answer may slightly vary due to rounding off values. \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.b/Ex4_4.3B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.b/Ex4_4.3B.r
new file mode 100644
index 00000000..33ed77c2
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.3.b/Ex4_4.3B.r
@@ -0,0 +1,31 @@
+# Example : 4.3B Chapter : 4.3 Page No: 226
+# Fit a Parabola
+solution<-function(A,b){
+ ATA<-t(A)%*%A
+ ATb<-t(A)%*%b
+ xhat<-solve(ATA,ATb)
+ return(xhat)
+}
+fit_parabola<-function(D){
+ num_of_points<-nrow(D)
+ t<-c()
+ for(i in 1:num_of_points){
+ t<-c(t,1)
+ }
+ t<-c(t,D[,1])
+ t<-c(t,D[,1]*D[,1])
+ A<-matrix(c(t),ncol=3)
+ b<-D[,2]
+ b<-matrix(c(b),ncol=1)
+ x<-solution(A,b)# The system has no solution, we need to find the best solution
+ return(x)
+}
+t<-c(-2,-1,0,1,2)
+b<-c(0,0,1,0,0)
+Data<-matrix(c(t,b),ncol=2)
+x<-fit_parabola(Data)
+C<-x[1]
+D<-x[2]
+E<-x[3]
+print(paste("The best Parabola that fitt in is b= ",C,"+",D,"t+",E,"t2"))
+#The answer may slightly vary due to rounding off values. \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.4.4/Ex4.4_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.4.4/Ex4.4_4.r
new file mode 100644
index 00000000..6574a53d
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.4.4/Ex4.4_4.r
@@ -0,0 +1,21 @@
+# Example : 4 Chapter : 4.4 Page No: 233
+# Projections of the vector onto line,plane if basis are given as orthonormal vectors
+Q<-matrix(c(-1,2,2,2,-1,2,2,2,-1),ncol=3)
+Q<-(1/3)*Q
+q1<-Q[,1]
+q2<-Q[,2]
+q3<-Q[,3]
+b<-c(0,0,1)
+p1<-sum(q1*b)*q1
+p2<-sum(q2*b)*q2
+p3<-sum(q3*b)*q3
+print("Projection of b onto q1")
+print(p1)
+print("Projection of b onto q2")
+print(p2)
+print("Projection of b onto q3")
+print(p3)
+print("Projection of b onto plane of q1 and q2")
+print(p1+p2)
+print("Projection of b onto space of q1,q2, and q3")
+print(p1+p2+p3) # same as vector b
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.4.5/Ex4.4_5.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.4.5/Ex4.4_5.r
new file mode 100644
index 00000000..f94e8c09
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH4/EX4.4.5/Ex4.4_5.r
@@ -0,0 +1,27 @@
+# Example : 5 Chapter : 4.4 Page No: 233
+# Gram-Schmidt method to convert matrix into its orthogonal form
+magnitude<-function(a){
+ x<-0
+ for(i in 1:length(a)){
+ x<-x+a[i]*a[i]
+ }
+ x<-sqrt(x)
+ return(x)
+}
+a<-c(1,-1,0)
+b<-c(2,0,-2)
+c<-c(3,-3,3)
+A<-a
+B<-b-(sum(A*b)/sum(A*A))*A
+C<-c-(sum(A*c)/sum(A*A))*A-(sum(B*c)/sum(B*B))*B
+print("Orthogonal vectors corresponding to a,b,c are")
+print(A)
+print(B)
+print(C)
+q1<-(1/magnitude(A))*A
+q2<-(1/magnitude(B))*B
+q3<-(1/magnitude(C))*C
+Q<-matrix(c(q1,q2,q3),ncol=3)
+print("Orthogonal matrix with orthonormal vectors of a,b,c ")
+print(Q)
+#The answer may slightly vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.1/Ex5.2_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.1/Ex5.2_1.r
new file mode 100644
index 00000000..92f5d7c0
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.1/Ex5.2_1.r
@@ -0,0 +1,10 @@
+# Example : 1 Chapter : 5.2 Page No: 255
+# Determinant of matrices by multiplying pivots
+A<-matrix(c(0,0,4,0,2,5,1,3,6),ncol=3)
+P<-matrix(c(0,0,1,0,1,0,1,0,0),ncol=3)
+PA<-P%*%A
+print(PA)
+detA<--1*PA[1,1]*PA[2,2]*PA[3,3]
+print(detA)
+det(A)
+print("detA is the determinant of the given matrix") \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.5/Ex5.2_5.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.5/Ex5.2_5.r
new file mode 100644
index 00000000..f86ef826
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.5/Ex5.2_5.r
@@ -0,0 +1,6 @@
+# Example : 5 Chapter : 5.2 Page No: 259
+# Determinants of matrices
+A4<-matrix(c(0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0),ncol=4)
+P4<-matrix(c(0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0),ncol=4)
+print(det(A4))
+print(det(P4))
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.7/Ex5.2_7.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.7/Ex5.2_7.r
new file mode 100644
index 00000000..f1556c83
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.2.7/Ex5.2_7.r
@@ -0,0 +1,4 @@
+# Example : 7 Chapter : 5.2 Page No: 261
+# Determinants of matrices
+B4<-matrix(c(1,-1,0,0,-1,2,-1,0,0,-1,2,-1,0,0,-1,2),ncol=4)
+print(det(B4)) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.1/Ex5.3_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.1/Ex5.3_1.r
new file mode 100644
index 00000000..1e6818aa
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.1/Ex5.3_1.r
@@ -0,0 +1,13 @@
+# Example : 1 Chapter : 5.3 Page No: 269
+# Cramers rule for solving system of equations
+A<-matrix(c(3,5,4,6),ncol=2)
+b<-c(2,4)
+B1<-A
+B1[,1]<-b
+B2<-A
+B2[,2]<-b
+x1<-det(B1)/det(A)
+x2<-det(B2)/det(A)
+print("SOlution is ")
+print(x1)
+print(x2)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.3/Ex5.3_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.3/Ex5.3_3.r
new file mode 100644
index 00000000..546b936b
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.3/Ex5.3_3.r
@@ -0,0 +1,6 @@
+# Example : 3 Chapter : 5.3 Page No: 271
+# The inverse of the traingular matrix is traingular
+A<-matrix(c(1,1,1,1,0,1,1,1,0,0,1,1,0,0,0,1),ncol=4)
+A1<-solve(A)
+print("The inverse of A is")
+print(A1) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.7/Ex5.3_7.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.7/Ex5.3_7.r
new file mode 100644
index 00000000..cccd7f3a
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.7/Ex5.3_7.r
@@ -0,0 +1,14 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 7 Chapter : 5.3 Page No: 275
+# CrossProduct of Vectors
+library(pracma)
+u<-c(3,2,0)
+v<-c(1,4,0)
+cp<-cross(u,v)
+print("u * v is ")
+print(cp)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.8/Ex5.3_8.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.8/Ex5.3_8.r
new file mode 100644
index 00000000..aa1cf744
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.8/Ex5.3_8.r
@@ -0,0 +1,15 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 8 Chapter : 5.3 Page No: 276
+# CrossProduct of Vectors
+
+library(pracma)
+u<-c(1,1,1)
+v<-c(1,1,2)
+cp<-cross(u,v)
+print("u * v is ")
+print(cp)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.9/Ex5.3_9.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.9/Ex5.3_9.r
new file mode 100644
index 00000000..c8b42029
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.9/Ex5.3_9.r
@@ -0,0 +1,15 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 9 Chapter : 5.3 Page No: 276
+# The right hand rule - cross product of x-axis and y-axis is z-axis
+
+library(pracma)
+u<-c(1,0,0)
+v<-c(0,1,0)
+cp<-cross(u,v)
+print("u * v is ")
+print(cp) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.a/Ex5_5.3A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.a/Ex5_5.3A.r
new file mode 100644
index 00000000..ac70393c
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.a/Ex5_5.3A.r
@@ -0,0 +1,28 @@
+# Example : 5.3A Chapter : 5.3 Page No: 277
+# Nullspace of matrix as transpose of Cofactor matrix
+nullspacebasis<-function(A){
+ C<-matrix(c(1:9),ncol=3)
+ for(i in 1:3){
+ for(j in 1:3){
+ if((i+j)%%2==0){
+ x<-1
+ }
+ else{
+ x<--1
+ }
+ C[i,j]<-x*det(A[-i,-j])
+ }
+ }
+ C<-t(C)
+ return(C)
+}
+
+A1<-matrix(c(1,2,2,4,3,2,7,9,8),ncol=3)
+N1<-nullspacebasis(A1)
+print("The null space basis are given by columns of transpose of cofactor matrix")
+print("Null space of A1 is")
+print(N1)
+A2<-matrix(c(1,1,1,1,1,1,2,1,1),ncol=3)
+N2<-nullspacebasis(A2)
+print("Null space of A2 is ")
+print(N2) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.b/Ex5_5.3B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.b/Ex5_5.3B.r
new file mode 100644
index 00000000..2dfb1feb
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.b/Ex5_5.3B.r
@@ -0,0 +1,46 @@
+# Example : 5.3B Chapter : 5.3 Page No: 278
+# Solve by crammers rule and inverse of the matrix
+
+solve_by_crammersrule<-function(A,b){
+ B1<-A
+ B2<-A
+ B3<-A
+ B1[,1]<-b
+ B2[,2]<-b
+ B3[,3]<-b
+ x1<-det(B1)/det(A)
+ x2<-det(B2)/det(A)
+ x3<-det(B3)/det(A)
+ x<-c(x1,x2,x3)
+ return(x)
+}
+inverse<-function(A){
+ C<-matrix(c(1:9),ncol=3)
+ for(i in 1:3){
+ for(j in 1:3){
+ if((i+j)%%2==0){
+ x<-1
+ }
+ else{
+ x<--1
+ }
+ C[i,j]<-x*det(A[-i,-j])
+ }
+ }
+ CT<-t(C)
+ A1<-(1/det(A))*CT
+ return(A1)
+}
+
+A<-matrix(c(2,1,5,6,4,9,2,2,0),ncol=3)
+b<-c(0,0,1)
+x<-solve_by_crammersrule(A,b)
+print("x is ")
+print(x)
+A1<-inverse(A)
+print("Inverse of A is ")
+print(A1)
+print("A * inverse of A is Identity matrix")
+I<-A%*%A1
+print(I)
+#The answer may slightly vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.1/Ex6.1_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.1/Ex6.1_1.r
new file mode 100644
index 00000000..bb43e3c8
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.1/Ex6.1_1.r
@@ -0,0 +1,19 @@
+# Example : 1 Chapter : 6.1 Page No: 284
+# Eigen values and eigen vectors
+A<-matrix(c(0.8,0.2,0.3,0.7),ncol=2)
+sol<-eigen(A)
+lambda<-sol$values
+x<-sol$vectors
+print("The eigen values of the matrix are")
+print(lambda)
+print("The eigen vectors of the matrix in normalised form are")
+print(x)
+#to get eigen vectors in the textbook multiply normalised vectors by scalars
+x[,1]<-x[,1]*(0.6/x[1,1])
+x[,2]<-x[,2]*(1/x[1,2])
+print("Eigen vectors with respect to the above eigen values respectively are")
+print(x)
+print(A%*%x)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.2/Ex6.1_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.2/Ex6.1_2.r
new file mode 100644
index 00000000..369a5e47
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.2/Ex6.1_2.r
@@ -0,0 +1,13 @@
+# Example : 2 Chapter : 6.1 Page No: 285
+# Eigen values and eigen vectors of Projection matrix
+A<-matrix(c(0.5,0.5,0.5,0.5),ncol=2)
+sol<-eigen(A)
+lambda<-sol$values
+x<-sol$vectors #These are normalised eigen vectors
+#to get eigen vectors in text book multiply them with scalars
+x[,1]<-x[,1]*(1/x[1,1])
+x[,2]<-x[,2]*(1/x[1,2])
+print("The eigen values of the matrix are")
+print(lambda)
+print("The eigen vectors of the matrix are")
+print(x) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.3/Ex6.1_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.3/Ex6.1_3.r
new file mode 100644
index 00000000..f878ef16
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.3/Ex6.1_3.r
@@ -0,0 +1,8 @@
+# Example : 3 Chapter : 6.1 Page No: 286
+# Eigen values and eigen vectors of Reflection matrix
+A<-matrix(c(0,1,1,0),ncol=2)
+sol<-eigen(A)
+lambda<-sol$values
+print("The eigen values of the matrix are")
+print(lambda)
+#The answer may slightly vary due to rounding off values
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.4/Ex6.1_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.4/Ex6.1_4.r
new file mode 100644
index 00000000..6d8b139e
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.4/Ex6.1_4.r
@@ -0,0 +1,81 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 4 Chapter : 6.1 Page No: 287
+# Eigen values and eigen vectors of Singualar matrix
+
+library(pracma)
+nullspacebasis <- function(A){
+ R<-rref(A)
+ m<-nrow(A)
+ n<-ncol(A)
+ pivotcol<-c() #vector to store the column numbers of pivot columns
+ freecol<-c() #vector to store the column numbers of free columns
+ i<-1
+ j<-1
+
+ # to find which columns are pivot and which are free
+ while(i<=m & j<=n){
+ if(R[i,j]==1){
+ pivotcol<-c(pivotcol,j)
+ i<-i+1
+ j<-j+1
+ }
+ else{
+ j<-j+1
+ }
+ }
+ y<-length(pivotcol)
+ freecol<-c(1:n)
+ freecol<-freecol[!freecol%in%pivotcol]
+ x<-length(freecol)
+ N<-c()
+ #find the basis for null space based on Row reduced echelon form of given matrix
+ if(y==n){
+ return(N)
+ }
+ for(i in 1:x){
+ temp<-c(1:n)
+ for(j in 1:x){
+ temp[freecol[j]]<-0
+ }
+ temp[freecol[i]]<-1
+ temp[freecol[i]]
+ for(j in 1:y){
+ temp[pivotcol[j]]<-R[j,freecol[i]]*-1
+ }
+ N<-c(N,temp)
+ }
+ N<-matrix(N,nrow=n,ncol=x)
+ #Basis for the nullspace of given matrix
+ return(N)
+}
+A<-matrix(c(1,2,2,4),ncol=2)
+sol<-eigen(A)
+print(sol)
+lambda<-sol$values
+print("The eigen values of the matrix are")
+print(lambda)
+I<-matrix(c(1,0,0,1),ncol=2)
+E1<-A-lambda[1]*I
+E1
+rref(E1)
+x1<-nullspacebasis(E1)
+E2<-A-lambda[2]*I
+rref(E2)
+x2<-nullspacebasis(E2)
+print("The eigen vectors of the matrix in normalized form are")
+print(x1)
+print(x2)
+#to get eigen vectors in the textbook multiply normalised vectors by scalars
+x1<-2*x1
+x2<--1*x2
+print("The eigen vectors of the matrix are ")
+print(x2)
+print(x1)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.a/Ex6_6.1A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.a/Ex6_6.1A.r
new file mode 100644
index 00000000..b7bf991a
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.a/Ex6_6.1A.r
@@ -0,0 +1,31 @@
+# Example : 6.1A Chapter : 6.1 Page No: 291
+# Eigen values and eigen vectors
+solution<-function(A){
+ sol<-eigen(A)
+ lambda<-sol$values
+ x<-sol$vectors #these are normalised eigen vectors
+ #to get the eigen vectors as in texxt book multiply these normalised vectors with scalars
+ x[,1]<-x[,1]*(1/x[1,1])
+ x[,2]<-x[,2]*(1/x[1,2])
+ print("The eigen values of the matrix are")
+ print(lambda)
+ print("The eigen vecotrs of the matrix respective to above eigen values are")
+ print(x)
+}
+
+A<-matrix(c(2,-1,-1,2),ncol=2)
+print("For A")
+solution(A)
+A2<-A%*%A
+print("For square of A")
+solution(A2)
+A1<-solve(A)
+print("For inverse of A")
+solution(A1)
+I<-matrix(c(1,0,0,1),ncol=2)
+A4I<-A+4*I
+print("For A+4I")
+solution(A4I)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.b/Ex6_6.1B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.b/Ex6_6.1B.r
new file mode 100644
index 00000000..f2c11521
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.1.b/Ex6_6.1B.r
@@ -0,0 +1,19 @@
+# Example : 6.1B Chapter : 6.1 Page No: 292
+# Eigen values and eigen vectors
+solution<-function(A){
+ sol<-eigen(A)
+ lambda<-round(sol$values)
+ x<-sol$vectors #these are normalised eigen vectors
+ #to get eigen vectors in text book multiply normalised eigen vectors with scalars
+ x[,1]<-x[,1]*(1/x[1,1])
+ x[,2]<-round(x[,2]*(1/x[1,2]))
+ x[,3]<-x[,3]*(1/x[1,3])
+ print("The eigen values of the matrix are")
+ print(lambda)
+ print("The eigen vectors of the matrix respective to above eigen values are")
+ print(x)
+}
+
+A<-matrix(c(1,-1,0,-1,2,-1,0,-1,1),ncol=3)
+solution(A)
+#The answer may slightly vary due to rounding off values
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.1/Ex6.2_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.1/Ex6.2_1.r
new file mode 100644
index 00000000..42b08fae
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.1/Ex6.2_1.r
@@ -0,0 +1,20 @@
+# Example : 1 Chapter : 6.2 Page No: 299
+# Diagonilizing a Matrix and Power of matrix computed from power of its diagonal matrix
+A<-matrix(c(1,0,5,6),ncol=2)
+lambda<-eigen(A)$values
+S<-eigen(A)$vectors
+S<-round(S)
+S1<-solve(S)
+Diag_matrix<-round(S1%*%A%*%S)
+print("Diagonal Matrix is ")
+print(Diag_matrix)
+A2<-A%*%A
+print("The square of matrix")
+print(A2)
+print("The Power of matrix can also be computed from its diagonal matrix as follows")
+A2_diag<-S%*%Diag_matrix%*%Diag_matrix%*%S1
+print("The square of matrix computed from its diagonal matrix")
+print(A2_diag)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0 \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.2/Ex6.2_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.2/Ex6.2_2.r
new file mode 100644
index 00000000..09d7f4c4
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.2/Ex6.2_2.r
@@ -0,0 +1,16 @@
+# Example : 2 Chapter : 6.2 Page No: 300
+# The diagonal matrix of any matrix contains the eigen values in its main diagonal
+A<-matrix(c(0.8,0.2,0.3,0.7),ncol=2)
+lambda<-eigen(A)$values
+print(lambda)
+S<-eigen(A)$vectors #Normlised eigen vectors, Answer can also be validated with normalised eigen vectors
+#to get eigen vector matrix in text book
+S[,1]<-S[,1]*(0.6/S[1,1])
+S[,2]<-S[,2]*(1/S[1,2])
+S1<-solve(S)
+Diag_matrix<-diag(2)*lambda
+print("S*diag_matrix(A)*S-1 is A")
+print(S%*%Diag_matrix%*%S1)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0 \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.b/Ex6_6.2B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.b/Ex6_6.2B.r
new file mode 100644
index 00000000..991d615a
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.2.b/Ex6_6.2B.r
@@ -0,0 +1,33 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 6.2B Chapter : 6.2 Page No: 306
+# Inverse Eigen values Determinant and eigen vector matrix
+library(pracma)
+A<-5*eye(4)-ones(4)
+eigenvalues<-eigen(A)$values
+print("Eigen Values of A ")
+print(eigenvalues)
+A1<-solve(A)
+print("Inverse of A ")
+print(A1)
+eigenvalues1<-eigen(A1)$value
+print("Eigen Values of A inverse ")
+print(eigenvalues1)
+detA<-det(A)
+print("Determinant of A")
+print(detA)
+x<-eigen(A)$vectors[,4] #normalized eigen vector of eigen value=1
+#toget eigen vector in text book
+x<-x*(1/x[1])
+print("Eigen vector of A for eigen value 1")
+print(x)
+print("The other eigen vectors are perpendicular to x since A is Symmetric so eigen vector matrix contains x with different signs as follows")
+S<-matrix(c(1,-1,1,-1,1,1,-1,-1,1,-1,-1,1,x),ncol=4)
+print(S)
+print("To get normalized matrix multiply by magnitude of vectors which is same for all and is 0.5")
+S<-0.5*S
+print(S) # The eigen vectors are with respect to 5,5,5,1 \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.1/Ex6.3_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.1/Ex6.3_1.r
new file mode 100644
index 00000000..72bb740f
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.1/Ex6.3_1.r
@@ -0,0 +1,22 @@
+# Example : 1 Chapter : 6.3 Page No: 313
+# Solve Differential equation
+
+# lambda1,lamda2,x1,x2,c,d are computed here.. for remaining details look textbook
+A<-matrix(c(0,1,1,0),ncol=2)
+lambda<-eigen(A)$values
+x<-eigen(A)$vectors #These are normalised eigen vectors
+#to get eigen vectors in textbook .. Multiply them with the scalars
+x[,1]<-x[,1]*(1/x[1,1])
+x[,2]<-x[,2]*(1/x[1,2])
+print(x)
+u<-c(4,2)
+cd<-solve(x,u)
+C<-cd[1]
+D<-cd[2]
+print("Lambda 1 and Lambda 2")
+print(lambda)
+print("x1 and x2")
+print(x)
+print("C and D are")
+print(C)
+print(D) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.2/Ex6.3_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.2/Ex6.3_2.r
new file mode 100644
index 00000000..d583fb2f
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.2/Ex6.3_2.r
@@ -0,0 +1,18 @@
+# Example : 2 Chapter : 6.3 Page No: 314
+# Solve Differential equation
+
+# lambda1,lamda2,lambda3,x1,x2,x3,c1,c2,c3 are computed here.. for remaining details look textbook
+A<-matrix(c(1,0,0,1,2,0,1,1,3),ncol=3)
+lambda<-eigen(A)$values
+x<-round(eigen(A)$vectors)
+u<-c(9,7,4)
+c<-solve(x,u)
+print("Lambda 3 and Lambda 2 and Lambda 1 are")
+print(lambda)
+print("x3 and x2 and x1")
+print(x)
+print("c3,c2 and c1 are")
+print(c)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.6/Ex6.3_6.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.6/Ex6.3_6.r
new file mode 100644
index 00000000..dad9885d
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.6/Ex6.3_6.r
@@ -0,0 +1,18 @@
+# Example : 6 Chapter : 6.3 Page No: 321
+# Solve Differential equation
+
+# lambda1,lamda2,x1,x2,c,d are computed here.. for remaining details look textbook
+A<-matrix(c(1,0,1,2),ncol=2)
+lambda<-eigen(A)$values
+x<-round(eigen(A)$vectors)
+u<-c(2,1)
+c<-solve(x,u)
+print("Lambda 1 and Lambda 2")
+print(lambda)
+print("x1 and x2")
+print(x)
+print("c1 and c2 are")
+print(c)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.b/Ex6_6.3B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.b/Ex6_6.3B.r
new file mode 100644
index 00000000..30f54de1
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.3.b/Ex6_6.3B.r
@@ -0,0 +1,18 @@
+# Example : 6.3B Chapter : 6.3 Page No: 322
+# Eigen Values and Eigen vectors of A
+A<-matrix(c(-2,1,0,1,-2,1,0,1,-2),ncol=3)
+eigenvalues<-eigen(A)$values
+x<-eigen(A)$vectors
+print("Eigen values of A are ")
+print(eigenvalues)
+print("Eigen vectors of A in normalised form")
+print(x)
+#to get eigen vectors in the textbook multiply normalised vectors by scalars
+x[,1]<-x[,1]*(1/x[1,1])
+x[,2]<-x[,2]*(1/x[1,2])
+x[,3]<-x[,3]*(1/x[1,3])
+print("Eigen vectors with respect to the above eigen values respectively are")
+print(x)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.1/Ex6.4_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.1/Ex6.4_1.r
new file mode 100644
index 00000000..9baefa7d
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.1/Ex6.4_1.r
@@ -0,0 +1,14 @@
+# Example : 1 Chapter : 6.4 Page No: 331
+# Eigen Values and Eigen vectors of A
+A<-matrix(c(1,2,2,4),ncol=2)
+lambda<-eigen(A)$values
+x<-eigen(A)$vectors #These are Normalised eigen vectors
+#to get eigen vectors in textbook
+x[,1]<-x[,1]*(1/x[1,1])
+x[,2]<-x[,2]*(2/x[1,2])
+print("Eigen values and eigen vectors of respective eigen values of A")
+print(lambda)
+print(x)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.4/Ex6.4_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.4/Ex6.4_4.r
new file mode 100644
index 00000000..423a09e1
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.4/Ex6.4_4.r
@@ -0,0 +1,23 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 4 Chapter : 6.4 Page No: 334
+# Pivots and Eigen values have same signs for the Symmetric matrices
+library(pracma)
+A<-matrix(c(1,3,3,1),ncol=2)
+u<-lu(A)$U
+pivots<-c(u[1,1],u[2,2])
+eigenvalues<-eigen(A)$values
+print("Eigen values and pivots have same signs for symmetric matrix")
+print(pivots)
+print(eigenvalues)
+print("This is not true if the matrix is not symmetric")
+B<-matrix(c(1,-1,6,-4),ncol=2)
+Bu<-lu(B)$U
+Bpivots<-c(Bu[1,1],Bu[2,2])
+Beigenvalues<-eigen(B)$values
+print(Bpivots)
+print(Beigenvalues) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.b/Ex6_6.4B.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.b/Ex6_6.4B.r
new file mode 100644
index 00000000..566bf027
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.4.b/Ex6_6.4B.r
@@ -0,0 +1,32 @@
+# Example : 6.4B Chapter : 6.4 Page No: 336
+# Eigen Values and Eigen vectors of given matrices
+A3<-matrix(c(2,-1,0,-1,2,-1,0,-1,2),ncol=3)
+eigenvalues<-eigen(A3)$values
+x<-eigen(A3)$vectors
+print("Eigen values of A3 are ")
+print(eigenvalues)
+print("Eigen vectors of A3 in normalised form are ")
+print(x)
+#to get eigen vectors in the textbook multiply normalised vectors by scalars
+x[,1]<-x[,1]*(1/x[1,1])
+x[,2]<-x[,2]*(sqrt(2)/x[1,2])
+x[,3]<-x[,3]*(1/x[1,3])
+print("Eigen vectors with respect to the above eigen values respectively are")
+print(x)
+B4<-matrix(c(1,-1,0,0,-1,2,-1,0,0,-1,2,-1,0,0,-1,1),ncol=4)
+B4eigenvalues<-eigen(B4)$values
+B4x<-eigen(B4)$vectors
+print("Eigen values of B4 are ")
+print(B4eigenvalues)
+print("Eigen vectors of B4 in normalised form are")
+print(B4x)
+#to get eigen vectors in the textbook multiply normalised vectors by scalars
+B4x[,1]<-B4x[,1]*(1/B4x[1,1])
+B4x[,2]<-B4x[,2]*(1/B4x[1,2])
+B4x[,3]<-B4x[,3]*(1/B4x[1,3])
+B4x[,4]<-B4x[,4]*(1/B4x[1,4])
+print("Eigen vectors with respect to the above eigen values respectively are")
+print(B4x)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation process
+#Both answers are correct , here it is taken -Ax+b=0 , In the text book it is considered as Ax-b=0
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.5.1/Ex6.5_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.5.1/Ex6.5_1.r
new file mode 100644
index 00000000..e9a01511
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.5.1/Ex6.5_1.r
@@ -0,0 +1,18 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 1 Chapter : 6.5 Page No: 344
+# Tests for positive definitenes
+library(pracma)
+A<-matrix(c(2,-1,0,-1,2,-1,0,-1,2),ncol=3)
+u<-lu(A)$U
+pivots<-c(u[1,1],u[2,2],u[3,3])
+upper_left_deteminants<-c(A[1,1],det(A[-3,-3]),det(A))
+eigenvalues<-eigen(A)$values
+print("All pivots, upper left determinants and eigen values are positive")
+print(pivots)
+print(upper_left_deteminants)
+print(eigenvalues) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.1/Ex6.6_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.1/Ex6.6_1.r
new file mode 100644
index 00000000..f385fe21
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.1/Ex6.6_1.r
@@ -0,0 +1,17 @@
+# Example : 1 Chapter : 6.6 Page No: 356
+# Similar matrices are matrices with same eigen values
+A<-matrix(c(0.5,0.5,0.5,0.5),ncol=2)
+Aev<-eigen(A)$values
+print("Eigen values of A ")
+print(Aev)
+Lambda<-matrix(c(1,0,0,0),ncol=2)
+Lev<-eigen(Lambda)$values
+print("eigen values of lambda matrix")
+print(Lev)
+M<-matrix(c(1,1,0,2),ncol=2)
+M1<-solve(M)
+M1AM<-M1%*%A%*%M
+M1AMev<-eigen(M1AM)$values
+print("EIgen values of M-1*A*M")
+print(M1AMev)
+print("A and M-1*A*M are similar matrices") \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.2/Ex6.6_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.2/Ex6.6_2.r
new file mode 100644
index 00000000..91ec2c0d
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.2/Ex6.6_2.r
@@ -0,0 +1,10 @@
+# Example : 2 Chapter : 6.6 Page No: 356
+# Similar matrices with repeated eigen values
+A<-matrix(c(0,0,1,0),ncol=2)
+Aev<-eigen(A)$values
+A1<-matrix(c(1,1,-1,-1),ncol=2)
+A1ev<-round(eigen(A1)$values)
+print("Both th egiven matrices are similar because their eigen values are same")
+print(Aev)
+print(A1ev)
+#The answer may slightly vary due to rounding off values
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.3/Ex6.6_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.3/Ex6.6_3.r
new file mode 100644
index 00000000..fb2496ae
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.3/Ex6.6_3.r
@@ -0,0 +1,9 @@
+# Example : 3 Chapter : 6.6 Page No: 357
+# Jordans theorem and Jordan Matrix
+J<-matrix(c(5,0,0,1,5,0,0,1,5),ncol=3)
+Jev<-eigen(J)$values
+JT<-t(J)
+JTev<-eigen(JT)$values
+print("Jordans theorem says that both J and transpose of J are similar")
+print(Jev)
+print(JTev) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.a/Ex6_6.6A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.a/Ex6_6.6A.r
new file mode 100644
index 00000000..58eccd09
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.6.a/Ex6_6.6A.r
@@ -0,0 +1,9 @@
+# Example : 3 Chapter : 6.6 Page No: 357
+# Pascals matrix and its inverse are similar
+A<-matrix(c(1,1,1,1,0,1,2,3,0,0,1,3,0,0,0,1),ncol=4)
+A1<-solve(A)
+Aev<-eigen(A)$values
+A1ev<-eigen(A1)$values
+print("Both pascal matrix and its inverse have same eigen values")
+print(Aev)
+print(A1ev) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.7.3/Ex6.7_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.7.3/Ex6.7_3.r
new file mode 100644
index 00000000..b61c47aa
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.7.3/Ex6.7_3.r
@@ -0,0 +1,8 @@
+# Example : 3 Chapter : 6.7 Page No: 366
+# Singular Value decomposition
+
+A<-matrix(c(2,-1,2,1),ncol=2)
+print("Singular value decomposition is given by")
+print(svd(A))
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation method followed.
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.7.4/Ex6.7_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.7.4/Ex6.7_4.r
new file mode 100644
index 00000000..ecd3e15f
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH6/EX6.7.4/Ex6.7_4.r
@@ -0,0 +1,8 @@
+# Example : 3 Chapter : 6.7 Page No: 366
+# Singular Value decomposition
+
+A<-matrix(c(2,1,2,1),ncol=2)
+print("Singular value decomposition is given by")
+print(svd(A))
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation method followed.
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.1/Ex7.3_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.1/Ex7.3_1.r
new file mode 100644
index 00000000..aee17518
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.1/Ex7.3_1.r
@@ -0,0 +1,7 @@
+# Example : 1 Chapter : 7.3 Page No: 400
+# Diagonaliazation of matrix
+A<-matrix(c(0.5,-0.5,-0.5,0.5),ncol=2)
+ev<-eigen(A)$values
+D<-matrix(c(ev[1],0,0,ev[2]),ncol=2)
+print("The diagonialized matrix")
+print(D) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.2/Ex7.3_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.2/Ex7.3_2.r
new file mode 100644
index 00000000..5d9120da
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.2/Ex7.3_2.r
@@ -0,0 +1,13 @@
+# Example : 2 Chapter : 7.3 Page No: 401
+# Similar Projection Matrices
+A<-matrix(c(0.5,-0.5,-0.5,0.5),ncol=2)
+Aev<-eigen(A)$values
+W<-matrix(c(2,0,1,1),ncol=2)
+W1<-solve(W)
+B<-W1%*%A%*%W
+print("Matrix B = W-1 * A * W")
+print(B)
+Bev<-eigen(B)$values
+print("A and B are similar matrices")
+print(Aev)
+print(Bev) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.3/Ex7.3_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.3/Ex7.3_3.r
new file mode 100644
index 00000000..8a7369ce
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.3/Ex7.3_3.r
@@ -0,0 +1,12 @@
+# Example : 3 Chapter : 7.3 Page No: 402
+# Polar Decomposition
+A<-matrix(c(2,-1,2,1),ncol=2)
+Q<-round(svd(A)$u)%*%t(svd(A)$v)
+H<-t(Q)%*%A
+print("Polar Decomposition A=QH")
+print("Q is ")
+print(Q)
+print("H is ")
+print(H)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation method followed.
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.4/Ex7.3_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.4/Ex7.3_4.r
new file mode 100644
index 00000000..eb937da9
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.4/Ex7.3_4.r
@@ -0,0 +1,12 @@
+# Example : 4 Chapter : 7.3 Page No: 404
+# Pseduoinverse of matrix
+A<-matrix(c(2,1,2,1),ncol=2)
+V<-svd(A)$v
+UT<-t(svd(A)$u)
+d<-svd(A)$d
+sigma1<-matrix(c(1/d[1],0,0,0),ncol=2)
+A1<-V%*%sigma1%*%UT
+print("The Pseduo inverse of the given matrix")
+print(A1)
+#The answer may slightly vary due to rounding off values
+#The answers provided in the text book may vary because of the computation method followed.
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.a/Ex7_7.3A.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.a/Ex7_7.3A.r
new file mode 100644
index 00000000..a01e1311
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH7/EX7.3.a/Ex7_7.3A.r
@@ -0,0 +1,24 @@
+# Example : 7.3A Chapter : 7.3 Page No: 405
+# leftinverse,rightinverse,Pseduoinverse of given matrices
+A1<-matrix(c(2,2),ncol=1)
+A2<-matrix(c(2,2),ncol=2)
+A3<-matrix(c(2,2,2,2),ncol=2)
+A1T<-t(A1)
+A2T<-t(A2)
+A1inv<-solve(A1T%*%A1)%*%A1T
+print("Left inverse of A1")
+print(A1inv)
+print(A1inv%*%A1)
+A2inv<-A2T%*%solve(A2%*%A2T)
+print("right inverse of A2")
+print(A2inv)
+print(A2%*%A2inv)
+
+#The answers given in the text book is wrong it is 1/8 .. not 1/sqrt(8)
+V1<-svd(A3)$v
+U1T<-t(svd(A3)$u)
+d<-svd(A3)$d
+sigma1<-matrix(c(1/d[1],0,0,0),ncol=2)
+A3inv<-2*(V1%*%sigma1%*%U1T)
+print("The Pseduo inverse of the given matrix")
+print(A3inv) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.1.1/Ex8.1_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.1.1/Ex8.1_1.r
new file mode 100644
index 00000000..25d952f3
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.1.1/Ex8.1_1.r
@@ -0,0 +1,14 @@
+# Example : 1 Chapter : 8.1 Page No: 413
+# Find movements , tensions, elongations of spring
+K<-matrix(c(2,-1,0,-1,2,-1,0,-1,2),ncol=3)
+K1<-solve(K)
+f<-c(1,1,1)#since all mi=m
+u<-K1%*%f
+print("Movements are given by mg/c * u and u is")
+print(u)
+A<-matrix(c(1,-1,0,0,0,1,-1,0,0,0,1,-1),ncol=3)
+e<-A%*%u
+print("Elongations are given by mg/c * e and e is")
+print(e)
+print("Tensions are given by mg * e and e is")
+print(e) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.1.2/Ex8.1_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.1.2/Ex8.1_2.r
new file mode 100644
index 00000000..5a83baa2
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.1.2/Ex8.1_2.r
@@ -0,0 +1,15 @@
+# Example : 2 Chapter : 8.1 Page No: 414
+# Find movements , tensions, elongations of spring
+K1<-matrix(c(2,-1,0,-1,2,-1,0,-1,1),ncol=3)
+K11<-solve(K1)
+f<-c(1,1,1)
+u<-K11%*%f
+print("Movements are given by mg/c * u and u is")
+print(u)
+A<-matrix(c(1,-1,0,0,1,-1,0,0,1),ncol=3)
+e<-A%*%u
+print("Elongations are given by mg/c * e and e is")
+print(e)
+y<-solve(t(A))%*%f
+print("Tensions are given by mg * y and y is")
+print(y) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.2.1/Ex8.2_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.2.1/Ex8.2_1.r
new file mode 100644
index 00000000..d5687138
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.2.1/Ex8.2_1.r
@@ -0,0 +1,15 @@
+# Example : 1 Chapter : 8.2 Page No: 427
+# Find the currents
+A<-matrix(c(-1,-1,0,-1,0,0,1,0,-1,0,-1,0,0,1,1,0,0,-1,0,0,0,1,1,1),ncol=4)
+AT<-t(A)
+Laplacian_matrix<-AT%*%A
+Laplacian_matrix<-Laplacian_matrix[-4,-4]
+b<-c(1,0,0)
+x<-solve(Laplacian_matrix,b)
+x<-c(x,0)
+print("Voltages are given by S * ")
+print(x)
+print("S is source")
+y<--1*A%*%x
+print("Currents are given by S * ")
+print(y) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.1/Ex8.3_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.1/Ex8.3_1.r
new file mode 100644
index 00000000..08516b62
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.1/Ex8.3_1.r
@@ -0,0 +1,8 @@
+# Example : 1 Chapter : 8.3 Page No: 432
+# Positive Markov matrix Application.
+A<-matrix(c(0.8,0.2,0.05,0.95),ncol=2)
+u0<-c(0.02,0.98)
+u1<-A%*%u0
+print(u1)
+u2<-A%*%u1
+print(u2) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.3/Ex8.3_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.3/Ex8.3_3.r
new file mode 100644
index 00000000..e66f77d2
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.3/Ex8.3_3.r
@@ -0,0 +1,11 @@
+# Example : 3 Chapter : 8.3 Page No: 433
+# Markov matrix Application.
+A<-matrix(c(0,0.5,0.5,0.5,0,0.5,0.5,0.5,0),ncol=3)
+u0<-c(8,16,32)
+u1<-A%*%u0
+u2<-A%*%u1
+u3<-A%*%u2
+print("Populations in three groups in subsequent months")
+print(u1)
+print(u2)
+print(u3) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.4/Ex8.3_4.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.4/Ex8.3_4.r
new file mode 100644
index 00000000..f94b4967
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.4/Ex8.3_4.r
@@ -0,0 +1,10 @@
+# Example : 4 Chapter : 8.3 Page No: 437
+# Linear Algebra in Economy
+A<-matrix(c(0.2,0.4,0.5,0.3,0.4,0.1,0.4,0.1,0.3),ncol=3)
+lambda<-eigen(A)$values
+print("Lambda max is ")
+print(lambda[1])
+I<-matrix(c(1,0,0,0,1,0,0,0,1),ncol=3)
+A1<-solve(I-A)
+print(A1)
+#The answers may vary due to rounding off values
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.5/Ex8.3_5.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.5/Ex8.3_5.r
new file mode 100644
index 00000000..1858f801
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.3.5/Ex8.3_5.r
@@ -0,0 +1,10 @@
+# Example : 5 Chapter : 8.3 Page No: 437
+# Linear Algebra in Economy
+A<-matrix(c(0,1,4,0),ncol=2)
+lambda<-eigen(A)$values
+print("Lambda max is ")
+print(lambda[1])
+I<-matrix(c(1,0,0,1),ncol=2)
+A1<-solve(I-A)
+print(A1)
+#The answers may vary due to rounding off values
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.5.2/Ex8.5_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.5.2/Ex8.5_2.r
new file mode 100644
index 00000000..634de0d9
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.5.2/Ex8.5_2.r
@@ -0,0 +1,19 @@
+#integrate is a function from package stats which is included in R by default
+#if not install package stats
+# Example : 2 Chapter : 8.5 Page No: 448
+# length of function sinx and sinx and cosx are orthogonal in function space
+f1<-function(x){
+ return (sin(x)*sin(x))
+}
+f2<-function(x){
+ return (sin(x)*cos(x))
+}
+print("Inner product of sinx and sinx is ")
+lsin2x<-integrate(f1,0,2*pi)
+print(lsin2x)
+print("Length of sinx is square root of above inner product")
+print(sqrt(lsin2x$value))
+print("Cos x and sinx are orthogonal in functional space because their inner product equals zero")
+lsinxcosx<-integrate(f2,0,2*pi)
+print(lsinxcosx)
+#The answer may slightly vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.6.2/Ex8.6_6.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.6.2/Ex8.6_6.r
new file mode 100644
index 00000000..91c1dffb
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH8/EX8.6.2/Ex8.6_6.r
@@ -0,0 +1,6 @@
+# Example : 6 Chapter : 8.6 Page No: 457
+# Singualar Value Decomposition
+gradematrixA<-matrix(c(-6,0,4,2,2,4,0,-6,0,-6,2,4,4,2,-6,0),ncol=4)
+print("SVD of Grade matrix is")
+print(svd(gradematrixA))
+#The answers may vary due to rounding off values \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.2.2/Ex9.2_2.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.2.2/Ex9.2_2.r
new file mode 100644
index 00000000..df06d5b6
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.2.2/Ex9.2_2.r
@@ -0,0 +1,11 @@
+# Example : 2 Chapter : 9.2 Page No: 475
+# Norm of diagonal matrix
+A<-matrix(c(2,0,0,3),ncol=2)
+print("The norm of the diagonal matrix is its largest entry")
+print(A[2,2])
+print("Largest eigen value and norm are equal for this matrix")
+lambdamax<-eigen(A)$values[1]
+print(lambdamax)
+print("Eigen vectors of this matrix are")
+ev<-round(eigen(A)$vectors)
+print(ev)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.2.3/Ex9.2_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.2.3/Ex9.2_3.r
new file mode 100644
index 00000000..ef6c255b
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.2.3/Ex9.2_3.r
@@ -0,0 +1,7 @@
+# Example : 3 Chapter : 9.2 Page No: 478
+# Condition number for positive definite matrix
+A<-matrix(c(6,0,0,2),ncol=2)
+print("Condition number for positive definite matrix is max.eigen value/min.eign value")
+condition_number=eigen(A)$values[1]/eigen(A)$values[2]
+print("Condition number for A")
+print(condition_number) \ No newline at end of file
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.3.1/Ex9.3_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.3.1/Ex9.3_1.r
new file mode 100644
index 00000000..f7c2cae7
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH9/EX9.3.1/Ex9.3_1.r
@@ -0,0 +1,20 @@
+# Example : 1 Chapter : 9.3 Page No: 482
+# Powers of some matrices can be calculated easily with max eigen value
+B<-matrix(c(0.6,0.6,0.5,0.5),ncol=2)
+B1<-matrix(c(0.6,0,1.1,0.5),ncol=2)
+lambda<-eigen(B)$values
+lambda1<-eigen(B1)$values
+lmax<-lambda[1]
+l1max<-lambda1[1]
+print("Lambda max of B is")
+print(lmax)
+print("Lambda max of B1 is ")
+print(l1max)
+B2<-B%*%B
+print("B square is")
+print(B2)
+B2<-lmax*B
+print(B2)
+print("B1 square has 0.6*0.6 and 0.5*0.5 on its diagonal")
+B12<-B1%*%B1
+print(B12)
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/README.txt b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/README.txt
new file mode 100644
index 00000000..204fc7ef
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/README.txt
@@ -0,0 +1,18 @@
+About The Contributor
+
+Contributed By: Malapati Venkata Dharun Raghava
+Course: Bachelor Of Technology
+Branch: Computer Science And Engineering
+College/Institute/Organization: Sri Venkateswara University College Of Engineering
+
+About The Book
+
+Book: Introduction To Linear Algebra
+Author: Gilbert Strang
+Publisher: Wellesley - Cambridge Press Wellesley Ma Usa
+Year Of Publication: 2009
+ISBN: 978-0-9802327-1-4
+Edition: 4
+
+
+Textbook Companion Project By FOSSEE, IIT Bombay