To solve this problem, I will utilize the rref() (Reduced Row Echelon Form) function provided by R’s pracma (Practical Numerical Math Functions) package - https://www.rdocumentation.org/packages/pracma/versions/1.9.9/topics/rref.
# Create matrices for 'b' and 'W' so we can solve the problem in R.
matrix_b <- matrix(c(1, 1, 0, 1), 4, 1)
matrix_w <- matrix(c(1, 2, -1, 1, 1, 0, 3, 1, 2, 1, 1, 2), 4, 3)
# Combine matrices b and W so we can check for the existence of a
# linear combination of vectors equal to b in the resulting span.
matrix_b_w_combined <- cbind(matrix_w, matrix_b)
# Transform the combined matrix to 'reduced row echelon form'.
reduced_row_form <- rref(matrix_b_w_combined)
# Output the result.
reduced_row_form
## [,1] [,2] [,3] [,4]
## [1,] 1 0 0 0.3333333
## [2,] 0 1 0 0.0000000
## [3,] 0 0 1 0.3333333
## [4,] 0 0 0 0.0000000
In order for b to be considered an element of W (in the subspace W), There must be a linear combination of vectors in the combined span Wb equal to b.
‘b’ consists of the values 1, 1, 0, 1. In the “reduced_row_form” span above, the diagonal line cutting through the span consists of the values 1, 1, 1, 0 which is a linear combination of vectors equal to b, and therefore we can say that “b is in the subspace W”.
Answer: b is in the subspace W.