UNIVERSIDAD CENTRAL DEL ECUADOR

FACULTAD DE CIENCIAS ECONOMICAS

SISTEMAS DE INFORMACIÓN GEOGRÁFICA

Autores

-Rene Avila
-Michael Chacaguasay
-Johann Tul
-Bryan Venegas

PROBLEMA 1

Considerando la siguiente matriz

A<-c(1,2,3,4,2,4,6,8,3,6,9,12)
dim(A)<-c(4,3)
A
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    2    4    6
## [3,]    3    6    9
## [4,]    4    8   12

Problema 2

Introducir la matriz identidad de tamaño 4x4 en RStudio (sin usar un vector de 16 valores)

i<-diag(1,4,4)
i
##      [,1] [,2] [,3] [,4]
## [1,]    1    0    0    0
## [2,]    0    1    0    0
## [3,]    0    0    1    0
## [4,]    0    0    0    1

Problema 3

Encontrar la matriz inversa de L, donde L se define como:

l<-matrix(c(1,-1,2,2,-1,7,-4,5,-3))
dim(l)<-c(3,3)
l
##      [,1] [,2] [,3]
## [1,]    1    2   -4
## [2,]   -1   -1    5
## [3,]    2    7   -3

Para este ejercicio se debe isntalar el paquete “matlib”.

library(matlib)
## Warning: package 'matlib' was built under R version 4.1.3
Inverse(l,verbose=FALSE,fractions=TRUE,latex=TRUE)
##       [,1]  [,2] [,3]
## [1,] -16.0 -11.0  3.0
## [2,]   3.5   2.5 -0.5
## [3,]  -2.5  -1.5  0.5

Problema 4

Suponga que se quiere ingresar una matriz con muchas entradas como la matriz P que se presenta a continuación.

#p<-as.matrix(Matriz)
#p

Problema 5

Resolver el siguiente sistema de ecuaciones usando R:

d<-matrix(c(1,-2,5,-7),ncol = 2,nrow = 2)
d
##      [,1] [,2]
## [1,]    1    5
## [2,]   -2   -7
b<-c(7,-5)

showEqn(d,b)
##  1*x1 + 5*x2  =   7 
## -2*x1 - 7*x2  =  -5
d<-matrix(c(1,-2,5,-7),ncol = 2, nrow = 2)
b<-c(7,5)
library(matlib)
Solve(d,b,verbose=TRUE,fractions = TRUE)
## 
## Initial matrix:
##      [,1] [,2] [,3]
## [1,]  1    5    7  
## [2,] -2   -7    5  
## 
## row: 1 
## 
##  exchange rows 1 and 2 
##      [,1] [,2] [,3]
## [1,] -2   -7    5  
## [2,]  1    5    7  
## 
##  multiply row 1 by -1/2 
##      [,1] [,2] [,3]
## [1,]    1  7/2 -5/2
## [2,]    1    5    7
## 
##  subtract row 1 from row 2 
##      [,1] [,2] [,3]
## [1,]    1  7/2 -5/2
## [2,]    0  3/2 19/2
## 
## row: 2 
## 
##  multiply row 2 by 2/3 
##      [,1] [,2] [,3]
## [1,]    1  7/2 -5/2
## [2,]    0    1 19/3
## 
##  multiply row 2 by 7/2 and subtract from row 1 
##      [,1]  [,2]  [,3] 
## [1,]     1     0 -74/3
## [2,]     0     1  19/3
## x1    =  -74/3 
##   x2  =   19/3

Problema 6

Realice el determínate de la siguiente matriz, la solución manual se adjunta, usted debe realizarlo por R, puede usar la función del y comprobar los resultados.

a<-matrix(c(1,7,6,4,2,8,9,5,3),ncol = 3,nrow = 3)
a
##      [,1] [,2] [,3]
## [1,]    1    4    9
## [2,]    7    2    5
## [3,]    6    8    3
Det=(minor(a,1,1)
     -minor(a,1,2)
     +2*minor(a,1,3))
det(a)
## [1] 398

Problema 7

Realizar en R la transpuesta de la matriz propuesta a continuación:

a<-matrix(c(1,4,7,2,5,8,3,6,9),3,3)
a
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    4    5    6
## [3,]    7    8    9
e<-t(a)
e
##      [,1] [,2] [,3]
## [1,]    1    4    7
## [2,]    2    5    8
## [3,]    3    6    9