Skip to content

Commit 0f5045d

Browse files
committed
Updated
1 parent 2e99c5e commit 0f5045d

File tree

1 file changed

+103
-52
lines changed

1 file changed

+103
-52
lines changed

sage-start-here.ipynb

Lines changed: 103 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7+
"This document is one of [More SageMath Tutorials](https://more-sagemath-tutorials.readthedocs.io/en/latest/).\n",
8+
"You may [edit it on github](http://github.com/sagemath/more-sagemath-tutorials/).\n",
79
"$ \\def\\NN{\\mathbb{N}} $\n",
810
"$ \\def\\ZZ{\\mathbb{Z}} $\n",
911
"$ \\def\\QQ{\\mathbb{Q}} $\n",
@@ -18,7 +20,7 @@
1820
"cell_type": "markdown",
1921
"metadata": {},
2022
"source": [
21-
"# Tutorial: start here!"
23+
"# Start here!"
2224
]
2325
},
2426
{
@@ -278,48 +280,97 @@
278280
"cell_type": "markdown",
279281
"metadata": {},
280282
"source": [
281-
"### Algebra\n",
282-
"\n",
283-
"\n",
284-
" sage: factor(x^100 - 1)\n",
285-
"\n",
286-
"sage: p = 54*x^4+36*x^3-102*x^2-72*x-12\n",
287-
"sage: p.factor()\n",
288-
"6*(x^2 - 2)*(3*x + 1)^2\n",
289-
"\n",
290-
"sage: for K in [ZZ, QQ, ComplexField(16), QQ[sqrt(2)], GF(5)]:\n",
291-
"….: print K, “:”; print K[‘x’](p).factor()\n",
292-
"Integer Ring :\n",
293-
"2 * 3 * (3*x + 1)^2 * (x^2 - 2)\n",
294-
"Rational Field :\n",
295-
"(54) * (x + 1/3)^2 * (x^2 - 2)\n",
296-
"Complex Field with 16 bits of precision :\n",
297-
"(54.00) * (x - 1.414) * (x + 0.3333)^2 * (x + 1.414)\n",
298-
"Number Field in sqrt2 with defining polynomial x^2 - 2 :\n",
299-
"(54) * (x - sqrt2) * (x + sqrt2) * (x + 1/3)^2\n",
300-
"Finite Field of size 5 :\n",
301-
"(4) * (x + 2)^2 * (x^2 + 3)\n",
302-
"\n",
303-
"sage: ZZ.category()\n",
304-
"Category of euclidean domains\n",
305-
"\n",
306-
"sage: sorted( ZZ.category().axioms() )\n",
307-
"[‘AdditiveAssociative’, ‘AdditiveCommutative’, ‘AdditiveInverse’, ‘AdditiveUnital’,\n",
308-
"\n",
309-
"‘Associative’, ‘Commutative’,\n",
310-
"‘Distributive’, ‘NoZeroDivisors’, ‘Unital’]\n",
311-
"\n",
312-
"\n",
313-
"\n",
314-
"\n",
315-
"\n",
316-
"\n",
317-
"\n",
318-
"\n",
319-
"\n",
320-
"\n",
321-
" ‘Associative’, ‘Commutative’,\n",
322-
"‘Distributive’, ‘NoZeroDivisors’, ‘Unital’]"
283+
"### Algebra"
284+
]
285+
},
286+
{
287+
"cell_type": "code",
288+
"execution_count": null,
289+
"metadata": {},
290+
"outputs": [],
291+
"source": [
292+
"factor(x^100 - 1)"
293+
]
294+
},
295+
{
296+
"cell_type": "code",
297+
"execution_count": null,
298+
"metadata": {},
299+
"outputs": [
300+
{
301+
"name": "stdout",
302+
"output_type": "stream",
303+
"text": [
304+
"6*(x^2 - 2)*(3*x + 1)^2\n"
305+
]
306+
}
307+
],
308+
"source": [
309+
"p = 54*x^4+36*x^3-102*x^2-72*x-12\n",
310+
"p.factor()"
311+
]
312+
},
313+
{
314+
"cell_type": "code",
315+
"execution_count": null,
316+
"metadata": {},
317+
"outputs": [
318+
{
319+
"name": "stdout",
320+
"output_type": "stream",
321+
"text": [
322+
"Integer Ring :\n",
323+
"2 * 3 * (3*x + 1)^2 * (x^2 - 2)\n",
324+
"Rational Field :\n",
325+
"(54) * (x + 1/3)^2 * (x^2 - 2)\n",
326+
"Complex Field with 16 bits of precision :\n",
327+
"(54.00) * (x - 1.414) * (x + 0.3333)^2 * (x + 1.414)\n",
328+
"Number Field in sqrt2 with defining polynomial x^2 - 2 :\n",
329+
"(54) * (x - sqrt2) * (x + sqrt2) * (x + 1/3)^2\n",
330+
"Finite Field of size 5 :\n",
331+
"(4) * (x + 2)^2 * (x^2 + 3)\n"
332+
]
333+
}
334+
],
335+
"source": [
336+
"for K in [ZZ, QQ, ComplexField(16), QQ[sqrt(2)], GF(5)]:\n",
337+
" print K, \":\"; print K['x'](p).factor()"
338+
]
339+
},
340+
{
341+
"cell_type": "code",
342+
"execution_count": null,
343+
"metadata": {},
344+
"outputs": [
345+
{
346+
"name": "stdout",
347+
"output_type": "stream",
348+
"text": [
349+
"Category of euclidean domains\n"
350+
]
351+
}
352+
],
353+
"source": [
354+
"ZZ.category()"
355+
]
356+
},
357+
{
358+
"cell_type": "code",
359+
"execution_count": null,
360+
"metadata": {},
361+
"outputs": [
362+
{
363+
"name": "stdout",
364+
"output_type": "stream",
365+
"text": [
366+
"['AdditiveAssociative', 'AdditiveCommutative', 'AdditiveInverse', 'AdditiveUnital',\n",
367+
" 'Associative', 'Commutative',\n",
368+
" 'Distributive', 'NoZeroDivisors', 'Unital']"
369+
]
370+
}
371+
],
372+
"source": [
373+
"sorted( ZZ.category().axioms() )"
323374
]
324375
},
325376
{
@@ -577,10 +628,10 @@
577628
}
578629
],
579630
"source": [
580-
"Suit = Set([\"Coeur\", \"Carreau\", \"Pique\", \"Trefle\"])\n",
581-
"Values = Set([2, 3, 4, 5, 6, 7, 8, 9, 10, \"Valet\", \"Dame\", \"Roi\", \"As\"])\n",
631+
"Suits = Set([\"Hearts\", \"Diamonds\", \"Spades\", \"Clubs\"])\n",
632+
"Values = Set([2, 3, 4, 5, 6, 7, 8, 9, 10, \"Jack\", \"Queen\", \"King\", \"Ace\"])\n",
582633
"Cards = cartesian_product([Values, Suits])\n",
583-
"Hands = Subsets(Cartes, 5)\n",
634+
"Hands = Subsets(Cards, 5)\n",
584635
"Hands.random_element()"
585636
]
586637
},
@@ -598,7 +649,7 @@
598649
}
599650
],
600651
"source": [
601-
"Mains.cardinality()"
652+
"Hands.cardinality()"
602653
]
603654
},
604655
{
@@ -616,9 +667,9 @@
616667
"metadata": {},
617668
"outputs": [],
618669
"source": [
619-
"L = RootSystem([\"G\",2,1]).ambient_space()\n",
670+
"L = RootSystem([\"G\", 2, 1]).ambient_space()\n",
620671
"p = L.plot(affine=False, level=1)\n",
621-
"p.show(aspect_ratio=[1,1,2], frame=False)"
672+
"p.show(aspect_ratio=[1, 1, 2], frame=False)"
622673
]
623674
},
624675
{
@@ -635,7 +686,7 @@
635686
"outputs": [],
636687
"source": [
637688
"E = EllipticCurve('389a')\n",
638-
"plot(E,thickness=3)"
689+
"plot(E, thickness=3)"
639690
]
640691
},
641692
{
@@ -1735,8 +1786,8 @@
17351786
"- Ask Sage: [https://ask.sagemath.org](https://ask.sagemath.org) \n",
17361787
"- Bug Tracker: [https://trac.sagemath.org](https://trac.sagemath.org) \n",
17371788
"- The open book [Computational Mathematics with Sage](http://sagebook.gforge.inria.fr/english.html)\n",
1738-
" (originally written in $ French <http://sagebook.gforge.inria.fr/> $; also translated in $ German <http://www.loria.fr/~zimmerma/sagebook/CalculDeutsch.pdf/> $) \n",
1739-
"- [Sages main tutorial](http://doc.sagemath.org/html/en/tutorial/index.html#tutorial) \n",
1789+
" (originally written in [French](http://sagebook.gforge.inria.fr/); also translated in $ German <http://www.loria.fr/~zimmerma/sagebook/CalculDeutsch.pdf/> $) \n",
1790+
"- :ref:`Sage's main tutorial <tutorial>`_ \n",
17401791
"- [Sage’s official thematic tutorials](https://doc.sagemath.org/html/en/thematic_tutorials/index.html) \n",
17411792
"- [More Sage tutorials](https://more-sagemath-tutorials.readthedocs.io/) \n",
17421793
"- [Sage’s quick reference cards](https://wiki.sagemath.org/quickref) "

0 commit comments

Comments
 (0)