(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 27580, 716] NotebookOptionsPosition[ 24893, 623] NotebookOutlinePosition[ 25228, 638] CellTagsIndexPosition[ 25185, 635] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Rechnernutzung WS11/12", "Subtitle", PageWidth->PaperWidth, CellChangeTimes->{{3.527570392331064*^9, 3.5275706272271147`*^9}, { 3.527570881388413*^9, 3.527570965568946*^9}, {3.527571041859551*^9, 3.527571043811414*^9}, {3.527828117903689*^9, 3.52782811797358*^9}, { 3.527847970402978*^9, 3.527847976033135*^9}, 3.530526881124037*^9}], Cell["Aufgabe 19: Ersetzungsregeln", "Subsubtitle", PageWidth->PaperWidth, CellChangeTimes->{{3.530527486982504*^9, 3.53052751057974*^9}, { 3.530528030637907*^9, 3.5305280497063313`*^9}, {3.5305381689561043`*^9, 3.530538174516942*^9}, {3.53053820748442*^9, 3.53053821139573*^9}, { 3.531040730069593*^9, 3.53104073047318*^9}, {3.531040869985281*^9, 3.531040888837596*^9}, {3.531040959381337*^9, 3.531040959434519*^9}, { 3.5310520873213673`*^9, 3.531052090712515*^9}, 3.53208248243675*^9}], Cell[CellGroupData[{ Cell["\<\ Berechnen Sie mittels Substitutionsregeln beliebige ganzzahlige positive \ Potenzen beliebiger Zahlen.\ \>", "ItemNumbered", PageWidth->PaperWidth, CellChangeTimes->{{3.529836787055979*^9, 3.5298368227585907`*^9}, { 3.5298370453687963`*^9, 3.5298370515686607`*^9}, {3.529837524132135*^9, 3.529837529079043*^9}, {3.5298378469193068`*^9, 3.529837863462945*^9}, { 3.529837930026115*^9, 3.52983800457614*^9}, 3.529839380390664*^9, { 3.531040931221242*^9, 3.5310409472879667`*^9}, {3.531041015942481*^9, 3.531041061346245*^9}, {3.531041973906416*^9, 3.531041973984277*^9}}], Cell["\<\ Wiederholen Sie dieses Vorgehen f\[UDoubleDot]r die Fakult\[ADoubleDot]t \ einer ganzen Zahl.\ \>", "ItemNumbered", PageWidth->PaperWidth, CellChangeTimes->{{3.529837873866851*^9, 3.5298379024614763`*^9}, { 3.5310410704736147`*^9, 3.531041086721622*^9}, {3.5310419721622553`*^9, 3.531041972227977*^9}}], Cell["\<\ Modifizieren Ihre L\[ODoubleDot]sung f\[UDoubleDot]r Fakult\[ADoubleDot]ten \ so, dass Sie auch die 2-er Fakult\[ADoubleDot]t berechnen k\[ODoubleDot]nnen \ (7!! = 7*5*3*1 = 105).\ \>", "ItemNumbered", PageWidth->PaperWidth, CellChangeTimes->{{3.531041089528384*^9, 3.531041133143249*^9}, { 3.531041163278323*^9, 3.5310412226607523`*^9}, {3.5310412577253017`*^9, 3.531041261596449*^9}, {3.531041969826436*^9, 3.5310419699857607`*^9}, { 3.531045497075719*^9, 3.531045526600772*^9}}] }, Open ]], Cell[TextData[{ "Probieren Sie m\[ODoubleDot]glichst einfache wenige Regeln zu finden. Dabei \ ist die Verwendung von ", StyleBox["Power", "Input"], " \[OpenCurlyDoubleQuote]", StyleBox["^", "Input"], "\[CloseCurlyDoubleQuote] oder ", StyleBox["Factorial", "Input"], " \[OpenCurlyDoubleQuote]", StyleBox["!", "Input"], "\[CloseCurlyDoubleQuote] nat\[UDoubleDot]rlich ", StyleBox["verboten", FontSlant->"Italic"], "!" }], "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.531041399505237*^9, 3.5310414592707987`*^9}, { 3.531041505438427*^9, 3.531041507125497*^9}, {3.531044794536146*^9, 3.531044859305393*^9}}], Cell[CellGroupData[{ Cell["Hinweise", "Subsubtitle", PageWidth->PaperWidth, CellChangeTimes->{{3.531041354205255*^9, 3.5310413556173162`*^9}}], Cell[CellGroupData[{ Cell["\<\ Verwenden Sie sog. \ \[OpenCurlyDoubleQuote]Dummy\[CloseCurlyDoubleQuote]-Symbole (Schaffen Sie es \ auch ohne Dummy-Funktionen, also ohne Argumentenliste auszukommen?).\ \>", "Item", PageWidth->PaperWidth, CellChangeTimes->{{3.531041822502307*^9, 3.53104184519477*^9}, { 3.531041957962648*^9, 3.5310419772334843`*^9}, {3.5310433479779873`*^9, 3.5310433653588448`*^9}, {3.5320825618735*^9, 3.532082581153344*^9}, 3.5320868226108418`*^9}], Cell["\<\ Versuchen Sie, aus einfachen Rechenoperationen Ausdruckstrukturen zu bilden, \ die den Definitionen von Potenz oder Fakult\[ADoubleDot]t \[ADoubleDot]hneln.\ \ \>", "Item", PageWidth->PaperWidth, CellChangeTimes->{{3.531041895651574*^9, 3.531041923880311*^9}, { 3.5310419940094213`*^9, 3.5310420902546787`*^9}, 3.532253333634296*^9}], Cell["\<\ Einfache Zahlen sind absolut zul\[ADoubleDot]ssige Patterns.\ \>", "Item", PageWidth->PaperWidth, CellChangeTimes->{{3.531041925484067*^9, 3.53104195227427*^9}, { 3.531042182584549*^9, 3.5310421825898046`*^9}, {3.531050791489295*^9, 3.53105079149363*^9}}], Cell["\<\ Regeln in einer Liste werden von links nach rechts ausgewertet, wobei das \ Ergebnis einer Ersetzung f\[UDoubleDot]r nachfolgende Regeln einer Liste \ gesperrt ist.\ \>", "Item", PageWidth->PaperWidth, CellChangeTimes->{{3.531050794290275*^9, 3.531050855425145*^9}, { 3.5310509052324867`*^9, 3.531050944431814*^9}, {3.532253324595723*^9, 3.532253327120409*^9}}], Cell["Regeln lassen sich auch auf Listen anwenden.", "Item", CellChangeTimes->{{3.531042185580263*^9, 3.531042196404079*^9}}] }, Open ]], Cell[TextData[{ "Sie k\[ODoubleDot]nnen die Funktion ", StyleBox["stepwiseReplaceRepeated[expr,rules]", "Input"], " statt ", StyleBox["expr//.rules", "Input"], " verwenden, um sich Zwischenschritte/-ergebnisse wiederholter Anwendung von \ Regeln anzeigen zu lassen (mit \[OpenCurlyDoubleQuote]", StyleBox["//.", "Input"], "\[CloseCurlyDoubleQuote] lassen sich nicht endende Substitutionsketten sehr \ leicht erzeugen). Beachten Sie dabei: ", StyleBox["rules", "Input"], " muss immer eine Liste sein und als optionales Argument l\[ADoubleDot]sst \ sich die Anzahl maximaler Iterationen angeben, welche standardm\[ADoubleDot]\ \[SZ]ig ", StyleBox["100", "Input"], " betr\[ADoubleDot]gt." }], "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.529905175035082*^9, 3.529905410401875*^9}, { 3.529905690623291*^9, 3.5299058017491827`*^9}, {3.5310415800328074`*^9, 3.5310416360463142`*^9}, {3.5310417202526617`*^9, 3.5310417337768908`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"Options", "[", "stepwiseReplaceRepeated", "]"}], "=", RowBox[{"{", RowBox[{"info", "\[Rule]", "True"}], "}"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"stepwiseReplaceRepeated", "[", RowBox[{"expr_", ",", "rules_List", ",", RowBox[{"maxIts_:", "100"}], ",", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"res", "=", "expr"}], ",", "resOld", ",", "f"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"f", "=", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"resOld", "=", "res"}], ";", "\[IndentingNewLine]", RowBox[{"res", "=", RowBox[{"res", "/.", "rules"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Abbruch", ",", " ", RowBox[{"wenn", " ", RowBox[{"Subst", ".", " ", "nichts"}], " ", "mehr", " ", "bewirkt"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"res", "===", "resOld"}], ",", RowBox[{"Return", "[", "res", "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"OptionValue", "[", "info", "]"}], ",", RowBox[{"Print", "[", "res", "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], "&"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"max", ".", " ", "Anzahl"}], " ", "an", " ", "Iterationen"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"f", "/@", RowBox[{"Range", "[", "maxIts", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", "res", "]"}]}]}], "\[IndentingNewLine]", "]"}]}]}], "Input", CellChangeTimes->{{3.529904231229107*^9, 3.529904561910303*^9}, { 3.529904599579671*^9, 3.5299046290400887`*^9}, {3.5299046688097773`*^9, 3.529904740600481*^9}, 3.5299047778100567`*^9, {3.529904821341028*^9, 3.529904853009087*^9}, {3.529904896010313*^9, 3.529904900483027*^9}, { 3.5299049427797337`*^9, 3.529904953960938*^9}, {3.529904995670554*^9, 3.529905062451406*^9}, {3.529905823781316*^9, 3.529905843261467*^9}, { 3.531042351180142*^9, 3.53104240840786*^9}}], Cell[CellGroupData[{ Cell["Beispiel: Z\[ADoubleDot]hlen 1", "Subsubsection", CellChangeTimes->{{3.5310415662802067`*^9, 3.531041575091839*^9}, { 3.531042312957245*^9, 3.531042313824964*^9}, {3.531042485839884*^9, 3.531042491947115*^9}, {3.5310425485715017`*^9, 3.531042568459194*^9}, { 3.531043413879356*^9, 3.531043426965592*^9}, 3.5320829585000467`*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{"z\[ADoubleDot]hle", " ", "von", " ", "1", " ", "bis", " ", "e"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"e", "=", "13"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"kleine", " ", "Korrektur"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"e", "--"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"rules", "=", RowBox[{"{", RowBox[{ RowBox[{"x", "\[Rule]", RowBox[{"x", "+", "1"}]}], ",", RowBox[{"e", "\[Rule]", RowBox[{"e", "-", "x"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"stepwiseReplaceRepeated", "[", RowBox[{"x", ",", "rules", ",", "100", ",", RowBox[{"info", "\[Rule]", "True"}]}], "]"}]}]}]], "Input", CellChangeTimes->{{3.529904631105412*^9, 3.529904655713201*^9}, { 3.529904861904706*^9, 3.529904865076283*^9}, {3.529904912716241*^9, 3.529904919567108*^9}, {3.529905051156569*^9, 3.529905057314492*^9}, { 3.52990509712617*^9, 3.529905135116624*^9}, {3.531042502591975*^9, 3.5310425435204277`*^9}, {3.531042652463361*^9, 3.5310426884687643`*^9}, { 3.531042777546818*^9, 3.531042963624793*^9}, {3.531042996276802*^9, 3.531043256553393*^9}, 3.531043286932809*^9, {3.531043439614265*^9, 3.531043489489057*^9}, {3.5310437292373*^9, 3.531043763882864*^9}, 3.531044087811494*^9, {3.531044122263629*^9, 3.5310441533370657`*^9}, { 3.531044270751992*^9, 3.5310442714362*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"1", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.531044272355001*^9}], Cell[BoxData[ RowBox[{"2", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.531044272358901*^9}], Cell[BoxData[ RowBox[{"3", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.5310442723635883`*^9}], Cell[BoxData[ RowBox[{"4", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.531044272368374*^9}], Cell[BoxData[ RowBox[{"5", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.531044272373055*^9}], Cell[BoxData[ RowBox[{"6", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.5310442723777742`*^9}], Cell[BoxData[ RowBox[{"7", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.53104427238243*^9}], Cell[BoxData[ RowBox[{"8", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.531044272387156*^9}], Cell[BoxData[ RowBox[{"9", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.531044272391802*^9}], Cell[BoxData[ RowBox[{"10", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.531044272396453*^9}], Cell[BoxData[ RowBox[{"11", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.5310442724013033`*^9}], Cell[BoxData[ RowBox[{"12", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.531044272405912*^9}], Cell[BoxData["13"], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043474659401*^9, 3.5310434901155233`*^9}, 3.531044138251843*^9, 3.5310442724104843`*^9}] }, Open ]], Cell[BoxData["13"], "Output", CellChangeTimes->{ 3.5299049199361362`*^9, {3.529905049076152*^9, 3.529905057647702*^9}, { 3.529905097560005*^9, 3.529905135909813*^9}, 3.531042424082539*^9, 3.531042459905931*^9, {3.5310426818032722`*^9, 3.531042689063685*^9}, 3.531042783014956*^9, {3.531042839375813*^9, 3.531042960320403*^9}, 3.5310430003263903`*^9, {3.531043071157003*^9, 3.531043176348125*^9}, 3.531043220664031*^9, {3.531043263177211*^9, 3.531043288884409*^9}, { 3.53104347472263*^9, 3.531043490173176*^9}, 3.53104413830882*^9, 3.531044272415163*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{"nachdem", " ", "Test", " ", "erfolgreich"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"x", "//.", "rules"}]}]], "Input", CellChangeTimes->{{3.529905656092368*^9, 3.5299056624242764`*^9}, { 3.53104277057797*^9, 3.5310427712081347`*^9}, {3.531043269627537*^9, 3.531043303196042*^9}, {3.53104350249504*^9, 3.531043502631097*^9}}], Cell[BoxData["13"], "Output", CellChangeTimes->{{3.52990565980796*^9, 3.529905662821588*^9}, 3.5310432703939037`*^9, 3.531043502987857*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Beispiel: Z\[ADoubleDot]hlen 2", "Subsubsection", CellChangeTimes->{{3.5310415662802067`*^9, 3.531041575091839*^9}, { 3.531042312957245*^9, 3.531042313824964*^9}, {3.531042485839884*^9, 3.531042491947115*^9}, {3.5310425485715017`*^9, 3.531042568459194*^9}, { 3.531043413879356*^9, 3.53104341440689*^9}, 3.532082963435175*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{ "z\[ADoubleDot]hle", " ", "von", " ", "a", " ", "bis", " ", "e", " ", "in", " ", "Schritten", " ", "von", " ", "i"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"a", "=", "9"}], ",", RowBox[{"e", "=", "2"}], ",", RowBox[{"i", "=", "2"}]}], "}"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{"Korrekturen", " ", "an", " ", "i"}], "-", "VZ"}], ",", " ", RowBox[{"Ende", " ", "und", " ", "Grenzen"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"i", "=", RowBox[{ RowBox[{"Sign", "[", RowBox[{"e", "-", "a"}], "]"}], "*", RowBox[{"Abs", "[", "i", "]"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"e", "=", RowBox[{"a", "+", RowBox[{"i", "*", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"e", "-", "a"}], ")"}], "/", "i"}], "]"}]}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"a", ",", "e"}], "}"}], "-=", "i"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Anfangsausdruck", " ", "und", " ", "Regel"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"y", "=", RowBox[{"a", "+", "x"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"rules", "=", RowBox[{"{", RowBox[{ RowBox[{"x", "\[Rule]", RowBox[{"x", "+", "i"}]}], ",", RowBox[{"e", "\[Rule]", RowBox[{"e", "-", "x"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"stepwiseReplaceRepeated", "[", RowBox[{"y", ",", "rules", ",", "100", ",", RowBox[{"info", "\[Rule]", "True"}]}], "]"}]}]}]], "Input", CellChangeTimes->{{3.529904631105412*^9, 3.529904655713201*^9}, { 3.529904861904706*^9, 3.529904865076283*^9}, {3.529904912716241*^9, 3.529904919567108*^9}, {3.529905051156569*^9, 3.529905057314492*^9}, { 3.52990509712617*^9, 3.529905135116624*^9}, {3.531042502591975*^9, 3.5310425435204277`*^9}, {3.531042652463361*^9, 3.5310426884687643`*^9}, { 3.531042777546818*^9, 3.531042963624793*^9}, {3.531042996276802*^9, 3.531043256553393*^9}, 3.531043286932809*^9, {3.5310437726558657`*^9, 3.531043796812945*^9}, {3.531044106546473*^9, 3.531044107034342*^9}, { 3.5310441457792664`*^9, 3.531044148011507*^9}, {3.531044194707533*^9, 3.531044254112315*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"9", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043510280486*^9, 3.531043522612842*^9}, 3.531044259412447*^9}], Cell[BoxData[ RowBox[{"7", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043510280486*^9, 3.531043522612842*^9}, 3.5310442594168673`*^9}], Cell[BoxData[ RowBox[{"5", "+", "x"}]], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043510280486*^9, 3.531043522612842*^9}, 3.5310442594222317`*^9}], Cell[BoxData["3"], "Print", CellChangeTimes->{ 3.531042459882227*^9, {3.531042681795891*^9, 3.531042689039176*^9}, 3.531042782526966*^9, {3.5310428390267572`*^9, 3.531042960300462*^9}, 3.531043000306527*^9, {3.531043071161385*^9, 3.531043175834196*^9}, 3.531043220650009*^9, {3.531043263159444*^9, 3.5310432888681726`*^9}, { 3.531043510280486*^9, 3.531043522612842*^9}, 3.5310442594275923`*^9}] }, Open ]], Cell[BoxData["3"], "Output", CellChangeTimes->{ 3.5299049199361362`*^9, {3.529905049076152*^9, 3.529905057647702*^9}, { 3.529905097560005*^9, 3.529905135909813*^9}, 3.531042424082539*^9, 3.531042459905931*^9, {3.5310426818032722`*^9, 3.531042689063685*^9}, 3.531042783014956*^9, {3.531042839375813*^9, 3.531042960320403*^9}, 3.5310430003263903`*^9, {3.531043071157003*^9, 3.531043176348125*^9}, 3.531043220664031*^9, {3.531043263177211*^9, 3.531043288884409*^9}, { 3.531043510298623*^9, 3.5310435226310797`*^9}, 3.531044259432254*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{"nachdem", " ", "Test", " ", "erfolgreich"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"y", "//.", "rules"}]}]], "Input", CellChangeTimes->{{3.529905656092368*^9, 3.5299056624242764`*^9}, { 3.53104277057797*^9, 3.5310427712081347`*^9}, {3.531043269627537*^9, 3.531043303196042*^9}}], Cell[BoxData["3"], "Output", CellChangeTimes->{{3.52990565980796*^9, 3.529905662821588*^9}, 3.5310432703939037`*^9, 3.5310435115872726`*^9, 3.53104354916079*^9, 3.531044261267437*^9}] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["L\[ODoubleDot]sung", "Subsubtitle", CellChangeTimes->{{3.530538177754944*^9, 3.530538185780909*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Quit", "[", "]"}], ";"}]], "Input", CellChangeTimes->{{3.531042441758211*^9, 3.531042446488991*^9}}], Cell[CellGroupData[{ Cell["1.)", "Subsection", CellChangeTimes->{{3.531044354538602*^9, 3.531044360199997*^9}, { 3.5310448693804417`*^9, 3.531044876864223*^9}}], Cell[BoxData["\[IndentingNewLine]"], "Input", CellChangeTimes->{3.532083095520784*^9}] }, Open ]], Cell[CellGroupData[{ Cell["2.)", "Subsection", CellChangeTimes->{{3.5310443838076677`*^9, 3.531044386708313*^9}}], Cell[BoxData["\[IndentingNewLine]"], "Input", CellChangeTimes->{3.532083097430668*^9}] }, Open ]], Cell[CellGroupData[{ Cell["3.)", "Subsection", CellChangeTimes->{{3.532082648244228*^9, 3.5320826494722443`*^9}}], Cell[BoxData["\[IndentingNewLine]"], "Input", CellChangeTimes->{3.53208310424922*^9}] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{960, 1017}, WindowMargins->{{Automatic, 0}, {Automatic, 0}}, FrontEndVersion->"8.0 for Linux x86 (64-bit) (October 10, 2011)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 351, 5, 54, "Subtitle"], Cell[933, 29, 506, 7, 31, "Subsubtitle"], Cell[CellGroupData[{ Cell[1464, 40, 597, 10, 41, "ItemNumbered"], Cell[2064, 52, 319, 7, 24, "ItemNumbered"], Cell[2386, 61, 500, 9, 41, "ItemNumbered"] }, Open ]], Cell[2901, 73, 631, 18, 49, "Text"], Cell[CellGroupData[{ Cell[3557, 95, 123, 2, 31, "Subsubtitle"], Cell[CellGroupData[{ Cell[3705, 101, 460, 9, 41, "Item"], Cell[4168, 112, 348, 7, 41, "Item"], Cell[4519, 121, 272, 6, 24, "Item"], Cell[4794, 129, 378, 8, 41, "Item"], Cell[5175, 139, 126, 1, 24, "Item"] }, Open ]], Cell[5316, 143, 952, 20, 144, "Text"], Cell[6271, 165, 2469, 58, 297, "Input"], Cell[CellGroupData[{ Cell[8765, 227, 345, 4, 28, "Subsubsection"], Cell[CellGroupData[{ Cell[9135, 235, 1588, 35, 164, "Input"], Cell[CellGroupData[{ Cell[10748, 274, 460, 8, 23, "Print"], Cell[11211, 284, 460, 8, 23, "Print"], Cell[11674, 294, 462, 8, 23, "Print"], Cell[12139, 304, 460, 8, 23, "Print"], Cell[12602, 314, 460, 8, 23, "Print"], Cell[13065, 324, 462, 8, 23, "Print"], Cell[13530, 334, 459, 8, 23, "Print"], Cell[13992, 344, 460, 8, 23, "Print"], Cell[14455, 354, 460, 8, 23, "Print"], Cell[14918, 364, 461, 8, 23, "Print"], Cell[15382, 374, 463, 8, 23, "Print"], Cell[15848, 384, 461, 8, 23, "Print"], Cell[16312, 394, 441, 7, 23, "Print"] }, Open ]], Cell[16768, 404, 582, 9, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17387, 418, 399, 8, 50, "Input"], Cell[17789, 428, 144, 2, 30, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[17982, 436, 342, 4, 28, "Subsubsection"], Cell[CellGroupData[{ Cell[18349, 444, 2595, 68, 240, "Input"], Cell[CellGroupData[{ Cell[20969, 516, 432, 7, 23, "Print"], Cell[21404, 525, 434, 7, 23, "Print"], Cell[21841, 534, 434, 7, 23, "Print"], Cell[22278, 543, 412, 6, 23, "Print"] }, Open ]], Cell[22705, 552, 559, 8, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[23301, 565, 354, 8, 50, "Input"], Cell[23658, 575, 192, 3, 30, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[23911, 585, 107, 1, 31, "Subsubtitle"], Cell[24021, 588, 136, 3, 30, "Input"], Cell[CellGroupData[{ Cell[24182, 595, 142, 2, 39, "Subsection"], Cell[24327, 599, 87, 1, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[24451, 605, 93, 1, 39, "Subsection"], Cell[24547, 608, 87, 1, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[24671, 614, 93, 1, 39, "Subsection"], Cell[24767, 617, 86, 1, 50, "Input"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)