1. Learn
  2. /
  3. Courses
  4. /
  5. Linear Algebra for Data Science in R

Exercise

Reflections

In the last exercise, you looked at stretching or shrinking components of a vector.

In this one, you'll apply a reflection matrix to the vector b <- c(2, 1).

Instructions

100 XP
  • A, B, C and b are loaded for you. Use matrix multiplication in R to show that multiplication by the matrix \(A\) with R output:
> A
     [,1] [,2]
[1,]    -1    0
[2,]    0    1

reflects the vector b = c(2, 1) about the y axis.

  • Show that multiplication by the matrix \(B\) with R output:
> B
     [,1] [,2]
[1,]    1    0
[2,]    0   -1

reflects b about the x axis.

  • What does the matrix \(C\) with R output:
> C
     [,1] [,2]
[1,]    -4    0
[2,]    0    -2

do to b?