Lecture 16: Review of the First 15 LecturesΒΆ
In the first 15 lectures we explored the extensive number system of Sage, manipulated polynomials and general expressions.
Below is a first, preliminary list of questions to review. Consider also the quizzes and homework assignments.
Explain the difference between
1.0 + 10**(-32)
and1 + 10**(-32)
.The Gelfond-Schneider constant is \(2^{\sqrt{2}}\). Give all Sage commands
to compute a rational approximation for \(2^{\sqrt{2}}\) accurate with 5 decimal places;
to show that the accuracy of this approximation is indeed 5 decimal places;
to compute a sequence of 10 consecutive rational approximations, starting with 5 decimal places and increasing in accuracy with one decimal place in each step of the sequence.
Explain the difference between
x = polygen(QQ)
andvar('x')
.Consider the polynomial \(p = 97 x^{45} - 62 x^{46} - 73 x^{31}\). What is the best way to evaluate \(p\) at hardware floating point numbers? Give the relevant Sage commands and compare between the straightforward evaluation of the expression for \(p\).
Define a function
whatis
which stores definitions. Below is a session with this function:whatis('computer algebra')
returnscall again with the definition for computer algebra
whatis('computer algebra', 'the study of algorithms in symbolic computation')
stores the definition for
'computer algebra'
whatis('computer algebra')
returnsthe study of algorithms in symbolic computation
Consider the polynomial \(p = 25 x^3 + 12 x^2 + 26 x + 4\) over a finite field of size 29, similar to working modulo 29.
Does the polynomial factor over this field?
Give the Sage commands to add sufficiently many formal roots to the field so \(p\) has three roots over the extended number field.
Write the symbolic factorization of \(p\) in linear factors below.
Write a Python function
python_sum
which takes on input a positive integer \(n\) and which returns the floating-point value of\[\frac{\pi}{n} \sum_{i=1}^{n-1} \cos\left( - \frac{\pi}{2} + i \frac{\pi}{n} \right).\]Write a more efficient version
numpy_sum
using vectorization.Time the two versions to illustrate the efficiency.
Explain how rational expressions are normalized. Illustrate with an example.
Type
var('x,y'); q = (x^2 - y)/(y^2 - x)
and draw the expression three ofq
.Give the Sage commands to transform \(( x + (z^2 + 1))(y - (z^2+1))\) into \(x y + (-z^2 - 1) x + (z^2 + 1) y - z^4 - 2 z^2 - 1\).