HW 1 for CS 4220
You may (and probably should) talk about problems with the each other, with the TAs, and with me, providing attribution for any good ideas you might get. Your final write-up should be your own.
1: Placing Parens
Suppose
hw1p1a (generic function with 1 method)
"P1a code passes correctness test"
"Estimated complexity: O(n^2.876225695250725)"
hw1p1b (generic function with 1 method)
"P1b code passes correctness test"
"Estimated complexity: O(n^2.2188158938444063)"
hw1p1c (generic function with 1 method)
"P1c code passes correctness test"
"Estimated complexity: O(n^3.006758543014128)"
2: Making matrices
In terms of the power basis, write
The matrix
corresponding to the inner product between two quadratics; that is, if and , then .The matrix
corresponding to the linear map from quadratics to linears associated with differentiation.
The following testers will sanity check your answer, but you should also (briefly) describe how you got the right matrix.
3×3 Matrix{Float64}:
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
"A fails basic check"
2×3 Matrix{Float64}:
0.0 0.0 0.0
0.0 0.0 0.0
"B fails basic check"
3: Crafty cosines
Suppose
Express
compute_dot (generic function with 1 method)
"Fails sanity check"