Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168756
Image: ubuntu2004

Sage in Simple Rings

Tim McLarnan, Earlham College

This very short worksheet illustrates how easy it is to use Sage to do arithmetic in a variety of different rings.  Hopefully the calculations here are more or less self-explanatory.

Z7 = Integers(7)
Z7(1/2)
\newcommand{\Bold}[1]{\mathbf{#1}}4
Z7(2).sqrt()
\newcommand{\Bold}[1]{\mathbf{#1}}3
PR.<x> = PolynomialRing(Z7)
(x^2-2).factor()
\newcommand{\Bold}[1]{\mathbf{#1}}(x + 3) \cdot (x + 4)
QT.<t> = PolynomialRing(QQ)
(t^2-2).factor()
\newcommand{\Bold}[1]{\mathbf{#1}}(t^{2} - 2)
RZ.<z> = PolynomialRing(RR)
(z^2-2).factor()
\newcommand{\Bold}[1]{\mathbf{#1}}(z - 1.41421356237310) \cdot (z + 1.41421356237310)
(t^3-t^2+3*t-10).factor()
\newcommand{\Bold}[1]{\mathbf{#1}}(t - 2) \cdot (t^{2} + t + 5)
(z^3-z^2+3*z-10).factor()
\newcommand{\Bold}[1]{\mathbf{#1}}(z - 2.00000000000000) \cdot (z^{2} + z + 5.00000000000000)
CY.<y> = PolynomialRing(CC)
(y^3-y^2+3*y-10).factor()
\newcommand{\Bold}[1]{\mathbf{#1}}(y - 2.00000000000000) \cdot (y + 0.500000000000000 - 2.17944947177034i) \cdot (y + 0.500000000000000 + 2.17944947177034i)