<jupyter_start><jupyter_text>Problem 1, A return to Lagrange Polynomials<jupyter_code>def sin(x):
    return np.sin(x)
L = p1.Lagrange(sin, 1000, 0, 2 * np.pi, [-3,3,0,1])<jupyter_output><empty_output><jupyter_text>As you can see, the object is instantiated, so let's graph stuff<jupyter_code>L.graph(sin, 20, -2, 2, [-3,3,0,1])<jupyter_output><empty_output><jupyter_text>Which is a portion of the sin graph, well done!  Problem 2, Langrange, part 2 Unfortunately, I cannot find this problem in edition 2 of the book, so here's a picture of a surprised cat in ascii ^(0.0)^  Problem 3, Polynomials and Vectorization<jupyter_code>%timeit poly1 = p3.Polynomial([1,13,2,2.5,7,8])
%timeit poly2 = p3.Polynomial([1,13,2,2.5,7,8])
poly1 = p3.Polynomial([1,13,2,2.5,7,8])
poly2 = p3.Polynomial([1,13,2,2.5,7,8])

%timeit result = poly1.__add__(poly2)<jupyter_output>The slowest run took 10.33 times longer than the fastest. This could mean that an intermediate result is being cached 
100000 loops, best of 3: 2.22 µs per loop
The slowest run took 4.01 times longer than the fastest. This could mean that an intermediate result is being cached 
100000 loops, best of 3: 2.2 µs per loop
The slowest run took 5.61 times longer than the fastest. This could mean that an intermediate result is being cached 
100000 loops, best of 3: 8.03 µs per loop<jupyter_text>Problem 4, Polynomials and Dictionaries<jupyter_code>%timeit poly1 = p4.Polynomial({0:2, 1:3, 2:4, 3:5, 4:6, 5:7, 6:8, 7:9})
%timeit poly2 = p4.Polynomial({0:2, 1:3, 2:4, 3:5, 4:6, 5:7, 6:8, 7:9})
poly1 = p4.Polynomial({0:2, 1:3, 2:4, 3:5, 4:6, 5:7, 6:8, 7:9})
poly2 = p4.Polynomial({0:2, 1:3, 2:4, 3:5, 4:6, 5:7, 6:8, 7:9})

%timeit result = poly1.__add__(poly2)<jupyter_output>The slowest run took 4.38 times longer than the fastest. This could mean that an intermediate result is being cached 
1000000 loops, best of 3: 707 ns per loop
1000000 loops, best of 3: 715 ns per loop
1000000 loops, best of 3: 1.72 µs per loop
{'fraction_non_alphanumeric': 0.12860759493670887, 'fraction_numerical': 0.11037974683544304, 'mean_word_length': 5.175, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '102730', 'license': 'MIT', 'n_tokens_mistral': 891, 'n_tokens_neox': 774, 'n_words': 263, 'path': 'hw7.ipynb', 'repo_name': 'chapman-phys227-2016s/hw-7-C0deMonkee', 'size': '1975'}