# 2.37

# SICP Exercise 2.37

This was one of the hardest problems yet.

```
(define (dot-product v w)
(accumulate + 0 (map * v w)))
(define (matrix-*-vector m v)
(map (lambda (row-m)
(dot-product row-m v))
m))
(define (transpose mat)
(accumulate-n cons nil mat))
(define (matrix-*-matrix m n)
(let ((cols (transpose n)))
(map (lambda (row-m)
(matrix-*-vector cols row-m)) m)))
```