For the matrix A, find A^2, A^3, A^4. Find the general formula for A^n for any positive integer.
So first, I need to make the matrix.
A <- matrix(c(1,0,2,1), nrow = 2, ncol = 2)
A
## [,1] [,2]
## [1,] 1 2
## [2,] 0 1
Next, find A^2, A^3, A^4
A ** 2
## [,1] [,2]
## [1,] 1 4
## [2,] 0 1
A ** 3
## [,1] [,2]
## [1,] 1 8
## [2,] 0 1
A ** 4
## [,1] [,2]
## [1,] 1 16
## [2,] 0 1
Since this matrix consists of 0 and 1 mostly, the only position with a general formula is the 2 which would be 2^n. So for any n in A^n, the matrix will be:
matrix(c(1,0,"2**n",1), nrow = 2, ncol = 2)
## [,1] [,2]
## [1,] "1" "2**n"
## [2,] "0" "1"