(************** Content-type: application/mathematica ************** Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 13130, 416]*) (*NotebookOutlinePosition[ 14251, 456]*) (* CellTagsIndexPosition[ 14183, 450]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ "Campi finiti ", Cell[BoxData[ StyleBox[ ButtonBox[ StyleBox[ TagBox[ ButtonBox[\(\(TORNA\)\(\ \)\(ALL'\) \(INDICE\)\(\ \)\), ButtonFrame->"DialogBox", Background->RGBColor[0.300008, 1, 1]], DisplayForm], FontSize->12], ButtonData:>{"INDICE.nb", None}, ButtonStyle->"Hyperlink"], FontSize->12]], "Input"], " " }], "Subtitle", Evaluatable->False, CellHorizontalScrolling->False, TextAlignment->Center, FontFamily->"Times New Roman", CellTags->"in"], Cell["\<\ Per mostrare un semplice esempio di uso delle matrici, in questo notebook \ mostriamo come costruire una tavola della moltiplicazione per l'anello Z/n \ degli interi modulo n. Inoltre esamina in quali circostanze tale anello \ \[EGrave] un campo. Ci si serve della funzione Mod[m,n] che fornisce il resto \ della divisione di m con n. \ \>", "Text", Evaluatable->False, FontFamily->"Times New Roman"], Cell["Ad esempio", "Text", Evaluatable->False, FontFamily->"Times New Roman"], Cell[CellGroupData[{ Cell["x = Mod[8, 3]", "Input", FontFamily->"Times New Roman"], Cell[BoxData[ \(2\)], "Output"] }, Open ]], Cell[BoxData[ \(La\ tavola\ di\ addizione\ si\ scrive\)], "Input"], Cell[BoxData[ \(\(tavadd[m_]\ := \ Table[Table[Mod[i + j, \ m], \ {i, 0, \ m - 1}], {j, \ 0, \ m - 1}];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(MatrixForm[tavadd[5]]\)\(\ \)\)\)], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "2", "3", "4"}, {"1", "2", "3", "4", "0"}, {"2", "3", "4", "0", "1"}, {"3", "4", "0", "1", "2"}, {"4", "0", "1", "2", "3"} }], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[BoxData[ \(Il\ fatto\ che\ al\ primo\ rigo\ compaia\ la\ sequenza\ 0\ 1\ 2\ 3\ 4\ \ significa\ che\ 0\ \[EGrave]\ elemento\ neutro . \ \[IndentingNewLine]La\ \ simmetria\ della\ matrice\ rispetto\ alla\ diagonale\ ci\ dice\ che\ l' operazione\ \[EGrave]\ commutativa . \ \[IndentingNewLine]Il\ fatto\ \ che\ 0\ compaia\ in\ ogni\ riga\ ci\ dice\ che\ ogni\ elemento\ ammette\ \ opposto . \n\t\t\n La\ tavola\ di\ moltiplicazione\ per\ gli\ interi\ modulo\ m\ si\ \ costruisce\ al\ modo\ seguente\)], "Input"], Cell["\<\ tavmolt[m_] := Table[Table[Mod[i*j, m], {i,0, m-1}],{j, 0, m-1}];\ \>", "Input", FontFamily->"Times New Roman"], Cell[CellGroupData[{ Cell["MatrixForm[tavmolt[5]]", "Input", FontFamily->"Times New Roman"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", "0", "0"}, {"0", "1", "2", "3", "4"}, {"0", "2", "4", "1", "3"}, {"0", "3", "1", "4", "2"}, {"0", "4", "3", "2", "1"} }], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell["\<\ Si noti che il fatto che la matrice sia simmetrica ci dice che il prodotto \ \[EGrave] commutativo. Il fatto che la seconda riga sia costituita da 0, 1, \ 2, 3, 4 significa che 1 \[EGrave] l'elemento neutro. Inoltre, poich\[EGrave] \ in ogni riga (diversa da quella dello 0) compare 1, ogni elemento non nullo \ ammette inverso. Pertanto gli interi modulo 5 costituiscono un campo. Guardiamo invece gli interi modulo 4:\ \>", "Text", Evaluatable->False, FontFamily->"Times New Roman"], Cell[CellGroupData[{ Cell["tavmolt[4] // MatrixForm", "Input", FontFamily->"Times New Roman"], Cell[BoxData[ TagBox[ RowBox[{"(", GridBox[{ {"0", "0", "0", "0"}, {"0", "1", "2", "3"}, {"0", "2", "0", "2"}, {"0", "3", "2", "1"} }], ")"}], (MatrixForm[ #]&)]], "Output"] }, Open ]], Cell["\<\ In questo caso la terza riga, che corrisponde alla tabellina del 2 non \ presenta 1 e quindi 2 non ammette inverso. Pertanto R/4 non \[EGrave] un \ campo. Per verificare se un dato R/m \[EGrave] un campo, cominciamo col \ definire un predicato che dica se un elemento \[EGrave] invertibile \ verificando se nella riga corrispondente \[EGrave] presente 1. Usiamo il \ predicato MemberQ[lista, elemento]. \ \>", "Text", Evaluatable->False, FontFamily->"Times New Roman"], Cell[CellGroupData[{ Cell[BoxData[ \({MemberQ[{1, 3, 5}, 5], MemberQ[{1, 3, 5}, 2]}\)], "Input"], Cell[BoxData[ \({True, False}\)], "Output"] }, Open ]], Cell[BoxData[ \(Poi\ ricordiamo\ che\ se\ l\ \[EGrave]\ una\ lista\ allora\ l[\([n]\)]\ \ \[EGrave]\ l' elemento\ n - esimo\ della\ lista . \ Ad\ esempio\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({2, 4, 6}[\([3]\)]\)], "Input"], Cell[BoxData[ \(6\)], "Output"] }, Open ]], Cell[BoxData[ \(\(\(\ \)\(Pertanto\ \(tavmolt[m]\)[\([i + 1]\)]\ rappresenta\ la\ i + 1 - sima\ riga\ nella\ tavola\ \(\(tavmolt[n]\)\(.\)\)\)\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(tavmolt[5]\)[\([3]\)]\)], "Input"], Cell[BoxData[ \({0, 2, 4, 1, 3}\)], "Output"] }, Open ]], Cell[BoxData[ \(Il\ predicato\ invert[n, i]\ verifica\ se\ nella\ i - esima\ riga\ compare\ il\ numero\ 1. \)], "Input"], Cell[BoxData[ \(invert[m_, \ i_] := \ MemberQ[\(tavmolt[m]\)[\([i + 1]\)], \ 1]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({invert[3, 2], invert[4, 3]}\)], "Input"], Cell[BoxData[ \({True, True}\)], "Output"] }, Open ]], Cell["\<\ Per verificare se una struttura Z/m \[EGrave] un campo, verifichiamo se tutti \ gli elementi diversi da zero sono invertibili. A tale scopo definiamo il \ quantificatore \"Ogni\"\ \>", "Text", Evaluatable->False, FontFamily->"Times New Roman"], Cell[BoxData[ \(\(verifica[m_]\ := Ogni[Table[invert[m, \ i], {i, \ 1, \ m - 1}]];\)\)], "Input"], Cell[BoxData[ \(Ogni[{}] := True; Ogni[l_] := First[l] && Ogni[Rest[l]]\)], "Input"], Cell["verifica[m_] := Ogni[Table[invert[m, i],{i, 1, m-1}]];", "Input", FontFamily->"Times New Roman"], Cell[CellGroupData[{ Cell["verifica[11]", "Input", FontFamily->"Times New Roman"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \(Un\ modo\ diverso\ di\ definire\ il\ quantificatore\ "\"\ \ \[EGrave]\ quello\ di\ usare\ la\ funzione\ di\ libreria\ \ \(\(And\)\(.\)\)\)], "Input"], Cell[BoxData[ \(tutti[l_] := Apply[And, l]\)], "Input"], Cell[BoxData[ \(\(verif[m_] := tutti[Table[invert[m, i], {i, 1, m - 1}]];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({verif[5], verif[6]}\)], "Input"], Cell[BoxData[ \({True, False}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ For[ i = 2, i < 15, i++, Print[\"Gli interi modulo \",i, \" sono un campo \", verifica[i]] ]\ \>", "Input", FontFamily->"Times New Roman"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]2\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]True\), SequenceForm[ "Gli interi modulo ", 2, " sono un campo ", True], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]3\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]True\), SequenceForm[ "Gli interi modulo ", 3, " sono un campo ", True], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]4\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]False\), SequenceForm[ "Gli interi modulo ", 4, " sono un campo ", False], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]5\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]True\), SequenceForm[ "Gli interi modulo ", 5, " sono un campo ", True], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]6\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]False\), SequenceForm[ "Gli interi modulo ", 6, " sono un campo ", False], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]7\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]True\), SequenceForm[ "Gli interi modulo ", 7, " sono un campo ", True], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]8\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]False\), SequenceForm[ "Gli interi modulo ", 8, " sono un campo ", False], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]9\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]False\), SequenceForm[ "Gli interi modulo ", 9, " sono un campo ", False], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]10\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]False\), SequenceForm[ "Gli interi modulo ", 10, " sono un campo ", False], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]11\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]True\), SequenceForm[ "Gli interi modulo ", 11, " sono un campo ", True], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]12\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]False\), SequenceForm[ "Gli interi modulo ", 12, " sono un campo ", False], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]13\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]True\), SequenceForm[ "Gli interi modulo ", 13, " sono un campo ", True], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Gli interi modulo "\[InvisibleSpace]14\ \[InvisibleSpace]" sono un campo "\[InvisibleSpace]False\), SequenceForm[ "Gli interi modulo ", 14, " sono un campo ", False], Editable->False]], "Print"] }, Open ]], Cell["\<\ Sulla base di questo esperimento viene spontaneo congetturare che Rn \ \[EGrave] un campo se e solo se n \[EGrave] primo. \ \>", "Text", Evaluatable->False, FontFamily->"Times New Roman"], Cell[BoxData[ RowBox[{ StyleBox[ ButtonBox[ StyleBox[ TagBox[ ButtonBox[\(\(TORNA\)\(\ \)\(ALL'\) \(INDICE\)\(\ \)\), ButtonFrame->"DialogBox", Background->RGBColor[0.300008, 1, 1]], DisplayForm], FontSize->12], ButtonData:>{"INDICE.nb", None}, ButtonStyle->"Hyperlink"], FontSize->12], StyleBox[" ", FontSize->12], StyleBox[ ButtonBox[ StyleBox[ TagBox[ ButtonBox[\(\(TORNA\)\(\ \)\(SU\)\(\ \)\), ButtonFrame->"DialogBox", Background->RGBColor[0, 0, 1]], DisplayForm], FontColor->RGBColor[1, 1, 0]], ButtonData:>"in", ButtonStyle->"Hyperlink"], FontColor->RGBColor[1, 1, 0]]}]], "Input"] }, FrontEndVersion->"4.1 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 679}}, ScreenStyleEnvironment->"Presentation", PrintingStyleEnvironment->"Working", WindowToolbars->{}, CellGrouping->Manual, WindowSize->{1016, 647}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, Magnification->1.25, StyleDefinitions -> "Defaults.nb" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{ "in"->{ Cell[1705, 50, 669, 21, 156, "Subtitle", Evaluatable->False, CellTags->"in"]} } *) (*CellTagsIndex CellTagsIndex->{ {"in", 14063, 442} } *) (*NotebookFileOutline Notebook[{ Cell[1705, 50, 669, 21, 156, "Subtitle", Evaluatable->False, CellTags->"in"], Cell[2377, 73, 414, 8, 115, "Text", Evaluatable->False], Cell[2794, 83, 81, 2, 55, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[2900, 89, 63, 1, 45, "Input"], Cell[2966, 92, 35, 1, 47, "Output"] }, Open ]], Cell[3016, 96, 70, 1, 48, "Input"], Cell[3089, 99, 145, 3, 48, "Input"], Cell[CellGroupData[{ Cell[3259, 106, 68, 1, 48, "Input"], Cell[3330, 109, 374, 10, 146, "Output"] }, Open ]], Cell[3719, 122, 532, 8, 309, "Input"], Cell[4254, 132, 123, 3, 45, "Input"], Cell[CellGroupData[{ Cell[4402, 139, 72, 1, 45, "Input"], Cell[4477, 142, 374, 10, 146, "Output"] }, Open ]], Cell[4866, 155, 499, 9, 145, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[5390, 168, 74, 1, 45, "Input"], Cell[5467, 171, 249, 8, 120, "Output"] }, Open ]], Cell[5731, 182, 482, 9, 145, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[6238, 195, 79, 1, 48, "Input"], Cell[6320, 198, 47, 1, 47, "Output"] }, Open ]], Cell[6382, 202, 170, 2, 77, "Input"], Cell[CellGroupData[{ Cell[6577, 208, 51, 1, 48, "Input"], Cell[6631, 211, 35, 1, 47, "Output"] }, Open ]], Cell[6681, 215, 168, 2, 77, "Input"], Cell[CellGroupData[{ Cell[6874, 221, 56, 1, 48, "Input"], Cell[6933, 224, 49, 1, 47, "Output"] }, Open ]], Cell[6997, 228, 131, 2, 48, "Input"], Cell[7131, 232, 103, 2, 48, "Input"], Cell[CellGroupData[{ Cell[7259, 238, 61, 1, 48, "Input"], Cell[7323, 241, 46, 1, 47, "Output"] }, Open ]], Cell[7384, 245, 257, 6, 85, "Text", Evaluatable->False], Cell[7644, 253, 111, 2, 48, "Input"], Cell[7758, 257, 88, 1, 48, "Input"], Cell[7849, 260, 104, 1, 45, "Input"], Cell[CellGroupData[{ Cell[7978, 265, 62, 1, 45, "Input"], Cell[8043, 268, 38, 1, 47, "Output"] }, Open ]], Cell[8096, 272, 177, 3, 77, "Input"], Cell[8276, 277, 59, 1, 48, "Input"], Cell[8338, 280, 92, 1, 48, "Input"], Cell[CellGroupData[{ Cell[8455, 285, 53, 1, 48, "Input"], Cell[8511, 288, 47, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8595, 294, 160, 5, 91, "Input"], Cell[8758, 301, 245, 4, 35, "Print"], Cell[9006, 307, 245, 4, 35, "Print"], Cell[9254, 313, 247, 4, 35, "Print"], Cell[9504, 319, 245, 4, 35, "Print"], Cell[9752, 325, 247, 4, 35, "Print"], Cell[10002, 331, 245, 4, 35, "Print"], Cell[10250, 337, 247, 4, 35, "Print"], Cell[10500, 343, 247, 4, 35, "Print"], Cell[10750, 349, 249, 4, 35, "Print"], Cell[11002, 355, 247, 4, 35, "Print"], Cell[11252, 361, 249, 4, 35, "Print"], Cell[11504, 367, 247, 4, 35, "Print"], Cell[11754, 373, 249, 4, 35, "Print"] }, Open ]], Cell[12018, 380, 201, 5, 55, "Text", Evaluatable->False], Cell[12222, 387, 904, 27, 60, "Input"] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)