Exercise 2: Composing S and R in Both Orders — Possible Solution ==================================================================== GIVEN ------------------------------ w = [2, -1] S = [[3, 0], [0, 2]] R = [[0, -1], [1, 0]] STEP 1: COMPUTING R x S ("SCALE FIRST, THEN ROTATE") ------------------------------ Row 0, Col 0: (0)(3) + (-1)(0) = 0 Row 0, Col 1: (0)(0) + (-1)(2) = -2 Row 1, Col 0: (1)(3) + (0)(0) = 3 Row 1, Col 1: (1)(0) + (0)(2) = 0 R x S = [[0, -2], [3, 0]] Applying to w: (R x S) w = [(0)(2) + (-2)(-1), (3)(2) + (0)(-1)] = [0 + 2, 6 + 0] = [2, 6] STEP 2: COMPUTING S x R ("ROTATE FIRST, THEN SCALE") ------------------------------ Row 0, Col 0: (3)(0) + (0)(1) = 0 Row 0, Col 1: (3)(-1) + (0)(0) = -3 Row 1, Col 0: (0)(0) + (2)(1) = 2 Row 1, Col 1: (0)(-1) + (2)(0) = 0 S x R = [[0, -3], [2, 0]] Applying to w: (S x R) w = [(0)(2) + (-3)(-1), (2)(2) + (0)(-1)] = [0 + 3, 4 + 0] = [3, 4] STEP 3: CONFIRMING THE RESULTS DIFFER ------------------------------ (R x S) w = [2, 6] (S x R) w = [3, 4] The two results are different, confirming order genuinely matters here, not just in principle. WHICH ORDER MEANS WHAT ------------------------------ R x S applied to w = [2, 6] represents "scale w first, then rotate the scaled result" (S is the rightmost matrix, applied first). S x R applied to w = [3, 4] represents "rotate w first, then scale the rotated result" (R is the rightmost matrix, applied first). WHY THIS WORKS AS AN ANSWER ------------------------------ Both combined matrices are computed using this chapter's own row-by- column multiplication rule, applied to the same starting vector w, and the "which order means what" explanation follows directly from this chapter's own stated convention that A x B means "apply B first, then A" - rather than guessing which combined matrix corresponds to which real-world sequence.