(* Content-type: application/vnd.wolfram.cdf.text *) (*** Wolfram CDF File ***) (* http://www.wolfram.com/cdf *) (* CreatedBy='Mathematica 9.0' *) (*************************************************************************) (* *) (* The Mathematica License under which this file was created prohibits *) (* restricting third parties in receipt of this file from republishing *) (* or redistributing it by any means, including but not limited to *) (* rights management or terms of use, without the express consent of *) (* Wolfram Research, Inc. For additional information concerning CDF *) (* licensing and redistribution see: *) (* *) (* www.wolfram.com/cdf/adopting-cdf/licensing-options.html *) (* *) (*************************************************************************) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 1063, 20] NotebookDataLength[ 8441, 225] NotebookOptionsPosition[ 8866, 216] NotebookOutlinePosition[ 9225, 232] CellTagsIndexPosition[ 9182, 229] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ "Print", "[", "\"\\"", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Manipulate", "[", "\n", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"intc", "=", RowBox[{"{", "0", "}"}]}], ",", "ztab", ",", "c"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"ztab", " ", "=", " ", RowBox[{"Flatten", "[", RowBox[{"List", "[", RowBox[{"AppendTo", "[", RowBox[{"intc", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"z", "[", RowBox[{"b", ",", "n", ",", "0"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"n", ",", "1", ",", "width"}], "}"}]}], "]"}]}], "]"}], "]"}], "]"}]}], ";", "\n", RowBox[{"For", "[", RowBox[{ RowBox[{"c", "=", "1"}], ",", RowBox[{"c", "\[LessEqual]", " ", "depth"}], ",", RowBox[{"c", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"intc", " ", "=", " ", RowBox[{"{", "c", "}"}]}], ";", " ", "\[IndentingNewLine]", RowBox[{"AppendTo", "[", RowBox[{"ztab", ",", " ", RowBox[{"Flatten", "[", RowBox[{"List", "[", RowBox[{"AppendTo", "[", RowBox[{"intc", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"z", "[", RowBox[{"b", ",", "c", ",", "n"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"n", ",", "1", ",", "width"}], "}"}]}], "]"}]}], "]"}], "]"}], "]"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"Grid", "[", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", "ztab", "]"}], ",", RowBox[{"width", "+", "1"}]}], "]"}], "]"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"b", ",", "1", ",", "100", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"depth", ",", "1", ",", "100", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"width", ",", "1", ",", "100", ",", "1"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Initialization", " ", "\[RuleDelayed]", " ", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"z", "[", RowBox[{"_", ",", "_", ",", "0"}], "]"}], "=", "0"}], ";", RowBox[{ RowBox[{"z", "[", RowBox[{"b_", ",", "c_", ",", "n_"}], "]"}], " ", ":=", " ", RowBox[{ RowBox[{"z", "[", RowBox[{"b", ",", "c", ",", "n"}], "]"}], " ", "=", " ", RowBox[{"Mod", "[", RowBox[{ RowBox[{ RowBox[{"b", "*", RowBox[{"z", "[", RowBox[{"b", ",", "c", ",", RowBox[{"n", "-", "1"}]}], "]"}]}], "+", "c"}], ",", "n"}], "]"}]}]}]}], "}"}]}]}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.5895334345755177`*^9, 3.589533435171132*^9}}], Cell[CellGroupData[{ Cell[BoxData["\<\"Rumor Array with given b\"\>"], "Print", CellChangeTimes->{3.589533334543798*^9, 3.589533437406008*^9}], Cell[BoxData["\<\"Left hand column gives the c values, c = 0 to c = \ depth\"\>"], "Print", CellChangeTimes->{3.589533334543798*^9, 3.589533437407393*^9}], Cell[BoxData["\<\"Columns n = 1 to n = width\"\>"], "Print", CellChangeTimes->{3.589533334543798*^9, 3.5895334374088707`*^9}] }, Open ]], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`b$$ = 29, $CellContext`depth$$ = 28, $CellContext`width$$ = 23, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[$CellContext`b$$], 1, 100, 1}, { Hold[$CellContext`depth$$], 1, 100, 1}, { Hold[$CellContext`width$$], 1, 100, 1}}, Typeset`size$$ = { 633., {311.9375, 319.0625}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`b$896$$ = 0, $CellContext`depth$897$$ = 0, $CellContext`width$898$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`b$$ = 1, $CellContext`depth$$ = 1, $CellContext`width$$ = 1}, "ControllerVariables" :> { Hold[$CellContext`b$$, $CellContext`b$896$$, 0], Hold[$CellContext`depth$$, $CellContext`depth$897$$, 0], Hold[$CellContext`width$$, $CellContext`width$898$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Module[{$CellContext`intc$ = { 0}, $CellContext`ztab$, $CellContext`c$}, $CellContext`ztab$ = Flatten[{ AppendTo[$CellContext`intc$, Table[ $CellContext`z[$CellContext`b$$, $CellContext`n, 0], {$CellContext`n, 1, $CellContext`width$$}]]}]; For[$CellContext`c$ = 1, $CellContext`c$ <= $CellContext`depth$$, Increment[$CellContext`c$], $CellContext`intc$ = {$CellContext`c$}; AppendTo[$CellContext`ztab$, Flatten[{ AppendTo[$CellContext`intc$, Table[ $CellContext`z[$CellContext`b$$, $CellContext`c$, \ $CellContext`n], {$CellContext`n, 1, $CellContext`width$$}]]}]]]; Grid[ Partition[ Flatten[$CellContext`ztab$], $CellContext`width$$ + 1]]], "Specifications" :> {{$CellContext`b$$, 1, 100, 1}, {$CellContext`depth$$, 1, 100, 1}, {$CellContext`width$$, 1, 100, 1}}, "Options" :> {}, "DefaultOptions" :> {}], ImageSizeCache->{688., {419., 426.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`z[ Blank[], Blank[], 0] = 0; $CellContext`z[ Pattern[$CellContext`b, Blank[]], Pattern[$CellContext`c, Blank[]], Pattern[$CellContext`n, Blank[]]] := ($CellContext`z[$CellContext`b, $CellContext`c, \ $CellContext`n] = Mod[$CellContext`b $CellContext`z[$CellContext`b, $CellContext`c, \ $CellContext`n - 1] + $CellContext`c, $CellContext`n])}; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{3.589533335806107*^9, 3.589533437463586*^9}] }, Open ]] }, WindowSize->{1663, 1193}, WindowMargins->{{Automatic, 400}, {Automatic, 41}}, FrontEndVersion->"9.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (January 25, \ 2013)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1485, 35, 3566, 93, 372, "Input"], Cell[CellGroupData[{ Cell[5076, 132, 122, 1, 26, "Print"], Cell[5201, 135, 155, 2, 26, "Print"], Cell[5359, 139, 126, 1, 26, "Print"] }, Open ]], Cell[5500, 143, 3350, 70, 899, "Output"] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature KuDs0GmCPLWQSA1PF#ko8G0C *) .