(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 9460, 280] NotebookOptionsPosition[ 8768, 253] NotebookOutlinePosition[ 9214, 271] CellTagsIndexPosition[ 9171, 268] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["GACA - Uebungsblatt 01", "Section", CellChangeTimes->{{3.416728527628327*^9, 3.4167285277112207`*^9}, { 3.432978835417632*^9, 3.432978835489069*^9}, 3.432978891739192*^9, { 3.4335828999159403`*^9, 3.4335829028182783`*^9}, {3.433584522158498*^9, 3.4335845222929792`*^9}}], Cell[CellGroupData[{ Cell["Aufgabe 2", "Subsection", CellChangeTimes->{{3.432978845519897*^9, 3.432978845639078*^9}, { 3.432982005434053*^9, 3.4329820056234617`*^9}}], Cell[TextData[{ "Definition der inneren Verkn\[UDoubleDot]pfung ", StyleBox["Star", FontWeight->"Bold"] }], "Text", CellChangeTimes->{{3.433584652656452*^9, 3.4335846728024597`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"Star", "[", RowBox[{"j_", ",", "k_"}], "]"}], ":=", RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"j", "+", "k"}], ",", "5"}], "]"}], "/;", RowBox[{ RowBox[{"j", "<", "5"}], " ", "&&", " ", RowBox[{"j", "\[GreaterEqual]", "0"}], " ", "&&", " ", RowBox[{"k", "<", "5"}], " ", "&&", " ", RowBox[{"k", "\[GreaterEqual]", "0"}]}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Star", "[", RowBox[{"j_", ",", "k_"}], "]"}], ":=", RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"5", "+", "j", "-", "k"}], ",", "5"}], "]"}], "/;", RowBox[{ RowBox[{"j", "<", "10"}], " ", "&&", " ", RowBox[{"j", "\[GreaterEqual]", "5"}], " ", "&&", " ", RowBox[{"k", "<", "10"}], " ", "&&", " ", RowBox[{"k", "\[GreaterEqual]", "5"}]}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Star", "[", RowBox[{"j_", ",", "k_"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"5", "+", "j", "-", "k"}], ",", "5"}], "]"}], "+", "5"}], "/;", RowBox[{ RowBox[{"j", "<", "10"}], " ", "&&", " ", RowBox[{"j", "\[GreaterEqual]", "5"}], " ", "&&", " ", RowBox[{"k", "<", "5"}], " ", "&&", " ", RowBox[{"k", "\[GreaterEqual]", "0"}]}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Star", "[", RowBox[{"j_", ",", "k_"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"j", "+", "k"}], ",", "5"}], "]"}], "+", "5"}], "/;", RowBox[{ RowBox[{"j", "<", "5"}], " ", "&&", " ", RowBox[{"j", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", RowBox[{"k", "<", "10"}], " ", "&&", " ", RowBox[{"k", "\[GreaterEqual]", "5"}]}]}]}]}], "Input", CellChangeTimes->{{3.4335830381844788`*^9, 3.433583104964345*^9}, { 3.433583190999835*^9, 3.433583260671339*^9}}], Cell["Definition der Permutation T", "Text", CellChangeTimes->{{3.4335846350951233`*^9, 3.433584645050613*^9}, { 3.433584713666904*^9, 3.4335847152742853`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"T", "[", "0", "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"T", "[", "1", "]"}], "=", "5"}], ";", RowBox[{ RowBox[{"T", "[", "2", "]"}], "=", "7"}], ";", RowBox[{ RowBox[{"T", "[", "3", "]"}], "=", "6"}], ";", RowBox[{ RowBox[{"T", "[", "4", "]"}], "=", "2"}], ";", RowBox[{ RowBox[{"T", "[", "5", "]"}], "=", "8"}], ";", RowBox[{ RowBox[{"T", "[", "6", "]"}], "=", "3"}], ";", RowBox[{ RowBox[{"T", "[", "7", "]"}], "=", "0"}], ";", RowBox[{ RowBox[{"T", "[", "8", "]"}], "=", "9"}], ";", RowBox[{ RowBox[{"T", "[", "9", "]"}], "=", "4"}], ";"}]], "Input", CellChangeTimes->{{3.433583310097908*^9, 3.433583374765067*^9}}], Cell["Prozedur zum Testen einer deutschen DM-Banknote", "Text", CellChangeTimes->{{3.433584723881629*^9, 3.433584764986435*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "CheckDMBanknote", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"CheckDMBanknote", "[", "string_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"liste", ",", "test", ",", "k"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "=", RowBox[{"ToCharacterCode", "[", "string", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "65"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "0"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "68"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "1"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "71"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "2"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "75"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "3"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "76"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "4"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "78"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "5"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "83"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "6"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "85"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "7"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "89"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "8"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "90"}], ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", "9"}], ",", "\[IndentingNewLine]", "True", ",", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "=", RowBox[{ RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], "-", "48"}]}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"k", ",", RowBox[{"Length", "[", "liste", "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"test", "=", RowBox[{"liste", "[", RowBox[{"[", "11", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", RowBox[{ RowBox[{"test", "=", RowBox[{"Star", "[", RowBox[{ RowBox[{"Nest", "[", RowBox[{"T", ",", RowBox[{"liste", "[", RowBox[{"[", "k", "]"}], "]"}], ",", "k"}], "]"}], ",", "test"}], "]"}]}], ",", RowBox[{"{", RowBox[{"k", ",", "10", ",", "1", ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"test", "===", "0"}], ",", "\"\\"", ",", "\"\\""}], "]"}]}]}], "]"}]}]}], "Input", CellChangeTimes->{{3.43358381161397*^9, 3.43358420690808*^9}, { 3.433584332927311*^9, 3.4335843483716507`*^9}}] }, Open ]] }, Open ]] }, WindowToolbars->"EditBar", WindowSize->{948, 846}, WindowMargins->{{Automatic, 86}, {Automatic, 0}}, DockedCells->FEPrivate`FrontEndResource[ "FEExpressions", "CompatibilityToolbar"], FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (June 19, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 287, 4, 83, "Section"], Cell[CellGroupData[{ Cell[902, 31, 148, 2, 42, "Subsection"], Cell[1053, 35, 187, 5, 32, "Text"], Cell[1243, 42, 1881, 53, 91, "Input"], Cell[3127, 97, 163, 2, 32, "Text"], Cell[3293, 101, 720, 22, 53, "Input"], Cell[4016, 125, 129, 1, 32, "Text"], Cell[4148, 128, 4592, 121, 433, "Input"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)