# Matrix of (kg/batch) Trail Mix
<- matrix(c(7, 6, 2, 6, 4, 5, 2, 5, 8), nrow = 3, ncol = 3)
trails trails
## [,1] [,2] [,3]
## [1,] 7 6 2
## [2,] 6 4 5
## [3,] 2 5 8
# Find Batches (trails divided by 15)
<- trails/15
trails_batch trails_batch
## [,1] [,2] [,3]
## [1,] 0.4666667 0.4000000 0.1333333
## [2,] 0.4000000 0.2666667 0.3333333
## [3,] 0.1333333 0.3333333 0.5333333
# Cost of Trail Mix
<- matrix(c(3.69, 3.86, 4.45), nrow = 3, ncol = 1)
trails_cost trails_cost
## [,1]
## [1,] 3.69
## [2,] 3.86
## [3,] 4.45
# Solve to check for linearity
<- solve(trails_batch, trails_cost)
results results
## [,1]
## [1,] 2.55
## [2,] 4.65
## [3,] 4.80