Get startedGet started for free

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).

This exercise is part of the course

Linear Algebra for Data Science in R

View Course

Exercise instructions

  • 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?

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Multiply A by b
A%*%___

# Multiply B by b 
___%*%b

# Multiply C by b 
C___b
Edit and Run Code