(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' 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[ 82310, 2672]*) (*NotebookOutlinePosition[ 106422, 3546]*) (* CellTagsIndexPosition[ 106378, 3542]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Random Boolean Networks", "Title"], Cell["R.G. Palmer, 2/24/05", "Subsubtitle"], Cell[CellGroupData[{ Cell["Background and Copyright", "Subsection"], Cell[TextData[{ "This ", StyleBox["Mathematica", FontSlant->"Italic"], " Notebook was written by Richard G. Palmer (Physics Department, Duke \ University) for use in a course he taught. As of 1999, it has been made \ available for general non-profit use under the following copyright \ provision." }], "Text"], Cell[TextData[{ StyleBox["This Mathematica Notebook is Copyright Richard G. Palmer, 1997", FontWeight->"Bold"], ". It may be freely used by individuals, and by classes at academic \ institutions, provided:\n1. Credit is given to Richard Palmer as the original \ author; and\n2. It is not bought or sold or exchanged for profit, or \ incorporated into material that is bought or sold or exchanged for profit.\n\ Any other use requires the written permission of Richard Palmer, Dept. of \ Physics, Box 90305, Duke University, Durham, NC 27708, USA.", "See ", StyleBox["http://www.phy.duke.edu/~palmer", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for the email address." }], "Text"], Cell[TextData[{ "See ", StyleBox["http://www.phy.duke.edu/~palmer/notebooks/", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for other ", StyleBox["Mathematica", FontSlant->"Italic"], " notebooks by Richard Palmer." }], "Text"], Cell[TextData[{ StyleBox["Note", FontWeight->"Bold"], " (June 2003): Richard Palmer make a more general Notebook, not just random \ connections and random truth tables, for research. See the last section \ (\"General Boolean Network\")." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Introduction", "Section"], Cell[TextData[{ "This notebook concerns the random Boolean networks introduced by Stuart \ Kauffman, and described in his books ", StyleBox["At Home in the Universe", FontSlant->"Italic"], " and ", StyleBox["Origins of Order", FontSlant->"Italic"], ". A random Boolean network consists of a number of logic gates, each of \ which is either on (1) or off (0) at each time step. At each tick of the \ clock (time step), each gate updates its output to be a particular Boolean \ function of its inputs, which come from the outputs (before the clock tick) \ of some of the gates." }], "Text"], Cell["\<\ Except for the last sections (\"General Boolean Network\"), the \ following assumptions are made: 1. All gates have the same number of inputs; 2. Inputs to a gate are chosen to come randomly from all possible gates \ (including possibly itself), without duplication. 3. The Boolean functions (truth tables) used by each gate are chosen \ randomly, independently for each gate. The output value for each input \ pattern is randomly either 0 (with probability 1-p) or 1 (with probability \ p).\ \>", "Text"], Cell[TextData[{ StyleBox["Note", FontSlant->"Italic"], ": You might want to look at the \"Exercise\" section of this notebook \ first, so you can keep in mind what it is you'll need to do while you're \ working through the rest." }], "Text"], Cell[TextData[{ "This notebook first defines a lot of useful functions, and then explores \ their use. ", StyleBox[ "You do not need to understand the definitions, only how to use them", FontSlant->"Italic"], ". Do the following:" }], "Text"], Cell["\<\ Make sure that the following \"Definitions\" section is a closed \ group, showing just the title line. Select the whole section with a single \ click on the outer cell bracket (the one with the downward-pointing arrow). \ Press Enter (or Shift-Return) to evaluate the whole section -- this may take \ a little while; wait for \"Running\" to disappear from the title bar. Then \ go on to the next section, \"Making and Examining a Network\".\ \>", "Text", CellFrame->True, Background->GrayLevel[0.849989]] }, Closed]], Cell[CellGroupData[{ Cell["Definitions", "Section"], Cell[TextData[{ "Note: You do not need to read or understand any of this \"Definitions\" \ section. It uses some pretty sophisticated ", StyleBox["Mathematica", FontSlant->"Italic"], " constructs, and is definitely not for beginners. You can close up this \ whole section and evaluate it as a whole, as explained above." }], "Text", FontSlant->"Italic"], Cell["\<\ The explanatory text in this section is for documentation by the \ author, not a tutorial.\ \>", "Text"], Cell[CellGroupData[{ Cell["Prolog", "Subsection"], Cell[BoxData[ \(Off[General::spell1]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Global variables", "Subsection"], Cell[BoxData[{ \(\(maxninputs\ = 0;\)\), "\n", \(\(minninputs = 0;\)\), "\[IndentingNewLine]", \(\(ngates\ = \ 0;\)\), "\n", \(\(bias\ = \ 0.5;\)\), "\n", \(\(ncycles\ = \ 0;\)\), "\n", \(\(lengthlist = {};\)\), "\n", \(\(cyclelist = {};\)\), "\n", \(\(basinlist = {};\)\), "\n", \(\(fullcyclelist = {{}};\)\), "\n", \(\(Clear[ninputs, connections, truth];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Make the network", "Subsection"], Cell[TextData[{ StyleBox["makeNetwork[n,k,p]", "Input", FontSize->12], " constructs a whole network. This must be first." }], "Text"], Cell[BoxData[ \(makeNetwork[n_Integer, \ k_Integer: 0, \ p_Real: 0.5]\ := \ \((\[IndentingNewLine]Clear[ninputs, connections, truth]; \[IndentingNewLine]ngates\ = \ n; \[IndentingNewLine]bias\ = \ p; \[IndentingNewLine]randomAllConnections[ k]; \[IndentingNewLine]randomAllTruths[];\[IndentingNewLine])\)\)], \ "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Connections", "Subsection"], Cell[TextData[{ StyleBox["randomCombination[n,k]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " gives a randomly-chosen list of ", StyleBox["k", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " different digits in the range 1 to ", StyleBox["n", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". Example: randomCombination[10,2] = {6,8}." }], "Text"], Cell[BoxData[{ \(randomCombination[n_Integer, k_Integer]\ := \ Module[{digits = Range[n], m, j}, Do[m = Random[Integer, {j, n}]; {digits[\([j]\)], digits[\([m]\)]}\ = \ {digits[\([m]\)], digits[\([j]\)]}, {j, 1, k}]; Take[digits, k]] /; 1 <= k <= n\), "\[IndentingNewLine]", \(\(randomCombination[n_Integer, 0] = {};\)\)}], "Input"], Cell[TextData[{ StyleBox["connections[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["i", FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " from which input is to be taken for unit ", StyleBox["i", FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], ". The number of inputs for ", StyleBox["i", FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], " unit is ", StyleBox["ninputs[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["i", FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". Examples: connections[3] = {4,8} and ninputs[3]=2." }], "Text"], Cell[TextData[{ StyleBox["randomConnections[i,k]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes ", StyleBox["k", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " random connections from unit ", StyleBox["i", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". ", StyleBox["randomAllConnections[k]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes ", StyleBox["k", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " random connections from all units. Duplicate connections are \ disallowed, but self-connections may occur." }], "Text"], Cell[BoxData[ \(randomConnections[i_Integer, k_Integer]\ := Module[{nl}, \[IndentingNewLine]If[ninputs[i] \[NotEqual] k, clearTruth[i]]; \[IndentingNewLine]ninputs[i] = k; \[IndentingNewLine]nl = Table[ninputs[j], {j, ngates}]; \[IndentingNewLine]maxninputs\ = Max[nl]; \[IndentingNewLine]minninputs = Min[nl]; \[IndentingNewLine]connections[i]\ = randomCombination[ngates, k];\[IndentingNewLine]] /; 1 <= i <= ngates\ && \ 0 <= k <= ngates\)], "Input"], Cell[BoxData[ \(randomAllConnections[k_Integer]\ := Module[{}, \[IndentingNewLine]Clear[ninputs, truth, connections]; \[IndentingNewLine]Do[ ninputs[i] = k, {i, ngates}]; \[IndentingNewLine]maxninputs\ = \(minninputs = \ k\); \[IndentingNewLine]Do[ connections[i]\ = randomCombination[ngates, ninputs[i]], \ {i, ngates}]\[IndentingNewLine]] /; 0 <= k <= ngates\)], "Input"], Cell[TextData[{ StyleBox["makeConnections[i,{j1,j2,...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes ", StyleBox["{j1,j2,...}", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " connections from unit ", StyleBox["i", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ".\n", StyleBox["makeAllConnections[{{i1,i2,...},{j1,j2,...},...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes all connections from all units." }], "Text"], Cell[BoxData[ \(makeConnections[i_Integer, connects_List /; VectorQ[connects]] := Module[{nl}, \[IndentingNewLine]If[ ninputs[i] \[NotEqual] Length[connects], clearTruth[i]]; \[IndentingNewLine]ninputs[i] = Length[connects]; \[IndentingNewLine]nl = Table[ninputs[j], {j, ngates}]; \[IndentingNewLine]maxninputs\ = Max[nl]; \[IndentingNewLine]minninputs = Min[nl]; \[IndentingNewLine]connections[i]\ = connects;\[IndentingNewLine]] /; 1 <= i <= ngates\)], "Input"], Cell[BoxData[ \(makeAllConnections[connects : {___List}] := Module[{nl}, \[IndentingNewLine]If[ngates \[NotEqual] Length[connects], Print["\", ngates, "\<)\>"]; Return[]]; \[IndentingNewLine]Clear[ninputs, truth, connections]; \[IndentingNewLine]nl = Length /@ connects; \[IndentingNewLine]Do[ ninputs[i] = nl[\([i]\)], {i, ngates}]; \[IndentingNewLine]maxninputs = Max[nl]; \[IndentingNewLine]minninputs = Min[nl]; \[IndentingNewLine]Do[ connections[i] = connects[\([i]\)], {i, ngates}];\[IndentingNewLine]]\)], "Input"], Cell[TextData[{ StyleBox["showConnections[]", "Input", FontSize->12], " displays a table of the connections." }], "Text"], Cell[BoxData[ \(showConnections[]\ := \n\t If[ngates > 0, TableForm[ Table[{i, connections[i]}, {i, 1, ngates}], \n\t\tTableDirections -> {Column, Row, Row}, TableSpacing -> {1, 4, 2}, TableHeadings -> {None, {"\", "\"}, None}], Print["\"]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Truth Tables", "Subsection"], Cell[TextData[{ StyleBox["inputpatterns[k]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " gives a list of the 2^k binary input patterns.\nExample: inputpatterns[2] \ = {{0,0},{0,1},{1,0},{1,1}}." }], "Text"], Cell[BoxData[{ \(\(inputpatterns[k_]\ := \ \(inputpatterns[k]\ = Flatten[Array[\(({##} - 1)\) &, Table[2, {k}]], k - 1]\);\)\), "\[IndentingNewLine]", \(\(inputpatterns[0] = {{}};\)\)}], "Input"], Cell[TextData[{ StyleBox["coinflip[p]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " gives 1 with probability p, 0 with probability 1-p." }], "Text"], Cell[BoxData[ \(coinflip[p_]\ := \ If[Random[Real] > p, \ 0, 1]\)], "Input"], Cell[TextData[{ "The truth tables are stored as values of ", StyleBox["truth[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["unit", FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[",", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["inputpattern", FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", so e.g. for ", StyleBox["ninputs[6]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "=4, ", StyleBox["truth[6,{0,0,1,0}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " gives the output (0 or 1) when input {0,0,1,0} is presented at unit 6. \ Use ", StyleBox["?truth", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to see." }], "Text"], Cell[TextData[{ StyleBox["randomTruth[i,p]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes (or changes) a random truth table with bias p for unit i. ", StyleBox["randomTruth[i]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " using for the ", StyleBox["bias", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". ", StyleBox["randomTruth[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " using for a random unit. ", StyleBox["randomAllTruths[p]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes a set of random truth tables with bias p, one for each of n units \ each with inputs. ", StyleBox["randomAllTruths[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " using for the ", StyleBox["bias", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "." }], "Text"], Cell[BoxData[{ \(\(randomTruth[i_Integer, p_Real]\ := \ Scan[\((truth[i, #]\ = coinflip[p])\) &, \ inputpatterns[ninputs[i]]] /; 1 <= i <= ngates;\)\), "\n", \(\(randomTruth[i_Integer] := randomTruth[i, bias];\)\), "\[IndentingNewLine]", \(\(randomTruth[]\ := randomTruth[Random[Integer, {1, ngates}]];\)\)}], "Input"], Cell[BoxData[{ \(\(randomAllTruths[p_Real]\ := \ Module[{}, \[IndentingNewLine]Clear[truth, savedtruths]; \[IndentingNewLine]Do[ Scan[\((truth[i, #]\ = coinflip[p])\) &, \ inputpatterns[ninputs[i]]], {i, ngates}]; \[IndentingNewLine]saveTruths[];\[IndentingNewLine]];\ \)\), "\[IndentingNewLine]", \(\(randomAllTruths[] := randomAllTruths[bias];\)\)}], "Input"], Cell[TextData[{ StyleBox["makeTruth[i,{j1,j2,...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes (or changes) a ", StyleBox["{j1,j2,...}", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " truth table for unit i. ", StyleBox["makeAllTruths[{{i1,i2,...},{j1,j2,...},...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes a set of truth tables." }], "Text"], Cell[BoxData[ \(makeTruth[i_Integer, t_List /; VectorQ[t]] := Module[{}, \[IndentingNewLine]If[ 2^ninputs[i] \[NotEqual] Length[t], \[IndentingNewLine]Print["\", i, "\<: Length[\>", t, "\<] \[NotEqual] 2^\>", ninputs[i]]; Return[]]; \[IndentingNewLine]Scan[\((truth[ i, #[\([1]\)]] = #[\([2]\)])\) &, Transpose[{inputpatterns[ninputs[i]], t}]];\[IndentingNewLine]] /; 1 <= i <= ngates\)], "Input"], Cell[BoxData[ \(makeAllTruths[t : {___List}] := Module[{}, \[IndentingNewLine]If[ngates \[NotEqual] Length[t], Print["\", ngates, "\<)\>"]; Return[]]; \[IndentingNewLine]Clear[truth, savedtruths]; \[IndentingNewLine]Do[\[IndentingNewLine]If[ 2^ninputs[i] == Length[t[\([i]\)]], Scan[\((truth[i, #[\([1]\)]] = #[\([2]\)])\) &, Transpose[{inputpatterns[ninputs[i]], t[\([i]\)]}]], Print["\", i, "\<: Length[\>", t[\([i]\)], "\<] \[NotEqual] 2^\>", ninputs[i]]\[IndentingNewLine]], \[IndentingNewLine]{i, ngates}\[IndentingNewLine]]; \[IndentingNewLine]saveTruths[];\ \[IndentingNewLine]]\)], "Input"], Cell[TextData[{ StyleBox["clearTruth[i]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " clears the truth table for unit i. ", StyleBox["checkTruth[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " checks the truth tables. " }], "Text"], Cell[BoxData[ \(\(clearTruth[i_Integer] := Module[{}, \[IndentingNewLine]Scan[\((If[IntegerQ[truth[i, #]], truth[i, #]\ =. ])\) &, \ inputpatterns[ninputs[i]]]\[IndentingNewLine]] /; 1 <= i <= ngates;\)\)], "Input"], Cell[BoxData[ \(checkTruths[quiet_: 0] := Module[{bad = 0}, \[IndentingNewLine]If[ngates == 0, Return["\"]]; Do[Scan[\((If[\(! IntegerQ[ truth[i, #]]\), \[IndentingNewLine]\(bad++\); Print["\", i, "\<: \>", #]])\) &, \ inputpatterns[ninputs[i]]], {i, ngates}]; \[IndentingNewLine]If[quiet == 0, Print[bad, "\< errors\>"], bad]\[IndentingNewLine]]\)], "Input"], Cell[TextData[{ StyleBox["saveTruths[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " and ", StyleBox["restoreTruths[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " save/restore the whole set of truth tables." }], "Text"], Cell[BoxData[ \(saveTruths[]\ := \ \((\(savedtruths = Table[\(truth[i, #] &\) /@ inputpatterns[ninputs[i]], {i, 1, ngates}];\))\)\)], "Input"], Cell[BoxData[ \(restoreTruths[] := Do[\((thesetruths = savedtruths[\([i]\)]; MapIndexed[\((\(truth[i, #1] = thesetruths[\([#2[\([1]\)]]\)];\))\) &, inputpatterns[ninputs[i]]])\), {i, ngates}]\)], "Input"], Cell[TextData[{ StyleBox["showTruth[i]", "Input", FontSize->12], " displays the truth table for unit i.", "\n", StyleBox["showAllTruths[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " displays all the truth tables as one table." }], "Text"], Cell[BoxData[ \(showTruth[i_Integer]\ := If[1 <= i <= ngates, TableForm[\(\(({#, truth[i, #]})\) &\) /@ inputpatterns[ninputs[i]], TableDirections -> {Column, Row, Row}, \n\t TableSpacing -> {0, 2, 1}, TableHeadings -> {None, {"\", "\"}, None}], Print["\", i]]\)], "Input"], Cell[BoxData[ \(showAllTruths[]\ := \ Module[{}, \[IndentingNewLine]If[ngates == 0, Return["\"]]; \[IndentingNewLine]If[ checkTruths[1] \[NotEqual] 0, Return[]]; \[IndentingNewLine]TableForm[ Prepend[\(\(({#, Table[truth[i, Take[#, {1, ninputs[i]}]], {i, 1, ngates}]})\) &\) /@ inputpatterns[maxninputs], {Range[maxninputs], Mod[Range[ngates], 10]}], TableDirections -> {Column, Row, Row}, \n\t TableSpacing -> {0, 2, 1}, TableHeadings -> {None, {"\", "\"}, None}]\[IndentingNewLine]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["States", "Subsection"], Cell[TextData[{ StyleBox["randomState[]", "Input", FontSize->12], " returns a random state" }], "Text"], Cell[BoxData[ \(randomState[]\ := \ Table[Random[Integer], {ngates}]\)], "Input"], Cell[TextData[{ StyleBox["toValue[state]", "Input", FontSize->12], " converts a state (a list of 0's and 1's) to an integer value. It can \ also be applied to a list of states." }], "Text"], Cell[BoxData[{ \(\(toValue[s_List\ /; \ VectorQ[s]]\ := \ FromDigits[s, 2] + 1;\)\), "\n", \(toValue[ s_List\ /; \ MatrixQ[s]]\ := \ \(\((FromDigits[#, 2] + 1)\) &\) /@ s\)}], "Input"], Cell[TextData[{ StyleBox["toState[value]", "Input", FontSize->12], " converts an integer value to a state (a list of 0's and 1's). It can \ also be applied to a list of values." }], "Text"], Cell[BoxData[{ \(\(toState[v_Integer]\ := \ IntegerDigits[v - 1, 2, ngates];\)\), "\n", \(toState[v_List]\ := \ \(\((IntegerDigits[# - 1, 2, ngates])\) &\) /@ v\)}], "Input"], Cell["More generally, it works for N (but not using it):", "Text"], Cell[BoxData[{ \(\(toState[v_Integer, n_Integer]\ := \ IntegerDigits[v - 1, 2, n];\)\), "\n", \(toState[v_List, n_Integer]\ := \ \(\((IntegerDigits[# - 1, 2, n])\) &\) /@ v\)}], "Input"], Cell[TextData[{ StyleBox["oneflip[state,i]", "Input", FontSize->12], " flips bit i in a state. ", StyleBox["oneflip[value,i]", "Input", FontSize->12], " does the same thing for a state expressed as an integer value. If you \ leave out i it gets chosen randomly." }], "Text"], Cell[BoxData[{ \(\(oneflip[s_List\ /; \ VectorQ[s], i_]\ := \ ReplacePart[s, 1 - s[\([i]\)], i];\)\), "\n", \(oneflip[v_Integer, i_]\ := \ toValue[oneflip[toState[v], i]]; oneflip[s_]\ := \ oneflip[s, Random[Integer, {1, ngates}]]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Display", "Subsection"], Cell[TextData[{ StyleBox["showParameters[]", "Input", FontSize->12], " displays a list of parameter values for the current network." }], "Text"], Cell[BoxData[ \(showParameters[]\ := \ Module[{nones, nall}, \[IndentingNewLine]If[ngates <= 0, Return["\"]]; \[IndentingNewLine]If[ checkTruths[1] \[NotEqual] 0, Return[]]; \[IndentingNewLine]nones = Plus @@ Flatten[ Table[\(truth[i, #] &\) /@ inputpatterns[ninputs[i]], {i, ngates}]]; \[IndentingNewLine]nall = Plus @@ Table[ 2^ninputs[i], {i, ngates}]; \[IndentingNewLine]Print["\", ngates]; Print[\*"\"\\"", 2^ngates]; If[minninputs == maxninputs, Print["\", maxninputs]; \[IndentingNewLine]Print[\*"\"\\"", 2^maxninputs], \[IndentingNewLine]Print[\*"\"\<\!\(K\_min\) = \ number of minimum inputs per gate = \>\"", minninputs]; \[IndentingNewLine]Print[\*"\"\\"", 2^minninputs]; \[IndentingNewLine]Print[\*"\"\<\!\(K\_max\) = \ number of maximum inputs per gate = \>\"", maxninputs]; \[IndentingNewLine]Print[\*"\"\\"", 2^maxninputs]\[IndentingNewLine]]; \[IndentingNewLine]Print["\

", bias]; \[IndentingNewLine]Print["\", nones, "\", nall, "\< = \>", N[nones/nall, 3]];]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Graphics", "Subsection"], Cell[TextData[{ StyleBox["makeUnit[x,y,theta,r,k]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " generates coordinates and graphics elements for a unit centered at {x,y}, \ oriented at angle theta, of size (radius) r, with k inputs. There are \ different versions for different \"Unit\" settings. It returns a list of 5 \ things:\n1. The {x,y} coordinates of the output point;\n2. A list of the \ {x,y} coordinates of the input points;\n3. The {x,y} coordinates of the \ center, for label placement;\n4. A list of Graphics primitives for drawing \ the whole unit;\n5. A list of Graphics primitives for coloring the unit." }], "Text"], Cell[BoxData[ \(makeUnit["\", x_, y_, theta_, r_, k_]\ := \ Module[{rs = r*N[Sin[theta]], rc = r*N[Cos[theta]], outpt, inlist}, outpt\ = \ {x + rc, y - rs}; inlist = Table[{x - rc + rs*\((2 j - k - 1)\)/\((k + 1)\), y + rs + rc*\((2 j - k - 1)\)/\((k + 1)\)}, {j, 1, k}]; {outpt, inlist, {x, y}, {Line[{{x - 0.5 rc - rs, y - rc + 0.5 rs}, {x - 0.5 rc + rs, y + rc + 0.5 rs}}], Circle[{x - 0.5 rc, y + 0.5 rs}, r, {\(-Pi\)/2 - theta, Pi/2 - theta}], Line[{{x + 0.5 rc, y - 0.5 rs}, {x + rc, y - rs}}], \n\t\t\t\tPoint[ outpt], \({Point[#], Line[{#, # + {0.5 rc, \(-0.5\) rs}}]} &\) /@ inlist}\n, {Disk[{x - 0.5 rc, y + 0.5 rs}, r, {\(-Pi\)/2 - theta, Pi/2 - theta}]}}]\)], "Input"], Cell[BoxData[ \(makeUnit["\", x_, y_, theta_, r_, k_]\ := \ Module[{inlist}, inlist = Table[{x + r*Cos[2.0 j*Pi/k - theta], y + r*Sin[2.0 j*Pi/k - theta]}, {j, 0, k - 1}]; {{x, y}, inlist, {x, y}, {Circle[{x, y}, r], Point[{x, y}], \(Point[#] &\) /@ inlist}, {Disk[{x, y}, r]}}]\)], "Input"], Cell[BoxData[ \(makeUnit["\", x_, y_, theta_, r_, k_]\ := \ Module[{rs = r*N[Sin[theta]], rc = r*N[Cos[theta]], alpha = 3 Pi/8, ca, sa, outpt, inlist, baselist}, ca = N[Cos[alpha]]; sa = N[Sin[alpha]]; outpt\ = \ {x + rs, y + rc}; inlist = Table[{x + rc*ca*\((2 j - k - 1)\)/\((k + 1)\) - 1.5 rs, y - 1.5 rc - rs*ca*\((2 j - k - 1)\)/\((k + 1)\)}, {j, 1, k}]; baselist = {{x + rc*ca - rs*sa, y - rs*ca - rc*sa}, {x + rc*ca - 1.5 rs, y - rs*ca - 1.5 rc}, {x - rc*ca - 1.5 rs, y + rs*ca - 1.5 rc}, {x - rc*ca - rs*sa, y + rs*ca - rc*sa}}; {outpt, inlist, {x, y}, {Circle[{x, y}, r, {\(-alpha\) - theta, Pi + alpha - theta}], Line[baselist], Point[outpt], \(Point[#] &\) /@ inlist}, {Disk[{x, y}, r], Polygon[baselist]}}]\)], "Input"], Cell[TextData[{ StyleBox["showNetwork[state]", "Input", FontSize->12], " draws and colors a whole network. It first sets up the whole layout, \ creating ", StyleBox["picture", "Input", FontSize->12], ", ", StyleBox["gatecolor", "Input", FontSize->12], ", and ", StyleBox["colorlist", "Input", FontSize->12], " for use by . Then it calls ", StyleBox["showState[state]", "Input", FontSize->12], " to do the actual drawing of one or more states." }], "Text"], Cell[BoxData[{ \(\(showNetwork[state_, opts___] := \ Module[{nr, nc, r, theta, theangle, thelayout, thejiggle, thewiggle, thelabel, theunit, theconnect, delta, layout}, If[ngates <= 0, Print["\"]; Return[]]; thelayout\ = \ ToString[\(Layout /. {opts}\) /. Options[showNetwork]]; theunit\ = \ ToString[\(Unit /. {opts}\) /. Options[showNetwork]]; {theangle, thejiggle, thewiggle, thelabel, theconnect}\ = \ \({Angle, Jiggle, Wiggle, Label, Connect} /. {opts}\) /. Options[showNetwork]; \[IndentingNewLine]layout\ = \ Transpose[ Which[\[IndentingNewLine]thelayout == "\", \ \[IndentingNewLine]r\ = \ Min[0.2, N[0.667*Pi/ngates]]; delta = 2 r*thejiggle; \ Table[\((theta\ = \ \ N[\((\((i - 1)\)/ngates)\)*2 Pi]; makeUnit[theunit, Sin[theta] + delta*Random[Real], Cos[theta] + delta*Random[Real], thewiggle*Random[Real, {\(-Pi\), Pi}] + theta - theangle, r, ninputs[i]])\), \[IndentingNewLine]{i, 1, ngates}], \[IndentingNewLine]thelayout == "\", \ \[IndentingNewLine]nr\ \ = Ceiling[Sqrt[ngates]]; \[IndentingNewLine]nc\ = \ Ceiling[ngates/nr]; \[IndentingNewLine]r\ = \ Min[0.2, 0.33/nr]; \[IndentingNewLine]delta = 2 r*thejiggle; \[IndentingNewLine]Table[ makeUnit[\ theunit, N[Mod[i - 1, \ nr]/nr] + delta*Random[Real], 1.0\ - Quotient[i - 1, nr]/nr + delta*Random[Real], thewiggle*Random[Real, {\(-Pi\), Pi}] - theangle, r, ninputs[i]], {i, 1, ngates}]\[IndentingNewLine]]]; \[IndentingNewLine]picture\ \ = \ {{Thickness[0.01], PointSize[0.02], layout[\([4]\)]}}; If[theconnect, \[IndentingNewLine]AppendTo[picture, Line /@ Transpose[{Flatten[layout[\([2]\)], 1], layout[\([1, Flatten[ Array[connections, ngates]]]\)]}]]\[IndentingNewLine]]; \ \[IndentingNewLine]If[ thelabel\ || \ \((thelabel == Automatic\ && \ ngates <= 10)\), AppendTo[picture, Table[Text[ToString[i], layout[\([3, i]\)]], {i, 1, ngates}]]\[IndentingNewLine]]; \[IndentingNewLine]colorlist\ \ = \ layout[\([5]\)]; \[IndentingNewLine]gatecolor = \(Color /. {opts}\) /. Options[showNetwork]; \[IndentingNewLine]showState[ state]];\)\), "\n", \(\(Options[showNetwork]\ = \ {Layout -> Ring, Angle -> 0, \ Jiggle -> 0, Wiggle -> 0, Label -> Automatic, Connect -> True, Color -> RGBColor[1, 0.75, 0], Unit -> Gate};\)\)}], "Input"], Cell[TextData[{ StyleBox["showState[state]", "Input", FontSize->12], " draws and colors a whole network, assuming that ", StyleBox["showNetwork[]", "Input", FontSize->12], " has done all the setup. It can be applies to an ordinary state (list of \ 0's and 1's), or to coded value, or to a list of states; in the last case it \ produces a sequence of drawings suitable for animation." }], "Text"], Cell[BoxData[{ \(\(showState[s_List\ /; \ VectorQ[s]]\ := \ If[Length[s] == ngates, Show[Graphics[{gatecolor, colorlist[\([Flatten[Position[s, 1]]]\)], GrayLevel[0], picture}], AspectRatio -> Automatic], Print["\", Length[s], "\<) is not equal to number of gates (\>", ngates, "\<)\>"]];\)\), "\n", \(\(showState[s_List\ /; \ MatrixQ[s]]\ := \ showState /@ s;\)\), "\n", \(showState[v_Integer]\ := \ showState[toState[v]]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Step", "Subsection"], Cell[TextData[{ StyleBox["step[state]", "Input", FontSize->12], " produces the successor to ", StyleBox["state", "Input", FontSize->12], ". This can also be applied to integer values. Returns ", StyleBox["state", "Input", FontSize->12], " unchanged if its length is wrong." }], "Text"], Cell[BoxData[{ \(\(step[s_List]\ := If[Length[s] == ngates, \(\((Table[ truth[i, #[\([connections[i]]\)]], {i, 1, ngates}])\) &\)[ s], s];\)\), "\n", \(step[v_Integer]\ := \ toValue[step[toState[v]]]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Attractor basins", "Subsection"], Cell[TextData[{ StyleBox["analyze[]", "Input", FontSize->12], " does a complete analysis of the state cycles and attractor basins, using \ a Hoshen-Kopelman algorithm. It prints a summary table showing each of the \ attractors, each with its cycle length and basin of attraction size. One \ state in the cycle is also given as an integer value. It sets up the lists \ ", StyleBox["cyclelist", "Input", FontSize->12], ", ", StyleBox["fullcyclelist", "Input", FontSize->12], ", ", StyleBox["basinlist", "Input", FontSize->12], ", and ", StyleBox["lengthlist", "Input", FontSize->12], " for further use." }], "Text"], Cell[BoxData[ \(analyze[] := Module[{ns = 2^ngates, att, cyc, j, k, s, attractor}, \[IndentingNewLine]If[ngates == 0, Return["\"]]; \[IndentingNewLine]If[ngates > 16, Return["\"]]; \[IndentingNewLine]If[ checkTruths[1] \[NotEqual] 0, Return[]]; \[IndentingNewLine]Do[ att[i] = \ 0, \ {i, 1, ns}]; \[IndentingNewLine]For[j = 1, j <= ns, \(j++\), \[IndentingNewLine]k = j; \[IndentingNewLine]If[ att[k] == 0, \((s = toState[k]; While[att[k] == 0, att[k] = j; s = step[s]; k = toValue[s]]; If[att[k] == j, cyc[j] = k, cyc[j] = cyc[att[ k]]])\)]\[IndentingNewLine]]; \ \[IndentingNewLine]attractor\ = \ Table[cyc[att[i]], \ {i, 1, ns}]; cyclelist\ = \ Union[attractor]; \[IndentingNewLine]ncycles = Length[cyclelist]; \[IndentingNewLine]fullcyclelist\ = Function[start, Drop[FixedPointList[toValue[step[toState[#]]] &, start, SameTest -> \((\((#2 == start)\) &)\)], \(-1\)]] /@ cyclelist; \[IndentingNewLine]cyclelist = Min /@ fullcyclelist; \[IndentingNewLine]basinlist\ = \ Length /@ Split[ Sort[attractor]]; \[IndentingNewLine]lengthlist\ = \ Length /@ fullcyclelist; \[IndentingNewLine]TableForm[ Transpose[{Range[ncycles], lengthlist, basinlist, cyclelist}], TableHeadings -> {None, {"\<#\>", "\", "\", \ "\"}}]\n]\)], "Input"], Cell[TextData[{ StyleBox["analyze[n]", "Input", FontSize->12], " is similar in intent to ", StyleBox["analyze[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", but only looks at n starting states, and therefpre only gathers \ statistical information. In this case the numbers listed under \"Basin\" are \ the number of randomly chosen starting states that led to the specified \ cycle. It sets up the lists ", StyleBox["attractor", "Input", FontSize->12], ", ", StyleBox["cyclelist", "Input", FontSize->12], ", ", StyleBox["fullcyclelist", "Input", FontSize->12], ", ", StyleBox["basinlist", "Input", FontSize->12], ", and ", StyleBox["lengthlist", "Input", FontSize->12], " for further use." }], "Text"], Cell[BoxData[ \(analyze[n_Integer]\ := Module[{st, valuelist, p, group, attractor, groupsize}, \[IndentingNewLine]If[ngates == 0, Return["\"]]; \[IndentingNewLine]If[ checkTruths[1] \[NotEqual] 0, Return[]]; \[IndentingNewLine]groupsize = 2^maxninputs (*empirical*) ; attractor\ = \ Table[st = randomState[]; valuelist = {toValue[st]}; While[True, group = Drop[NestList[step, st, groupsize], 1]; valuelist = Join[valuelist, toValue /@ group]; p = Position[Drop[valuelist, \(-1\)], Last[valuelist]]; If[Length[p] > 0, Break[]]; st = Last[group]]; Min[Drop[valuelist, p[\([1, 1]\)]]], {n}]; cyclelist\ = \ Union[attractor]; \[IndentingNewLine]ncycles = Length[cyclelist]; \[IndentingNewLine]fullcyclelist\ = Function[start, Drop[FixedPointList[toValue[step[toState[#]]] &, start, SameTest -> \((\((#2 == start)\) &)\)], \(-1\)]] /@ cyclelist; basinlist\ = \ Length /@ Split[ Sort[attractor]]; \[IndentingNewLine]lengthlist\ = \ Length /@ fullcyclelist; \[IndentingNewLine]TableForm[ Transpose[{Range[ncycles], lengthlist, basinlist, cyclelist}], TableHeadings -> {None, {"\<#\>", "\", "\", \ "\"}}]\n]\)], "Input"], Cell[TextData[{ StyleBox["showCycle[m]", "Input", FontSize->12], " shows all the states in the n'th cycle (as numbered by ", StyleBox["analyze[]", "Input", FontSize->12], " or ", StyleBox["analyze[n]", "Input", FontSize->12], "), both as integer values and as 0/1 lists." }], "Text"], Cell[BoxData[ \(showCycle[j_]\ := TableForm[\({#, toState[#]} &\) /@ fullcyclelist[\([j]\)], TableDirections -> {Column, Row, Row}] /; 1 <= j <= ncycles\)], "Input"], Cell[TextData[{ StyleBox["findCycle[state]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " finds the cycle that a particular starting state leads to, returning the \ whole cycle starting from the lowest numbered state (thus making the output \ unique for a given cycle)." }], "Text"], Cell[BoxData[{ \(\(findCycle[s_List\ /; \ VectorQ[s]]\ := \ Module[{valuelist = {}, st = s, newvalue, p}, \n While[True, st = step[st]; newvalue = toValue[st]; p = Position[valuelist, newvalue]; If[Length[p] > 0, Break[]]; AppendTo[valuelist, newvalue]]; valuelist = Drop[valuelist, p[\([1, 1]\)] - 1]; p = Position[valuelist, Min[valuelist]]; RotateLeft[valuelist, p[\([1, 1]\)] - 1]];\)\), "\n", \(findCycle[v_Integer] := findCycle[toState[v]]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Epilog", "Subsection"], Cell[BoxData[ \(On[General::spell1]\)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Making and Examining a Network", "Section"], Cell[TextData[{ "The first thing we need to do is to make a network. The function ", StyleBox["makeNetwork[N,K,p]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " does this, with parameters:\nN - the number of units;\nK - the number of \ inputs per unit;\np - the bias in the truth tables towards having a \"1\" \ output (0.5 is unbiased)" }], "Text"], Cell[BoxData[ \(makeNetwork[10, 2, 0.5]\)], "Input"], Cell["\<\ This doesn't actually show what it has done. To make a picture of \ the network in a random state we can use:\ \>", "Text"], Cell[BoxData[ \(showNetwork[randomState[]]\)], "Input"], Cell[TextData[{ StyleBox["Make sure you understand all that you're seeing here", FontSlant->"Italic"], ". The logic gates are drawn with one output and K inputs. They're \ numbered in a clockwise direction, starting with number 1 at the top. The \ lines show the connections, connecting outputs to inputs randomly except that \ no gate receives more than one input from a given other gate. Gates may \ receive inputs from themselves (look for examples). The gates that are \ \"on\" (output = 1) are colored yellow, somewhat like light bulbs. Which \ ones are on and which ones are off was chosen randomly by the ", "randomState[]", " function." }], "Text"], Cell[TextData[{ "Each time you use you get a new randomly chosen state, which is \ technically just a list of 0's and 1's. But you can save a state produced by \ the ", StyleBox["randomState[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " function, calling it ", StyleBox["state", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " say, and then display it. Make sure you understand the following." }], "Text"], Cell[BoxData[ \(randomState[]\)], "Input"], Cell[BoxData[ \(state\ = \ randomState[]\)], "Input"], Cell[BoxData[ \(showNetwork[state]\)], "Input"], Cell[TextData[{ "Note how the value of ", StyleBox["state", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " corresponds to the picture." }], "Text"], Cell[TextData[{ "Of course the picture doesn't show the particular Boolean functions that \ are used by each gate, but ", StyleBox["makeNetwork[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " did construct those too. You can look at the truth table for one gate \ with (for gate 4, for example)" }], "Text"], Cell[BoxData[ \(showTruth[4]\)], "Input"], Cell["Or you can look at them all at once with", "Text"], Cell[BoxData[ \(showAllTruths[]\)], "Input"], Cell[TextData[{ "The table combines n truth tables, one for each gate. For technical \ formatting reasons, the heading shows only the last digit of the gate number \ (so 10 appears as 0). Column 4 should agree with the single truth table \ above. ", StyleBox["showAllTruths[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is rather slow (as you might expect from its grandstanding name!), and is \ not recommended for large N or large K." }], "Text"], Cell["\<\ You can also get a list of the connections, which should agree with \ the drawing above, with:\ \>", "Text"], Cell[BoxData[ \(showConnections[]\)], "Input"], Cell[TextData[{ StyleBox["Also, ", FontVariations->{"CompatibilityType"->0}], StyleBox["showNetwork[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " has some options that affect the drawing (but not the network itself):\n\ \n1. ", StyleBox["Layout\[Rule]Grid", "Input", FontSize->12], " or ", StyleBox["Layout\[Rule]Ring", "Input", FontSize->12], " (default) changes the basic layout.\n\n2. ", StyleBox["Unit\[Rule]Gate", "Input", FontSize->12], " (default), ", StyleBox["Unit\[Rule]Bulb", "Input", FontSize->12], ", or ", StyleBox["Unit\[Rule]Circle", "Input", FontSize->12], " changes the appearance of the gates themselves. ", StyleBox["Unit\[Rule]Circle", "Input", FontSize->12], " is boring, but is best to use if you want to draw a lot of gates; think \ of it as looking down on a light bulb from above.\n\n3. ", StyleBox["Angle\[Rule]", "Input", FontSize->12], StyleBox["angle", "Input", FontSize->12, FontSlant->"Italic"], " changes the orientation of the gates, rotating them all counterclockwise \ by \"angle\" (in radians; \[Pi]/2 means 90 degrees).\n\n4. ", StyleBox["Jiggle\[Rule]", "Input", FontSize->12], StyleBox["c", "Input", FontSize->12, FontSlant->"Italic"], " moves the {x,y} location of each gate randomly by a small amount. c \ controls how large the jiggling is, and should normally be between 0 and 1.\n\ \n5. ", StyleBox["Wiggle\[Rule]", "Input", FontSize->12], StyleBox["c", "Input", FontSize->12, FontSlant->"Italic"], " rotates the gates randomly by an amount controlled by c. c should \ normally be between 0 and 1. ", StyleBox["Wiggle\[Rule]1", "Input", FontSize->12], " gives completely random orientations.\n\n6. ", StyleBox["Label\[Rule]False", "Input", FontSize->12], " or ", StyleBox["Label\[Rule]True", "Input", FontSize->12], " turns off or on the numbering of gates. The default is ", StyleBox["Label\[Rule]Automatic", "Input", FontSize->12], ", which only does numbering if N is 10 or less. Numbering is usually the \ slowest part of drawing the picture.\n\n7. ", StyleBox["Connect\[Rule]False", "Input", FontSize->12], " turns off drawing the connections -- only the gates themselves are shown. \ This make make a nicer picture, especially for large N.\n\n8. ", StyleBox["Color\[Rule]", "Input", FontSize->12], StyleBox["color", "Input", FontSize->12, FontSlant->"Italic"], " changes the color used to show gates that are \"on\". Unless you are an \ expert at color specifications, you should use ", StyleBox["Color\[Rule]RGBColor[r,g,b]", "Input", FontSize->12], ", where r, g, and b are the amounts of red, green, and blue to use, each \ from 0 to 1. E.g. ", StyleBox["Color\[Rule]RGBColor[1,0,0]", "Input", FontSize->12], " gives red." }], "Text"], Cell["\<\ Here are examples of some of those options in use (using a new \ random state for each picture):\ \>", "Text"], Cell[BoxData[ \(showNetwork[randomState[], Unit \[Rule] Bulb]\)], "Input"], Cell[BoxData[ \(showNetwork[randomState[], Layout \[Rule] Grid, Wiggle \[Rule] 1]\)], "Input"], Cell[BoxData[ \(showNetwork[randomState[], Angle \[Rule] \(-Pi\)/2, Label \[Rule] False, Connect \[Rule] False, Color \[Rule] RGBColor[0, 0, 1]]\)], "Input"], Cell[TextData[{ "If you want to change the ", StyleBox["default", FontSlant->"Italic"], " values of any of these options, you can do so with a command like" }], "Text"], Cell[BoxData[ \(SetOptions[showNetwork, Color \[Rule] RGBColor[1, 0.75, 0]]\)], "Input"], Cell[TextData[{ "That shows all the current defaults. Actually it didn't really change \ anything, since I was using that color already. But you can set another \ color or layout parameter with ", StyleBox["SetOptions[showNetwork,", "Input", FontSize->12], StyleBox["option", "Input", FontSize->12, FontSlant->"Italic"], StyleBox["]", "Input", FontSize->12], " if you wish (but only change one option at a time). Also feel free to \ change my choices in later examples of ", StyleBox["showNetwork[]", "Input", FontSize->12], "." }], "Text"], Cell["\<\ Before we go on to set one of these networks in motion, let's just \ check the effect of the p parameter. Here's a new network with K=4 inputs \ and p set to 0.8. I also added some jiggle for fun (it actually helps to \ avoid lines falling on top of each other):\ \>", "Text"], Cell[BoxData[{ \(\(makeNetwork[10, 4, 0.8];\)\), "\n", \(showNetwork[randomState[], Layout \[Rule] Grid, Jiggle \[Rule] 0.5]\)}], "Input"], Cell["\<\ To see the effect of the p parameter we have to look at the truth \ tables:\ \>", "Text"], Cell[BoxData[ \(showAllTruths[]\)], "Input"], Cell["\<\ You should see that most of the output values are 1's -- about 80% \ on average. You can get an exact count with\ \>", "Text"], Cell[BoxData[ \(showParameters[]\)], "Input"], Cell[TextData[{ "The last line gives the actual number of 1's in the output columns above, \ as a fraction of the total number of entries (160 = N", Cell[BoxData[ \(TraditionalForm\`2\^K\)]], ")." }], "Text"], Cell[TextData[{ "Make sure you understand all the other lines produced by ", StyleBox["showParameters[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " too." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Running the Network", "Section"], Cell["\<\ Before we proceed, let's make a new network with N=10, K=2 and no \ bias (i.e. p=0.5):\ \>", "Text"], Cell[BoxData[{ \(\(makeNetwork[10, 2, 0.5];\)\), "\n", \(\(state\ = \ randomState[];\)\), "\n", \(showNetwork[state, Label -> False]\)}], "Input"], Cell[TextData[{ "Here I set ", StyleBox["state", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to a new random state for future reference. It's a good idea to do that \ right after making a new network, to make sure the length of the ", StyleBox["state", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " list matches the network. I also turned off the unit labels for the sake \ of speed. Here's the state shown above" }], "Text"], Cell[BoxData[ \(state\)], "Input"], Cell["\<\ The basic operation on the network is to update it by one step, so \ all the outputs are set to whatever the truth tables say as a function of \ their current (old) inputs. That can be done with\ \>", "Text"], Cell[BoxData[ \(step[state]\)], "Input"], Cell[TextData[{ "Note carefully that this doesn't reset the ", StyleBox["state", "Input", FontSize->12], " variable itself; it just produces the successor state. If you want to \ reset ", StyleBox["state", "Input", FontSize->12], " you need to say" }], "Text"], Cell[BoxData[ \(state\ = \ step[state]\)], "Input"], Cell["You could do 3 steps with", "Text"], Cell[BoxData[ \(step[step[step[state]]]\)], "Input"], Cell["or, equivalently, with", "Text"], Cell[BoxData[ \(Nest[step, state, 3]\)], "Input"], Cell[TextData[{ "(the last two results should be the same). It should be pretty obvious \ from this example what the ", StyleBox["Mathematica", FontSlant->"Italic"], " function ", StyleBox["Nest[]", "Input", FontSize->12], " does:" }], "Text"], Cell[BoxData[ \(\(?Nest\)\)], "Input"], Cell[TextData[{ "More commonly we'll want to produce a list of a succession of states, to \ follow what's happening. The ", StyleBox["NestList[]", "Input", FontSize->12], " function is perfect for our purpose:" }], "Text"], Cell[BoxData[ \(\(?NestList\)\)], "Input"], Cell[BoxData[ \(NestList[step, state, 3]\)], "Input"], Cell["\<\ Note that that includes the original state as the first element of \ the result, so we got 4 elements in all.\ \>", "Text"], Cell[TextData[{ "Also note that the above doesn't reset ", StyleBox["state", "Input", FontSize->12], " at all. If you want to reset ", StyleBox["state", "Input", FontSize->12], " to the final state produced by ", StyleBox["NestList", "Input", FontSize->12], ", use ", StyleBox["Last[]", "Input", FontSize->12], " to get the last element of the list of states. E.g." }], "Text"], Cell[BoxData[ \(state\ = \ Last[%]\)], "Input"], Cell[TextData[{ "(", StyleBox["%", "Input", FontSize->12], " means the last result)." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Converting States to Numbers", "Section"], Cell[TextData[{ "These lists of 0's and 1's aren't very easy to interpret or compare unless \ you're a computer. It's much easier if we convert them to numbers. There \ are ", Cell[BoxData[ \(TraditionalForm\`2\^10\)]], "= 1024 possible states for N=10, which we can represent as numbers from 1 \ to 1024 (or in general from 1 to ", Cell[BoxData[ \(TraditionalForm\`2\^N\)]], "). This is done by the ", StyleBox["toValue[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["s", FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " function:" }], "Text"], Cell[BoxData[ \(toValue[state]\)], "Input"], Cell["\<\ The actual number is basically thedecimal value of the state \ considered as a binary number, plus one. It's computed by giving the last \ entry value 1, the second to last value 2, the third to last value 4, and so \ on, and then adding 1 at the end. You can play with this directly to make \ sure you understand the rule:\ \>", "Text"], Cell[BoxData[ \(toValue[{1, 0, 0, 1, 1}]\)], "Input"], Cell["That's (16+2+1)+1, OK? The reverse conversion is done by", "Text"], Cell[BoxData[ \(toState[20]\)], "Input"], Cell[TextData[{ "This always produces a list of length N, using leading 0's if necessary, \ where N is the last value you used in ", StyleBox["makeNetwork[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". Or we could use ", StyleBox["toState[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["v", FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox[",", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["N", FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ":" }], "Text"], Cell[BoxData[ \(toState[20, 15]\)], "Input"], Cell[TextData[{ StyleBox["toValue[{", "Input", FontSize->12], StyleBox["s1", "Input", FontSize->12, FontWeight->"Plain", FontSlant->"Italic"], StyleBox[",", "Input", FontSize->12], StyleBox["s2", "Input", FontSize->12, FontWeight->"Plain", FontSlant->"Italic"], StyleBox[",....}]", "Input", FontSize->12], " will work on a ", StyleBox["list", FontSlant->"Italic"], " of states too, and ", StyleBox["toState[{", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["v1", FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox[",", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["v2", FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox[",...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " will work on a list of numbers:" }], "Text"], Cell[BoxData[ \(NestList[step, state, 3]\)], "Input"], Cell[BoxData[ \(toValue[NestList[step, state, 3]]\)], "Input"], Cell[BoxData[ \(toState[{1, 10, 100, 1000}]\)], "Input"], Cell[TextData[{ "Actually ", StyleBox["step[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["v", FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " can also be applied directly to a number, and will implicitly convert it \ to a state, step the state, and convert it back to a number." }], "Text"], Cell[BoxData[ \(step[123]\)], "Input"], Cell[TextData[{ "But in general you should not use that much, particularly in ", StyleBox["Nest", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " or ", StyleBox["NestList", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", because all the converting back and forth is relatively slow. The \ following two expressions should give the same thing, but the second is \ better (faster) because it does less converting back and forth:" }], "Text"], Cell[BoxData[ \(Nest[step, toValue[state], 1000]\)], "Input"], Cell[BoxData[ \(toValue[Nest[step, state, 1000]]\)], "Input"], Cell["\<\ (You may not notice the time difference here, but you would for a \ sufficiently large number of steps.)\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["What's Happening?", "Section"], Cell["\<\ Now let's see what's actually happening. The following expression \ shows the first 20 states reached from a random starting state, expressed as \ numbers:\ \>", "Text"], Cell[BoxData[ \(toValue[NestList[step, randomState[], 20]]\)], "Input"], Cell["\<\ You should be readily able to see whether the network has fallen \ into a repeating state cycle. Has it? Probably yes, after just a few \ initial steps. Possibly it's a really boring cycle of length 1 -- the same \ number repeating itself. Or possibly you've hit a really long cycle and \ don't see any repeats. Don't worry, any of these are possible.\ \>", "Text"], Cell[TextData[{ "Try evaluating the previous expression a number of times. Do you always \ get the same state cycle after a few initial steps? Are the state cycles \ really boring, of length 1? You may be lucky, or you may get a dull case. \ So here (following) are the commands to make a new network and then run \ trials on it. ", StyleBox["Make networks and explore them each from a number of starting \ points until you get some interesting behavior (multiple non-boring state \ cycles)", FontSlant->"Italic", FontColor->RGBColor[1, 0, 0]], StyleBox[". ", FontColor->RGBColor[1, 0, 0]], "Try to find a case with a state cycle of length between 4 and 10, and ", StyleBox["note down one of the numbers within the ", FontColor->RGBColor[1, 0, 0]], StyleBox["cycle", FontColor->RGBColor[1, 0, 1]], StyleBox[" and the ", FontColor->RGBColor[1, 0, 0]], StyleBox["length", FontColor->RGBColor[1, 0, 1]], StyleBox[" of the cycle", FontColor->RGBColor[1, 0, 0]], " (number of different states in it). We'll use these numbers shortly. \ You may have try a dozen or so networks, or you may get lucky early on -- be \ patient." }], "Text"], Cell[BoxData[ \(makeNetwork[10, 2, 0.5]\)], "Input"], Cell[BoxData[ \(toValue[NestList[step, randomState[], 20]]\)], "Input"], Cell[TextData[{ "Well I bet I know what you're thinking by now: can't we see the light \ bulbs twinkling?\nIndeed we can, just by putting a list of states into ", StyleBox["showNetwork[]", "Input", FontSize->12], " , which then produces a sequence of pictures. ", StyleBox["NestList[]", "Input", FontSize->12], " produces such a list, so the following does what we want (this produces \ 10 pictures):" }], "Text"], Cell[BoxData[ \(showNetwork[NestList[step, randomState[], 10]]\)], "Input"], Cell[TextData[{ "Now animate these pictures by double-clicking beside one of them (or use \ the ", StyleBox["Animate Selected Graphics", FontWeight->"Bold"], " command on the ", StyleBox["Cell", FontWeight->"Bold"], " menu)." }], "Text"], Cell["\<\ You'll probably need to slow this down to get a sensible movie, \ using the \"tape-recorder\" controls at the bottom of the window. Depending \ on the network you've chosen, and the (random) starting state, you'll \ probably see a transient lead-in and then a cyclic behavior.\ \>", "Text"], Cell[TextData[{ "To get a nice movie of a cycle, pick the numbers you remembered above, and \ fill them in in place of ", StyleBox["start", FontSlant->"Italic"], " and ", StyleBox["length", FontSlant->"Italic"], " in the expression below (it doesn't matter if the numbers are in \ italics). Don't evaluate this until you've done so! You may also want to add \ your wn options to produce light bulbs, etc." }], "Text"], Cell[BoxData[ RowBox[{"showNetwork", "[", RowBox[{"NestList", "[", RowBox[{"step", ",", RowBox[{"toState", "[", StyleBox["start", FontWeight->"Plain", FontSlant->"Italic"], "]"}], ",", RowBox[{ StyleBox["length", FontWeight->"Plain", FontSlant->"Italic"], "-", "1"}]}], "]"}], "]"}]], "Input"], Cell["Here's another way of looking at a series of states ", "Text"], Cell[BoxData[ \(ListDensityPlot[NestList[step, randomState[], 20], AspectRatio \[Rule] Automatic]\)], "Input"], Cell[TextData[{ "Get it? Time is going upwards, from bottom to top, and white and dark \ cells represent on and off gates (white is on, black is off). You'll \ probably be able to see a state cycle fairly clearly -- if not, try the same \ command a few times more. You might also try the state cycle you remembered \ earlier (starting within it should give no transient at all). If you're \ curious, you could also try removing the ", StyleBox["AspectRatio\[Rule]Automatic", "Input", FontSize->12], " (and the preceding comma) to see what it does." }], "Text"], Cell["\<\ And here's one more way, converting the states to numerical values \ and plotting those. The actual values have no absolute meaning, but the \ graphs allow you to see state cycles fairly easily. Try evaluating the \ following expression several times. The options are a bit complicated, but \ you should understand the basic idea, on the second line.\ \>", "Text"], Cell[BoxData[ \(ListPlot[\n\ttoValue[NestList[step, randomState[], 20]], \n\t PlotJoined \[Rule] True, PlotRange \[Rule] {{0, Automatic}, {0, 2^ngates}}, AxesOrigin \[Rule] {0, 0}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Mapping Out the Attractors", "Section"], Cell[TextData[{ "You could map out the attractors and transients for a given network given \ the tools I've described so far, but it would be very tedious to do so. I \ thought better of my original plans to have you do such a thing. Instead I \ wrote a function called ", StyleBox["analyze[]", "Input", FontSize->12], " that does all the work for you. Let's try it on the current network." }], "Text"], Cell[BoxData[ \(analyze[]\)], "Input"], Cell[TextData[{ StyleBox["analyze[]", "Input", FontSize->12], " produces a list of the different attractors (state cycles). The first \ column (#) is just a number for each (used in ", StyleBox["showCycle[", "Input", FontSize->12], StyleBox["i", "Input", FontSize->12, FontWeight->"Plain", FontVariations->{"CompatibilityType"->0}], StyleBox["]", "Input", FontSize->12], " below). The second column (Length) gives the length of the state cycle. \ 1 means a boring constant state, with nothing twinkling at all. The third \ column (Basin) gives the size of the basin of attraction -- the number of \ states that lead ultimately into that state cycle (including those already in \ it). The numbers in that column sum up to the total number of states, ", Cell[BoxData[ \(TraditionalForm\`2\^N\)]], "(or 1024 here). The last column (Start) gives the numerical value of ", "lowest-numbered", " state in the cycle, which may be used to start the cycle off. The actual \ state is obtained with ", StyleBox["toState[", "Input", FontSize->12], StyleBox["v", "Input", FontSize->12, FontWeight->"Plain"], StyleBox["]", "Input", FontSize->12], " of course." }], "Text"], Cell[TextData[{ "To see the state cycles themselves, you can use ", StyleBox["showCycle[", "Input", FontSize->12], StyleBox["i", "Input", FontSize->12, FontWeight->"Plain"], StyleBox["]", "Input", FontSize->12], " for cycle i. E.g." }], "Text"], Cell[BoxData[ \(showCycle[5]\)], "Input"], Cell["\<\ This shows all the states in the cycle, both as a numerical value \ and as a string of 0's and 1's. Look at some other cycles (by changing the \ \"1\") if the first one is boring.\ \>", "Text"], Cell[TextData[{ StyleBox["analyze[]", "Input", FontSize->12], " tries starting from all the ", StyleBox[Cell[BoxData[ \(TraditionalForm\`2\^N\)]]], " states and follows what happens. It may take a very long time and/or run \ out of memory if you try it for N too large. It'll refuse to even try if N \ is larger than 16, and sticking to N=12 or less probably makes sense. If you \ want to look at larger cases you can use ", StyleBox["analyze[n]", "Input", FontSize->12], " (i.e., with an argument). This tries starting from ", StyleBox["n", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " randomly chosen states, instead of all ", StyleBox[Cell[BoxData[ \(TraditionalForm\`2\^N\)]]], ", so it just gives you a statistical sampling of the attractors, not a \ complete list." }], "Text"], Cell[BoxData[ \(analyze[200]\)], "Input"], Cell[TextData[{ "Note that the sum of the numbers in the \"Basin\" column is 200 (the \ number of starting points), not 1024 as earlier. And it might not have found \ all the attractors if some had small basins of attraction. Even if you used \ ", StyleBox["analyze[1024]", "Input", FontSize->12], ", you probably wouldn't get exactly the same results as ", StyleBox["analyze[]", "Input", FontSize->12], ", because the former chooses 1024 random starting states, most likely \ hitting some more than once and others not at all, while the latter hits each \ one exactly once." }], "Text"], Cell[TextData[{ "In summary: use ", StyleBox["analyze[]", "Input", FontSize->12], " for small cases, up to N=12 or so, and ", StyleBox["analyze[n]", "Input", FontSize->12], " for larger cases, choosing ", StyleBox["n", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to compromise between your patience and accuracy." }], "Text"], Cell[TextData[{ "If, after using ", StyleBox["analyze[]", "Input", FontSize->12], " or ", StyleBox["analyze[n]", "Input", FontSize->12], ", you want to extract the results produced, you can find them in the \ following variables. ", StyleBox["ncycles", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " says how many cycles (atttractors) were found, ", StyleBox["lengthlist", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", ", StyleBox["basinlist", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", and ", StyleBox["cyclelist", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " give the columns of the table, and ", StyleBox["fullcyclelist", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " gives the complete cycles:" }], "Text"], Cell[BoxData[ \(ncycles\)], "Input"], Cell[BoxData[ \(basinlist\)], "Input"], Cell[BoxData[ \(lengthlist\)], "Input"], Cell[BoxData[ \(cyclelist\)], "Input"], Cell[BoxData[ \(fullcyclelist\)], "Input"], Cell[TextData[{ "If you want to see the full ", StyleBox["state", FontSlant->"Italic"], ", you could use" }], "Text"], Cell[BoxData[ \(toState[fullcyclelist] // ColumnForm\)], "Input"], Cell[TextData[{ "If you want to investigate the attractors by hand, you might also find the \ ", StyleBox["findCycle[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["state", FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " function useful. This takes a starting ", StyleBox["state", FontSlant->"Italic"], " (specified either like ", StyleBox["state", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " or as an integer value) and finds the attractor cycle that it leads to. \ It returns the whole attractor as a list of values, with the smallest one \ first. E.g." }], "Text"], Cell[BoxData[ \(findCycle[randomState[]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox[ "Investigating Homeostasis and Graceful Stability"]], "Section"], Cell[TextData[{ "Stuart Kauffman emphasizes two desirable properties of boolean networks \ besides having reasonably small state cycles: homeostasis and graceful \ stabilty. ", StyleBox["Homeostasis", FontSlant->"Italic"], " means that nearby states should generally (though certainly not always) \ flow to the same attractor. ", StyleBox["Graceful stability", FontSlant->"Italic"], " means that changing one of the truth tables, or changing the wiring \ diagram slightly, should not totally change the attractors; most should \ remain about the same." }], "Text"], Cell[TextData[{ "To investigate homeostasis, the function ", StyleBox["oneflip[state,n]", "Input", FontSize->12], " may be useful. It returns a new state with bit n flipped (but doesn't \ actually change ", StyleBox["state", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " itself). If you leave out the ", StyleBox["n", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " it flips a random bit:" }], "Text"], Cell[BoxData[ \(state\)], "Input"], Cell[BoxData[ \(oneflip[state, 3]\)], "Input"], Cell[BoxData[ \(oneflip[state]\)], "Input"], Cell[BoxData[ \(state\)], "Input"], Cell[TextData[{ "You can also apply ", StyleBox["oneflip[]", "Input", FontSize->12], " to states in their numerical value form" }], "Text"], Cell[BoxData[ \(oneflip[234]\)], "Input"], Cell[TextData[{ "To investigate graceful stability, you can use the function ", StyleBox["randomTruth[n]", "Input", FontSize->12], " to randomly change the truth table for gate ", StyleBox["n", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " (using the same p value as originally). If you leave out the ", StyleBox["n", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " it changes one truth table selected at random." }], "Text"], Cell[BoxData[ \(makeNetwork[20, 3, 0.5]\)], "Input"], Cell[BoxData[ \(showAllTruths[]\)], "Input"], Cell[BoxData[ \(randomTruth[5]\)], "Input"], Cell[BoxData[ \(showAllTruths[]\)], "Input"], Cell[TextData[{ "You can restore the original truth tables for all units (as made by the \ last ", StyleBox["makeNetwork[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ") with ", StyleBox["restoreTruths[]", "Input", FontSize->12], ":" }], "Text"], Cell[BoxData[ \(restoreTruths[]\)], "Input"], Cell[BoxData[ \(showAllTruths[]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Exercise -- Investigation of Kauffman's Claims", "Section"], Cell["\<\ OK, now it's up to you. I've given you all the tools you should \ need to investigate what happens on average as you change the parameters (N, \ K, and p). Kauffman discusses the basic types of behavior in his chapter 4. \ In summary, he says:\ \>", "Text"], Cell["\<\ K=1: Very short state cycles, often of length 1. You get to one \ quickly.\ \>", "Text", Background->GrayLevel[0.900008]], Cell[TextData[{ "K=N (and p=0.5): Extremely long state cycles (for large N), length around \ ", Cell[BoxData[ \(TraditionalForm\`\@2\^N\)]], ". Small number of such attractors, around N/e (where e = 2.718). Little \ homeostasis: flipping one bit in a state cycle typically takes you to a \ different cycle -- \"massively chaotic\". No graceful stability: changing \ the truth table on one unit causes massive changes in behavior." }], "Text", Background->GrayLevel[0.900008]], Cell["K=4 or 5 (and p=0.5): Similar to K=N -- massively chaotic.", "Text", Background->GrayLevel[0.900008]], Cell[TextData[{ "K=2 (and p=0.5): Well behaved, socks blown off. Length of cycles around \ ", Cell[BoxData[ \(TraditionalForm\`\@N\)]], ". Number of cycles around ", Cell[BoxData[ \(TraditionalForm\`\@N\)]], ". (These are both 317 for N=100,000). Nearby states often go to the same \ attractor -- homeostasis, not chaotic. Graceful stability: changing a truth \ table doesn't change things a lot." }], "Text", Background->GrayLevel[0.900008]], Cell["\<\ Increasing p (from 0.5 towards 1.0) has an effect like decreasing \ K, so you can get well-behaved networks at say K=4 or 5 and large enough p \ (but not too large: setting p=1.0 gives a very boring network!).\ \>", "Text",\ Background->GrayLevel[0.900008]], Cell[TextData[{ StyleBox["Investigate some of these claims", FontSlant->"Italic"], ". There's no need to try everything; in fact I'd rather see a more \ careful study of one or two claims than a superficial study of everything. \ Do not expect Kauffman's claims to be very accurate for each and every \ network for small N; they're only claims about what happens on average, and \ the fluctuations are very large at small N." }], "Text"], Cell[TextData[{ "Print out some examples of your investigation, including some pictures or \ graphs. Explain what you did, and comment on what you found. You can do \ this all within a ", StyleBox["Mathematica", FontSlant->"Italic"], " notebook if you wish (see the ", StyleBox["Notebook.nb", FontWeight->"Bold"], " notebook in the same folder)." }], "Text"], Cell[TextData[{ StyleBox["Warnings about large N and K:", FontSlant->"Italic"], "\n1. You can certainly try N=50 or more if you wish, though I'd recommend \ against ", StyleBox["drawing", FontSlant->"Italic"], " really large networks. But don't try to use ", StyleBox["analyze[]", "Input", FontSize->12], " for N larger than 12 or so, depending on your patience--use only ", StyleBox["analyze[n]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". It's annoying, but the fact is that you just ", StyleBox["can't", FontSlant->"Italic"], " do an exhaustive analysis at say N=50, unless you have thousands or \ millions of years to spare. And at N=100 a million times the age of the \ universe would cut it.\n2. If you make K larger than 5, then don't try to \ look at the truth tables (", StyleBox["showTruth[]", "Input", FontSize->12], " or ", StyleBox["showAllTruths[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ") because there'll be ", Cell[BoxData[ \(TraditionalForm\`2\^K\)]], " rows. Making K larger than about 10 is probably not a good idea at all, \ for internal reasons." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["General Boolean Nets (2003)", "Section"], Cell[TextData[{ StyleBox["Note", FontWeight->"Bold"], " (June 2003): Richard Palmer made a more general Notebook, not just random \ connections and random truth tables, for research. This is just an outline, \ but it should be simple after you first read about the whole Notebook." }], "Text"], Cell[CellGroupData[{ Cell["Make the network", "Subsection"], Cell["To use a general boolean network, use:", "Text"], Cell[TextData[{ "(1) #units: ", StyleBox["makeNetwork[n]. ", "Input", FontSize->12], StyleBox["You must use this first.", FontSlant->"Italic"] }], "Text"], Cell[TextData[{ "(2) The connections -- (a) or (b):\n\t(a) ", StyleBox["makeAllConnections[{{i1,i2,...},{j1,j2,...},...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes all connections from all units, or\n\t(b) ", StyleBox["randomAllConnections[k]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes ", StyleBox["k", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " random connections from all units." }], "Text"], Cell[TextData[{ "(3) The truth tables -- (a) or (b):\n\t(a) ", StyleBox["makeAllTruths[{{i1,i2,...},{j1,j2,...},...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes a set of truth tables, or\n\t(b) ", StyleBox["randomAllTruths[p]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes a set of random truth tables with bias p from all units" }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Example 1", "Subsection"], Cell["Make the number of units and the connections:", "Text"], Cell[BoxData[ \(makeNetwork[4]\)], "Input"], Cell[BoxData[ \(makeAllConnections[{{1}, {4, 1}, {2}, {3}}]\)], "Input"], Cell["Note how the connections corresponds to the picture:", "Text"], Cell[BoxData[ \(showNetwork[randomState[]]\)], "Input"], Cell[BoxData[ \(showConnections[]\)], "Input"], Cell["Make the truth tables, and check to look:", "Text"], Cell[BoxData[ \(makeAllTruths[{{0, 1}, {1, 0, 0, 1}, {1, 0}, {0, 1}}]\)], "Input"], Cell[BoxData[ \(showAllTruths[]\)], "Input"], Cell["\<\ Now, we can use all the expressions from in this Notebook. E.g.:\ \ \>", "Text"], Cell[BoxData[ \(showParameters[]\)], "Input"], Cell[BoxData[ \(showNetwork[NestList[step, {0, 0, 0, 0}, 2]]\)], "Input"], Cell[BoxData[ \(ListDensityPlot[NestList[step, {1, 1, 1, 1}, 12], AspectRatio \[Rule] Automatic]\)], "Input"], Cell[BoxData[ \(analyze[]\)], "Input"], Cell[BoxData[ \(analyze[10]\)], "Input"], Cell[BoxData[ \(toState[fullcyclelist] // ColumnForm\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Changing connections for unit i", "Subsection"], Cell[TextData[{ StyleBox["makeConnections[i,{j1,j2,...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes ", StyleBox["{j1,j2,...}", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " connections from unit ", StyleBox["i", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "." }], "Text"], Cell[TextData[{ StyleBox["randomConnections[i,k]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes ", StyleBox["k", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " random connections from unit ", StyleBox["i", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "." }], "Text"], Cell[TextData[{ "You ", StyleBox["can", FontSlant->"Italic"], " change the number of inputs, but then you must make new truth table (see \ next sub-section). Sometimes it is useful to check ", StyleBox["checkTruths[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". " }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Changing truth tables for unit i", "Subsection"], Cell[TextData[{ StyleBox["makeTruth[i,{j1,j2,...}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes (or changes) a ", StyleBox["{j1,j2,...}", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " truth table for unit i." }], "Text"], Cell[TextData[{ StyleBox["randomTruth[i,p]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " makes (or changes) a random truth table with bias p for unit i. ", StyleBox["randomTruth[i]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " using for the ", StyleBox["bias", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Example 1 - continued", "Subsection"], Cell[BoxData[ \(makeConnections[1, {4, 2}]\)], "Input"], Cell[BoxData[ \(\(\(checkTruths[]\)\(\ \ \)\( (*\ Expect\ 4\ errors\ *) \)\)\)], "Input"], Cell[BoxData[ \(randomTruth[1, 0.3]\)], "Input"], Cell[BoxData[ \(checkTruths[]\)], "Input"], Cell[BoxData[ \(showNetwork[randomState[]]\)], "Input"], Cell[BoxData[ \(analyze[]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Example 2", "Subsection"], Cell[TextData[{ "Note: This is an example from ", StyleBox["Complex Systems Dynamics", FontSlant->"Italic"], " by G\[EAcute]rard Weisbuch, in section 2.2." }], "Text"], Cell["Make the number of units and the connections:", "Text"], Cell[BoxData[ \(makeNetwork[5]\)], "Input"], Cell[BoxData[ \(makeAllConnections[{{2, 3}, {3, 4}, {4, 5}, {1, 5}, {1, 2}}]\)], "Input"], Cell[BoxData[ \(showNetwork[randomState[]]\)], "Input"], Cell[BoxData[ \(showConnections[]\)], "Input"], Cell["Make the truth tables, and check to look:", "Text"], Cell[BoxData[ \(makeAllTruths[{{0, 1, 1, 0}, {1, 0, 0, 1}, {0, 0, 0, 1}, {1, 0, 0, 1}, {0, 1, 1, 0}}]\)], "Input"], Cell[BoxData[ \(showAllTruths[]\)], "Input"], Cell["\<\ Now, we can use all the expressions from in this Notebook. E.g.:\ \ \>", "Text"], Cell[BoxData[ \(ListDensityPlot[NestList[step, {1, 1, 1, 1, 1}, 13], AspectRatio \[Rule] Automatic]\)], "Input"], Cell[BoxData[ \(analyze[]\)], "Input"], Cell[BoxData[ \(toState[fullcyclelist] // ColumnForm\)], "Input"], Cell[TextData[{ "Note: They are different way to represent from states to numbers, and the \ way for this notebook (see section ", StyleBox["Converting States to Numbers", FontSlant->"Italic"], " above) is different from Weisbuch's book. For example:\nThis notebook:\t\ \t{0,1,0,1,1} \[LongRightArrow] 0*", Cell[BoxData[ \(2\^4\)]], "+ 1*", Cell[BoxData[ \(2\^3\)]], "+ 0*", Cell[BoxData[ \(2\^2\)]], "+ 1*", Cell[BoxData[ \(2\^1\)]], "+ 1*", Cell[BoxData[ \(2\^0\)]], "+ 1 = 12\nWeisbuch's book:\t{0,1,0,1,1} \[LongRightArrow] 0*", Cell[BoxData[ \(2\^0\)]], "+ 1*", Cell[BoxData[ \(2\^1\)]], "+ 0*", Cell[BoxData[ \(2\^2\)]], "+ 1*", Cell[BoxData[ \(2\^3\)]], "+ 1*", Cell[BoxData[ \(2\^4\)]], " = 25" }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Troubleshooting", "Subsection"], Cell[BoxData[ \(\(?ninputs\)\)], "Input"], Cell[BoxData[ \({minninputs, maxninputs}\)], "Input"], Cell[BoxData[ \(\(?connections\)\)], "Input"], Cell[BoxData[ \(\(?truth\)\)], "Input"], Cell[BoxData[ \(checkTruths[]\)], "Input"] }, Closed]] }, Closed]] }, Open ]] }, FrontEndVersion->"5.0 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{632, 675}, WindowMargins->{{288, Automatic}, {Automatic, 0}}, PrintingPageRange->{Automatic, Automatic}, PrintingOptions->{"PaperSize"->{612, 792}, "PaperOrientation"->"Portrait", "Magnification"->1}, StyleDefinitions -> Notebook[{ Cell[CellGroupData[{ Cell["Style Definitions", "Subtitle"], Cell["\<\ Modify the definitions below to change the default appearance of \ all cells in a given style. Make modifications to any definition using \ commands in the Format menu.\ \>", "Text"], Cell[CellGroupData[{ Cell["Style Environment Names", "Section"], Cell[StyleData[All, "Working"], PageWidth->WindowWidth, ScriptMinSize->9], Cell[StyleData[All, "Presentation"], PageWidth->WindowWidth, ScriptMinSize->12, FontSize->16], Cell[StyleData[All, "Condensed"], PageWidth->WindowWidth, CellBracketOptions->{"Margins"->{1, 1}, "Widths"->{0, 5}}, ScriptMinSize->8, FontSize->11], Cell[StyleData[All, "Printout"], PageWidth->PaperWidth, ScriptMinSize->5, FontSize->10, PrivateFontOptions->{"FontType"->"Outline"}] }, Closed]], Cell[CellGroupData[{ Cell["Notebook Options", "Section"], Cell["\<\ The options defined for the style below will be used at the \ Notebook level.\ \>", "Text"], Cell[StyleData["Notebook"], PageHeaders->{{Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"], None, Cell[ TextData[ { ValueBox[ "FileName"]}], "Header"]}, {Cell[ TextData[ { ValueBox[ "FileName"]}], "Header"], None, Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"]}}, CellFrameLabelMargins->6, StyleMenuListing->None] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headings", "Section", FontColor->RGBColor[0, 0, 1]], Cell[CellGroupData[{ Cell[StyleData["Title"], CellMargins->{{12, Inherited}, {20, 40}}, CellGroupingRules->{"TitleGrouping", 0}, PageBreakBelow->False, CounterIncrements->"Title", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}, { "Subtitle", 0}, {"Subsubtitle", 0}}, FontFamily->"Helvetica", FontSize->36, FontWeight->"Bold", FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Title", "Presentation"], CellMargins->{{24, 10}, {20, 40}}, LineSpacing->{1, 0}, FontSize->44], Cell[StyleData["Title", "Condensed"], CellMargins->{{8, 10}, {4, 8}}, FontSize->20], Cell[StyleData["Title", "Printout"], CellMargins->{{2, 10}, {15, 30}}, FontSize->24] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subtitle"], CellMargins->{{12, Inherited}, {10, 15}}, CellGroupingRules->{"TitleGrouping", 10}, PageBreakBelow->False, CounterIncrements->"Subtitle", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}, { "Subsubtitle", 0}}, FontFamily->"Helvetica", FontSize->24, FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Subtitle", "Presentation"], CellMargins->{{24, 10}, {15, 20}}, LineSpacing->{1, 0}, FontSize->36], Cell[StyleData["Subtitle", "Condensed"], CellMargins->{{8, 10}, {4, 4}}, FontSize->14], Cell[StyleData["Subtitle", "Printout"], CellMargins->{{2, 10}, {10, 15}}, FontSize->18] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsubtitle"], CellMargins->{{12, Inherited}, {10, 20}}, CellGroupingRules->{"TitleGrouping", 20}, PageBreakBelow->False, CounterIncrements->"Subsubtitle", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}}, FontFamily->"Helvetica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Subsubtitle", "Presentation"], CellMargins->{{24, 10}, {10, 20}}, LineSpacing->{1, 0}, FontSize->24], Cell[StyleData["Subsubtitle", "Condensed"], CellMargins->{{8, 10}, {8, 12}}, FontSize->12], Cell[StyleData["Subsubtitle", "Printout"], CellMargins->{{2, 10}, {8, 10}}, FontSize->14] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Section"], CellDingbat->"\[FilledSquare]", CellMargins->{{25, Inherited}, {8, 24}}, CellGroupingRules->{"SectionGrouping", 30}, PageBreakBelow->False, CounterIncrements->"Section", CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}}, FontFamily->"Helvetica", FontSize->16, FontWeight->"Bold", FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Section", "Presentation"], CellMargins->{{40, 10}, {11, 32}}, LineSpacing->{1, 0}, FontSize->24], Cell[StyleData["Section", "Condensed"], CellMargins->{{18, Inherited}, {6, 12}}, FontSize->12], Cell[StyleData["Section", "Printout"], CellMargins->{{13, 0}, {7, 22}}, FontSize->14] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsection"], CellDingbat->"\[FilledSmallSquare]", CellMargins->{{22, Inherited}, {8, 20}}, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, FontSize->14, FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], Cell[StyleData["Subsection", "Presentation"], CellMargins->{{36, 10}, {11, 32}}, LineSpacing->{1, 0}, FontSize->22], Cell[StyleData["Subsection", "Condensed"], CellMargins->{{16, Inherited}, {6, 12}}, FontSize->12], Cell[StyleData["Subsection", "Printout"], CellMargins->{{9, 0}, {7, 22}}, FontSize->12] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsubsection"], CellDingbat->"\[FilledSmallSquare]", CellMargins->{{22, Inherited}, {8, 18}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CounterIncrements->"Subsubsection", FontWeight->"Bold", FontColor->RGBColor[1, 0, 1]], Cell[StyleData["Subsubsection", "Presentation"], CellMargins->{{34, 10}, {11, 26}}, LineSpacing->{1, 0}, FontSize->18], Cell[StyleData["Subsubsection", "Condensed"], CellMargins->{{17, Inherited}, {6, 12}}, FontSize->10], Cell[StyleData["Subsubsection", "Printout"], CellMargins->{{9, 0}, {7, 14}}, FontSize->11] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Body Text", "Section"], Cell[CellGroupData[{ Cell[StyleData["Text"], CellMargins->{{12, 10}, {7, 7}}, LineSpacing->{1, 3}, CounterIncrements->"Text", FontSize->14], Cell[StyleData["Text", "Presentation"], CellMargins->{{24, 10}, {10, 10}}, LineSpacing->{1, 5}], Cell[StyleData["Text", "Condensed"], CellMargins->{{8, 10}, {6, 6}}, LineSpacing->{1, 1}], Cell[StyleData["Text", "Printout"], CellMargins->{{2, 2}, {6, 6}}] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["SmallText"], CellMargins->{{12, 10}, {6, 6}}, LineSpacing->{1, 3}, CounterIncrements->"SmallText", FontFamily->"Helvetica", FontSize->9], Cell[StyleData["SmallText", "Presentation"], CellMargins->{{24, 10}, {8, 8}}, LineSpacing->{1, 5}, FontSize->12], Cell[StyleData["SmallText", "Condensed"], CellMargins->{{8, 10}, {5, 5}}, LineSpacing->{1, 2}, FontSize->9], Cell[StyleData["SmallText", "Printout"], CellMargins->{{2, 2}, {5, 5}}, FontSize->7] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Input/Output", "Section"], Cell["\<\ The cells in this section define styles used for input and output \ to the kernel. Be careful when modifying, renaming, or removing these \ styles, because the front end associates special meanings with these style \ names.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Input"], CellMargins->{{45, 10}, {5, 7}}, Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", FontWeight->"Bold"], Cell[StyleData["Input", "Presentation"], CellMargins->{{72, Inherited}, {8, 10}}, LineSpacing->{1, 0}], Cell[StyleData["Input", "Condensed"], CellMargins->{{40, 10}, {2, 3}}], Cell[StyleData["Input", "Printout"], CellMargins->{{39, 0}, {4, 6}}, FontSize->9] }, Closed]], Cell[StyleData["InputOnly"], Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", StyleMenuListing->None, FontWeight->"Bold"], Cell[CellGroupData[{ Cell[StyleData["Output"], CellMargins->{{47, 10}, {7, 5}}, CellEditDuplicate->True, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Output"], Cell[StyleData["Output", "Presentation"], CellMargins->{{72, Inherited}, {10, 8}}, LineSpacing->{1, 0}], Cell[StyleData["Output", "Condensed"], CellMargins->{{41, Inherited}, {3, 2}}], Cell[StyleData["Output", "Printout"], CellMargins->{{39, 0}, {6, 4}}, FontSize->9] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Message"], CellMargins->{{45, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"OutputGrouping", PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Message", StyleMenuListing->None, FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Message", "Presentation"], CellMargins->{{72, Inherited}, {Inherited, Inherited}}, LineSpacing->{1, 0}], Cell[StyleData["Message", "Condensed"], CellMargins->{{41, Inherited}, {Inherited, Inherited}}], Cell[StyleData["Message", "Printout"], CellMargins->{{39, Inherited}, {Inherited, Inherited}}, FontSize->8, FontColor->GrayLevel[0]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Print"], CellMargins->{{45, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Print", StyleMenuListing->None], Cell[StyleData["Print", "Presentation"], CellMargins->{{72, Inherited}, {Inherited, Inherited}}, LineSpacing->{1, 0}], Cell[StyleData["Print", "Condensed"], CellMargins->{{41, Inherited}, {Inherited, Inherited}}], Cell[StyleData["Print", "Printout"], CellMargins->{{39, Inherited}, {Inherited, Inherited}}, FontSize->8] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Graphics"], CellMargins->{{4, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"GraphicsGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, DefaultFormatType->DefaultOutputFormatType, FormatType->InputForm, CounterIncrements->"Graphics", ImageMargins->{{43, Inherited}, {Inherited, 0}}, StyleMenuListing->None], Cell[StyleData["Graphics", "Presentation"], ImageMargins->{{62, Inherited}, {Inherited, 0}}], Cell[StyleData["Graphics", "Condensed"], ImageSize->{175, 175}, ImageMargins->{{38, Inherited}, {Inherited, 0}}], Cell[StyleData["Graphics", "Printout"], ImageSize->{250, 250}, ImageMargins->{{30, Inherited}, {Inherited, 0}}, FontSize->9] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["CellLabel"], StyleMenuListing->None, FontFamily->"Helvetica", FontSize->9, FontColor->RGBColor[0, 0, 1]], Cell[StyleData["CellLabel", "Presentation"], FontSize->12], Cell[StyleData["CellLabel", "Condensed"], FontSize->9], Cell[StyleData["CellLabel", "Printout"], FontFamily->"Courier", FontSize->8, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Formulas and Programming", "Section"], Cell[CellGroupData[{ Cell[StyleData["InlineFormula"], CellMargins->{{10, 4}, {0, 8}}, CellHorizontalScrolling->True, ScriptLevel->1, SingleLetterItalics->True], Cell[StyleData["InlineFormula", "Presentation"], CellMargins->{{24, 10}, {10, 10}}, LineSpacing->{1, 5}], Cell[StyleData["InlineFormula", "Condensed"], CellMargins->{{8, 10}, {6, 6}}, LineSpacing->{1, 1}], Cell[StyleData["InlineFormula", "Printout"], CellMargins->{{2, 0}, {6, 6}}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["DisplayFormula"], CellMargins->{{42, Inherited}, {Inherited, Inherited}}, CellHorizontalScrolling->True, ScriptLevel->0, SingleLetterItalics->True, StyleMenuListing->None, UnderoverscriptBoxOptions->{LimitsPositioning->True}], Cell[StyleData["DisplayFormula", "Presentation"], LineSpacing->{1, 5}], Cell[StyleData["DisplayFormula", "Condensed"], LineSpacing->{1, 1}], Cell[StyleData["DisplayFormula", "Printout"]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headers and Footers", "Section"], Cell[StyleData["Header"], CellMargins->{{0, 0}, {4, 1}}, StyleMenuListing->None, FontSize->10, FontSlant->"Italic"], Cell[StyleData["Footer"], CellMargins->{{0, 0}, {0, 4}}, StyleMenuListing->None, FontSize->9, FontSlant->"Italic"], Cell[StyleData["PageNumber"], CellMargins->{{0, 0}, {4, 1}}, StyleMenuListing->None, FontFamily->"Times", FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell["Palette Styles", "Section"], Cell["\<\ The cells below define styles that define standard \ ButtonFunctions, for use in palette buttons.\ \>", "Text"], Cell[StyleData["Paste"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, After]}]&)}], Cell[StyleData["Evaluate"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, All], SelectionEvaluate[ FrontEnd`InputNotebook[ ], All]}]&)}], Cell[StyleData["EvaluateCell"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, All], FrontEnd`SelectionMove[ FrontEnd`InputNotebook[ ], All, Cell, 1], FrontEnd`SelectionEvaluateCreateCell[ FrontEnd`InputNotebook[ ], All]}]&)}], Cell[StyleData["CopyEvaluate"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`SelectionCreateCell[ FrontEnd`InputNotebook[ ], All], FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, All], FrontEnd`SelectionEvaluate[ FrontEnd`InputNotebook[ ], All]}]&)}], Cell[StyleData["CopyEvaluateCell"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`SelectionCreateCell[ FrontEnd`InputNotebook[ ], All], FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, All], FrontEnd`SelectionEvaluateCreateCell[ FrontEnd`InputNotebook[ ], All]}]&)}] }, Closed]], Cell[CellGroupData[{ Cell["Hyperlink Styles", "Section"], Cell["\<\ The cells below define styles useful for making hypertext \ ButtonBoxes. The \"Hyperlink\" style is for links within the same Notebook, \ or between Notebooks.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Hyperlink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookLocate[ #2]}]&), Active->True, ButtonNote->ButtonData}], Cell[StyleData["Hyperlink", "Presentation"]], Cell[StyleData["Hyperlink", "Condensed"]], Cell[StyleData["Hyperlink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell["\<\ The following styles are for linking automatically to the on-line \ help system.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["MainBookLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "MainBook", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["MainBookLink", "Presentation"]], Cell[StyleData["MainBookLink", "Condensed"]], Cell[StyleData["MainBookLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["AddOnsLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontFamily->"Courier", FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "AddOns", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["AddOnsLink", "Presentation"]], Cell[StyleData["AddOnsLink", "Condensed"]], Cell[StyleData["AddOnLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["RefGuideLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontFamily->"Courier", FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "RefGuideLink", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["RefGuideLink", "Presentation"]], Cell[StyleData["RefGuideLink", "Condensed"]], Cell[StyleData["RefGuideLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["GettingStartedLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "GettingStarted", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["GettingStartedLink", "Presentation"]], Cell[StyleData["GettingStartedLink", "Condensed"]], Cell[StyleData["GettingStartedLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["OtherInformationLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "OtherInformation", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["OtherInformationLink", "Presentation"]], Cell[StyleData["OtherInformationLink", "Condensed"]], Cell[StyleData["OtherInformationLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Placeholder Styles", "Section"], Cell["\<\ The cells below define styles useful for making placeholder \ objects in palette templates.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Placeholder"], Editable->False, Selectable->False, StyleBoxAutoDelete->True, Placeholder->True, StyleMenuListing->None], Cell[StyleData["Placeholder", "Presentation"]], Cell[StyleData["Placeholder", "Condensed"]], Cell[StyleData["Placeholder", "Printout"]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SelectionPlaceholder"], Editable->False, Selectable->False, StyleBoxAutoDelete->True, Placeholder->PrimaryPlaceholder, StyleMenuListing->None, DrawHighlighted->True], Cell[StyleData["SelectionPlaceholder", "Presentation"]], Cell[StyleData["SelectionPlaceholder", "Condensed"]], Cell[StyleData["SelectionPlaceholder", "Printout"]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["FormatType Styles", "Section"], Cell["\<\ The cells below define styles that are mixed in with the styles \ of most cells. If a cell's FormatType matches the name of one of the styles \ defined below, then that style is applied between the cell's style and its \ own options.\ \>", "Text"], Cell[StyleData["CellExpression"], PageWidth->Infinity, CellMargins->{{6, Inherited}, {Inherited, Inherited}}, ShowCellLabel->False, ShowSpecialCharacters->False, AllowInlineCells->False, AutoItalicWords->{}, StyleMenuListing->None, FontFamily->"Courier", Background->GrayLevel[1]], Cell[StyleData["InputForm"], AllowInlineCells->False, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["OutputForm"], PageWidth->Infinity, TextAlignment->Left, LineSpacing->{1, -5}, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["StandardForm"], LineSpacing->{1.25, 0}, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["TraditionalForm"], LineSpacing->{1.25, 0}, SingleLetterItalics->True, TraditionalFunctionNotation->True, DelimiterMatching->None, StyleMenuListing->None], Cell["\<\ The style defined below is mixed in to any cell that is in an \ inline cell within another.\ \>", "Text"], Cell[StyleData["InlineCell"], TextAlignment->Left, ScriptLevel->1, StyleMenuListing->None], Cell[StyleData["InlineCellEditing"], StyleMenuListing->None, Background->RGBColor[1, 0.749996, 0.8]] }, Closed]] }, Open ]] }] ] (******************************************************************* 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->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 40, 0, 102, "Title"], Cell[1819, 55, 43, 0, 48, "Subsubtitle"], Cell[CellGroupData[{ Cell[1887, 59, 46, 0, 45, "Subsection"], Cell[1936, 61, 320, 8, 71, "Text"], Cell[2259, 71, 723, 15, 166, "Text"], Cell[2985, 88, 267, 10, 52, "Text"], Cell[3255, 100, 258, 6, 52, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[3550, 111, 31, 0, 34, "Section"], Cell[3584, 113, 608, 13, 134, "Text"], Cell[4195, 128, 516, 10, 174, "Text"], Cell[4714, 140, 249, 6, 54, "Text"], Cell[4966, 148, 256, 7, 54, "Text"], Cell[5225, 157, 521, 9, 130, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[5783, 171, 30, 0, 34, "Section"], Cell[5816, 173, 367, 8, 71, "Text"], Cell[6186, 183, 114, 3, 33, "Text"], Cell[CellGroupData[{ Cell[6325, 190, 28, 0, 45, "Subsection"], Cell[6356, 192, 53, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[6446, 198, 38, 0, 29, "Subsection"], Cell[6487, 200, 425, 10, 171, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[6949, 215, 38, 0, 29, "Subsection"], Cell[6990, 217, 142, 4, 34, "Text"], Cell[7135, 223, 380, 7, 123, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[7552, 235, 33, 0, 29, "Subsection"], Cell[7588, 237, 436, 16, 54, "Text"], Cell[8027, 255, 404, 7, 91, "Input"], Cell[8434, 264, 989, 41, 54, "Text"], Cell[9426, 307, 686, 27, 74, "Text"], Cell[10115, 336, 555, 9, 139, "Input"], Cell[10673, 347, 469, 8, 123, "Input"], Cell[11145, 357, 552, 21, 74, "Text"], Cell[11700, 380, 566, 9, 155, "Input"], Cell[12269, 391, 675, 12, 171, "Input"], Cell[12947, 405, 129, 4, 34, "Text"], Cell[13079, 411, 378, 8, 123, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[13494, 424, 34, 0, 29, "Subsection"], Cell[13531, 426, 238, 7, 52, "Text"], Cell[13772, 435, 230, 4, 59, "Input"], Cell[14005, 441, 180, 6, 33, "Text"], Cell[14188, 449, 81, 1, 27, "Input"], Cell[14272, 452, 991, 41, 72, "Text"], Cell[15266, 495, 970, 37, 90, "Text"], Cell[16239, 534, 375, 7, 91, "Input"], Cell[16617, 543, 436, 8, 123, "Input"], Cell[17056, 553, 457, 16, 52, "Text"], Cell[17516, 571, 516, 9, 123, "Input"], Cell[18035, 582, 793, 13, 235, "Input"], Cell[18831, 597, 296, 11, 33, "Text"], Cell[19130, 610, 276, 5, 75, "Input"], Cell[19409, 617, 517, 9, 123, "Input"], Cell[19929, 628, 284, 11, 33, "Text"], Cell[20216, 641, 177, 3, 43, "Input"], Cell[20396, 646, 260, 5, 59, "Input"], Cell[20659, 653, 282, 10, 52, "Text"], Cell[20944, 665, 371, 7, 91, "Input"], Cell[21318, 674, 706, 14, 187, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[22061, 693, 28, 0, 29, "Subsection"], Cell[22092, 695, 111, 4, 34, "Text"], Cell[22206, 701, 86, 1, 27, "Input"], Cell[22295, 704, 198, 5, 54, "Text"], Cell[22496, 711, 223, 5, 43, "Input"], Cell[22722, 718, 198, 5, 54, "Text"], Cell[22923, 725, 203, 4, 43, "Input"], Cell[23129, 731, 66, 0, 34, "Text"], Cell[23198, 733, 224, 5, 59, "Input"], Cell[23425, 740, 291, 8, 54, "Text"], Cell[23719, 750, 271, 4, 75, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[24027, 759, 29, 0, 29, "Subsection"], Cell[24059, 761, 152, 4, 33, "Text"], Cell[24214, 767, 1554, 27, 337, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[25805, 799, 30, 0, 29, "Subsection"], Cell[25838, 801, 666, 12, 174, "Text"], Cell[26507, 815, 938, 18, 219, "Input"], Cell[27448, 835, 388, 8, 91, "Input"], Cell[27839, 845, 953, 17, 235, "Input"], Cell[28795, 864, 498, 17, 74, "Text"], Cell[29296, 883, 3011, 51, 811, "Input"], Cell[32310, 936, 412, 9, 94, "Text"], Cell[32725, 947, 557, 10, 139, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[33319, 962, 26, 0, 29, "Subsection"], Cell[33348, 964, 311, 10, 52, "Text"], Cell[33662, 976, 276, 6, 59, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[33975, 987, 38, 0, 29, "Subsection"], Cell[34016, 989, 656, 20, 90, "Text"], Cell[34675, 1011, 1602, 28, 347, "Input"], Cell[36280, 1041, 785, 27, 90, "Text"], Cell[37068, 1070, 1456, 27, 331, "Input"], Cell[38527, 1099, 307, 10, 52, "Text"], Cell[38837, 1111, 197, 4, 43, "Input"], Cell[39037, 1117, 313, 8, 52, "Text"], Cell[39353, 1127, 548, 9, 155, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[39938, 1141, 28, 0, 29, "Subsection"], Cell[39969, 1143, 52, 1, 27, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[40070, 1150, 49, 0, 34, "Section"], Cell[40122, 1152, 383, 9, 109, "Text"], Cell[40508, 1163, 56, 1, 27, "Input"], Cell[40567, 1166, 134, 3, 52, "Text"], Cell[40704, 1171, 59, 1, 27, "Input"], Cell[40766, 1174, 674, 12, 128, "Text"], Cell[41443, 1188, 472, 14, 71, "Text"], Cell[41918, 1204, 46, 1, 27, "Input"], Cell[41967, 1207, 58, 1, 27, "Input"], Cell[42028, 1210, 51, 1, 27, "Input"], Cell[42082, 1213, 178, 7, 33, "Text"], Cell[42263, 1222, 342, 9, 71, "Text"], Cell[42608, 1233, 45, 1, 27, "Input"], Cell[42656, 1236, 56, 0, 33, "Text"], Cell[42715, 1238, 48, 1, 27, "Input"], Cell[42766, 1241, 487, 11, 90, "Text"], Cell[43256, 1254, 118, 3, 33, "Text"], Cell[43377, 1259, 50, 1, 27, "Input"], Cell[43430, 1262, 2914, 81, 527, "Text"], Cell[46347, 1345, 120, 3, 33, "Text"], Cell[46470, 1350, 78, 1, 27, "Input"], Cell[46551, 1353, 105, 2, 27, "Input"], Cell[46659, 1357, 175, 3, 43, "Input"], Cell[46837, 1362, 178, 5, 52, "Text"], Cell[47018, 1369, 92, 1, 27, "Input"], Cell[47113, 1372, 577, 16, 90, "Text"], Cell[47693, 1390, 288, 5, 71, "Text"], Cell[47984, 1397, 154, 3, 43, "Input"], Cell[48141, 1402, 99, 3, 33, "Text"], Cell[48243, 1407, 48, 1, 27, "Input"], Cell[48294, 1410, 137, 3, 52, "Text"], Cell[48434, 1415, 49, 1, 27, "Input"], Cell[48486, 1418, 220, 6, 52, "Text"], Cell[48709, 1426, 201, 7, 33, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[48947, 1438, 38, 0, 34, "Section"], Cell[48988, 1440, 110, 3, 34, "Text"], Cell[49101, 1445, 161, 3, 59, "Input"], Cell[49265, 1450, 491, 14, 74, "Text"], Cell[49759, 1466, 38, 1, 27, "Input"], Cell[49800, 1469, 219, 4, 54, "Text"], Cell[50022, 1475, 44, 1, 27, "Input"], Cell[50069, 1478, 279, 9, 54, "Text"], Cell[50351, 1489, 56, 1, 27, "Input"], Cell[50410, 1492, 41, 0, 34, "Text"], Cell[50454, 1494, 56, 1, 27, "Input"], Cell[50513, 1497, 38, 0, 34, "Text"], Cell[50554, 1499, 53, 1, 27, "Input"], Cell[50610, 1502, 262, 9, 54, "Text"], Cell[50875, 1513, 42, 1, 27, "Input"], Cell[50920, 1516, 233, 6, 54, "Text"], Cell[51156, 1524, 46, 1, 27, "Input"], Cell[51205, 1527, 57, 1, 27, "Input"], Cell[51265, 1530, 133, 3, 34, "Text"], Cell[51401, 1535, 413, 14, 54, "Text"], Cell[51817, 1551, 52, 1, 27, "Input"], Cell[51872, 1554, 107, 5, 34, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[52016, 1564, 47, 0, 34, "Section"], Cell[52066, 1566, 720, 24, 90, "Text"], Cell[52789, 1592, 47, 1, 27, "Input"], Cell[52839, 1595, 349, 6, 90, "Text"], Cell[53191, 1603, 57, 1, 27, "Input"], Cell[53251, 1606, 73, 0, 33, "Text"], Cell[53327, 1608, 44, 1, 27, "Input"], Cell[53374, 1611, 714, 29, 52, "Text"], Cell[54091, 1642, 48, 1, 27, "Input"], Cell[54142, 1645, 940, 40, 52, "Text"], Cell[55085, 1687, 57, 1, 27, "Input"], Cell[55145, 1690, 66, 1, 27, "Input"], Cell[55214, 1693, 60, 1, 27, "Input"], Cell[55277, 1696, 446, 16, 52, "Text"], Cell[55726, 1714, 42, 1, 27, "Input"], Cell[55771, 1717, 499, 14, 71, "Text"], Cell[56273, 1733, 65, 1, 27, "Input"], Cell[56341, 1736, 65, 1, 27, "Input"], Cell[56409, 1739, 128, 3, 52, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[56574, 1747, 36, 0, 34, "Section"], Cell[56613, 1749, 180, 4, 54, "Text"], Cell[56796, 1755, 75, 1, 27, "Input"], Cell[56874, 1758, 380, 6, 94, "Text"], Cell[57257, 1766, 1190, 27, 173, "Text"], Cell[58450, 1795, 56, 1, 27, "Input"], Cell[58509, 1798, 75, 1, 27, "Input"], Cell[58587, 1801, 432, 10, 94, "Text"], Cell[59022, 1813, 79, 1, 27, "Input"], Cell[59104, 1816, 255, 9, 54, "Text"], Cell[59362, 1827, 301, 5, 74, "Text"], Cell[59666, 1834, 436, 11, 74, "Text"], Cell[60105, 1847, 416, 11, 27, "Input"], Cell[60524, 1860, 68, 0, 34, "Text"], Cell[60595, 1862, 121, 2, 43, "Input"], Cell[60719, 1866, 574, 10, 114, "Text"], Cell[61296, 1878, 377, 6, 94, "Text"], Cell[61676, 1886, 217, 4, 75, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[61930, 1895, 45, 0, 34, "Section"], Cell[61978, 1897, 415, 8, 94, "Text"], Cell[62396, 1907, 42, 1, 27, "Input"], Cell[62441, 1910, 1238, 32, 154, "Text"], Cell[63682, 1944, 271, 10, 34, "Text"], Cell[63956, 1956, 45, 1, 27, "Input"], Cell[64004, 1959, 204, 4, 54, "Text"], Cell[64211, 1965, 854, 22, 114, "Text"], Cell[65068, 1989, 45, 1, 27, "Input"], Cell[65116, 1992, 607, 13, 114, "Text"], Cell[65726, 2007, 375, 13, 54, "Text"], Cell[66104, 2022, 884, 34, 94, "Text"], Cell[66991, 2058, 40, 1, 27, "Input"], Cell[67034, 2061, 42, 1, 27, "Input"], Cell[67079, 2064, 43, 1, 27, "Input"], Cell[67125, 2067, 42, 1, 27, "Input"], Cell[67170, 2070, 46, 1, 27, "Input"], Cell[67219, 2073, 127, 5, 34, "Text"], Cell[67349, 2080, 69, 1, 27, "Input"], Cell[67421, 2083, 719, 24, 94, "Text"], Cell[68143, 2109, 57, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[68237, 2115, 88, 1, 34, "Section"], Cell[68328, 2118, 584, 13, 114, "Text"], Cell[68915, 2133, 471, 16, 54, "Text"], Cell[69389, 2151, 38, 1, 27, "Input"], Cell[69430, 2154, 50, 1, 27, "Input"], Cell[69483, 2157, 47, 1, 27, "Input"], Cell[69533, 2160, 38, 1, 27, "Input"], Cell[69574, 2163, 149, 5, 34, "Text"], Cell[69726, 2170, 45, 1, 27, "Input"], Cell[69774, 2173, 494, 15, 74, "Text"], Cell[70271, 2190, 56, 1, 27, "Input"], Cell[70330, 2193, 48, 1, 27, "Input"], Cell[70381, 2196, 47, 1, 27, "Input"], Cell[70431, 2199, 48, 1, 27, "Input"], Cell[70482, 2202, 287, 11, 54, "Text"], Cell[70772, 2215, 48, 1, 27, "Input"], Cell[70823, 2218, 48, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[70908, 2224, 65, 0, 34, "Section"], Cell[70976, 2226, 269, 5, 71, "Text"], Cell[71248, 2233, 134, 4, 49, "Text"], Cell[71385, 2239, 492, 10, 112, "Text"], Cell[71880, 2251, 109, 1, 49, "Text"], Cell[71992, 2254, 471, 12, 106, "Text"], Cell[72466, 2268, 270, 6, 87, "Text"], Cell[72739, 2276, 447, 8, 90, "Text"], Cell[73189, 2286, 378, 10, 71, "Text"], Cell[73570, 2298, 1205, 34, 185, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[74812, 2337, 46, 0, 34, "Section"], Cell[74861, 2339, 302, 6, 71, "Text"], Cell[CellGroupData[{ Cell[75188, 2349, 38, 0, 45, "Subsection"], Cell[75229, 2351, 54, 0, 33, "Text"], Cell[75286, 2353, 170, 6, 33, "Text"], Cell[75459, 2361, 512, 17, 90, "Text"], Cell[75974, 2380, 424, 12, 71, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[76435, 2397, 31, 0, 29, "Subsection"], Cell[76469, 2399, 61, 0, 33, "Text"], Cell[76533, 2401, 47, 1, 27, "Input"], Cell[76583, 2404, 76, 1, 27, "Input"], Cell[76662, 2407, 68, 0, 33, "Text"], Cell[76733, 2409, 59, 1, 27, "Input"], Cell[76795, 2412, 50, 1, 27, "Input"], Cell[76848, 2415, 57, 0, 33, "Text"], Cell[76908, 2417, 86, 1, 27, "Input"], Cell[76997, 2420, 48, 1, 27, "Input"], Cell[77048, 2423, 91, 3, 33, "Text"], Cell[77142, 2428, 49, 1, 27, "Input"], Cell[77194, 2431, 77, 1, 27, "Input"], Cell[77274, 2434, 120, 2, 27, "Input"], Cell[77397, 2438, 42, 1, 27, "Input"], Cell[77442, 2441, 44, 1, 27, "Input"], Cell[77489, 2444, 69, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[77595, 2450, 53, 0, 29, "Subsection"], Cell[77651, 2452, 372, 16, 33, "Text"], Cell[78026, 2470, 361, 16, 33, "Text"], Cell[78390, 2488, 320, 11, 52, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[78747, 2504, 54, 0, 29, "Subsection"], Cell[78804, 2506, 289, 11, 33, "Text"], Cell[79096, 2519, 415, 16, 52, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[79548, 2540, 43, 0, 29, "Subsection"], Cell[79594, 2542, 59, 1, 27, "Input"], Cell[79656, 2545, 93, 1, 27, "Input"], Cell[79752, 2548, 52, 1, 27, "Input"], Cell[79807, 2551, 46, 1, 27, "Input"], Cell[79856, 2554, 59, 1, 27, "Input"], Cell[79918, 2557, 42, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[79997, 2563, 31, 0, 29, "Subsection"], Cell[80031, 2565, 177, 5, 33, "Text"], Cell[80211, 2572, 61, 0, 33, "Text"], Cell[80275, 2574, 47, 1, 27, "Input"], Cell[80325, 2577, 93, 1, 27, "Input"], Cell[80421, 2580, 59, 1, 27, "Input"], Cell[80483, 2583, 50, 1, 27, "Input"], Cell[80536, 2586, 57, 0, 33, "Text"], Cell[80596, 2588, 129, 2, 43, "Input"], Cell[80728, 2592, 48, 1, 27, "Input"], Cell[80779, 2595, 91, 3, 33, "Text"], Cell[80873, 2600, 123, 2, 27, "Input"], Cell[80999, 2604, 42, 1, 27, "Input"], Cell[81044, 2607, 69, 1, 27, "Input"], Cell[81116, 2610, 825, 37, 109, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[81978, 2652, 37, 0, 45, "Subsection"], Cell[82018, 2654, 45, 1, 27, "Input"], Cell[82066, 2657, 57, 1, 27, "Input"], Cell[82126, 2660, 49, 1, 27, "Input"], Cell[82178, 2663, 43, 1, 27, "Input"], Cell[82224, 2666, 46, 1, 27, "Input"] }, Closed]] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)