(************** 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[ 51793, 1722]*) (*NotebookOutlinePosition[ 122953, 4295]*) (* CellTagsIndexPosition[ 122593, 4282]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ "The ", Cell[BoxData[ \(TraditionalForm\`Mathematica\^\[RegisteredTrademark]\)]], " ", "Journal" }], "OnlineHeader"], Cell[CellGroupData[{ Cell["Algebraic Programming in Mathematica", "Title"], Cell["Andrzej Kozlowski", "Author"], Cell[TextData[{ "\[OpenCurlyDoubleQuote]Algebraic Programming\[CloseCurlyDoubleQuote] means \ programming based on the use of algebraic concepts, such as commutativity, \ associativity, and distributivity. It is a method of programming for which ", StyleBox["Mathematica", FontSlant->"Italic"], " is particularly well suited. We give several examples of algebraic \ programming in ", StyleBox["Mathematica", FontSlant->"Italic"], ", culminating with a solution of a problem that was posted to the ", StyleBox["MathGroup", FontSlant->"Italic"], " email list." }], "Abstract"], Cell[CellGroupData[{ Cell[TextData[{ CounterBox["Section"], ". ", "What is Algebraic Programming?" }], "SectionFirst"], Cell[TextData[{ "I first came across the expression \[OpenCurlyDoubleQuote]the algebraic \ method in programming\[CloseCurlyDoubleQuote] (or algebraic programming for \ short) in the context of ", StyleBox["Mathematica", FontSlant->"Italic"], " in the book by Ilan Vardi [", ButtonBox[ CounterBox["Reference", "Vardi1991"], ButtonData:>"Vardi1991", ButtonStyle->"Hyperlink"], "]. By algebraic programming, Vardi meant solving programming problems by \ using concepts of abstract algebra, such as distributivity, commutativity, \ and associativity. Vardi gives some examples of algebraic programming. One of \ these is a solution to the following problem." }], "Text"], Cell[TextData[{ "Write a program that will produce all possible subsets of a given set \ (list) of symbols, for example ", Cell[BoxData[ \(TraditionalForm\`{a, b, c}\)]], "." }], "BeginEndQuestion"], Cell["\<\ Vardi makes the observation that the answer to the problem is \ contained in the following algebraic formula.\ \>", "Text"], Cell[BoxData[ \(\(s = \((1 + a)\) \((1 + b)\) \((1 + c)\);\)\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(Expand[s]\)], "Input"], Cell[BoxData[ \(1 + a + b + a\ b + c + a\ c + b\ c + a\ b\ c\)], "Output"] }, Open ]], Cell[TextData[{ "This formula depends only on the algebraic property of distributivity of \ multiplication and the existence of a unit. Indeed, ", StyleBox["Mathematica", FontSlant->"Italic"], " makes it possible to solve the problem directly by converting the last \ formula." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Variables /@ \((Expand[s] /. Plus \[Rule] List)\) // Sort\)], "Input"], Cell[BoxData[ \({{}, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}\)], "Output"] }, Open ]], Cell["\<\ We can write a function that will apply this method to any set of \ symbols. Note, however, that this program will not work if we use a list of \ numbers!\ \>", "Text"], Cell[BoxData[ \(subSets[s_List] := Variables /@ \((Expand[Times @@ \((1 + s)\)] /. Plus \[Rule] List)\) // Sort\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(subSets[{a, b, c, d}]\)], "Input"], Cell[BoxData[ \({{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {a, d}, {b, c}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}}\)], "Output"] }, Open ]], Cell["\<\ This attractive method can be used to produce unexpected solutions \ to surprisingly many problems. However, this is not actually what Vardi meant \ by \[OpenCurlyDoubleQuote]algebraic programming.\[CloseCurlyDoubleQuote] In \ fact one might call this approach \[OpenCurlyDoubleQuote]naive algebraic \ programming.\[CloseCurlyDoubleQuote] It is naive because it makes use of \ specific algebraic functions rather than the general algebraic principles on \ which they are built. Here is a \[OpenCurlyDoubleQuote]sophisticated\ \[CloseCurlyDoubleQuote] algebraic program due to Vardi that achieves the \ same result.\ \>", "Text"], Cell[BoxData[ \(subSetsV[s_List] := Distribute[\({{}, {#}} &\) /@ s, List, List, List, Union]\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(subSetsV[{a, b, c, d}]\)], "Input"], Cell[BoxData[ \({{}, {d}, {c}, {c, d}, {b}, {b, d}, {b, c}, {b, c, d}, {a}, {a, d}, {a, c}, {a, c, d}, {a, b}, {a, b, d}, {a, b, c}, {a, b, c, d}}\)], "Output"] }, Open ]], Cell["\<\ Not surprisingly, the second program not only works with symbols \ and numbers, but is also considerably faster than the first.\ \>", "Text"], Cell[BoxData[ \(\(test = Array[a, {16}];\)\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(\(subSets[test];\) // Timing\)], "Input"], Cell[BoxData[ \({11.54`\ Second, Null}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(subSetsV[test];\) // Timing\)], "Input"], Cell[BoxData[ \({3.76`\ Second, Null}\)], "Output"] }, Open ]], Cell[TextData[{ "The main reason is that the second program is more \ \[OpenCurlyDoubleQuote]abstract,\[CloseCurlyDoubleQuote] in the sense that it \ makes fewer assumptions and has to perform fewer checks. Essentially it \ applies the principle of \[OpenCurlyDoubleQuote]distributivity\ \[CloseCurlyDoubleQuote] in the widest possible sense. In general, algebraic \ computations using functions like ", StyleBox["Times", "MR"], ", ", StyleBox["Expand", "MR"], ", and so forth involve extensive sorting of intermediate expressions \ before they are brought to a canonical form. From the point of view of \ efficiency, it is much better to operate with lists because no evaluation or \ canonicalization ever happens, and lists can contain anything." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ CounterBox["Section"], ". ", "Coefficients of Polynomials and Series" }], "Section"], Cell[TextData[{ "Probably the best known use of algebraic programming is in solving \ combinatorial problems, where many solutions can be expressed in terms of \ so-called \[OpenCurlyDoubleQuote]generating \ functions.\[CloseCurlyDoubleQuote] Many examples are considered in [", ButtonBox[ CounterBox["Reference", "Graham1989"], ButtonData:>"Graham1989", ButtonStyle->"Hyperlink"], "]. Here I shall only briefly mention a problem that was sent to ", StyleBox["MathGroup", FontSlant->"Italic"], " in July 2001." }], "Text"], Cell[TextData[{ "Define a ", StyleBox["Mathematica", FontSlant->"Italic"], " function that counts the number of ways of partitioning a number into a \ fixed number of parts (repetitions allowed) taken from a given set." }], "BeginEndQuestion"], Cell["Here is a solution that uses algebraic programming.", "Text"], Cell[BoxData[ \(kpartitions[n_, \ k_, \ l_List]\ := \n SeriesCoefficient[ Series[SeriesCoefficient[\n\ \ \ Series[ Times\ @@ \ \((\(\((1/\((1\ - \ t*x^#)\))\)\ &\)\ /@ \ l)\), \ \ {x, \ 0, \ n}], \ n], \ {t, \ 0, k}], \ k]\)], "InputOnly"], Cell["Here is an example.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(kpartitions[24, 5, {1, 2, 3, 4, 7, 11, 17, 19}]\)], "Input"], Cell[BoxData[ \(13\)], "Output"] }, Open ]], Cell[TextData[{ "The proof of the correctness of this solution is left to the reader. The \ above solution, while elegant, suffers from the usual defects of naive \ algebraic programming; it is fairly slow. Match faster solutions can be found \ in the ", StyleBox["MathGroup", FontSlant->"Italic"], " archives." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ CounterBox["Section"], ". ", "Attributes in ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Section"], Cell[TextData[{ "Let us look at another example. Suppose we are given a list of ", StyleBox["n", FontSlant->"Italic"], " objects and want to construct all permutations of ", StyleBox["k", FontSlant->"Italic"], " objects from them. Again, we shall look for an algebraic program to \ realize this task. Let us consider an example where ", Cell[BoxData[ \(TraditionalForm\`\(\(n = 4\)\(,\)\)\)]], " ", Cell[BoxData[ \(TraditionalForm\`\(\(k = 3\)\(,\)\)\)]], " and the objects are ", Cell[BoxData[ \(TraditionalForm\`{a, b, c, d}\)]], ". Then, as before, we see that we would get an answer by taking the terms \ of the expansion of " }], "Text"], Cell[BoxData[ \(TextForm\`\((a + b + c + d)\) \((a + b + c + d)\) \((a + b + c + d)\)\)], "DisplayFormula"], Cell[TextData[{ "except that this time we do not want the multiplication to be commutative. \ ", StyleBox["Mathematica", FontSlant->"Italic"], " has the following function. " }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?NonCommutativeMultiply\)\)], "Input"], Cell[BoxData[ RowBox[{"\<\"a ** b ** c is a general associative, but non-commutative, \ form of multiplication.\"\>", " ", ButtonBox[ StyleBox["More\[Ellipsis]", "SR"], ButtonData:>"NonCommutativeMultiply", Active->True, ButtonStyle->"RefGuideLink"]}]], "Print", CellTags->"Info3276155588-6859234"] }, Open ]], Cell[TextData[{ "However it knows very few rules so if we are lazy we might just clear the \ ", StyleBox["Orderless", "MR"], " attribute from ", StyleBox["Times", "MR"], " and do something like this." }], "Text"], Cell[BoxData[ \(Perms[S_List, k_Integer] := Module[{perms}, ClearAttributes[Times, Orderless]; perms = Flatten /@ \((Expand[\((Plus @@ S)\)^3] /. {Plus \[Rule] List, Times \[Rule] List, Power[x_, n_] \[RuleDelayed] Table[x, {n}]})\); SetAttributes[Times, Orderless]; perms]\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(Perms[{a, b, c, d}, 3]\)], "Input"], Cell[BoxData[ \({{a, b, a}, {c, b, a}, {d, b, a}, {b, b, a}, {a, c, a}, {b, c, a}, {d, c, a}, {c, c, a}, {a, d, a}, {b, d, a}, {c, d, a}, {d, d, a}, {b, a, a}, {c, a, a}, {d, a, a}, {a, a, a}, {b, a, b}, {c, a, b}, {d, a, b}, {a, a, b}, {a, c, b}, {b, c, b}, {d, c, b}, {c, c, b}, {a, d, b}, {b, d, b}, {c, d, b}, {d, d, b}, {a, b, b}, {c, b, b}, {d, b, b}, {b, b, b}, {b, a, c}, {c, a, c}, {d, a, c}, {a, a, c}, {a, b, c}, {c, b, c}, {d, b, c}, {b, b, c}, {a, d, c}, {b, d, c}, {c, d, c}, {d, d, c}, {a, c, c}, {b, c, c}, {d, c, c}, {c, c, c}, {b, a, d}, {c, a, d}, {d, a, d}, {a, a, d}, {a, b, d}, {c, b, d}, {d, b, d}, {b, b, d}, {a, c, d}, {b, c, d}, {d, c, d}, {c, c, d}, {a, d, d}, {b, d, d}, {c, d, d}, {d, d, d}}\)], "Output"] }, Open ]], Cell[TextData[{ "As before, this will not work for numbers instead of symbols. However, we \ could easily deal with this problem by mapping ", StyleBox["Hold", "MR"], " on the list and then applying ", StyleBox["ReleaseHold", "MR"], " at the end). Another problem is that we temporarily cleared the ", StyleBox["Orderless", "MR"], " attribute of ", StyleBox["Times", "MR"], ", which is generally not considered a very good idea and may produce \ unexpected results. In this case there were no such surprises. However, a \ general algebraic version of the code is both simpler and much more \ efficient." }], "Text"], Cell[BoxData[ \(Perms1[S_List, k_Integer] := Distribute[Table[S, {k}], List]\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(Perms1[{a, b, c, d}, 3]\)], "Input"], Cell[BoxData[ \({{a, a, a}, {a, a, b}, {a, a, c}, {a, a, d}, {a, b, a}, {a, b, b}, {a, b, c}, {a, b, d}, {a, c, a}, {a, c, b}, {a, c, c}, {a, c, d}, {a, d, a}, {a, d, b}, {a, d, c}, {a, d, d}, {b, a, a}, {b, a, b}, {b, a, c}, {b, a, d}, {b, b, a}, {b, b, b}, {b, b, c}, {b, b, d}, {b, c, a}, {b, c, b}, {b, c, c}, {b, c, d}, {b, d, a}, {b, d, b}, {b, d, c}, {b, d, d}, {c, a, a}, {c, a, b}, {c, a, c}, {c, a, d}, {c, b, a}, {c, b, b}, {c, b, c}, {c, b, d}, {c, c, a}, {c, c, b}, {c, c, c}, {c, c, d}, {c, d, a}, {c, d, b}, {c, d, c}, {c, d, d}, {d, a, a}, {d, a, b}, {d, a, c}, {d, a, d}, {d, b, a}, {d, b, b}, {d, b, c}, {d, b, d}, {d, c, a}, {d, c, b}, {d, c, c}, {d, c, d}, {d, d, a}, {d, d, b}, {d, d, c}, {d, d, d}}\)], "Output"] }, Open ]], Cell[TextData[{ "Here we see a characteristic difference between ", StyleBox["Mathematica", FontSlant->"Italic"], " and specialized programs for dealing with abstract algebraic structures \ like rings, groups, and so on. Such programs tend to be object oriented and \ contain structures like groups or rings as some form of data types. ", StyleBox["Mathematica", FontSlant->"Italic"], " does not have objects or types that correspond to groups or rings, but \ contains functions and attributes that let one implement distributivity, \ commutativity, associativity, and so forth in a functional way. As a bonus, \ we can find uses for them in more general programming, which are not strictly \ concerned with abstract algebraic structures. " }], "Text"], Cell[TextData[{ "As we have seen, distributivity is implemented in ", StyleBox["Mathematica", FontSlant->"Italic"], " through the function ", StyleBox["Distribute", "MR"], ". How about the other fundamental algebraic notions, commutativity and \ associativity? These are essentially implemented as a so-called \ \[OpenCurlyDoubleQuote]", StyleBox["Attributes", "MR"], "\[CloseCurlyDoubleQuote] of functions ", StyleBox["Orderless", "MR"], " and ", StyleBox["Flat", "MR"], ". Understanding these attributes (as well as ", StyleBox["OneIdentity", "MR"], ", which does not have a simple algebraic motivation) is the foundation of \ algebraic programming." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?Orderless\)\)], "Input"], Cell[BoxData[ RowBox[{"\<\"Orderless is an attribute that can be assigned to a symbol f \ to indicate that the elements ei in expressions of the form f[e1, e2, ... ] \ should automatically be sorted into canonical order. This property is \ accounted for in pattern matching.\"\>", " ", ButtonBox[ StyleBox["More\[Ellipsis]", "SR"], ButtonData:>"Orderless", Active->True, ButtonStyle->"RefGuideLink"]}]], "Print", CellTags->"Info3276155588-2764254"] }, Open ]], Cell[TextData[{ "The attribute ", StyleBox["Orderless", "MR"], " in a function is usually said to correspond to the mathematical notion of \ commutativity. This is indeed true, but one has to be careful with the \ interpretation of \[OpenCurlyDoubleQuote]correspond.\[CloseCurlyDoubleQuote] \ Many functions that are \[OpenCurlyDoubleQuote]mathematically\ \[CloseCurlyDoubleQuote] commutative do not have the attribute ", StyleBox["Orderless", "MR"], ". Such is the case with the logical function ", StyleBox["Or", "MR"], ". From the mathematical viewpoint the function is commutative." }], "Text"], Cell[BoxData[ \(<< Experimental`\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(ImpliesQ[Or[A, B], Or[B, A]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[TextData[{ "However, ", StyleBox["Orderless", "MR"], " is not an attribute of ", StyleBox["Or", "MR"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Attributes[Or]\)], "Input"], Cell[BoxData[ \({Flat, HoldAll, OneIdentity, Protected}\)], "Output"] }, Open ]], Cell["We can see the effect this has on pattern matching.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(a || b /. _ || a \[Rule] c\)], "Input"], Cell[BoxData[ \(a || b\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(b || a /. _ || a \[Rule] c\)], "Input"], Cell[BoxData[ \(c\)], "Output"] }, Open ]], Cell[TextData[{ "The reason is not mathematical but has to do with performance and the way \ logical functions are used in programming, where one actually may wish to \ exploit the order of evaluation. The arguments of ", Cell[BoxData[ FormBox[ RowBox[{ StyleBox["Or", "MR"], StyleBox["[", "MR"], RowBox[{"p", StyleBox[",", "MR"], "q", StyleBox[",", "MR"], "r", StyleBox[",", "MR"], "s", StyleBox[",", "MR"], "t", StyleBox[",", "MR"], "..."}], StyleBox["]", "MR"]}], TraditionalForm]]], " are evaluated in order, and ", StyleBox["True", "MR"], " will be returned the moment one of them is found to be true. This may be \ a substantial timesaver. Also, consider the following example, which I owe to \ Daniel Lichtblau." }], "Text"], Cell[BoxData[{ \(\(cond1 := And[Length[a] \[GreaterEqual] 2\ , a[\([2]\)] \[Equal] 3];\)\), "\n", \(\(cond2 := And[a[\([2]\)] \[Equal] 3, Length[a] \[GreaterEqual] 2];\)\)}], "InputOnly"], Cell["\<\ We can see that the following two evaluations will produce \ different behavior.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(cond1 /. a \[Rule] {x}\), "\n", \(cond2 /. a \[Rule] {x}\)}], "Input"], Cell[BoxData[ \(False\)], "Output"], Cell[BoxData[ RowBox[{\(Part::"partd"\), \(\(:\)\(\ \)\), "\<\"Part specification \ \\!\\(a \[LeftDoubleBracket] 2 \[RightDoubleBracket]\\) is longer than depth \ of object. \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::partd\\\"]\\)\"\>"}]], "Message"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[TextData[{ "In other words: we have to pay attention to order when pattern matching \ even though ", StyleBox["||", "MR"], " is in fact a commutative operation. This can be exploited in programming \ both to increase efficiency and to avoid generating unnecessary errors." }], "Text"], Cell[TextData[{ "On the other hand, it is precisely the effect of the \ \[OpenCurlyDoubleQuote]algebraic\[CloseCurlyDoubleQuote] attributes ", StyleBox["Orderless", "MR"], ", ", StyleBox["Flat", "MR"], ", and ", StyleBox["OneIdentity", "MR"], " on pattern matching that makes algebraic programming a surprisingly \ powerful technique." }], "Text"], Cell[TextData[{ "Let us then consider these remaining algebraic attributes, ", StyleBox["Flat", "MR"], " and ", StyleBox["OneIdentity", "MR"], ", which together with the function ", StyleBox["Distribute", "MR"], " and the ", StyleBox["Orderless", "MR"], " attribute, play the central roles in algebraic programming. " }], "Text"], Cell[TextData[{ "The attribute ", StyleBox["Flat", "MR"], ", corresponds to the mathematical property of associativity. Of course, as \ usual there is more to it than just that." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?Flat\)\)], "Input"], Cell[BoxData[ RowBox[{"\<\"Flat is an attribute that can be assigned to a symbol f to \ indicate that all expressions involving nested functions f should be \ flattened out. This property is accounted for in pattern matching.\"\>", " ", ButtonBox[ StyleBox["More\[Ellipsis]", "SR"], ButtonData:>"Flat", Active->True, ButtonStyle->"RefGuideLink"]}]], "Print", CellTags->"Info3276155589-2657043"] }, Open ]], Cell[TextData[{ "In order to understand the effect of the algebraic attributes on pattern \ matching we shall use the ", StyleBox["Mathematica", FontSlant->"Italic"], " function ", StyleBox["ReplaceList", "MR"], ". Indeed, this function, together with ", StyleBox["Distribute", "MR"], " and the algebraic attributes, is the most useful ", StyleBox["Mathematica", FontSlant->"Italic"], " command in algebraic programming. " }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?ReplaceList\)\)], "Input"], Cell[BoxData[ RowBox[{"\<\"ReplaceList[expr, rules] attempts to transform the entire \ expression expr by applying a rule or list of rules in all possible ways, and \ returns a list of the results obtained. ReplaceList[expr, rules, n] gives a \ list of at most n results.\"\>", " ", ButtonBox[ StyleBox["More\[Ellipsis]", "SR"], ButtonData:>"ReplaceList", Active->True, ButtonStyle->"RefGuideLink"]}]], "Print", CellTags->"Info3276155590-5352541"] }, Open ]], Cell[TextData[{ "Let us try using ", StyleBox["ReplaceList", "MR"], " to understand the effect of the ", StyleBox["Flat", "MR"], " attribute on pattern matching." }], "Text"], Cell[TextData[{ " We start by taking a function ", StyleBox["f", "MR"], " with no attributes and consider the following replacement rule." }], "Text"], Cell[BoxData[ \(ClearAll[f]\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(ReplaceList[f[a, b, c], f[a_, b_] \[Rule] g[a, b]]\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[TextData[{ "Not surprisingly there was no match. Now give ", StyleBox["f", "MR"], " the attribute ", StyleBox["Flat", "MR"], "." }], "Text"], Cell[BoxData[ \(SetAttributes[f, Flat]\)], "InputOnly"], Cell["Let us repeat the previous attempt.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ReplaceList[f[a, b, c], f[a_, b_] \[Rule] g[a, b]]\)], "Input"], Cell[BoxData[ \({g[f[a], f[b, c]], g[f[a, b], f[c]]}\)], "Output"] }, Open ]], Cell[TextData[{ "Note what happened. The function ", Cell[BoxData[ \(TraditionalForm\`f[a, b, c]\)]], " was now rewritten using \[OpenCurlyDoubleQuote]associativity\ \[CloseCurlyDoubleQuote] in two ways, as ", Cell[BoxData[ \(TraditionalForm\`f[f[a], f[b, c]]\)]], " and ", Cell[BoxData[ \(TraditionalForm\`f[f[a, b], f[c]]\)]], ". The rule was then applied but only at the top level. Now suppose we give \ ", StyleBox["f", "MR"], " the attribute ", StyleBox["OneIdentity", "MR"], " in addition to ", StyleBox["Flat", "MR"], "." }], "Text"], Cell[BoxData[ \(SetAttributes[f, OneIdentity]\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(ReplaceList[f[a, b, c], f[a_, b_] \[Rule] g[a, b]]\)], "Input"], Cell[BoxData[ \({g[a, f[b, c]], g[f[a, b], c]}\)], "Output"] }, Open ]], Cell[TextData[{ "You see that all expressions of the type ", StyleBox["f[", "MR"], StyleBox["x", "TI"], StyleBox["]", "MR"], " were replaced just by ", Cell[BoxData[ \(TraditionalForm\`x\)]], ". Of course this happens only when pattern matching. If you enter" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(f[x]\)], "Input"], Cell[BoxData[ \(f[x]\)], "Output"] }, Open ]], Cell[TextData[{ "you still get just ", StyleBox["f[", "MR"], StyleBox["x", "TI"], StyleBox["]", "MR"], ", not ", Cell[BoxData[ \(TraditionalForm\`x\)]], "." }], "Text"], Cell["Indeed:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?OneIdentity\)\)], "Input"], Cell[BoxData[ RowBox[{"\<\"OneIdentity is an attribute that can be assigned to a symbol \ f to indicate that f[x], f[f[x]], etc. are all equivalent to x for the \ purpose of pattern matching.\"\>", " ", ButtonBox[ StyleBox["More\[Ellipsis]", "SR"], ButtonData:>"OneIdentity", Active->True, ButtonStyle->"RefGuideLink"]}]], "Print", CellTags->"Info3276155590-7972361"] }, Open ]], Cell[TextData[{ "The useful function ", StyleBox["ReplaceAllList", "MR"], " works like ", StyleBox["ReplaceList", "MR"], " but also works on all subexpressions." }], "Text"], Cell[BoxData[ \(ReplaceAllList[expr_, rules_] := Module[{i}, Join[ReplaceList[expr, rules], If[AtomQ[expr], {}, Join @@ Table[\(ReplacePart[expr, #, i] &\) /@ ReplaceAllList[expr[\([i]\)], rules], {i, Length[expr]}]]]]\)], "InputOnly"], Cell["\<\ Let us now look at another example of algebraic programming. Of \ course, the most natural use of algebraic programming is solving algebra \ problems. So let us first consider an associativity problem.\ \>", "Text"], Cell[TextData[{ "Suppose ", Cell[BoxData[ \(TraditionalForm\`g\)]], " is a nonassociative noncommutative product of any number of elements. \ Find all the distinct ways of multiplying four elements using ", Cell[BoxData[ \(TraditionalForm\`g\)]], " that would be equal if ", Cell[BoxData[ \(TraditionalForm\`g\)]], " were associative." }], "BeginEndQuestion"], Cell[TextData[{ "We use a function ", StyleBox["f", "MR"], ", which we assign the attributes ", StyleBox["Flat", "MR"], " and ", StyleBox["OneIdentity", "MR"], "." }], "Text"], Cell[BoxData[ \(ClearAll[f]; SetAttributes[f, {Flat, OneIdentity}]\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(FixedPoint[ Union[Flatten[ReplaceAllList[#, f[a_, b_] \[Rule] g[a, b]]]] &, f[a, b, c, d]]\)], "Input"], Cell[BoxData[ \({g[a, f[b, c, d]], g[a, g[b, f[c, d]]], g[a, g[b, g[c, d]]], g[a, g[f[b, c], d]], g[a, g[g[b, c], d]], g[f[a, b], f[c, d]], g[f[a, b], g[c, d]], g[f[a, b, c], d], g[g[a, b], f[c, d]], g[g[a, b], g[c, d]], g[g[a, f[b, c]], d], g[g[a, g[b, c]], d], g[g[f[a, b], c], d], g[g[g[a, b], c], d]}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Union[% /. f \[Rule] g]\)], "Input"], Cell[BoxData[ \({g[a, g[b, g[c, d]]], g[a, g[g[b, c], d]], g[a, g[b, c, d]], g[g[a, b], g[c, d]], g[g[a, g[b, c]], d], g[g[g[a, b], c], d], g[g[a, b, c], d]}\)], "Output"] }, Open ]], Cell["\<\ This sort of thing is in fact quite useful in various areas of \ mathematics. Later we shall give just one application of exactly this idea to \ solving a rather well-known puzzle that is frequently asked on symbolic \ algebra email lists.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ CounterBox["Section"], ". ", "The 4 Fours problem" }], "Section"], Cell[TextData[{ "The following problem was sent to the ", StyleBox["MathGroup", FontSlant->"Italic"], " email list in June 2002." }], "Text"], Cell[TextData[{ "Find the numbers 0 to 99 using any rational operator (i.e., an operation \ which results in a rational number) and 4 fours, where each equation must \ contain no more and no less than 4 fours. Not all numbers may be possible. \ Some examples include:\n", Cell[BoxData[ \(TraditionalForm\`0 = 4 + 4 - 4 - 4\)]], "\n", Cell[BoxData[ \(TraditionalForm\`1 = 4/4 + \((4 - 4)\)\)]], "\n", Cell[BoxData[ \(TraditionalForm\`2 = 4/4 + 4/4\)]], "\n", Cell[BoxData[ \(TraditionalForm\`27 = \(4!\) + 4/4 + \@4\)]], "." }], "BeginEndQuestion"], Cell["\<\ The problem as formulated is rather unclear because of the \ vagueness of the phrase \[OpenCurlyDoubleQuote]rational operator.\ \[CloseCurlyDoubleQuote] The question allowed not only binary operations but \ also unary operations, such as taking the square root or factorials. This of \ course means that there is an infinite number of possible solutions unless \ one imposes additional restrictions. However, we shall first simplify the \ problem and consider only binary operations: addition, subtraction, \ multiplication, division, and exponentiation. Let us try to solve the \ following simpler version of the problem.\ \>", "Text"], Cell["\<\ Find all integers between 1 and 99 that are expressible using 4 \ fours and only the arithmetical operations: +, -, *, /, and ^. \ \>", \ "BeginEndQuestion"], Cell[TextData[{ "This is very easy to implement in ", StyleBox["Mathematica", FontSlant->"Italic"], " using algebraic programming. In fact, we shall use exactly the same \ method as in the last example." }], "Text"], Cell[TextData[{ "The idea is very simple. First we find all ways of writing expressions \ like ", Cell[BoxData[ \(TraditionalForm\`A\_0[A\_1[4, 4], A\_2[4, 4]]\)]], ", where the ", Cell[BoxData[ \(TraditionalForm\`A\_i\)]], " are the binary operations ", StyleBox["Times", "MR"], ", ", StyleBox["Plus", "MR"], ", ", StyleBox["Divide", "MR"], ", ", StyleBox["Subtract", "MR"], ", and ", StyleBox["Power", "MR"], ". Actually in ", StyleBox["Mathematica", FontSlant->"Italic"], ", ", StyleBox["Times", "MR"], " and ", StyleBox["Plus", "MR"], " are ", StyleBox["n", FontSlant->"Italic"], "-ary operations for any ", Cell[BoxData[ \(TraditionalForm\`n \[GreaterEqual] 1\)]], ", but ", StyleBox["Divide", "MR"], ", ", StyleBox["Subtract", "MR"], ", and ", StyleBox["Power", "MR"], " are not. To handle them all simultaneously, we consider them to be binary \ operations." }], "Text"], Cell[TextData[{ "It is clear that the number of different expressions that can be made up \ of four arguments and binary operations ", Cell[BoxData[ \(TraditionalForm\`A\_0, A\_1, ... \)]], " (which may be different or the same) can be described as follows. Let ", Cell[BoxData[ \(TraditionalForm\`A\)]], " be an associative binary operation. Then expressions such as ", Cell[BoxData[ \(TraditionalForm\`A[x, A[y, A[z, w]]]\)]], " and ", Cell[BoxData[ \(TraditionalForm\`A[A[x, y], A[z, w]]\)]], " are equal. Clearly the number of such expressions that are equal by \ virtue of the associativity of ", Cell[BoxData[ \(TraditionalForm\`A\)]], " (which we found in the previous section) is equal to the number of \ distinct ways of applying three binary functions to four arguments. In fact \ we can obtain all the expressions of the latter type from those of the former \ as follows." }], "Text"], Cell[TextData[{ "First we repeat what we did above, that is, define an associative \ operation ", StyleBox["f", "MR"], "." }], "Text"], Cell[BoxData[ \(ClearAll[f]; SetAttributes[f, {Flat, OneIdentity}]\)], "InputOnly"], Cell["\<\ Next, just as above, we find all the ways of \ \[OpenCurlyDoubleQuote]associating\[CloseCurlyDoubleQuote] four \ elements.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ls = Union[FixedPoint[ Union[Flatten[ReplaceAllList[#, f[a_, b_] \[Rule] g[a, b]]]] &, f[a, b, c, d]] /. f \[Rule] g]\)], "Input"], Cell[BoxData[ \({g[a, g[b, g[c, d]]], g[a, g[g[b, c], d]], g[a, g[b, c, d]], g[g[a, b], g[c, d]], g[g[a, g[b, c]], d], g[g[g[a, b], c], d], g[g[a, b, c], d]}\)], "Output"] }, Open ]], Cell[TextData[{ "Then we remove all duplicates and expressions that involve the application \ of ", StyleBox["g", "MR"], " to three elements." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ls = Union[Flatten[ DeleteCases[ ls, _?\((Not[ FreeQ[#, g[x__ /; Length[{x}] \[GreaterEqual] 3]]] &)\), 1]]]\)], "Input"], Cell[BoxData[ \({g[a, g[b, g[c, d]]], g[a, g[g[b, c], d]], g[g[a, b], g[c, d]], g[g[a, g[b, c]], d], g[g[g[a, b], c], d]}\)], "Output"] }, Open ]], Cell[TextData[{ "Finally we replace ", StyleBox["g", "MR"], " by ", Cell[BoxData[ FormBox[ RowBox[{ FormBox[\(A\_2, A\_1\), "TraditionalForm"], ",", \(A\_0\)}], TraditionalForm]]], ", in this order, and make all the elements ", Cell[BoxData[ \(TraditionalForm\`{a, b, c, d}\)]], " equal to 4." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ls = \((i = 0; MapAll[If[# === g, # /. g -> Subscript[A, Mod[\(++i\), 3]], #] &, ls, Heads \[Rule] True] /. Thread[Rule[{a, b, c, d}, 4]])\)\)], "Input"], Cell[BoxData[ \({A\_1[4, A\_2[4, A\_0[4, 4]]], A\_1[4, A\_2[A\_0[4, 4], 4]], A\_1[A\_2[4, 4], A\_0[4, 4]], A\_1[A\_2[4, A\_0[4, 4]], 4], A\_1[A\_2[A\_0[4, 4], 4], 4]}\)], "Output"] }, Open ]], Cell[TextData[{ "(A different approach to the same problem can be found in \ \:f363\:f363exercise 13 of Chapter 6 of [", ButtonBox[ CounterBox["Reference", "Graham1989"], ButtonData:>"Graham1989", ButtonStyle->"Hyperlink"], "])." }], "Text"], Cell[TextData[{ "We shall now simply substitute the five binary operations ", StyleBox["Plus", "MR"], ", ", StyleBox["Subtract", "MR"], ", ", StyleBox["Times", "MR"], ", ", StyleBox["Divide", "MR"], ", and ", StyleBox["Power", "MR"], " for ", Cell[BoxData[ FormBox[ RowBox[{ FormBox[\(A\_0, A\_1\), "TraditionalForm"], ",", \(A\_2\)}], TraditionalForm]]], " in all possible ways. First we need to redefine ", StyleBox["Divide", "MR"], " and ", StyleBox["Power", "MR"], ". Basically we do this to avoid error messages caused by division by 0. \ For later use, we also place a restriction on the maximum and minimum size of \ the exponent to avoid unnecessary computations of very large and very small \ numbers. " }], "Text"], Cell[BoxData[{ \(Off[General::"\"]; Off[General::"\"];\), "\n", \(power[x_Integer?\((# > 0 &)\), y_Integer?\((\(-16\) \[LessEqual] # \[LessEqual] 16 &)\)] := x^y; power[x__] := Indeterminate;\), "\n", \(divide[x_, y_] /; y \[NotEqual] 0 := Divide[x, y]; divide[x_, 0] := Indeterminate;\)}], "InputOnly"], Cell[TextData[{ "Next we create a set of rules that we shall use to create all possible \ ways of replacing the ", Cell[BoxData[ \(TraditionalForm\`A\_i\)]], " with the binary operations." }], "Text"], Cell[BoxData[ \(\(rules = Map[Thread, Map[RuleDelayed[Array[A\_\(# - 1\) &, {5}], \ #]\ &, Distribute[ Array[{Times, \ Plus, Subtract, divide, power} &, {5}], List]]];\)\)], "InputOnly"], Cell["Here is what the list we created looks like.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Take[rules, 5]\)], "Input"], Cell[BoxData[ \({{A\_0 \[RuleDelayed] Times, A\_1 \[RuleDelayed] Times, A\_2 \[RuleDelayed] Times, A\_3 \[RuleDelayed] Times, A\_4 \[RuleDelayed] Times}, {A\_0 \[RuleDelayed] Times, A\_1 \[RuleDelayed] Times, A\_2 \[RuleDelayed] Times, A\_3 \[RuleDelayed] Times, A\_4 \[RuleDelayed] Plus}, {A\_0 \[RuleDelayed] Times, A\_1 \[RuleDelayed] Times, A\_2 \[RuleDelayed] Times, A\_3 \[RuleDelayed] Times, A\_4 \[RuleDelayed] Subtract}, {A\_0 \[RuleDelayed] Times, A\_1 \[RuleDelayed] Times, A\_2 \[RuleDelayed] Times, A\_3 \[RuleDelayed] Times, A\_4 \[RuleDelayed] divide}, {A\_0 \[RuleDelayed] Times, A\_1 \[RuleDelayed] Times, A\_2 \[RuleDelayed] Times, A\_3 \[RuleDelayed] Times, A\_4 \[RuleDelayed] power}}\)], "Output"] }, Open ]], Cell[TextData[{ "In fact, since an actual formula never involves more than three binary \ operations, we remove the rules involving unnecessary ", Cell[BoxData[ \(TraditionalForm\`A\)]], "s." }], "Text"], Cell[BoxData[ \(\(rules = Union[DeleteCases[rules, HoldPattern[A\_3 \[RuleDelayed] _] | HoldPattern[A\_4 \[RuleDelayed] _], Infinity]];\)\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(Take[rules, 5]\)], "Input"], Cell[BoxData[ \({{A\_0 \[RuleDelayed] divide, A\_1 \[RuleDelayed] divide, A\_2 \[RuleDelayed] divide}, {A\_0 \[RuleDelayed] divide, A\_1 \[RuleDelayed] divide, A\_2 \[RuleDelayed] Plus}, {A\_0 \[RuleDelayed] divide, A\_1 \[RuleDelayed] divide, A\_2 \[RuleDelayed] power}, {A\_0 \[RuleDelayed] divide, A\_1 \[RuleDelayed] divide, A\_2 \[RuleDelayed] Subtract}, {A\_0 \[RuleDelayed] divide, A\_1 \[RuleDelayed] divide, A\_2 \[RuleDelayed] Times}}\)], "Output"] }, Open ]], Cell["\<\ Let us now find all possible solutions of the \ \[OpenCurlyDoubleQuote]easy\[CloseCurlyDoubleQuote] 4 fours problem.\ \>", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(solutions = Union[Flatten[ Union[\(Union[ Select[Flatten[Union[# /. rules]], Element[#, Integers] && 0 \[LessEqual] # \[LessEqual] 99 &]] &\) /@ ls]]]\)], "Input"], Cell[BoxData[ \({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 20, 24, 28, 32, 36, 48, 60, 63, 64, 65, 68, 80, 81}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Length[solutions]\)], "Input"], Cell[BoxData[ \(27\)], "Output"] }, Open ]], Cell["\<\ Finally let us find all possible ways of obtaining a given number, \ for example, 7.\ \>", "Text"], Cell[BoxData[ \(\(patterns = Union[Flatten[\(Union[Flatten[Union[HoldForm[#] /. rules]]] &\) /@ ls]];\)\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(Select[patterns, ReleaseHold[#] \[Equal] 7 &] /. {divide \[Rule] Divide, power \[Rule] Power}\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ TagBox[\(\((4 - 4\/4)\) + 4\), HoldForm], ",", TagBox[\(4 + \((4 - 4\/4)\)\), HoldForm], ",", TagBox[\(4 - \((4\/4 - 4)\)\), HoldForm], ",", TagBox[\(\((4 + 4)\) - 4\/4\), HoldForm]}], "}"}]], "Output"] }, Open ]], Cell["\<\ This completely solves the \[OpenCurlyDoubleQuote]easy\ \[CloseCurlyDoubleQuote] 4 fours problem. We can solve the analogous 5 fives \ problem and so on in exactly the same way. In the final section we take a \ look at the \[OpenCurlyDoubleQuote]hard\[CloseCurlyDoubleQuote] 4 fours \ problem presented in the original question. \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ CounterBox["Section"], ". ", "The Hard 4 Fours Problem" }], "Section"], Cell[TextData[{ "The hard version of the problem is to find all possible representations of \ all numbers between 1 and 99 using any \[OpenCurlyDoubleQuote]reasonable\ \[CloseCurlyDoubleQuote] operations, including unary ones (\ \[OpenCurlyDoubleQuote]functions\[CloseCurlyDoubleQuote]) like ", StyleBox["Sqrt", "MR"], " or ", StyleBox["Factorial", "MR"], ". Of course there is now an infinite number of possible ways of trying to \ write out a solution, even with a finite number of operations. We shall \ therefore concentrate only on representations using ", StyleBox["Sqrt", "MR"], " and ", StyleBox["Factorial", "MR"], " in addition to the usual arithmetic operations, and only try to find some \ additional solutions. (If the additional operations were binary [e.g., ", StyleBox["Max", "MR"], " or ", StyleBox["Min", "MR"], "] then we could use exactly the same method as before to obtain a complete \ solution.) We first introduce modified definitions of the additional \ operations." }], "Text"], Cell[BoxData[{ \(sqrt[x_?\((# > 0 &)\)] := Sqrt[x]; sqrt[x_] := Indeterminate;\), "\[IndentingNewLine]", \(factorial[n_Integer?\((0 <= # < 12 &)\)] = Factorial[n]; factorial[n_] := Indeterminate;\)}], "InputOnly"], Cell[TextData[{ "We create a new set of rules that transform our unary functions ", Cell[BoxData[ \(TraditionalForm\`B\_i\)]], " into ", StyleBox["factorial", "MR"], ", ", StyleBox["sqrt", "MR"], ", or ", StyleBox["Identity", "MR"], " to account for the cases where no unary operation is used." }], "Text"], Cell[BoxData[ \(\(rules1 = Map[Thread, Map[RuleDelayed[Array[B\_# &, {4}], #] &, Distribute[Array[{Identity, Identity, factorial, sqrt} &, {4}], List]]];\)\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(Take[rules1, 5]\)], "Input"], Cell[BoxData[ \({{B\_1 \[RuleDelayed] Identity, B\_2 \[RuleDelayed] Identity, B\_3 \[RuleDelayed] Identity, B\_4 \[RuleDelayed] Identity}, {B\_1 \[RuleDelayed] Identity, B\_2 \[RuleDelayed] Identity, B\_3 \[RuleDelayed] Identity, B\_4 \[RuleDelayed] Identity}, {B\_1 \[RuleDelayed] Identity, B\_2 \[RuleDelayed] Identity, B\_3 \[RuleDelayed] Identity, B\_4 \[RuleDelayed] factorial}, {B\_1 \[RuleDelayed] Identity, B\_2 \[RuleDelayed] Identity, B\_3 \[RuleDelayed] Identity, B\_4 \[RuleDelayed] sqrt}, {B\_1 \[RuleDelayed] Identity, B\_2 \[RuleDelayed] Identity, B\_3 \[RuleDelayed] Identity, B\_4 \[RuleDelayed] Identity}}\)], "Output"] }, Open ]], Cell["\<\ We see that there are rather many identical rules. We can reduce \ their number.\ \>", "Text"], Cell[BoxData[ \(\(rules1 = Union[rules1, SameTest \[Rule] \((\((\((Array[B\_# &, {4}] /. #1)\) === \((Array[ B\_# &, {4}] /. #2)\))\) &)\)];\)\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(Take[rules1, 5]\)], "Input"], Cell[BoxData[ \({{B\_1 \[RuleDelayed] factorial, B\_2 \[RuleDelayed] factorial, B\_3 \[RuleDelayed] factorial, B\_4 \[RuleDelayed] factorial}, {B\_1 \[RuleDelayed] factorial, B\_2 \[RuleDelayed] factorial, B\_3 \[RuleDelayed] factorial, B\_4 \[RuleDelayed] Identity}, {B\_1 \[RuleDelayed] factorial, B\_2 \[RuleDelayed] factorial, B\_3 \[RuleDelayed] factorial, B\_4 \[RuleDelayed] sqrt}, {B\_1 \[RuleDelayed] factorial, B\_2 \[RuleDelayed] factorial, B\_3 \[RuleDelayed] Identity, B\_4 \[RuleDelayed] factorial}, {B\_1 \[RuleDelayed] factorial, B\_2 \[RuleDelayed] factorial, B\_3 \[RuleDelayed] Identity, B\_4 \[RuleDelayed] Identity}}\)], "Output"] }, Open ]], Cell[TextData[{ "The most obvious expressions to evaluate are obtained from the earlier \ ones by replacing all fours by ", Cell[BoxData[ \(TraditionalForm\`B\_i[4]\)]], "." }], "Text"], Cell[BoxData[ \(expr[j_] := Module[{i = 0}, MapAll[If[# === 4, \(Subscript[B, \(++i\)]\)[#], #] &, ls[\([j]\)]]]\)], "InputOnly"], Cell["Here are all the solutions we get in this way.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(extendedsols = Union[Flatten[\(Union[ Select[Flatten[Union[Union[expr[#] /. rules] /. rules1]], Element[#, Integers] && 0 \[LessEqual] # \[LessEqual] 99 &]] &\) /@ Range[5]]]\)], "Input"], Cell[BoxData[ \({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 42, 44, 46, 47, 48, 49, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 95, 96, 97, 98}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Length[%]\)], "Input"], Cell[BoxData[ \(72\)], "Output"] }, Open ]], Cell["\<\ An interesting case is the number 31, which was not among the \ solutions we got earlier. Let us see how it is represented.\ \>", "Text"], Cell[BoxData[ \(\(extendedpatterns = Union[Flatten[\(Union[ Union[HoldForm[Evaluate[expr[#]]] /. rules] /. rules1] &\) /@ Range[5]]];\)\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(\(Select[Flatten[extendedpatterns], ReleaseHold[#] \[Equal] 31 &] /. {divide \[Rule] Divide, power \[Rule] Power, sqrt \[Rule] Sqrt, factorial \[Rule] Factorial}\) /. HoldPattern[Identity[x_]] \[Rule] x\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ TagBox[\(\(4!\) + \(4 + \(4!\)\)\/4\), HoldForm], ",", TagBox[\(\(4!\) + \(\(4!\) + 4\)\/4\), HoldForm], ",", TagBox[\(\(4 + \(4!\)\)\/4 + \(4!\)\), HoldForm], ",", TagBox[\(\(\(4!\) + 4\)\/4 + \(4!\)\), HoldForm]}], "}"}]], "Output"] }, Open ]], Cell[TextData[{ "Of course there are in principle infinitely many ways to insert more ", StyleBox["B", "TI"], "s into different slots, and it is not clear how many more numbers can be \ obtained in this way. Here is just one example. Consider the pattern ", Cell[BoxData[ \(TraditionalForm\`A\_o[A\_2[B\_2[A\_1[B\_1[4], 4]], B\_3[4]], B\_4[4]]\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(extrasols = Union[Select[ Flatten[Union[ Union[A\_0[A\_2[B\_2[A\_1[B\_1[4], 4]], B\_3[4]], B\_4[4]] /. rules] /. rules1]], Element[#, Integers] && 0 \[LessEqual] # \[LessEqual] 99 &]]\)], "Input"], Cell[BoxData[ \({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 36, 38, 40, 42, 44, 45, 46, 47, 48, 49, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 88, 90, 92, 94, 96, 98}\)], "Output"] }, Open ]], Cell["We see that it produced just one new number.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Complement[extrasols, extendedsols]\)], "Input"], Cell[BoxData[ \({45}\)], "Output"] }, Open ]], Cell["\<\ However, we created several new representations for the solutions \ already found. Here is another representation of 31.\ \>", "Text"], Cell[BoxData[ \(\(extrapatterns = Flatten[Union[ Union[HoldForm[ A\_0[A\_2[B\_2[A\_1[B\_1[4], 4]], B\_3[4]], B\_4[4]]] /. rules] /. rules1]];\)\)], "InputOnly"], Cell[CellGroupData[{ Cell[BoxData[ \(\(Select[extrapatterns, ReleaseHold[#] \[Equal] 31 &] /. {divide \[Rule] Divide, power \[Rule] Power, sqrt \[Rule] Sqrt, factorial \[Rule] Factorial}\) /. HoldPattern[Identity[x_]] \[Rule] x\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ TagBox[\(\(\(\(\(4!\)\/4\)!\) + \(4!\)\)\/\(4!\)\), HoldForm], ",", TagBox[\(\(\(\((\@4 + 4)\)!\) + \(4!\)\)\/\(4!\)\), HoldForm], ",", TagBox[\(\(\(4!\) + 4\)\/4 + \(4!\)\), HoldForm]}], "}"}]], "Output"] }, Open ]], Cell["Here are all the solutions we have found so far.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(solutions = Union[extendedsols, extrasols]\)], "Input"], Cell[BoxData[ \({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 42, 44, 45, 46, 47, 48, 49, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 95, 96, 97, 98}\)], "Output"] }, Open ]], Cell["Here are the remaining outstanding numbers.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Complement[Range[99], solutions]\)], "Input"], Cell[BoxData[ \({33, 39, 41, 43, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 99}\)], "Output"] }, Open ]], Cell["\<\ See if you can find interesting representations of these, possibly \ using some other operations.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Acknowledgments", "Section"], Cell[TextData[{ "I would like thank Daniel Lichtblau and Michael Trott [", ButtonBox[ CounterBox["Reference", "Trott2003"], ButtonData:>"Trott2003", ButtonStyle->"Hyperlink"], "] for useful comments and suggestions." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["References", "Section"], Cell[TextData[{ Cell[TextData[{ "[", CounterBox["Reference"], "]\[ThickSpace]\[MediumSpace]" }], CellSize->{24, Inherited}, TextAlignment->Right], "Ilan Vardi, ", StyleBox["Computational Recreations in Mathematica", FontSlant->"Italic"], ", Reading, MA: Addison-Wessley, 1991." }], "Reference", CellTags->"Vardi1991"], Cell[TextData[{ Cell[TextData[{ "[", CounterBox["Reference"], "]\[ThickSpace]\[MediumSpace]" }], CellSize->{24, Inherited}, TextAlignment->Right], "R. L. Graham, D. E. Knuth, and O. Patashnik, ", StyleBox["Concrete Mathematics", FontSlant->"Italic"], ", Reading, MA: Addison-Wesley, 1989." }], "Reference", CellTags->"Graham1989"], Cell[TextData[{ Cell[TextData[{ "[", CounterBox["Reference"], "]\[ThickSpace]\[MediumSpace]" }], CellSize->{24, Inherited}, TextAlignment->Right], "Michael Trott, ", StyleBox["The Mathematica Guidebook to Programming", FontSlant->"Italic"], ", Berlin: Springer-Verlag, 2003." }], "Reference", CellTags->"Trott2003"] }, Open ]], Cell[CellGroupData[{ Cell["About the Author", "SectionAboutAuthor"], Cell[TextData[{ "Andrzej Kozlowski was when he wrote this article a professor of \ mathematics at Toyama International University in Japan. He is now teaching \ mathematics and physics at Tokyo Denki University in Japan. Most of his \ research has been in algebraic topology, but recently he has become \ interested in mathematical finance, which he is teaching as an Internet-based \ course at Warsaw University. He is has recently joined Chatham Research \ (http://www.chathamresearch.com/) in a project to apply ", StyleBox["Mathematica", FontSlant->"Italic"], " to problems in quantitative finance and economics. He is a frequent \ contributor to the ", StyleBox["MathGroup", FontSlant->"Italic"], " email list." }], "TextAboutAuthor"], Cell[TextData[{ StyleBox["Andrzej Kozlowski", FontWeight->"Bold"], "\n", StyleBox["Tokyo Denki University\nFaculty of Information Environment\n\ Chiba, Japan\n", FontSlant->"Italic"], StyleBox[ButtonBox["akoz@mimuw.edu.pl", ButtonData:>{ URL[ "mailto:akoz@mimuw.edu.pl"], None}, ButtonStyle->"Hyperlink"], FontSlant->"Italic"], StyleBox[" ", FontSlant->"Italic"] }], "TextAboutAuthor"] }, Open ]] }, Open ]] }, FrontEndVersion->"5.0 for Macintosh", ScreenRectangle->{{27, 1152}, {0, 746}}, WindowToolbars->{}, WindowSize->{1004, 719}, WindowMargins->{{4, Automatic}, {Automatic, 1}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, PageHeaders->{{ Inherited, Inherited, Cell[ "Andrzej Kozlowski", "Header"]}, { Cell[ "Algebraic Programming in Mathematica", "Header"], Inherited, Inherited}}, PageFooters->{{Cell[ TextData[ {"The Mathematica Journal ", StyleBox[ "9", FontWeight -> "Bold"], ":2 \[Copyright] 2004 Wolfram Media, Inc."}], "Footer"], Inherited, Inherited}, {Inherited, Inherited, Cell[ TextData[ {"The Mathematica Journal ", StyleBox[ "9", FontWeight -> "Bold"], ":2 \[Copyright] 2004 Wolfram Media, Inc."}], "Footer"]}}, PrintingOptions->{"PrintCellBrackets"->False, "PrintRegistrationMarks"->False, "PrintMultipleHorizontalPages"->False, "FirstPageHeader"->False, "FacingPages"->True}, Magnification->1, StyleDefinitions -> Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Style Definitions for \n", StyleBox["The Mathematica Journal", FontSlant->"Italic"], "\nWorking, Presentation, and Printout Environments" }], "Subtitle", CellMargins->{{0, Inherited}, {Inherited, 0}}, CellFrameMargins->{{20, 4}, {8, 20}}, FontSize->36, FontWeight->"Bold", FontColor->GrayLevel[1], Background->GrayLevel[0]], Cell["\<\ TMJv4Style.nb 5-6-2003\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell["Style Environment Names", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell[StyleData[All, "Working"], ScreenStyleEnvironment->"Working", PrintingStyleEnvironment->"Printout", CellBracketOptions->{"Color"->RGBColor[0.115343, 0.350561, 0.362966]}, ShowCellLabel->True, CellFrameLabelMargins->6, ScriptMinSize->9, PrivateFontOptions->{"FontType"->"Bitmap"}], Cell[StyleData[All, "Presentation"], ScreenStyleEnvironment->"Presentation", PrintingStyleEnvironment->"Printout", Magnification->1.25], Cell[StyleData[All, "Printout"], ScreenStyleEnvironment->"Printout", PrintingStyleEnvironment->"Printout", PageWidth->PaperWidth, PrintingOptions->{"PrintRegistrationMarks"->False, "FirstPageHeader"->False, "FacingPages"->True}, ShowCellBracket->False, PrivateFontOptions->{"FontType"->"Outline"}] }, Closed]], Cell[CellGroupData[{ Cell["Notebook Options", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], 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"], Inherited, Cell[ "Author(s)", "Header"]}, { Cell[ "Article Title", "Header"], Inherited, Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"]}}, PageFooters->{{Cell[ TextData[ {"The Mathematica Journal ", StyleBox[ "volume", FontWeight -> "Bold"], ":issue \[Copyright] year Wolfram Media, Inc."}], "Footer"], Inherited, Cell[ TextData[ { ValueBox[ "FileName"], ValueBox[ "Date"]}], "Footer"]}, {Cell[ TextData[ { ValueBox[ "FileName"], ValueBox[ "Date"]}], "Footer"], Inherited, Cell[ TextData[ {"The Mathematica Journal ", StyleBox[ "volume", FontWeight -> "Bold"], ":issue \[Copyright] year Wolfram Media, Inc."}], "Footer"]}}, CellLabelAutoDelete->True, CellFrameLabelMargins->6, HyphenationOptions->{"HyphenationCharacter"->"-"}, StyleMenuListing->None] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headings", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell["\<\ Each notebook should contain a Title cell. Title resets all cell \ CounterBox values to zero (except Title).\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Title"], ShowCellBracket->False, ShowSelection->True, CellMargins->{{54, 24}, {0, 15}}, CellGroupingRules->{"TitleGrouping", 0}, PageBreakBelow->False, LineSpacing->{1.125, 0}, CounterIncrements->"Title", CounterAssignments->{{"Subtitle", 0}, {"Section", 0}, {"Subsection", 0}, { "Subsubsection", 0}, {"List", 0}, {"NumberedFigure", 0}, { "NumberedTable", 0}, {"NumberedProgram", 0}, {"Equation", 0}, { "Text", 0}, {"SmallText", 0}, {"Reference", 0}}, FontFamily->"Times", FontSize->36, FontSlant->"Italic"], Cell[StyleData["Title", "Presentation"]], Cell[StyleData["Title", "Printout"], CellMargins->{{72, 72}, {14, 0}}, CellFrameMargins->False, FontColor->GrayLevel[0], Background->None] }, Closed]], Cell["Sub(sub)titles are optional, follows Title, precedes Author.", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Subtitle"], ShowCellBracket->False, ShowSelection->True, CellMargins->{{54, 24}, {5, 2}}, CellGroupingRules->{"TitleGrouping", 10}, PageBreakBelow->False, LineSpacing->{1.25, 0}, CounterIncrements->"Subtitle", FontFamily->"Times", FontSize->24, FontSlant->"Italic"], Cell[StyleData["Subtitle", "Presentation"]], Cell[StyleData["Subtitle", "Printout"], CellMargins->{{72, 72}, {12, 2}}, FontSize->12, FontSlant->"Plain"] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsubtitle"], ShowCellBracket->False, ShowSelection->True, CellMargins->{{54, 24}, {5, 2}}, CellGroupingRules->{"TitleGrouping", 10}, PageBreakBelow->False, LineSpacing->{1, 0}, CounterIncrements->"Subtitle", StyleMenuListing->None, FontFamily->"Times", FontSize->18, FontSlant->"Italic"], Cell[StyleData["Subsubtitle", "Presentation"]], Cell[StyleData["Subsubtitle", "Printout"], CellMargins->{{72, 72}, {6, 2}}, FontSize->10, FontSlant->"Plain"] }, Closed]], Cell["\<\ SectionFirst should be used for the first section level heading \ in a notebook. SectionFirst sets the Subsection and Subsubsection counters to \ zero. Sets Section counter value to 1. If not preceded by Abstract space \ above should be adjusted to 18.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["SectionFirst"], CellFrame->False, CellDingbat->"\[FilledSquare]", CellMargins->{{67, 25}, {10, 30}}, Evaluatable->False, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CounterIncrements->"Section", CounterAssignments->{{"Section", 0}, {"Subsection", 0}, { "Subsubsection", 0}}, AspectRatioFixed->True, FontFamily->"Helvetica", FontSize->16, FontWeight->"Bold"], Cell[StyleData["SectionFirst", "Presentation"], FontSize->18], Cell[StyleData["SectionFirst", "Printout"], CellMargins->{{72, 72}, {2, 30}}, FontSize->12] }, Closed]], Cell["\<\ Section should be used for subsequent Section level headings. \ Sets counter values Subsection and Subsubsection to zero.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Section"], CellFrame->False, CellDingbat->"\[FilledSquare]", CellMargins->{{67, 25}, {10, 30}}, Evaluatable->False, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CounterIncrements->"Section", CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}}, AspectRatioFixed->True, FontFamily->"Helvetica", FontSize->16, FontWeight->"Bold"], Cell[StyleData["Section", "Presentation"], FontSize->18], Cell[StyleData["Section", "Printout"], CellMargins->{{72, 72}, {2, 30}}, FontSize->12] }, Closed]], Cell["\<\ Subsection is an optional style. Sets counter Subsubsection to \ zero.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Subsection"], CellDingbat->"\[EmptySquare]", CellMargins->{{67, 25}, {10, 26}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, FontFamily->"Helvetica", FontSize->14, FontWeight->"Bold"], Cell[StyleData["Subsection", "Presentation"]], Cell[StyleData["Subsection", "Printout"], CellDingbat->"\[EmptySquare]", CellMargins->{{72, 72}, {2, 16}}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsubsection"], CellDingbat->"\[FilledSmallSquare]", CellMargins->{{67, 25}, {6, 20}}, CellGroupingRules->{"SectionGrouping", 60}, PageBreakBelow->False, CounterIncrements->"Subsubsection", FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold"], Cell[StyleData["Subsubsection", "Presentation"]], Cell[StyleData["Subsubsection", "Printout"], CellDingbat->None, CellMargins->{{72, 72}, {-4, 2}}, FontSize->9, FontSlant->"Oblique"] }, Open ]], Cell["\<\ NoSpace heading variants used if a subsequent level heading \ directly follows its predecessor.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["SubsectionNoSpace"], CellDingbat->"\[EmptySquare]", CellMargins->{{67, 25}, {10, 2}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->14, FontWeight->"Bold"], Cell[StyleData["SubsectionNoSpace", "Presentation"]], Cell[StyleData["SubsectionNoSpace", "Printout"], CellDingbat->"\[EmptySquare]", CellMargins->{{72, 72}, {2, 2}}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SubsubsectionNoSpace"], CellDingbat->"\[FilledSmallSquare]", CellMargins->{{67, 25}, {6, 2}}, CellGroupingRules->{"SectionGrouping", 60}, PageBreakBelow->False, CounterIncrements->"Subsubsection", StyleMenuListing->None, FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold"], Cell[StyleData["SubsubsectionNoSpace", "Presentation"]], Cell[StyleData["SubsubsectionNoSpace", "Printout"], CellDingbat->None, CellMargins->{{72, 72}, {-4, 2}}, FontSize->9, FontSlant->"Oblique"] }, Closed]], Cell["\<\ NoDingbat heading variants used, for example, in the frontmatter.\ \ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["SectionNoDingbat"], CellFrame->False, CellDingbat->None, CellMargins->{{67, 25}, {10, 30}}, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CounterIncrements->"Section", CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->16, FontWeight->"Bold"], Cell[StyleData["SectionNoDingbat", "Presentation"], CellFrameMargins->{{0, 0}, {0, 4}}], Cell[StyleData["SectionNoDingbat", "Printout"], CellFrame->False, CellMargins->{{72, 72}, {2, 30}}, CellFrameColor->GrayLevel[0], FontSize->12] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SubsectionNoDingbat"], CellDingbat->None, CellMargins->{{67, 25}, {10, 26}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->14, FontWeight->"Bold"], Cell[StyleData["SubsectionNoDingbat", "Presentation"]], Cell[StyleData["SubsectionNoDingbat", "Printout"], CellMargins->{{72, 72}, {2, 16}}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SubsectionNoSpaceNoDingbat"], CellMargins->{{67, 25}, {2, 2}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->14, FontWeight->"Bold"], Cell[StyleData["SubsectionNoSpaceNoDingbat", "Presentation"]], Cell[StyleData["SubsectionNoSpaceNoDingbat", "Printout"], CellMargins->{{72, 72}, {2, 2}}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SubsubsectionNoDingbat"], CellMargins->{{67, 25}, {6, 20}}, CellGroupingRules->{"SectionGrouping", 60}, PageBreakBelow->False, CounterIncrements->"Subsubsection", StyleMenuListing->None, FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold"], Cell[StyleData["SubsubsectionNoDingbat", "Presentation"]], Cell[StyleData["SubsubsectionNoDingbat", "Printout"], CellMargins->{{72, 72}, {-4, 2}}, FontSize->9, FontSlant->"Oblique"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Body Text", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell[CellGroupData[{ Cell[StyleData["Text"], CellMargins->{{67, 24}, {4, 4}}, LineSpacing->{1, 4}, CounterIncrements->"Text", FontFamily->"Times", FontSize->12], Cell[StyleData["Text", "Presentation"]], Cell[StyleData["Text", "Printout"], CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 12}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SmallText"], CellMargins->{{67, 24}, {4, 4}}, LineSpacing->{1, 4}, CounterIncrements->"SmallText", FontFamily->"Times", FontSize->10], Cell[StyleData["SmallText", "Presentation"]], Cell[StyleData["SmallText", "Printout"], CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 11}, FontSize->9] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Quote"], CellMargins->{{83, 40}, {Inherited, Inherited}}, LineSpacing->{1, 3}, FontFamily->"Times", FontSize->12], Cell[StyleData["Quote", "Presentation"]], Cell[StyleData["Quote", "Printout"], CellMargins->{{96, 96}, {2, 4}}, LineSpacing->{0, 12}, FontSize->10] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Input, Output, and Graphics", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell["\<\ The cells in this section define styles used for active kernel \ sessions. Be careful when modifying, renaming, or removing these styles, \ because the front end associates special meanings with these style \ names.\ \>", "Text"], Cell[TextData[{ "Input cell style to be used for ", StyleBox["Mathematica", FontSlant->"Italic"], " input statements that are followed by either Output or GraphicsOnly \ cell styles. Sets ", "DefaultFormatType->DefaultInputFormatType." }], "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Input"], CellFrame->{{0.25, 0.25}, {0, 0.25}}, CellMargins->{{67, 24}, {-1, 10}}, Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelAutoDelete->True, CellLabelMargins->{{23, Inherited}, {Inherited, Inherited}}, CellFrameColor->GrayLevel[0.869993], DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", FontSize->12, FontWeight->"Bold", Background->GrayLevel[0.949996]], Cell[StyleData["Input", "Presentation"], FontSize->14], Cell[StyleData["Input", "Printout"], CellFrame->False, CellMargins->{{96, 72}, {2, 4}}, PrivateEvaluationOptions->{"OutputFormPageWidth"->342}, CellFrameMargins->False, LineSpacing->{1.25, 0}, FontSize->9, Background->None] }, Closed]], Cell[TextData[{ "InputOnly cell style to be used for ", StyleBox["Mathematica", FontSlant->"Italic"], " input statements that produce no output or graphic. See Program and \ ProgramNoLabel cell styles for presenting segments of code that do not \ evaluate." }], "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["InputOnly"], CellFrame->{{0.25, 0.25}, {0, 0.25}}, CellMargins->{{67, 24}, {10, 10}}, Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelAutoDelete->True, CellLabelMargins->{{23, Inherited}, {Inherited, Inherited}}, CellFrameColor->GrayLevel[0.869993], DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", FontSize->12, FontWeight->"Bold", Background->GrayLevel[0.949996]], Cell[StyleData["InputOnly", "Presentation"], FontSize->14], Cell[StyleData["InputOnly", "Printout"], CellFrame->False, CellMargins->{{96, 72}, {2, 4}}, PrivateEvaluationOptions->{"OutputFormPageWidth"->342}, LineSpacing->{1.25, 0}, FontSize->9, Background->None] }, Closed]], Cell[TextData[{ "Output cell style is usually generated by the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel. To follow Input cell style. Sets \ DefaultFormatType->DefaultOutputFormatType." }], "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Output"], CellFrame->{{0.25, 0.25}, {0.25, 0}}, CellMargins->{{67, 24}, {10, 0}}, CellEditDuplicate->True, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, CellLabelAutoDelete->True, CellLabelMargins->{{23, Inherited}, {Inherited, Inherited}}, CellFrameColor->GrayLevel[0.869993], DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, CounterIncrements->"Output", StyleMenuListing->None, FontSize->12, Background->GrayLevel[0.949996]], Cell[StyleData["Output", "Presentation"], FontSize->14], Cell[StyleData["Output", "Printout"], CellFrame->False, CellMargins->{{96, 72}, {2, 4}}, CellLabelMargins->{{72, Inherited}, {Inherited, Inherited}}, LineSpacing->{1.25, 0}, FontSize->9, Background->None] }, Closed]], Cell[TextData[{ "OutputOnly cell style to be used for output generated by the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel without the Input. Sets \ DefaultFormatType->DefaultOutputFormatType." }], "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["OutputOnly"], CellFrame->True, CellMargins->{{67, 24}, {15, 10}}, CellEditDuplicate->True, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, CellLabelAutoDelete->True, CellLabelMargins->{{23, Inherited}, {Inherited, Inherited}}, CellFrameColor->GrayLevel[0.869993], DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, CounterIncrements->"Output", StyleMenuListing->None, FontSize->12, Background->GrayLevel[0.949996]], Cell[StyleData["OutputOnly", "Presentation"], FontSize->14], Cell[StyleData["OutputOnly", "Printout"], CellFrame->False, CellMargins->{{96, 72}, {2, 4}}, CellLabelMargins->{{72, Inherited}, {Inherited, Inherited}}, LineSpacing->{1.25, 0}, FontSize->9, Background->None] }, Closed]], Cell[TextData[{ "Message cells are sometimes generated by the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel during evaluation. To follow Input cell style, precede Output \ cell style." }], "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Message"], CellFrame->{{0.25, 0.25}, {0, 0}}, CellDingbat->"\[WarningSign]", CellMargins->{{67, 24}, {0, 0}}, CellGroupingRules->"OutputGrouping", PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{23, Inherited}, {Inherited, Inherited}}, CellFrameColor->GrayLevel[0.869993], CellFrameLabelMargins->-9, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->10, FontColor->RGBColor[0, 0, 1], Background->GrayLevel[0.949996]], Cell[StyleData["Message", "Presentation"], FontSize->12], Cell[StyleData["Message", "Printout"], CellFrame->True, CellDingbat->None, CellMargins->{{96, 72}, {2, 4}}, PrivateEvaluationOptions->{"OutputFormPageWidth"->342}, CellFrameMargins->4, CellFrameColor->GrayLevel[0], LineSpacing->{0, 10}, FontSize->8, FontColor->GrayLevel[0], Background->None] }, Closed]], Cell[TextData[{ "Print cells are usually generated by the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel from such commands as ?Plot." }], "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Print"], CellFrame->True, CellMargins->{{67, 24}, {0, 0}}, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{23, Inherited}, {Inherited, Inherited}}, CellFrameColor->GrayLevel[0], DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, StyleMenuListing->None, FontSize->10], Cell[StyleData["Print", "Presentation"], FontSize->12], Cell[StyleData["Print", "Printout"], CellFrame->True, CellMargins->{{96, 72}, {2, 4}}, PrivateEvaluationOptions->{"OutputFormPageWidth"->342}, CellFrameMargins->4, CellFrameColor->GrayLevel[0], LineSpacing->{0, 11}, FontSize->9, Background->None] }, Closed]], Cell["\<\ Graphics cell usually output by kernel. To be preceded by Input \ cell, followed by Output cell.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Graphics"], CellFrame->{{0.25, 0.25}, {0, 0}}, CellMargins->{{67, 24}, {0, 0}}, CellGroupingRules->"GraphicsGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->True, CellLabelPositioning->Left, CellLabelAutoDelete->True, CellFrameColor->GrayLevel[0.869993], DefaultFormatType->DefaultOutputFormatType, FormatType->InputForm, ImageMargins->{{30, 0}, {0, 0}}, StyleMenuListing->None, Background->GrayLevel[0.949996]], Cell[StyleData["Graphics", "Presentation"]], Cell[StyleData["Graphics", "Printout"], CellFrame->False, CellMargins->{{96, 72}, {8, 10}}, LineSpacing->{0, 12}, ImageSize->{144, 144}, Background->None] }, Closed]], Cell["\<\ GraphicsOnly cell to follow Input cell, not followed by Output \ cell. Set Graphics cell to GraphicsOnly cell manually.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["GraphicsOnly"], CellFrame->{{0.25, 0.25}, {0.25, 0}}, CellMargins->{{67, 24}, {10, 0}}, CellGroupingRules->"GraphicsGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->True, CellLabelPositioning->Left, CellLabelAutoDelete->True, CellFrameColor->GrayLevel[0.869993], DefaultFormatType->DefaultOutputFormatType, FormatType->InputForm, ImageMargins->{{30, 0}, {0, 0}}, Background->GrayLevel[0.949996]], Cell[StyleData["GraphicsOnly", "Presentation"]], Cell[StyleData["GraphicsOnly", "Printout"], CellFrame->False, CellMargins->{{96, 72}, {8, 10}}, LineSpacing->{0, 12}, ImageSize->{144, 144}, FontSize->10, Background->None] }, Closed]], Cell["\<\ PictureGroup cell style used to group graphic cells that comprise \ an animation.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["PictureGroup"], CellFrame->{{0.25, 0.25}, {0.25, 0}}, CellMargins->{{67, 17}, {0, 0}}, CellGroupingRules->"GraphicsGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, ShowCellLabel->True, CellLabelAutoDelete->True, CellFrameColor->GrayLevel[0.869993], DefaultFormatType->DefaultOutputFormatType, FormatType->InputForm, ImageMargins->{{30, 0}, {0, 0}}, StyleMenuListing->None, Background->GrayLevel[0.949996]], Cell[StyleData["PictureGroup", "Presentation"]], Cell[StyleData["PictureGroup", "Printout"], CellFrame->False, CellMargins->{{96, 72}, {8, 10}}, LineSpacing->{0, 12}, ImageSize->{144, 144}, FontSize->10, Background->None] }, Closed]], Cell[TextData[{ "PlacedGraphics cell style to be used when importing a graphic from \ another application or when presenting a graphic not associated with ", StyleBox["Mathematica", FontSlant->"Italic"], " input. May be followed by NumberedFigureCaption." }], "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["PlacedGraphics"], CellFrame->False, CellMargins->{{67, 24}, {10, 10}}, CellGroupingRules->"GraphicsGrouping", CellHorizontalScrolling->True, ShowCellLabel->False, CellLabelAutoDelete->True, TextAlignment->Center], Cell[StyleData["PlacedGraphics", "Presentation"]], Cell[StyleData["PlacedGraphics", "Printout"], CellMargins->{{72, 72}, {8, 10}}, LineSpacing->{0, 12}, FontSize->10, Background->None] }, Closed]], Cell["\<\ CellLabel style definition controls how labels appear when a cell \ has ShowCellLabels->True.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["CellLabel"], CellMargins->{{5, Inherited}, {Inherited, Inherited}}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->8, FontSlant->"Oblique", FontColor->RGBColor[0.115343, 0.350561, 0.362966]], Cell[StyleData["CellLabel", "Presentation"], FontSize->10, FontColor->RGBColor[0.115343, 0.350561, 0.362966]], Cell[StyleData["CellLabel", "Printout"], LineSpacing->{1, 0}, FontSize->6, FontColor->GrayLevel[0]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Automatic Numbering and Lists", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell["\<\ NumberedEquation is for DisplayFormula cells that number \ sequentially throughout a notebook. Sets as \ DefaultFormatType->TraditionalForm.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["NumberedEquation"], CellMargins->{{67, 24}, {5, 10}}, PageBreakAbove->False, CellFrameLabels->{{None, Cell[ TextData[ {"(", CounterBox[ "NumberedEquation"], ")"}]]}, {None, None}}, DefaultFormatType->TraditionalForm, TextAlignment->Center, SingleLetterItalics->True, SpanMaxSize->Infinity, CounterIncrements->"NumberedEquation", FormatTypeAutoConvert->False, FontFamily->"Times", FontSize->12, UnderoverscriptBoxOptions->{LimitsPositioning->True}, GridBoxOptions->{AllowScriptLevelChange->False}], Cell[StyleData["NumberedEquation", "Presentation"], FontSize->14], Cell[StyleData["NumberedEquation", "Printout"], CellMargins->{{72, 72}, {2, 4}}, PrivateEvaluationOptions->{"OutputFormPageWidth"->342}, FontSize->10] }, Closed]], Cell["\<\ NumberedFigureCaption to be used directly after a PlacedGraphic \ cell. Use the TMJStyles.nb palette to begin the cell and paste in the word \ \"Figure\" and the NumberedFigure counter value. Allows for a descriptive \ caption.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["NumberedFigureCaption"], CellDingbat->"\[FilledUpTriangle]", CellMargins->{{67, 24}, {8, 10}}, PageBreakAbove->False, CellLabelPositioning->Left, TextAlignment->Left, CounterIncrements->"NumberedFigure", FormatTypeAutoConvert->False, FontFamily->"Helvetica", FontSize->10], Cell[StyleData["NumberedFigureCaption", "Presentation"]], Cell[StyleData["NumberedFigureCaption", "Printout"], CellDingbat->None, CellMargins->{{72, 72}, {18, 4}}, LineSpacing->{0, 11}, FontSize->9] }, Closed]], Cell["\<\ NumberedTableCaption to be used directly after a Table cell. Use \ the TMJStyles.nb palette to begin the cell and paste in the word \"Table\" \ and the NumberedTable counter value. Allows for a descriptive caption.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["NumberedTableCaption"], CellDingbat->"\[FilledUpTriangle]", CellMargins->{{67, 24}, {8, 10}}, PageBreakAbove->False, CounterIncrements->"NumberedTable", FontFamily->"Helvetica", FontSize->10], Cell[StyleData["NumberedTableCaption", "Presentation"]], Cell[StyleData["NumberedTableCaption", "Printout"], CellDingbat->None, CellMargins->{{72, 72}, {18, 4}}, LineSpacing->{0, 11}, FontSize->9] }, Closed]], Cell["\<\ NumberedProgramCaption to be used directly after a Program cell. \ Use the TMJStyles.nb palette to begin the cell and paste in the word \ \"Listing\" and the NumberedProgram counter value. Allows for a descriptive \ caption.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["NumberedProgramCaption"], CellDingbat->"\[FilledUpTriangle]", CellMargins->{{67, 24}, {8, 10}}, PageBreakAbove->False, CounterIncrements->"NumberedProgram", FormatTypeAutoConvert->False, FontFamily->"Helvetica", FontSize->10], Cell[StyleData["NumberedProgramCaption", "Presentation"]], Cell[StyleData["NumberedProgramCaption", "Printout"], CellDingbat->None, CellMargins->{{72, 72}, {18, 4}}, LineSpacing->{0, 11}, FontSize->9] }, Closed]], Cell["\<\ Use of Caption style by itself should be discouraged. See cell \ styles for NumberedFigureCaption, NumberedTableCaption, \ NumberedProgramCaption and the TMJStyles.nb palette.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Caption"], CellDingbat->"\[FilledUpTriangle]", CellMargins->{{67, 24}, {Inherited, 5}}, PageBreakAbove->False, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->10], Cell[StyleData["Caption", "Presentation"]], Cell[StyleData["Caption", "Printout"], CellDingbat->None, CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 11}, FontSize->9] }, Closed]], Cell["\<\ BulletedList is an optional style. Adds a CellDingbat of \ FilledSmallCircle. Text indents left a little more.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["BulletedList"], CellDingbat->"\[FilledSmallCircle]", CellMargins->{{104, 24}, {Inherited, Inherited}}, FontFamily->"Times", FontSize->12], Cell[StyleData["BulletedList", "Presentation"]], Cell[StyleData["BulletedList", "Printout"], CellMargins->{{109, 72}, {2, Inherited}}, LineSpacing->{0, 12}, FontSize->10] }, Closed]], Cell["\<\ BeginNumberedList to be used as the first item in a numbered list \ sequence. Use the TMJStyles.nb palette to begin the cell and paste in the \ List counter value.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["BeginNumberedList"], CellMargins->{{79, 24}, {Inherited, Inherited}}, ParagraphIndent->-24, CounterIncrements->"List", CounterAssignments->{{"List", 0}}, FontFamily->"Times", FontSize->12], Cell[StyleData["BeginNumberedList", "Presentation"], ParagraphIndent->-31], Cell[StyleData["BeginNumberedList", "Printout"], CellMargins->{{85, 72}, {2, Inherited}}, LineSpacing->{0, 12}, ParagraphIndent->-24, FontSize->10] }, Open ]], Cell["\<\ NumberedList to be used for subsequent items in a numbered list \ sequence with a single-digit label. Use the TMJstyles.nb palette to begin the \ cell and paste in the List counter value.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["NumberedList"], CellMargins->{{79, 24}, {Inherited, Inherited}}, ParagraphIndent->-24, CounterIncrements->"List", FontFamily->"Times", FontSize->12], Cell[StyleData["NumberedList", "Presentation"]], Cell[StyleData["NumberedList", "Printout"], CellMargins->{{85, 72}, {2, Inherited}}, LineSpacing->{0, 12}, ParagraphIndent->-24, FontSize->10] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["NolabelList"], CellMargins->{{103, 10}, {Inherited, Inherited}}, FontFamily->"Times", FontSize->12], Cell[StyleData["NolabelList", "Presentation"]], Cell[StyleData["NolabelList", "Printout"], CellMargins->{{109, 72}, {2, Inherited}}, LineSpacing->{0, 12}, ParagraphIndent->0, FontSize->10] }, Closed]], Cell["\<\ BeginSubList to be used as the first item in a lettered list \ sequence used as a subitem to a NumberedList item. Use the TMJStyles.nb \ palette to begin the cell and paste in the SubList counter value. Sets \ SubList counter to 0.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["BeginSubList"], CellMargins->{{95, 10}, {Inherited, Inherited}}, ParagraphIndent->-24, CounterIncrements->"SubList", CounterAssignments->{{"SubList", 0}}, FontFamily->"Times", FontSize->12, CounterBoxOptions->{CounterFunction:>(Part[ CharacterRange[ "a", "z"], #]&)}], Cell[StyleData["BeginSubList", "Presentation"]], Cell[StyleData["BeginSubList", "Printout"], CellMargins->{{85, 72}, {2, Inherited}}, LineSpacing->{0, 12}, ParagraphIndent->-24, FontSize->10] }, Closed]], Cell["\<\ SubList to be used as subsequent items in a lettered list \ sequence used as a subitem to a NumberedList item. Use the TMJStyles.nb \ palette to begin the cell and paste in the SubList counter value. Increments \ SubList counter.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["SubList"], CellMargins->{{95, 10}, {Inherited, Inherited}}, ParagraphIndent->-24, CounterIncrements->"SubList", FontFamily->"Times", FontSize->12, CounterBoxOptions->{CounterFunction:>(Part[ CharacterRange[ "a", "z"], #]&)}], Cell[StyleData["SubList", "Presentation"]], Cell[StyleData["SubList", "Printout"], CellMargins->{{85, 72}, {2, Inherited}}, LineSpacing->{0, 12}, ParagraphIndent->-24, FontSize->10] }, Closed]], Cell["\<\ Reference style to be used in the bibliography portion of a \ notebook. One cell for each bibliography entry. Use the TMJStyles.nb palette \ to begin cell and paste in the Reference counter value. Use Inline style SB \ for bold font changes. Use Inline style SO for italic font changes.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Reference"], CellMargins->{{79, 25}, {Inherited, Inherited}}, ParagraphIndent->-24, CounterIncrements->"Reference", FontFamily->"Helvetica", FontSize->10], Cell[StyleData["Reference", "Presentation"], ParagraphIndent->-25], Cell[StyleData["Reference", "Printout"], CellMargins->{{85, 72}, {2, 4}}, LineSpacing->{0, 10}, ParagraphIndent->-24, FontSize->8] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Journal Element Styles", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell["\<\ OnlineHeader to be used at the beginning of a notebook. Precedes \ the Title cell.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["OnlineHeader"], ShowCellBracket->False, ShowSelection->True, CellMargins->{{0, 25}, {0, 0}}, CellGroupingRules->{"TitleGrouping", 30}, PageBreakBelow->False, CellFrameMargins->{{54, 4}, {2, 8}}, LineSpacing->{1, 1}, StyleMenuListing->None, FontFamily->"Times", FontSize->12, FontWeight->"Plain", FontSlant->"Italic", FontColor->GrayLevel[1], Background->RGBColor[0.725383, 0.0545968, 0.0770581]], Cell[StyleData["OnlineHeader", "Presentation"], FontSize->14], Cell[StyleData["OnlineHeader", "Printout"], PageWidth->PaperWidth, CellFrame->False, CellMargins->{{72, 72}, {0, 0}}, FontSize->10, FontColor->GrayLevel[0], Background->None] }, Closed]], Cell["\<\ Cell Style PreTitle to be used for such things that precede a \ title as in EDITOR'S PICK. Should be entered all caps with a space between \ each letter, two spaces between words. FontTracking is set to Wide.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["PreTitle"], ShowCellBracket->False, CellMargins->{{54, 25}, {Inherited, 0}}, CellGroupingRules->{"TitleGrouping", 0}, PageBreakBelow->False, CellFrameMargins->{{55, 4}, {8, 20}}, LineSpacing->{1.125, 0}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->14, FontWeight->"Bold"], Cell[StyleData["PreTitle", "Presentation"]], Cell[StyleData["PreTitle", "Printout"], CellMargins->{{72, 72}, {14, 0}}, CellFrameMargins->False, FontSize->12, FontColor->GrayLevel[0], Background->None] }, Closed]], Cell["\<\ Author to be used after the Title cell with author name(s). \ Author name(s) may be preceded by \"Edited by \" for certain columns. Text in \ author cell to be used as the left page header. Usually followed by an \ Address cell.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Author"], ShowCellBracket->False, ShowSelection->True, CellMargins->{{54, 24}, {4, 0}}, CellGroupingRules->"NormalGrouping", PageBreakBelow->False, FontFamily->"Helvetica", FontSize->14, FontWeight->"Bold", FontSlant->"Plain"], Cell[StyleData["Author", "Presentation"], FontSize->16], Cell[StyleData["Author", "Printout"], CellMargins->{{72, 72}, {4, 4}}, LineSpacing->{0, 14}, FontSize->12] }, Closed]], Cell["\<\ Abstract to be used after the Author cell. Contains a short \ summary of the article.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Abstract"], ShowCellBracket->False, ShowSelection->True, CellMargins->{{54, 86}, {4, 25}}, LineSpacing->{1, 3}, FontFamily->"Times", FontSize->14, FontWeight->"Bold", FontSlant->"Plain"], Cell[StyleData["Abstract", "Presentation"], FontSize->16], Cell[StyleData["Abstract", "Printout"], CellMargins->{{72, 72}, {Inherited, 2}}, LineSpacing->{0, 12}, FontSize->10, FontWeight->"Bold", FontSlant->"Plain"] }, Closed]], Cell["\<\ BeginQuestion is used in the In and Out column directly after a \ section cell. Followed by either Question or Input, InputOnly, etc. Last \ paragraph of the question should be in EndQuestion cell style.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["BeginQuestion"], CellFrame->{{0, 0}, {0, 2}}, CellDingbat->"Q:", CellMargins->{{89, 34}, {8, 8}}, CellFrameMargins->{{0, 0}, {2, 4}}, LineSpacing->{1, 2}, FontFamily->"Times", FontSize->14, FontWeight->"Bold", FontColor->RGBColor[0.115511, 0.321752, 0.580118]], Cell[StyleData["BeginQuestion", "Presentation"]], Cell[StyleData["BeginQuestion", "Printout"], PageWidth->PaperWidth, CellFrame->{{0, 0}, {0, 2}}, CellMargins->{{72, 72}, {4, 16}}, LineSpacing->{0, 12}, FontSize->10, FontWeight->"Plain", FontColor->GrayLevel[0]] }, Closed]], Cell["\<\ Question used for text cells within the Question portion of a \ QuestionAnswer.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Question"], CellMargins->{{89, 34}, {8, 8}}, LineSpacing->{1, 2}, FontFamily->"Times", FontSize->14, FontWeight->"Bold", FontColor->RGBColor[0.115511, 0.321752, 0.580118]], Cell[StyleData["Question", "Presentation"]], Cell[StyleData["Question", "Printout"], PageWidth->PaperWidth, CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 12}, FontSize->10, FontWeight->"Plain", FontColor->GrayLevel[0]] }, Closed]], Cell["\<\ EndQuestion used in the In and Out column as the last paragraph \ of the question.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["EndQuestion"], CellFrame->{{0, 0}, {2, 0}}, CellMargins->{{89, 35}, {8, 8}}, LineSpacing->{1, 2}, FontFamily->"Times", FontSize->14, FontWeight->"Bold", FontColor->RGBColor[0.115511, 0.321752, 0.580118]], Cell[StyleData["EndQuestion", "Presentation"]], Cell[StyleData["EndQuestion", "Printout"], CellFrame->{{0, 0}, {2, 0}}, CellMargins->{{72, 72}, {18, 4}}, LineSpacing->{0, 12}, FontSize->10, FontWeight->"Plain", FontColor->GrayLevel[0]] }, Closed]], Cell["\<\ BeginEndQuestion is used in the In and Out column directly after \ a section cell. Used if the question is a single text paragraph.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["BeginEndQuestion"], CellFrame->{{0, 0}, {2, 2}}, CellDingbat->"Q:", CellMargins->{{89, 35}, {8, 8}}, LineSpacing->{1, 2}, FontFamily->"Times", FontSize->14, FontWeight->"Bold", FontColor->RGBColor[0.115511, 0.321752, 0.580118]], Cell[StyleData["BeginEndQuestion", "Presentation"]], Cell[StyleData["BeginEndQuestion", "Printout"], CellMargins->{{72, 72}, {18, 14}}, LineSpacing->{0, 12}, FontSize->10, FontWeight->"Plain", FontColor->GrayLevel[0]] }, Closed]], Cell["\<\ BeginAnswer is used in the In and Out column directly after an \ EndQuestion or BeginEndQuestion cell style to begin the answer portion. \ Followed by Text or Input/Output etc.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["BeginAnswer"], CellDingbat->"A:", CellMargins->{{89, 35}, {Inherited, Inherited}}, LineSpacing->{1, 4}, CounterIncrements->"Text", FontFamily->"Times", FontSize->12], Cell[StyleData["BeginAnswer", "Presentation"]], Cell[StyleData["BeginAnswer", "Printout"], CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 12}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Answer"], CellMargins->{{89, 35}, {Inherited, Inherited}}, LineSpacing->{1, 4}, FontFamily->"Times", FontSize->12], Cell[StyleData["Answer", "Presentation"]], Cell[StyleData["Answer", "Printout"], CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 12}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["EditorialComment"], CellFrame->False, CellDingbat->"\[FilledCircle]", CellMargins->{{36, 25}, {Inherited, Inherited}}, LineSpacing->{1, 3}, CounterIncrements->"Text", FontColor->RGBColor[1, 0, 0], Background->GrayLevel[1]], Cell[StyleData["EditorialComment", "Presentation"]], Cell[StyleData["EditorialComment", "Printout"], CellMargins->{{24, 80}, {Inherited, 0}}, LineSpacing->{1, 3}, FontSize->10, FontColor->GrayLevel[0]] }, Closed]], Cell["\<\ SecondAuthor to be used after a Section cell. Author name(s) \ credit a particular portion of a notebook. Used for columns Tech Support and \ Tricks of the Trade. Usually followed by a Text cell with author \ affiliation/email, etc.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["SecondAuthor"], ShowCellBracket->False, ShowSelection->True, CellMargins->{{67, 24}, {Inherited, Inherited}}, CellGroupingRules->"NormalGrouping", PageBreakBelow->False, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->14, FontWeight->"Bold", FontSlant->"Plain"], Cell[StyleData["SecondAuthor", "Presentation"], FontSize->16], Cell[StyleData["SecondAuthor", "Printout"], CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 14}, FontSize->12] }, Closed]], Cell["\<\ SectionAboutAuthor to be used as the section head for the About \ the Author portion of a notebook.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["SectionAboutAuthor"], CellMargins->{{54, 25}, {10, 60}}, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CellFrameMargins->4, FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold"], Cell[StyleData["SectionAboutAuthor", "Presentation"]], Cell[StyleData["SectionAboutAuthor", "Printout"], CellFrame->False, CellMargins->{{72, 72}, {0, 30}}, FontSize->12] }, Closed]], Cell["\<\ TextAboutAuthor is to be used for the text in the About the \ Author portion of a notebook. The last paragraph should be affiliation and \ contact information with author name set in bold.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["TextAboutAuthor"], CellMargins->{{54, 24}, {2, 5}}, LineSpacing->{1, 3}, CounterIncrements->"Text", FontSize->12], Cell[StyleData["TextAboutAuthor", "Presentation"], FontSize->14], Cell[StyleData["TextAboutAuthor", "Printout"], CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 11}, FontSize->9] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subsubsubsection"], CellDingbat->None, CellMargins->{{67, 25}, {6, 20}}, CellGroupingRules->{"SectionGrouping", 60}, PageBreakBelow->False, CounterIncrements->"Subsubsubsection", StyleMenuListing->None, FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold"], Cell[StyleData["Subsubsubsection", "Presentation"]], Cell[StyleData["Subsubsubsection", "Printout"], CellDingbat->None, CellMargins->{{72, 72}, {-4, 2}}, FontSize->9, FontWeight->"Bold", FontSlant->"Plain"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Display Formulas and Programming", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell[CellGroupData[{ Cell[StyleData["DisplayFormula"], CellMargins->{{67, 24}, {4, 4}}, CellHorizontalScrolling->True, PageBreakAbove->False, DefaultFormatType->TraditionalForm, TextAlignment->Center, ScriptLevel->0, SingleLetterItalics->True, SpanMaxSize->Infinity, FormatTypeAutoConvert->False, FontFamily->"Times", FontSize->12, UnderoverscriptBoxOptions->{LimitsPositioning->True}, GridBoxOptions->{AllowScriptLevelChange->False}], Cell[StyleData["DisplayFormula", "Presentation"]], Cell[StyleData["DisplayFormula", "Printout"], CellMargins->{{72, 72}, {2, 4}}, PrivateEvaluationOptions->{"OutputFormPageWidth"->342}, LineSpacing->{1.25, 0}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["ChemicalFormula"], CellMargins->{{67, 24}, {4, 4}}, PageBreakAbove->False, DefaultFormatType->DefaultInputFormatType, AutoSpacing->False, ScriptLevel->1, ScriptBaselineShifts->{0.6, Automatic}, SingleLetterItalics->False, ZeroWidthTimes->False, FontFamily->"Times", FontSize->12], Cell[StyleData["ChemicalFormula", "Presentation"], FontSize->14], Cell[StyleData["ChemicalFormula", "Printout"], CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 12}, FontSize->10] }, Open ]], Cell[TextData[{ "Program cell style to be followed by NumberedProgramCaption. See \ ProgramNoLabel cell style if nonevaluatable source code to be displayed \ (e.g., program listings from a program language other than ", StyleBox["Mathematica", FontSlant->"Italic"], ")." }], "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Program"], CellMargins->{{67, 25}, {Inherited, 6}}, FontFamily->"Courier", FontSize->10, FontWeight->"Plain"], Cell[StyleData["Program", "Presentation"]], Cell[StyleData["Program", "Printout"], CellMargins->{{72, 72}, {2, 18}}, LineSpacing->{0, 11}, FontSize->9] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["ProgramNoLabel"], CellMargins->{{67, 25}, {10, 10}}, FontFamily->"Courier", FontSize->10, FontWeight->"Plain"], Cell[StyleData["ProgramNoLabel", "Presentation"]], Cell[StyleData["ProgramNoLabel", "Printout"], CellMargins->{{72, 72}, {2, 4}}, LineSpacing->{0, 11}, FontSize->9] }, Closed]], Cell["\<\ Table cell style to be used for cells containing displayed \ tabular material. May be followed by NumberedTableCaption cell.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["Table"], CellMargins->{{67, 24}, {5, 10}}, TextAlignment->Center, FontFamily->"Times", FontSize->12, Background->GrayLevel[0.899001]], Cell[StyleData["Table", "Presentation"], FontSize->14], Cell[StyleData["Table", "Printout"], CellMargins->{{72, 72}, {0, 18}}, FontSize->10, Background->None] }, Closed]], Cell["DefinitionBox, 2 left-aligned columns.", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["DefinitionBox"], CellFrame->0.5, CellMargins->{{67, 24}, {8, 10}}, CellHorizontalScrolling->True, AutoIndent->False, AutoSpacing->False, SingleLetterItalics->False, LineIndent->0, FontFamily->"Times", FontSize->12, Background->GrayLevel[0.899001], GridBoxOptions->{RowSpacings->1.5, ColumnSpacings->1, ColumnWidths->{0.4, 0.6}, ColumnAlignments->{Left}}], Cell[StyleData["DefinitionBox", "Presentation"]], Cell[StyleData["DefinitionBox", "Printout"], CellMargins->{{72, 72}, {8, 10}}, FontSize->10, Background->None] }, Closed]], Cell["\<\ PseudoCellExpression cell style to be used when displaying \ unformatted box expressions. \ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["PseudoCellExpression"], CellFrame->{{0, 0}, {0, 0.5}}, CellMargins->{{67, 17}, {Inherited, Inherited}}, CellFrameMargins->2, LineSpacing->{1, 4}, FontFamily->"Courier", FontSize->12], Cell[StyleData["PseudoCellExpression", "Presentation"]], Cell[StyleData["PseudoCellExpression", "Printout"], CellMargins->{{84, 96}, {Inherited, Inherited}}, LineSpacing->{0, 12}, FontSize->10] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headers and Footers", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell[StyleData["Header"], CellMargins->{{0, 0}, {4, 1}}, StyleMenuListing->None, FontFamily->"Times", FontSize->9, FontSlant->"Italic"], Cell[StyleData["PageNumber"], CellMargins->{{0, 0}, {4, 1}}, StyleMenuListing->None, FontFamily->"Times", FontSize->9, FontWeight->"Bold"], Cell[StyleData["Footer"], CellMargins->{{0, 0}, {0, 4}}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->7, FontSlant->"Oblique"] }, Closed]], Cell[CellGroupData[{ Cell["Frontmatter Styles", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell[CellGroupData[{ Cell[StyleData["tocentry"], CellMargins->{{67, 24}, {Inherited, Inherited}}, AutoIndent->True, TabFilling->".", LineSpacing->{1, 4}, FontFamily->"Times", FontSize->12], Cell[StyleData["tocentry", "Presentation"]], Cell[StyleData["tocentry", "Printout"], CellMargins->{{84, 72}, {0, 0}}, LineSpacing->{0, 12}, ParagraphIndent->0, FontSize->10] }, Closed]], Cell["\<\ LetterWriter to be used after a letter. Use inline formatting \ SCBO for person's name. Use Text cell style for letter text.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["LetterWriter"], CellMargins->{{213, Inherited}, {6, 0}}, LineSpacing->{0, 10}, FontFamily->"Helvetica", FontSize->10, FontSlant->"Oblique"], Cell[StyleData["LetterWriter", "Presentation"], LineSpacing->{0, 12}, FontSize->12], Cell[StyleData["LetterWriter", "Printout"], CellMargins->{{250, Inherited}, {6, 0}}, LineSpacing->{0, 8}, FontFamily->"Helvetica", FontSize->8, FontSlant->"Oblique"] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["LetterReply"], CellMargins->{{67, 24}, {Inherited, Inherited}}, LineSpacing->{1, 4}, FontFamily->"Times", FontSize->12, FontSlant->"Italic"], Cell[StyleData["LetterReply", "Presentation"], FontSize->14], Cell[StyleData["LetterReply", "Printout"], CellMargins->{{72, 72}, {8, 4}}, LineSpacing->{0, 12}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["IndexEntry"], CellMargins->{{67, 24}, {Inherited, Inherited}}, LineSpacing->{1, 4}, FontFamily->"Times", FontSize->12], Cell[StyleData["IndexEntry", "Presentation"], FontSize->14], Cell[StyleData["IndexEntry", "Printout"], PageWidth->336, CellMargins->{{72, 72}, {0, 0}}, AutoIndent->True, LineSpacing->{0, 10}, ParagraphIndent->-27, TabSpacings->1, FontSize->8] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Classified"], CellFrame->{{0, 0}, {0, 2}}, CellMargins->{{67, 24}, {Inherited, Inherited}}, CellFrameMargins->False, LineSpacing->{1, 4}, FontFamily->"Helvetica", FontSize->12], Cell[StyleData["Classified", "Presentation"], FontSize->14], Cell[StyleData["Classified", "Printout"], CellMargins->{{72, 24}, {Inherited, 0}}, LineSpacing->{1, 3}, FontSize->10] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Hyperlink Styles", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell["The cells below define styles used for ButtonBoxes.", "Text"], Cell[CellGroupData[{ Cell[StyleData["Hyperlink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[1, 0, 0], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookLocate[ #2]}]&), Active->True, ButtonNote->ButtonData}], Cell[StyleData["Hyperlink", "Presentation"]], Cell[StyleData["Hyperlink", "Printout"], FontColor->GrayLevel[0]] }, Closed]], Cell["\<\ The following styles are for linking automatically to the locally \ installed on-line help system.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["MainBookLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[1, 0, 0], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "MainBook", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["MainBookLink", "Presentation"]], Cell[StyleData["MainBookLink", "Printout"], FontColor->GrayLevel[0]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["AddOnsLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[1, 0, 0], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "AddOns", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["AddOnsLink", "Presentation"]], Cell[StyleData["AddOnsLink", "Printout"], FontColor->GrayLevel[0]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["RefGuideLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[1, 0, 0], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "RefGuide", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["RefGuideLink", "Presentation"]], Cell[StyleData["RefGuideLink", "Printout"], FontColor->GrayLevel[0]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["GettingStartedLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[1, 0, 0], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "GettingStarted", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["GettingStartedLink", "Presentation"]], Cell[StyleData["GettingStartedLink", "Printout"], FontColor->GrayLevel[0]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["OtherInformationLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[1, 0, 0], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "OtherInformation", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["OtherInformationLink", "Presentation"]], Cell[StyleData["OtherInformationLink", "Printout"], FontColor->GrayLevel[0]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["FormatType Styles", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell["\<\ These cells define styles that are mixed in with other cells. If \ the FormatType of a cell style matches the name of one of the styles defined \ below, then that style is applied along with the local cell style \ definitions. \ \>", "Text"], Cell[StyleData["CellExpression"], CellMargins->{{54, 24}, {2, 4}}, ShowCellLabel->False, ShowSpecialCharacters->False, AllowInlineCells->False, Hyphenation->False, AutoItalicWords->{}, StyleMenuListing->None, FontFamily->"Courier", FontSize->12, Background->GrayLevel[1]], Cell[StyleData["InputForm"], AllowInlineCells->False, Hyphenation->False, LineSpacing->{1.25, 0}, StyleMenuListing->None, FontFamily->"Courier", FontProperties->{"FontSerifed"->True, "FontMonospaced"->True}], Cell[StyleData["OutputForm"], LineSpacing->{1.25, 0}, StyleMenuListing->None, FontFamily->"Courier", FontProperties->{"FontSerifed"->True, "FontMonospaced"->True}], Cell[StyleData["StandardForm"], LineSpacing->{1.25, 0}, SingleLetterItalics->False, StyleMenuListing->None, FontFamily->"Courier", FontProperties->{"FontSerifed"->True, "FontMonospaced"->True}], Cell[StyleData["TraditionalForm"], LineSpacing->{1.25, 0}, SingleLetterItalics->True, TraditionalFunctionNotation->True, DelimiterMatching->None, ZeroWidthTimes->False, StyleMenuListing->None, FontFamily->"Times", FontProperties->{"FontSerifed"->True, "FontMonospaced"->False}], 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]], Cell[CellGroupData[{ Cell["Inline Formatting", "Section", CellFrame->False, CellDingbat->None, ShowCellBracket->True, CellMargins->{{0, 0}, {10, 40}}, CellFrameMargins->{{20, 4}, {8, 8}}, FontColor->GrayLevel[1], Background->RGBColor[0.269902, 0.558434, 0.715618]], Cell["\<\ InlineInput is for Input and Output code segments embedded within \ another cell. Sets as FormatType->DefaultInputFormatType.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["InlineInput"], Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, AutoItalicWords->{}, FormatType->DefaultInputFormatType, ShowStringCharacters->True, NumberMarks->True, FontFamily->"Courier"], Cell[StyleData["InlineInput", "Presentation"]], Cell[StyleData["InlineInput", "Printout"]] }, Open ]], Cell["\<\ InlineInputTraditionalForm is for code segments embedded within \ another cell for articles that set Default Input/Output FormatType to \ TraditionalForm. Sets FormatType->TraditionalForm.\ \>", "EditorialComment"], Cell[CellGroupData[{ Cell[StyleData["InlineInputTraditionalForm"], CellHorizontalScrolling->True, FormatType->TraditionalForm, ShowStringCharacters->True, NumberMarks->True, SingleLetterItalics->True, ZeroWidthTimes->False, FontFamily->"Times"], Cell[StyleData["InlineInputTraditionalForm", "Presentation"]], Cell[StyleData["InlineInputTraditionalForm", "Printout"]] }, Open ]], Cell["\<\ The following styles are for modifying individual words or \ letters in a cell exclusive of the cell style.\ \>", "EditorialComment"], Cell["\<\ RM used to change selection to FontWeight->Plain, \ FontSlant->Plain\ \>", "EditorialComment"], Cell[StyleData["RM"], FontWeight->"Plain", FontSlant->"Plain"], Cell["\<\ BF used to change selection to FontWeight->Bold, FontSlant->Plain\ \ \>", "EditorialComment"], Cell[StyleData["BF"], FontWeight->"Bold", FontSlant->"Plain"], Cell["\<\ IT used to change selection to FontWeight->Plain, \ FontSlant->Italic\ \>", "EditorialComment"], Cell[StyleData["IT"], FontWeight->"Plain", FontSlant->"Italic"], Cell["\<\ BFI used to change selection to FontWeight->Bold, \ FontSlant->Italic\ \>", "EditorialComment"], Cell[StyleData["BFI"], FontWeight->"Bold", FontSlant->"Italic"], Cell["\<\ TR used to change selection to normal text font, \ FontWeight->Plain, FontSlant->Plain\ \>", "EditorialComment"], Cell[StyleData["TR"], FontFamily->"Times", FontWeight->"Plain", FontSlant->"Plain"], Cell["\<\ TI used to change selection to normal text font, \ FontWeight->Plain, FontSlant->Italic\ \>", "EditorialComment"], Cell[StyleData["TI"], FontFamily->"Times", FontWeight->"Plain", FontSlant->"Italic"], Cell["\<\ TB used to change selection to normal text font, \ FontWeight->Bold, FontSlant->Plain\ \>", "EditorialComment"], Cell[StyleData["TB"], FontFamily->"Times", FontWeight->"Bold", FontSlant->"Plain"], Cell["\<\ TBI used to change selection to normal text font, \ FontWeight->Bold, FontSlant->Italic\ \>", "EditorialComment"], Cell[StyleData["TBI"], FontFamily->"Times", FontWeight->"Bold", FontSlant->"Italic"], Cell["MR used to change selection to monospace font", "EditorialComment"], Cell[StyleData["MR"], HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, StyleMenuListing->None, FontFamily->"Courier", FontSlant->"Plain"], Cell["\<\ MO used to change selection to monospace font with \ FontSlant->Oblique\ \>", "EditorialComment"], Cell[StyleData["MO"], HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, StyleMenuListing->None, FontFamily->"Courier", FontSlant->"Oblique"], Cell["\<\ MB used to change selection to monospace font with \ FontWeight->Bold, FontSlant->Plain for display elements, e.g., labelling \ plots with emphasis\ \>", "EditorialComment"], Cell[StyleData["MB"], HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, StyleMenuListing->None, FontFamily->"Courier", FontWeight->"Bold", FontSlant->"Plain"], Cell["\<\ MBO used to change selection to monospace font with \ FontWeight->Bold, FontSlant->Oblique\ \>", "EditorialComment"], Cell[StyleData["MBO"], HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, StyleMenuListing->None, FontFamily->"Courier", FontWeight->"Bold", FontSlant->"Oblique"], Cell["\<\ SR used to change selection to sans serif font with \ FontWeight->Plain, FontSlant->Plain\ \>", "EditorialComment"], Cell[StyleData["SR"], FontFamily->"Helvetica", FontWeight->"Plain", FontSlant->"Plain"], Cell["\<\ SO used to change selection to sans serif font with \ FontWeight->Plain, FontSlant->Oblique\ \>", "EditorialComment"], Cell[StyleData["SO"], FontFamily->"Helvetica", FontWeight->"Plain", FontSlant->"Oblique"], Cell["\<\ SB used to change selection to sans serif font with \ FontWeight->Bold, FontSlant->Plain\ \>", "EditorialComment"], Cell[StyleData["SB"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Plain"], Cell["\<\ SBO used to change selection to sans serif font with \ FontWeight->Bold, FontSlant->Oblique\ \>", "EditorialComment"], Cell[StyleData["SBO"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Oblique"], Cell["\<\ SCL used to change selection to sans serif font \ (FontTracking->\"Condensed\", FontWeight->\"Light\")\ \>", "EditorialComment"], Cell[StyleData["SCL"], FontFamily->"Helvetica", FontWeight->"Light", FontTracking->"Condensed"], Cell["\<\ SCLO used to change selection to sans serif font \ (FontSlant->\"Oblique\", FontTracking->\"Condensed\", \ FontWeight->\"Light\")\ \>", "EditorialComment"], Cell[StyleData["SCLO"], FontFamily->"Helvetica", FontWeight->"Light", FontSlant->"Oblique", FontTracking->"Condensed"], Cell["\<\ SCB used to change selection to sans serif font \ (FontWeight->\"Bold\", FontTracking->\"Condensed\")\ \>", "EditorialComment"], Cell[StyleData["SCB"], FontFamily->"Helvetica", FontWeight->"Bold", FontTracking->"Condensed"], Cell["\<\ SCBO used to change selection to sans serif font \ (FontWeight->\"Bold\", FontSlant->\"Oblique\", FontTracking->\"Condensed\")\ \ \>", "EditorialComment"], Cell[StyleData["SCBO"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Oblique", FontTracking->"Condensed"], Cell["\<\ SXR used to change selection to sans serif font \ (FontWeight->\"ExtraBold\", FontTracking->\"Condensed\")\ \>", "EditorialComment"], Cell[StyleData["SXR"], FontFamily->"Helvetica", FontWeight->"ExtraBold", FontTracking->"Condensed"], Cell["\<\ SXO used to change selection to sans serif font \ (FontWeight->\"ExtraBold\", FontSlant->\"Oblique\", FontTracking->\"Condensed\ \")\ \>", "EditorialComment"], Cell[StyleData["SXO"], FontFamily->"Helvetica", FontWeight->"ExtraBold", FontSlant->"Oblique", FontTracking->"Condensed"] }, 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->{ "Info3276155588-6859234"->{ Cell[10662, 356, 353, 9, 29, "Print", CellTags->"Info3276155588-6859234"]}, "Info3276155588-2764254"->{ Cell[15749, 484, 503, 11, 43, "Print", CellTags->"Info3276155588-2764254"]}, "Info3276155589-2657043"->{ Cell[20874, 669, 456, 11, 43, "Print", CellTags->"Info3276155589-2657043"]}, "Info3276155590-5352541"->{ Cell[21882, 703, 502, 11, 43, "Print", CellTags->"Info3276155590-5352541"]}, "Info3276155590-7972361"->{ Cell[24965, 836, 422, 10, 43, "Print", CellTags->"Info3276155590-7972361"]}, "Vardi1991"->{ Cell[49401, 1634, 358, 14, 21, "Reference", CellTags->"Vardi1991"]}, "Graham1989"->{ Cell[49762, 1650, 371, 14, 21, "Reference", CellTags->"Graham1989"]}, "Trott2003"->{ Cell[50136, 1666, 356, 14, 21, "Reference", CellTags->"Trott2003"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Info3276155588-6859234", 121724, 4254}, {"Info3276155588-2764254", 121840, 4257}, {"Info3276155589-2657043", 121957, 4260}, {"Info3276155590-5352541", 122074, 4263}, {"Info3276155590-7972361", 122191, 4266}, {"Vardi1991", 122295, 4269}, {"Graham1989", 122392, 4272}, {"Trott2003", 122489, 4275} } *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 146, 6, 26, "OnlineHeader"], Cell[CellGroupData[{ Cell[1925, 61, 53, 0, 57, "Title"], Cell[1981, 63, 35, 0, 22, "Author"], Cell[2019, 65, 600, 14, 89, "Abstract"], Cell[CellGroupData[{ Cell[2644, 83, 106, 5, 58, "SectionFirst"], Cell[2753, 90, 691, 15, 58, "Text"], Cell[3447, 107, 210, 6, 54, "BeginEndQuestion"], Cell[3660, 115, 133, 3, 24, "Text"], Cell[3796, 120, 81, 1, 51, "InputOnly"], Cell[CellGroupData[{ Cell[3902, 125, 42, 1, 40, "Input"], Cell[3947, 128, 78, 1, 41, "Output"] }, Open ]], Cell[4040, 132, 299, 7, 42, "Text"], Cell[CellGroupData[{ Cell[4364, 143, 90, 1, 40, "Input"], Cell[4457, 146, 88, 1, 41, "Output"] }, Open ]], Cell[4560, 150, 178, 4, 24, "Text"], Cell[4741, 156, 148, 3, 51, "InputOnly"], Cell[CellGroupData[{ Cell[4914, 163, 54, 1, 40, "Input"], Cell[4971, 166, 182, 3, 41, "Output"] }, Open ]], Cell[5168, 172, 638, 10, 56, "Text"], Cell[5809, 184, 130, 3, 51, "InputOnly"], Cell[CellGroupData[{ Cell[5964, 191, 55, 1, 40, "Input"], Cell[6022, 194, 182, 3, 41, "Output"] }, Open ]], Cell[6219, 200, 151, 3, 24, "Text"], Cell[6373, 205, 63, 1, 51, "InputOnly"], Cell[CellGroupData[{ Cell[6461, 210, 61, 1, 40, "Input"], Cell[6525, 213, 56, 1, 41, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6618, 219, 62, 1, 40, "Input"], Cell[6683, 222, 55, 1, 41, "Output"] }, Open ]], Cell[6753, 226, 770, 14, 73, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[7560, 245, 109, 5, 58, "Section"], Cell[7672, 252, 546, 13, 42, "Text"], Cell[8221, 267, 253, 6, 72, "BeginEndQuestion"], Cell[8477, 275, 67, 0, 24, "Text"], Cell[8547, 277, 306, 6, 83, "InputOnly"], Cell[8856, 285, 35, 0, 24, "Text"], Cell[CellGroupData[{ Cell[8916, 289, 80, 1, 40, "Input"], Cell[8999, 292, 36, 1, 41, "Output"] }, Open ]], Cell[9050, 296, 333, 8, 42, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[9420, 309, 137, 7, 58, "Section"], Cell[9560, 318, 690, 19, 58, "Text"], Cell[10253, 339, 122, 2, 22, "DisplayFormula"], Cell[10378, 343, 196, 6, 26, "Text"], Cell[CellGroupData[{ Cell[10599, 353, 60, 1, 40, "Input"], Cell[10662, 356, 353, 9, 29, "Print", CellTags->"Info3276155588-6859234"] }, Open ]], Cell[11030, 368, 222, 7, 25, "Text"], Cell[11255, 377, 359, 6, 83, "InputOnly"], Cell[CellGroupData[{ Cell[11639, 387, 55, 1, 40, "Input"], Cell[11697, 390, 828, 11, 121, "Output"] }, Open ]], Cell[12540, 404, 633, 14, 58, "Text"], Cell[13176, 420, 104, 2, 51, "InputOnly"], Cell[CellGroupData[{ Cell[13305, 426, 56, 1, 40, "Input"], Cell[13364, 429, 828, 11, 121, "Output"] }, Open ]], Cell[14207, 443, 770, 14, 76, "Text"], Cell[14980, 459, 694, 18, 59, "Text"], Cell[CellGroupData[{ Cell[15699, 481, 47, 1, 40, "Input"], Cell[15749, 484, 503, 11, 43, "Print", CellTags->"Info3276155588-2764254"] }, Open ]], Cell[16267, 498, 612, 12, 58, "Text"], Cell[16882, 512, 53, 1, 51, "InputOnly"], Cell[CellGroupData[{ Cell[16960, 517, 61, 1, 40, "Input"], Cell[17024, 520, 38, 1, 41, "Output"] }, Open ]], Cell[17077, 524, 133, 6, 25, "Text"], Cell[CellGroupData[{ Cell[17235, 534, 47, 1, 40, "Input"], Cell[17285, 537, 73, 1, 41, "Output"] }, Open ]], Cell[17373, 541, 67, 0, 24, "Text"], Cell[CellGroupData[{ Cell[17465, 545, 59, 1, 40, "Input"], Cell[17527, 548, 40, 1, 41, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17604, 554, 59, 1, 40, "Input"], Cell[17666, 557, 35, 1, 41, "Output"] }, Open ]], Cell[17716, 561, 969, 29, 57, "Text"], Cell[18688, 592, 236, 6, 67, "InputOnly"], Cell[18927, 600, 104, 3, 24, "Text"], Cell[CellGroupData[{ Cell[19056, 607, 96, 2, 56, "Input"], Cell[19155, 611, 39, 1, 41, "Output"], Cell[19197, 614, 342, 5, 29, "Message"], Cell[19542, 621, 39, 1, 41, "Output"] }, Open ]], Cell[19596, 625, 295, 6, 41, "Text"], Cell[19894, 633, 361, 10, 41, "Text"], Cell[20258, 645, 347, 10, 41, "Text"], Cell[20608, 657, 196, 5, 25, "Text"], Cell[CellGroupData[{ Cell[20829, 666, 42, 1, 40, "Input"], Cell[20874, 669, 456, 11, 43, "Print", CellTags->"Info3276155589-2657043"] }, Open ]], Cell[21345, 683, 460, 13, 44, "Text"], Cell[CellGroupData[{ Cell[21830, 700, 49, 1, 40, "Input"], Cell[21882, 703, 502, 11, 43, "Print", CellTags->"Info3276155590-5352541"] }, Open ]], Cell[22399, 717, 184, 6, 25, "Text"], Cell[22586, 725, 156, 4, 25, "Text"], Cell[22745, 731, 48, 1, 51, "InputOnly"], Cell[CellGroupData[{ Cell[22818, 736, 83, 1, 40, "Input"], Cell[22904, 739, 36, 1, 41, "Output"] }, Open ]], Cell[22955, 743, 155, 6, 25, "Text"], Cell[23113, 751, 59, 1, 51, "InputOnly"], Cell[23175, 754, 51, 0, 24, "Text"], Cell[CellGroupData[{ Cell[23251, 758, 83, 1, 40, "Input"], Cell[23337, 761, 70, 1, 41, "Output"] }, Open ]], Cell[23422, 765, 584, 19, 41, "Text"], Cell[24009, 786, 66, 1, 51, "InputOnly"], Cell[CellGroupData[{ Cell[24100, 791, 83, 1, 40, "Input"], Cell[24186, 794, 64, 1, 41, "Output"] }, Open ]], Cell[24265, 798, 291, 9, 26, "Text"], Cell[CellGroupData[{ Cell[24581, 811, 37, 1, 40, "Input"], Cell[24621, 814, 38, 1, 41, "Output"] }, Open ]], Cell[24674, 818, 188, 9, 26, "Text"], Cell[24865, 829, 23, 0, 24, "Text"], Cell[CellGroupData[{ Cell[24913, 833, 49, 1, 40, "Input"], Cell[24965, 836, 422, 10, 43, "Print", CellTags->"Info3276155590-7972361"] }, Open ]], Cell[25402, 849, 183, 6, 25, "Text"], Cell[25588, 857, 317, 7, 67, "InputOnly"], Cell[25908, 866, 225, 4, 40, "Text"], Cell[26136, 872, 391, 12, 72, "BeginEndQuestion"], Cell[26530, 886, 189, 8, 25, "Text"], Cell[26722, 896, 87, 1, 51, "InputOnly"], Cell[CellGroupData[{ Cell[26834, 901, 136, 3, 40, "Input"], Cell[26973, 906, 350, 5, 73, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27360, 916, 56, 1, 40, "Input"], Cell[27419, 919, 189, 3, 57, "Output"] }, Open ]], Cell[27623, 925, 263, 5, 40, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[27923, 935, 90, 5, 58, "Section"], Cell[28016, 942, 151, 5, 26, "Text"], Cell[28170, 949, 589, 17, 140, "BeginEndQuestion"], Cell[28762, 968, 646, 10, 72, "Text"], Cell[29411, 980, 167, 4, 54, "BeginEndQuestion"], Cell[29581, 986, 225, 6, 26, "Text"], Cell[29809, 994, 965, 39, 59, "Text"], Cell[30777, 1035, 948, 22, 72, "Text"], Cell[31728, 1059, 140, 5, 25, "Text"], Cell[31871, 1066, 87, 1, 51, "InputOnly"], Cell[31961, 1069, 146, 4, 24, "Text"], Cell[CellGroupData[{ Cell[32132, 1077, 182, 4, 40, "Input"], Cell[32317, 1083, 189, 3, 57, "Output"] }, Open ]], Cell[32521, 1089, 160, 5, 25, "Text"], Cell[CellGroupData[{ Cell[32706, 1098, 203, 6, 40, "Input"], Cell[32912, 1106, 146, 2, 41, "Output"] }, Open ]], Cell[33073, 1111, 361, 13, 25, "Text"], Cell[CellGroupData[{ Cell[33459, 1128, 206, 4, 56, "Input"], Cell[33668, 1134, 198, 3, 41, "Output"] }, Open ]], Cell[33881, 1140, 257, 8, 26, "Text"], Cell[34141, 1150, 794, 25, 58, "Text"], Cell[34938, 1177, 353, 6, 83, "InputOnly"], Cell[35294, 1185, 212, 6, 24, "Text"], Cell[35509, 1193, 253, 6, 67, "InputOnly"], Cell[35765, 1201, 60, 0, 24, "Text"], Cell[CellGroupData[{ Cell[35850, 1205, 47, 1, 40, "Input"], Cell[35900, 1208, 839, 14, 73, "Output"] }, Open ]], Cell[36754, 1225, 215, 6, 24, "Text"], Cell[36972, 1233, 208, 5, 51, "InputOnly"], Cell[CellGroupData[{ Cell[37205, 1242, 47, 1, 40, "Input"], Cell[37255, 1245, 534, 9, 57, "Output"] }, Open ]], Cell[37804, 1257, 142, 4, 24, "Text"], Cell[CellGroupData[{ Cell[37971, 1265, 279, 7, 56, "Input"], Cell[38253, 1274, 139, 2, 41, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[38429, 1281, 50, 1, 40, "Input"], Cell[38482, 1284, 36, 1, 41, "Output"] }, Open ]], Cell[38533, 1288, 108, 3, 24, "Text"], Cell[38644, 1293, 148, 3, 51, "InputOnly"], Cell[CellGroupData[{ Cell[38817, 1300, 144, 3, 40, "Input"], Cell[38964, 1305, 324, 10, 56, "Output"] }, Open ]], Cell[39303, 1318, 353, 6, 40, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[39693, 1329, 95, 5, 58, "Section"], Cell[39791, 1336, 10