This repository contains the course materials from Math 157: Intro to Mathematical Software.
Creative Commons BY-SA 4.0 license.
License: OTHER
Math 157: Intro to Mathematical Software
UC San Diego, winter 2018
Homework 2: due January 26, 2018
Please enter all answers within this notebook unless otherwise specified. As usual, don't forget to cite sources and collaborators.
Problem 1: Comparison of relevant software
Grading criterion: correctness. Remember to cite all sources!
1a. Specify whether each of the following computer algebra systems fits the Open Source Initiative definition of an "open-source" project (https://opensource.org/definition). If not, identify a criterion which fails to be met.
GAP
Geogebra
Magma
Maple
Mathematica
MATLAB
Pari/GP
Sage
Sympy
1b. For each of the following projects, give a one-sentence description of the project, and indicate in what year and by what person/organization the first version was released.
Cython
Julia
MacSyma / Maxima (treat as one project)
Numpy
Pandas
Python
R
Sage
Scipy
TeX / LaTeX (treat as one project)
Problem 2: Under the hood
Grading criterion: correctness.
For each of the following Sage commands, identify one external component of Sage which is used to execute that command, and indicate how you did so. (Hint: in addition to the Sage documentation, inspecting docstrings or even source code may be helpful.)
Problem 3: Mersenne primes
Grading criteria: correctness of explanation and code.
3a. A Mersenne prime is a prime number of the form where is itself prime. (Note that these are the only possible primes of the form where is a positive integer). They are called this because Marin Mersenne was the first person to attempt to list these primes systematically: he claimed that for , is prime if and only if This list turns out to be incorrect; write Sage code to compute the correct list.
3b. On January 3, 2018, the Great Internet Mersenne Prime Search announced that is the "50th known Mersenne prime." Why didn't they announce that it is the "50th Mersenne prime"?
3c. The little Fermat theorem states that if is prime, then . This can be used as a test for primality (the Fermat test) which has no false negatives, but does have some false positives (see part (d)).
Explain why the following code cannot be used to apply the Fermat test to the number , then give an alternate approach that does work.
(your explanation goes here)
3d. Find all integers up to 1000 which are false positives for the Fermat test. These include Carmichael numbers, in case you want to read more about this phenomenon.
Problem 4: Defining and evaluating a function
Grading criteria: correctness of code.
4a. Define in Sage the symbolic function (not a Python function) .
4b. Compute exactly (i.e., your answer should be a symbolic expression).
4c. Compute numerically (i.e., your answer should be a decimal expansion).
4d. Plot from to .
Problem 5: Numerical root-finding
Grading criteria: correctness (of code) and thoroughness (of explanation).
5a. Plot the function on the interval .
5b. Use Sage to compute the derivative and antiderivative of .
5c. Find numerical approximations to all of the zeros of .
5d. In as much detail as you can, justify mathematically why your list in (c) is complete. Your explanation may include additional Sage code if necessary.
Problem 6: Taylor series
Grading criteria: correctness.
6a. Define the function . Find the degree 3 Taylor series of about .
6b. Make a single Sage plot on the interval showing both and its degree 10 Taylor series about .