(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[         0,          0]
NotebookDataLength[     78409,       2291]
NotebookOptionsPosition[     55041,       1761]
NotebookOutlinePosition[     56444,       1807]
CellTagsIndexPosition[     56288,       1799]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["EPM`Strings`", "Section",
 InitializationGroup->True],

Cell[TextData[{
 StyleBox["From",
  FontWeight->"Bold"],
 ": ",
 StyleBox["Essentials of Programming in Mathematica\n",
  FontSlant->"Italic"],
 "\[Copyright] Paul R. Wellin 2015"
}], "Text",
 CellMargins->{{28, 10}, {7, 7}},
 FontSize->14],

Cell[CellGroupData[{

Cell["Metadata ", "Subsection"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Name", ":", " ", "EPM`Strings`"}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Book", ":", " ", 
   RowBox[{
   "Essentials", " ", "of", " ", "Pogramming", " ", "in", " ", 
    "Mathematica"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Author", ":", " ", 
    RowBox[{"Paul", " ", "Wellin"}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Summary", ":", " ", 
   RowBox[{
   "This", " ", "package", " ", "contains", " ", "the", " ", "functions", " ",
     "defined", " ", "in", " ", "Chapter", " ", "7", " ", 
    RowBox[{"Strings", "."}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Context", ":", " ", "EPM`Strings`"}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Package", " ", 
    RowBox[{"Version", ":", " ", "1.0"}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", "Copyright", ":", " ", 
    RowBox[{"Copyright", " ", "2015"}]}], ",", " ", 
   RowBox[{"Paul", " ", "R", " ", "Wellin"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", 
    RowBox[{"History", ":", " ", 
     RowBox[{
     "Version", " ", "1.0", " ", "by", " ", "Paul", " ", "Wellin"}]}]}], ",", 
   " ", 
   RowBox[{"Dec", " ", "2012"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", "Keywords", ":", " ", 
    RowBox[{"Abecedarian", " ", "words"}]}], ",", " ", "anagram", ",", " ", 
   "blanagram", ",", " ", 
   RowBox[{"Fibonacci", " ", "words"}], ",", " ", 
   RowBox[{"text", " ", "filtering"}], ",", " ", 
   RowBox[{"GC", " ", "ratio"}], ",", " ", "palindromes", ",", " ", 
   RowBox[{"random", " ", "strings"}], ",", " ", 
   RowBox[{"padding", " ", "strings"}], ",", " ", 
   RowBox[{"DNA", " ", "sequence", " ", "table"}], ",", " ", 
   RowBox[{"string", " ", "partition"}], ",", " ", 
   RowBox[{"string", " ", "tally"}], ",", " ", 
   RowBox[{"string", " ", "transpose"}], ",", " ", 
   RowBox[{"XOR", " ", "encoding"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Source", ":", " ", 
   RowBox[{"Strings", ".", "nb"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Mathematica", " ", "Version"}], ":", " ", "10.3"}], " ", 
  "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{"Tested", " ", "in", " ", "Mathematica", " ", "11.1"}], " ", 
  "*)"}]], "Input",ExpressionUUID->"6a1c1117-64ca-4451-915a-a32b20dd6372"]
}, Closed]],

Cell[CellGroupData[{

Cell["BeginPackage", "Subsection"],

Cell[BoxData[
 RowBox[{"Remove", "[", 
  RowBox[{
  "AbecedarianQ", ",", "Anagrams", ",", "Blanagrams", ",", "FibonacciWord", 
   ",", "FilterText", ",", "FindSubsequence", ",", "FindWordsContaining", ",",
    "GCRatio", ",", "IncludeCharacters", ",", "AllCharacters", ",", 
   "WordCharacters", ",", "PunctuationOnly", ",", "MakeVarList", ",", 
   "palindromeQ", ",", "Palindromes", ",", "RandomString", ",", "RowLength", 
   ",", "SequenceTable", ",", "StringPad", ",", "stringPartition", ",", 
   "StringPermutations", ",", "StringTally", ",", "StringTranspose", ",", 
   "UcLc", ",", "UniqueCharacters", ",", "WordPosition", ",", "XorEncode"}], 
  "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{"BeginPackage", "[", "\"\<EPM`Strings`\>\"", "]"}], " ", 
  "*)"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Usage messages", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"AbecedarianQ", "::", "usage"}], "=", "\"\<AbecedarianQ[\!\(\*
StyleBox[\"word\", \"TI\"]\)] returns True if the characters in \!\(\*
StyleBox[\"word\", \"TI\"]\) are ordered in the sense of their character \
codes.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Anagrams", "::", "usage"}], "=", "\"\<Anagrams[\!\(\*
StyleBox[\"word\", \"TI\"]\)] finds all anagrams of the string \!\(\*
StyleBox[\"word\", \"TI\"]\) in the dictionary.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Blanagrams", "::", "usage"}], "=", "\"\<Blanagrams[\!\(\*
StyleBox[\"word\", \"TI\"]\)] returns all blanagrams of \!\(\*
StyleBox[\"word\", \"TI\"]\) in the built-in dictionary.\>\""}], 
  ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"FibonacciWord", "::", "usage"}], "=", "\"\<FibonacciWord[\!\(\*
StyleBox[\"n\", \"TI\"]\)] returns the \!\(\*
StyleBox[\(\*
StyleBox[\"n\", \"TI\"]th\)]\) Fibonacci word created by, starting with the \
strings \\\"0\\\" and \\\"01\\\", concatenates the the (\!\(\*
StyleBox[\"n\", \"TI\"]\)-1)st and (\!\(\*
StyleBox[\"n\", \"TI\"]\)-2)nd Fibonacci words.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"FilterText", "::", "usage"}], "=", "\"\<FilterText[\!\(\*
StyleBox[\"str\", \"TI\"]\)\!\(\*
StyleBox[\",\", \"TI\"]\)\!\(\*
StyleBox[\" \", \"TI\"]\)\!\(\*
StyleBox[\"lis\", \"TI\"]\)] removes all stops words given in the list \!\(\*
StyleBox[\"lis\", \"TI\"]\) from the string \!\(\*
StyleBox[\"str\", \"TI\"]\).\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"FindSubsequence", "::", "usage"}], "=", "\"\<FindSubsequence[\!\(\*
StyleBox[\"num\", \"TI\"]\)\!\(\*
StyleBox[\",\", \"TI\"]\)\!\(\*
StyleBox[\" \", \"TI\"]\)\!\(\*
StyleBox[\"subseq\", \"TI\"]\)] returns the starting and ending positions of \
the subsequence \!\(\*
StyleBox[\"subseq\", \"TI\"]\)\!\(\*
StyleBox[\" \", \"TI\"]\)in the number \!\(\*
StyleBox[\"num\", \"TI\"]\)\!\(\*
StyleBox[\".\", \"TI\"]\)\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"FindWordsContaining", "::", "usage"}], "=", 
   "\"\<FindWordsContaining[\!\(\*
StyleBox[\"str\", \"TI\"]\)] finds all words in the built-in dictionary that \
contain the string \!\(\*
StyleBox[\"str\", \"TI\"]\). The option WordPosition\[Rule]\!\(\*
StyleBox[\"pos\", \"TI\"]\) can be used to specify the position of \!\(\*
StyleBox[\"str\", \"TI\"]\). \!\(\*
StyleBox[\"pos\", \"TI\"]\) can be either \\\"Start\\\", \\\"Middle\\\", \
\\\"End\\\", or \\\"Anywhere\\\".\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"GCRatio", "::", "usage"}], "=", "\"\<GCRatio[\!\(\*
StyleBox[\"str\", \"TI\"]\)\!\(\*
StyleBox[\",\", \"TI\"]\)\!\(\*
StyleBox[\" \", \"TI\"]\)\!\(\*
StyleBox[\"blocksize\", \"TI\"]\)] computes the GC ratio in the string \!\(\*
StyleBox[\"str\", \"TI\"]\) for substrings of size \!\(\*
StyleBox[\"blocksize\", \"TI\"]\).\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"IncludeCharacters", "::", "usage"}], "=", 
   "\"\<IncludeCharacters is an option to StringTally. Possible values are \
AllCharacters, PunctuationOnly, and WordCharacters.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"AllCharacters", "::", "usage"}], "=", 
   "\"\<AllCharacters is a possible setting for the IncludeCharacters option \
in StringTally.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"WordCharacters", "::", "usage"}], "=", 
   "\"\<WordCharacters is a possible setting for the IncludeCharacters option \
in StringTally.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"PunctuationOnly", "::", "usage"}], "=", 
   "\"\<PunctuationOnly is a possible setting for the IncludeCharacters \
option in StringTally.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"MakeVarList", "::", "usage"}], "=", "\"\<MakeVarList[\!\(\*
StyleBox[\"sym\", \"TI\"]\)\!\(\*
StyleBox[\",\", \"TI\"]\)\!\(\*
StyleBox[\" \", \"TI\"]\)\!\(\*
StyleBox[\"n\", \"TI\"]\)] generates a list of \!\(\*
StyleBox[\"n\", \"TI\"]\) indexed symbols.\\nMakeVarList[\!\(\*
StyleBox[\"sym\", \"TI\"]\)\!\(\*
StyleBox[\",\", \"TI\"]\)\!\(\*
StyleBox[\" \", \"TI\"]\)\!\(\*
StyleBox[\"{\", \"TI\"]\)\!\(\*
StyleBox[\"n\", \"TI\"]\)\!\(\*
StyleBox[\",\", \"TI\"]\)\!\(\*
StyleBox[\"m\", \"TI\"]\)\!\(\*
StyleBox[\"}\", \"TI\"]\)] generates a list of indexed symbols from \
\!\(\*SubscriptBox[
StyleBox[
StyleBox[\"sym\", \"TI\"],
FontWeight->\"Plain\"], 
StyleBox[\"n\", \"TI\"]]\) to \!\(\*SubscriptBox[
StyleBox[\"sym\", \"TI\"], 
StyleBox[\"m\", \"TI\"]]\).\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{"If", "[", 
  RowBox[{
   RowBox[{"$VersionNumber", "<", "10.3"}], ",", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"PalindromeQ", "::", "usage"}], "=", "\"\<PalindromeQ[\!\(\*
StyleBox[\"expr\", \"TI\"]\)] returns True of \!\(\*
StyleBox[\"expr\", \"TI\"]\) is palindromic. The expression \!\(\*
StyleBox[\"expr\", \"TI\"]\) can be either a string or a number.\>\""}]}], 
  "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"If", "[", 
  RowBox[{
   RowBox[{"$VersionNumber", "\[GreaterEqual]", "10.3"}], ",", 
   RowBox[{
    RowBox[{"palindromeQ", "::", "usage"}], "=", "\"\<palindromeQ[\!\(\*
StyleBox[\"expr\", \"TI\"]\)] returns True of \!\(\*
StyleBox[\"expr\", \"TI\"]\) is palindromic. The expression \!\(\*
StyleBox[\"expr\", \"TI\"]\) can be either a string or a number.\>\""}]}], 
  "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Palindromes", "::", "usage"}], "=", 
   "\"\<Palindromes[] returns all palindromes from the dictionary the comes \
with \!\(\*
StyleBox[\"Mathematica\",
FontSlant->\"Italic\"]\).\\nPalindromes[\!\(\*
StyleBox[\"n\", \"TI\"]\)] returns all palindromes of length \!\(\*
StyleBox[\"n\", \"TI\"]\).\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"RandomString", "::", "usage"}], "=", "\"\<RandomString[\!\(\*
StyleBox[\"{\", \"TI\"]\)\!\(\*SubscriptBox[
StyleBox[\"c\", \"TI\"], \"1\"]\),\!\(\*SubscriptBox[
StyleBox[\"c\", \"TI\"], \"2\"]\),\[Ellipsis],\!\(\*SubscriptBox[
StyleBox[\"c\", \"TI\"], \"n\"]\)}] generates a random string of length \
\!\(\*
StyleBox[\"n\", \"TI\"]\) from among the characters \!\(\*SubscriptBox[
StyleBox[\"c\", \"TI\"], \"i\"]\) chosen at random. The option Weights can be \
used to give weighted choices of the characters.\\nRandomString[\!\(\*
StyleBox[\"{\", \"TI\"]\)\!\(\*
StyleBox[\"list\", \"TI\"]\),{\!\(\*SubscriptBox[
StyleBox[\"n\", \"TI\"], 
StyleBox[\"1\", \"TR\"]]\),\!\(\*SubscriptBox[
StyleBox[\"n\", \"TI\"], 
StyleBox[\"2\", \"TR\"]]\),\!\(\*
StyleBox[\"\[Ellipsis]\", \"TR\"]\)}] generates an \!\(\*SubscriptBox[
StyleBox[\"n\", \"TI\"], 
StyleBox[\"1\", \"TR\"]]\)\[Times]\!\(\*SubscriptBox[
StyleBox[\"n\", \"TI\"], 
StyleBox[\"2\", \"TR\"]]\)\[Times]\[Ellipsis] array of random strings.\>\""}],
   ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"RandomString", "::", "badwt"}], "=", 
   "\"\<The list of weights should have the same length as the list of \
strings.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"RowLength", "::", "usage"}], "=", 
   "\"\<RowLength is an option to SequenceTable that specifies the number of \
blocks in each row.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"SequenceTable", "::", "usage"}], "=", "\"\<SequenceTable[\!\(\*
StyleBox[\"lis\", \"TI\"]\)] returns a formatted table suitable for \
displaying gene sequences. SequenceTable inherits options from Grid.\>\""}], 
  ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"StringPad", "::", "usage"}], "=", "\"\<StringPad[\!\(\*
StyleBox[\"str\", \"TI\"]\),\!\(\*
StyleBox[\"n\", \"TI\"]\)] pads string \!\(\*
StyleBox[\"str\", \"TI\"]\) out to length \!\(\*
StyleBox[\"n\", \"TI\"]\) with whitespace.\\nStringPad[\!\(\*
StyleBox[\"str\", \"TI\"]\),{\!\(\*
StyleBox[\"n\", \"TI\"]\)}] appends \!\(\*
StyleBox[\"n\", \"TI\"]\) whitespace characters to the end of \!\(\*
StyleBox[\"str\", \"TI\"]\).\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"StringPad", "::", "badlen"}], "=", 
   "\"\<Pad length `1` must be greater than the length of string `2`.\>\""}], 
  ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"stringPartition", "::", "usage"}], "=", 
   "\"\<stringPartition[[\!\(\*
StyleBox[\"list\", \"TI\"]\),\!\(\*
StyleBox[\"n\", \"TI\"]\)] partitions \!\(\*
StyleBox[\"list\", \"TI\"]\) into non-overlapping sublists of strings of \
length \!\(\*
StyleBox[\"n\", \"TI\"]\). stringPartition has the same argument structure as \
Partition.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"StringPermutations", "::", "usage"}], "=", 
   "\"\<StringPermutations[[\!\(\*
StyleBox[\"str\", \"TI\"]\)] returns all permutations of the string \!\(\*
StyleBox[\"str\", \"TI\"]\).\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"StringTally", "::", "usage"}], "=", "\"\<StringTally[\!\(\*
StyleBox[\"str\", \"TI\"]\)] tallys the occurrences of each character in the \
string str. The option IncludeCharacters can take on values AllCharacters \
(the default), WordCharacters, or PunctuationOnly to restrict the types of \
characters that are tallied.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"StringTally", "::", "badopt"}], "=", 
   "\"\<The option value IncludeCharacters can only take on the following \
values: All, LetterCharacters, WordCharacters, PunctuationOnly.\>\""}], 
  ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"StringTranspose", "::", "usage"}], "=", 
   "\"\<StringTranspose[\!\(\*SubscriptBox[
StyleBox[\"str\", \"TI\"], \"1\"]\)\!\(\*
StyleBox[\",\", \"TI\"]\)\!\(\*
StyleBox[\" \", \"TI\"]\)\!\(\*SubscriptBox[
StyleBox[\"str\", \"TI\"], \"2\"]\)] transposes the characters in the two \
strings \!\(\*SubscriptBox[
StyleBox[\"str\", \"TI\"], \"1\"]\) and \!\(\*SubscriptBox[
StyleBox[\"str\", \"TI\"], \"2\"]\) returning the concatenated result.\>\""}],
   ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"UcLc", "::", "usage"}], "=", "\"\<UcLc[\!\(\*
StyleBox[\"str\", \"TI\"]\)] converts the first character in the string \
\!\(\*
StyleBox[\"str\", \"TI\"]\) to uppercase.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"UniqueCharacters", "::", "usage"}], "=", 
   "\"\<UniqueCharacters[\!\(\*
StyleBox[\"str\", \"TI\"]\)] returns a list of unique characters in the \
string \!\(\*
StyleBox[\"str\", \"TI\"]\), deleting duplicates.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"WordPosition", "::", "usage"}], "=", 
   "\"\<WordPosition is an option to FindWordsContaining that determines \
where the target string occurs. Possible values are \\\"Start\\\", \\\"Middle\
\\\", \\\"End\\\", or \\\"Anywhere\\\".\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"XorEncode", "::", "usage"}], "=", "\"\<XorEncode[\!\(\*
StyleBox[\"text\", \"TI\"]\)\!\(\*
StyleBox[\",\", \"TI\"]\)\!\(\*
StyleBox[\" \", \"TI\"]\)\!\(\*
StyleBox[\"key\", \"TI\"]\)] encodes \!\(\*
StyleBox[\"text\", \"TI\"]\) using an Xor cipher with key \!\(\*
StyleBox[\"key\", \"TI\"]\).\>\""}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Options", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Options", "[", "FindWordsContaining", "]"}], "=", 
   RowBox[{"{", 
    RowBox[{"WordPosition", "\[Rule]", "\"\<Start\>\""}], "}"}]}], 
  ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Options", "[", "RandomString", "]"}], "=", 
   RowBox[{"{", 
    RowBox[{"Weights", "\[Rule]", 
     RowBox[{"{", "}"}]}], "}"}]}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Options", "[", "SequenceTable", "]"}], "=", 
   RowBox[{"Join", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"BlockSize", "\[Rule]", "12"}], ",", 
       RowBox[{"RowLength", "\[Rule]", "5"}]}], "}"}], ",", 
     RowBox[{"Options", "[", "Grid", "]"}]}], "]"}]}], ";"}]], "Input",
 CellTags->"9.5"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Options", "[", "StringTally", "]"}], "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"IncludeCharacters", "\[Rule]", "AllCharacters"}], ",", 
     RowBox[{"IgnoreCase", "\[Rule]", "False"}]}], "}"}]}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Begin private context", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Begin", "[", "\"\<`Private`\>\"", "]"}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Function definitions", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"AbecedarianQ", "[", "word_String", "]"}], ":=", 
  RowBox[{"OrderedQ", "[", 
   RowBox[{"ToCharacterCode", "[", "word", "]"}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Anagrams", "[", "word_String", "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"len", "=", 
       RowBox[{"StringLength", "[", "word", "]"}]}], ",", "words"}], "}"}], 
    ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"words", "=", 
      RowBox[{"DictionaryLookup", "[", 
       RowBox[{"RegularExpression", "[", 
        RowBox[{"\"\<\\\\w{\>\"", "<>", 
         RowBox[{"ToString", "[", "len", "]"}], "<>", "\"\<}\>\""}], "]"}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"Select", "[", 
      RowBox[{"words", ",", 
       RowBox[{
        RowBox[{
         RowBox[{"Sort", "[", 
          RowBox[{"Characters", "[", "#", "]"}], "]"}], "\[Equal]", 
         RowBox[{"Sort", "[", 
          RowBox[{"Characters", "[", "word", "]"}], "]"}]}], "&"}]}], 
      "]"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Blanagrams", "[", "word_String", "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", "blana", "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"blana", "=", 
      RowBox[{"Table", "[", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"Map", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"StringReplacePart", "[", 
            RowBox[{"word", ",", "ch", ",", 
             RowBox[{"{", 
              RowBox[{"#", ",", "#"}], "}"}]}], "]"}], "&"}], ",", 
          RowBox[{"Range", "[", 
           RowBox[{"StringLength", "[", "word", "]"}], "]"}]}], "]"}], ",", 
        "\[IndentingNewLine]", 
        RowBox[{"{", 
         RowBox[{"ch", ",", 
          RowBox[{"CharacterRange", "[", 
           RowBox[{"\"\<a\>\"", ",", "\"\<z\>\""}], "]"}]}], "}"}]}], "]"}]}],
      ";", "\[IndentingNewLine]", 
     RowBox[{"DeleteDuplicates", "[", 
      RowBox[{"Flatten", "[", 
       RowBox[{"Map", "[", 
        RowBox[{"Anagrams", ",", "blana", ",", 
         RowBox[{"{", "2", "}"}]}], "]"}], "]"}], "]"}]}]}], 
   "\[IndentingNewLine]", "]"}]}]], "Input"],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"FibonacciWord", "[", "1", "]"}], "=", "\"\<0\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"FibonacciWord", "[", "2", "]"}], "=", "\"\<01\>\""}], 
  ";"}]}], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"FibonacciWord", "[", "n_", "]"}], ":=", 
  RowBox[{
   RowBox[{"FibonacciWord", "[", 
    RowBox[{"n", "-", "1"}], "]"}], "<>", 
   RowBox[{"FibonacciWord", "[", 
    RowBox[{"n", "-", "2"}], "]"}]}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"FilterText", "[", 
   RowBox[{"str_String", ",", "stopwords_List"}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", "tmp", "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"tmp", "=", 
      RowBox[{"StringSplit", "[", 
       RowBox[{"str", ",", 
        RowBox[{
         RowBox[{"Characters", "[", "\"\<:,;.!? \>\"", "]"}], ".."}]}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"Flatten", "@", 
      RowBox[{"StringSplit", "[", 
       RowBox[{"tmp", ",", 
        RowBox[{"WordBoundary", "~~", 
         RowBox[{"Apply", "[", 
          RowBox[{"Alternatives", ",", "stopwords"}], "]"}], "~~", 
         "WordBoundary"}], ",", 
        RowBox[{"IgnoreCase", "\[Rule]", "True"}]}], "]"}]}]}]}], 
   "\[IndentingNewLine]", "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindSubsequence", "[", 
   RowBox[{
    RowBox[{"num_", "?", "NumberQ"}], ",", 
    RowBox[{"subseq_", "?", "NumberQ"}]}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"n", "=", 
       RowBox[{"ToString", "[", "num", "]"}]}], ",", 
      RowBox[{"s", "=", 
       RowBox[{"ToString", "[", "subseq", "]"}]}]}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"StringPosition", "[", 
     RowBox[{
      RowBox[{"Part", "[", 
       RowBox[{
        RowBox[{"StringSplit", "[", 
         RowBox[{"n", ",", "\"\<.\>\""}], "]"}], ",", "2"}], "]"}], ",", 
      "s"}], "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input",ExpressionUUID-\
>"ef8af8f0-97bd-465b-9ed3-2f72d4082bff"],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", " ", 
   RowBox[{
   "Alternative", " ", "definition", " ", "using", " ", "SequencePosition"}], 
   " ", "*)"}], "\[IndentingNewLine]", 
  RowBox[{"(*", " ", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FindSubsequence", "[", 
     RowBox[{
      RowBox[{"num", ":", 
       RowBox[{"{", 
        RowBox[{"__", "?", "NumberQ"}], "}"}]}], ",", 
      RowBox[{"subseq_", "?", "NumberQ"}]}], "]"}], ":=", 
    "\[IndentingNewLine]", 
    RowBox[{"SequencePosition", "[", 
     RowBox[{"num", ",", 
      RowBox[{"IntegerDigits", "[", "subseq", "]"}]}], "]"}]}], 
   "\[IndentingNewLine]", "*)"}]}]], "Input",ExpressionUUID->"5ed760c0-750a-\
415d-b80f-8922760ba2d7"],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindWordsContaining", "[", 
   RowBox[{"str_String", ",", 
    RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"wp", "=", 
      RowBox[{"OptionValue", "[", "WordPosition", "]"}]}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"Which", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"wp", "==", "\"\<Start\>\""}], ",", 
      RowBox[{"DictionaryLookup", "[", 
       RowBox[{"RegularExpression", "[", 
        RowBox[{"StringJoin", "[", 
         RowBox[{"\"\<\\\\b\>\"", ",", "str", ",", "\"\<.*\\\\b\>\""}], "]"}],
         "]"}], "]"}], ",", "\[IndentingNewLine]", 
      RowBox[{"wp", "==", "\"\<Middle\>\""}], ",", 
      RowBox[{"DictionaryLookup", "[", 
       RowBox[{"RegularExpression", "[", 
        RowBox[{"StringJoin", "[", 
         RowBox[{"\"\<\\\\b.+\>\"", ",", "str", ",", "\"\<.+\\\\b\>\""}], 
         "]"}], "]"}], "]"}], ",", "\[IndentingNewLine]", 
      RowBox[{"wp", "==", "\"\<End\>\""}], ",", 
      RowBox[{"DictionaryLookup", "[", 
       RowBox[{"RegularExpression", "[", 
        RowBox[{"StringJoin", "[", 
         RowBox[{"\"\<\\\\b.*\>\"", ",", "str", ",", "\"\<\\\\b\>\""}], "]"}],
         "]"}], "]"}], ",", "\[IndentingNewLine]", 
      RowBox[{"wp", "\[Equal]", "\"\<Anywhere\>\""}], ",", 
      RowBox[{"DictionaryLookup", "[", 
       RowBox[{"RegularExpression", "[", 
        RowBox[{"StringJoin", "[", 
         RowBox[{"\"\<\\\\b.*\>\"", ",", "str", ",", "\"\<.*\\\\b\>\""}], 
         "]"}], "]"}], "]"}]}], "\[IndentingNewLine]", "]"}]}], 
   "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"gcRatio", "[", "ls_String", "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", "gc", "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"gc", "=", 
      RowBox[{"StringCount", "[", 
       RowBox[{"ls", ",", 
        RowBox[{"\"\<G\>\"", "|", "\"\<C\>\""}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"N", "[", 
      RowBox[{"gc", "/", 
       RowBox[{"StringLength", "[", "ls", "]"}]}], "]"}]}]}], 
   "\[IndentingNewLine]", "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"GCRatio", "[", 
   RowBox[{"str_String", ",", "blocksize_Integer"}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"lis", ",", "blocks"}], "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"lis", "=", 
      RowBox[{"stringPartition", "[", 
       RowBox[{"str", ",", "blocksize"}], "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"blocks", "=", 
      RowBox[{"Table", "[", 
       RowBox[{"i", ",", 
        RowBox[{"{", 
         RowBox[{"i", ",", "1", ",", 
          RowBox[{"StringLength", "[", "str", "]"}], ",", "blocksize"}], 
         "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"Transpose", "[", 
      RowBox[{"{", 
       RowBox[{"blocks", ",", 
        RowBox[{"Map", "[", 
         RowBox[{"gcRatio", ",", "lis"}], "]"}]}], "}"}], "]"}]}]}], 
   "\[IndentingNewLine]", "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"GCRatio", "[", 
   RowBox[{
    RowBox[{"{", "str_String", "}"}], ",", "blocksize_Integer"}], "]"}], ":=", 
  RowBox[{"GCRatio", "[", 
   RowBox[{"str", ",", "blocksize"}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"MakeVarList", "[", 
   RowBox[{"x_Symbol", ",", "n_Integer"}], "]"}], ":=", 
  RowBox[{"ToExpression", "[", 
   RowBox[{"Map", "[", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"ToString", "[", "x", "]"}], "<>", 
       RowBox[{"ToString", "[", "#", "]"}]}], "&"}], ",", 
     RowBox[{"Range", "[", "n", "]"}]}], "]"}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"MakeVarList", "[", 
   RowBox[{"x_Symbol", ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"n_Integer", "?", "Positive"}], ",", 
      RowBox[{"m_Integer", "?", "Positive"}]}], "}"}]}], "]"}], ":=", 
  RowBox[{"ToExpression", "[", 
   RowBox[{"Map", "[", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"ToString", "[", "x", "]"}], "<>", 
       RowBox[{"ToString", "[", "#", "]"}]}], "&"}], ",", 
     RowBox[{"Range", "[", 
      RowBox[{"n", ",", "m"}], "]"}]}], "]"}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{"If", "[", 
  RowBox[{
   RowBox[{"$VersionNumber", "<", "10.3"}], ",", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"PalindromeQ", "[", "str_String", "]"}], ":=", 
    RowBox[{
     RowBox[{"StringReverse", "[", "str", "]"}], "==", "str"}]}]}], 
  "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"If", "[", 
  RowBox[{
   RowBox[{"$VersionNumber", "\[GreaterEqual]", "10.3"}], ",", 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"palindromeQ", "[", "str_String", "]"}], ":=", 
    RowBox[{
     RowBox[{"StringReverse", "[", "str", "]"}], "==", "str"}]}]}], 
  "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"If", "[", 
  RowBox[{
   RowBox[{"$VersionNumber", "<", "10.3"}], ",", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"PalindromeQ", "[", "num_Integer", "]"}], ":=", 
    RowBox[{"PalindromeQ", "[", 
     RowBox[{"ToString", "[", "num", "]"}], "]"}]}]}], "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"If", "[", 
  RowBox[{
   RowBox[{"$VersionNumber", "\[GreaterEqual]", "10.3"}], ",", 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"palindromeQ", "[", "num_Integer", "]"}], ":=", 
    RowBox[{"palindromeQ", "[", 
     RowBox[{"ToString", "[", "num", "]"}], "]"}]}]}], "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Palindromes", "[", "len_Integer", "]"}], ":=", 
  RowBox[{"DictionaryLookup", "[", 
   RowBox[{"w__", "/;", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"w", "==", 
       RowBox[{"StringReverse", "[", "w", "]"}]}], " ", "&&", " ", 
      RowBox[{
       RowBox[{"StringLength", "[", "w", "]"}], "\[Equal]", "len"}]}], 
     ")"}]}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Palindromes", "[", "]"}], ":=", 
  RowBox[{"DictionaryLookup", "[", 
   RowBox[{"w__", "/;", 
    RowBox[{"(", 
     RowBox[{"w", "==", 
      RowBox[{"StringReverse", "[", "w", "]"}]}], " ", ")"}]}], 
   "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"RandomString", "[", 
   RowBox[{
    RowBox[{"{", "c__String", "}"}], ",", "n_Integer", ",", 
    RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"wts", "=", 
      RowBox[{"OptionValue", "[", "Weights", "]"}]}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"Which", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"Length", "[", "wts", "]"}], "\[Equal]", "0"}], ",", 
      RowBox[{"StringJoin", "[", 
       RowBox[{"RandomChoice", "[", 
        RowBox[{
         RowBox[{"{", "c", "}"}], ",", "n"}], "]"}], "]"}], ",", 
      "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"Length", "[", "wts", "]"}], "\[Equal]", 
       RowBox[{"Length", "[", 
        RowBox[{"{", "c", "}"}], "]"}]}], ",", 
      RowBox[{"StringJoin", "[", 
       RowBox[{"RandomChoice", "[", 
        RowBox[{
         RowBox[{"wts", "\[Rule]", 
          RowBox[{"{", "c", "}"}]}], ",", "n"}], "]"}], "]"}], ",", 
      "\[IndentingNewLine]", "True", ",", 
      RowBox[{"Message", "[", 
       RowBox[{"RandomString", "::", "badwt"}], "]"}]}], 
     "\[IndentingNewLine]", "]"}]}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"RandomString", "[", 
   RowBox[{
    RowBox[{"{", "c__String", "}"}], ",", 
    RowBox[{"opts", ":", 
     RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", 
  RowBox[{"RandomString", "[", 
   RowBox[{
    RowBox[{"{", "c", "}"}], ",", "1", ",", "opts"}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"RandomString", "[", 
   RowBox[{
    RowBox[{"{", "c__String", "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"n_Integer", ",", "len_Integer"}], "}"}], ",", 
    RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"wts", "=", 
      RowBox[{"OptionValue", "[", "Weights", "]"}]}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"Which", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"Length", "[", "wts", "]"}], "\[Equal]", "0"}], ",", 
      RowBox[{"Map", "[", 
       RowBox[{"StringJoin", ",", 
        RowBox[{"RandomChoice", "[", 
         RowBox[{
          RowBox[{"{", "c", "}"}], ",", 
          RowBox[{"{", 
           RowBox[{"n", ",", "len"}], "}"}]}], "]"}]}], "]"}], ",", 
      "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"Length", "[", "wts", "]"}], "\[Equal]", 
       RowBox[{"Length", "[", 
        RowBox[{"{", "c", "}"}], "]"}]}], ",", 
      RowBox[{"Map", "[", 
       RowBox[{"StringJoin", ",", 
        RowBox[{"RandomChoice", "[", 
         RowBox[{
          RowBox[{"wts", "\[Rule]", 
           RowBox[{"{", "c", "}"}]}], ",", 
          RowBox[{"{", 
           RowBox[{"n", ",", "len"}], "}"}]}], "]"}]}], "]"}], ",", 
      "\[IndentingNewLine]", "True", ",", 
      RowBox[{"Message", "[", 
       RowBox[{"RandomString", "::", "badwt"}], "]"}]}], 
     "\[IndentingNewLine]", "]"}]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.524665480351028*^9, 3.524665487450761*^9}, {
  3.524665582184537*^9, 3.524665740698756*^9}, {3.524665864068852*^9, 
  3.524665869803155*^9}, {3.524665943400193*^9, 3.5246659563119383`*^9}, {
  3.524666140682979*^9, 3.524666145392123*^9}, {3.524666187071706*^9, 
  3.524666188487198*^9}, {3.524666285132325*^9, 3.524666325461466*^9}, {
  3.524666502948704*^9, 3.524666507196312*^9}, {3.524666741932231*^9, 
  3.524666747124289*^9}, {3.524700956720539*^9, 3.52470096084039*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"SequenceTable", "[", 
   RowBox[{"lis_String", ",", 
    RowBox[{"opts", ":", 
     RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", 
  "\[IndentingNewLine]", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"n", "=", 
       RowBox[{"OptionValue", "[", "BlockSize", "]"}]}], ",", 
      RowBox[{"len", "=", 
       RowBox[{"StringLength", "[", "lis", "]"}]}], ",", 
      RowBox[{"r", "=", 
       RowBox[{"OptionValue", "[", "RowLength", "]"}]}], ",", "str", ",", 
      "blocks", ",", "ind"}], "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"str", "=", 
      RowBox[{"stringPartition", "[", 
       RowBox[{"lis", ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"blocks", "=", 
      RowBox[{"Partition", "[", 
       RowBox[{"str", ",", "r", ",", "r", ",", "1", ",", "\"\< \>\""}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"ind", "=", 
      RowBox[{"Select", "[", 
       RowBox[{
        RowBox[{"Range", "[", "len", "]"}], ",", 
        RowBox[{
         RowBox[{
          RowBox[{"Mod", "[", 
           RowBox[{"#", ",", 
            RowBox[{"r", "*", "n"}]}], "]"}], "\[Equal]", "1"}], "&"}]}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"Grid", "[", 
      RowBox[{
       RowBox[{"MapThread", "[", 
        RowBox[{
         RowBox[{
          RowBox[{"Prepend", "[", 
           RowBox[{"#1", ",", "#2"}], "]"}], "&"}], ",", 
         RowBox[{"{", 
          RowBox[{"blocks", ",", "ind"}], "}"}]}], "]"}], ",", 
       "\[IndentingNewLine]", 
       RowBox[{"FilterRules", "[", 
        RowBox[{
         RowBox[{"{", "opts", "}"}], ",", " ", 
         RowBox[{"Options", "[", "Grid", "]"}]}], "]"}], ",", 
       RowBox[{"Alignment", "\[Rule]", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{"Right", ",", 
            RowBox[{"{", "Left", "}"}]}], "}"}], ",", "Automatic"}], "}"}]}], 
       ",", 
       RowBox[{"ItemStyle", "\[Rule]", 
        RowBox[{"{", "8", "}"}]}], ",", 
       RowBox[{"Frame", "\[Rule]", "True"}], ",", 
       RowBox[{"Dividers", "\[Rule]", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{"True", ",", "False"}], "}"}], ",", "All"}], "}"}]}]}], 
      "]"}]}]}], "\[IndentingNewLine]", "]"}]}]], "InputOnly",
 CellTags->"9.5"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringPad", "[", 
   RowBox[{"str_String", ",", 
    RowBox[{"{", "n_", "}"}]}], "]"}], ":=", 
  RowBox[{"StringJoin", "[", 
   RowBox[{"str", ",", 
    RowBox[{"Table", "[", 
     RowBox[{"\"\< \>\"", ",", 
      RowBox[{"{", "n", "}"}]}], "]"}]}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringPad", "[", 
   RowBox[{"str_String", ",", "n_"}], "]"}], ":=", 
  RowBox[{"With", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"len", "=", 
      RowBox[{"StringLength", "[", "str", "]"}]}], "}"}], ",", 
    RowBox[{"If", "[", 
     RowBox[{
      RowBox[{"len", ">", "n"}], ",", 
      RowBox[{"Message", "[", 
       RowBox[{
        StyleBox[
         RowBox[{"StringPad", "::", "badlen"}], "MessageName"], ",", "n", ",",
         "str"}], "]"}], ",", 
      RowBox[{"StringPad", "[", 
       RowBox[{"str", ",", 
        RowBox[{"{", 
         RowBox[{"n", "-", "len"}], "}"}]}], "]"}]}], "]"}]}], 
   "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringPad", "[", 
   RowBox[{"str_String", ",", "n_", ",", "m_"}], "]"}], ":=", 
  RowBox[{"StringJoin", "[", 
   RowBox[{
    RowBox[{"Table", "[", 
     RowBox[{"\"\< \>\"", ",", 
      RowBox[{"{", "n", "}"}]}], "]"}], ",", "str", ",", 
    RowBox[{"Table", "[", 
     RowBox[{"\"\< \>\"", ",", 
      RowBox[{"{", "m", "}"}]}], "]"}]}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"stringPartition", "[", 
   RowBox[{"str_String", ",", "seq__"}], "]"}], ":=", 
  RowBox[{"Map", "[", 
   RowBox[{"StringJoin", ",", 
    RowBox[{"Partition", "[", 
     RowBox[{
      RowBox[{"Characters", "[", "str", "]"}], ",", "seq"}], "]"}]}], 
   "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"stringPartition", "[", 
   RowBox[{"str_String", ",", "blocksize_"}], "]"}], ":=", 
  RowBox[{"Map", "[", 
   RowBox[{"StringJoin", ",", 
    RowBox[{"Partition", "[", 
     RowBox[{
      RowBox[{"Characters", "[", "str", "]"}], ",", "blocksize", ",", 
      "blocksize", ",", "1", ",", 
      RowBox[{"{", "}"}]}], "]"}]}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringPermutations", "[", "str_String", "]"}], ":=", 
  RowBox[{"Map", "[", 
   RowBox[{"StringJoin", ",", 
    RowBox[{"Permutations", "[", 
     RowBox[{"Characters", "[", "str", "]"}], "]"}]}], "]"}]}]], "Input",
 CellTags->{"7.2", "7.2 Exercises"}],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringTally", "[", 
   RowBox[{"text_", ",", 
    RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"ic", "=", 
       RowBox[{"OptionValue", "[", "IncludeCharacters", "]"}]}], ",", 
      RowBox[{"igcase", "=", 
       RowBox[{"OptionValue", "[", "IgnoreCase", "]"}]}]}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"Tally", "[", 
     RowBox[{"StringCases", "[", 
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{"igcase", ",", 
         RowBox[{"ToLowerCase", "[", "text", "]"}], ",", "text"}], "]"}], ",",
        "\[IndentingNewLine]", 
       RowBox[{"Which", "[", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"ic", "===", "AllCharacters"}], ",", 
         RowBox[{"RegularExpression", "[", "\"\<.\>\"", "]"}], ",", 
         "\[IndentingNewLine]", 
         RowBox[{"ic", "===", "WordCharacters"}], ",", 
         RowBox[{"RegularExpression", "[", "\"\<\\\\w\>\"", "]"}], ",", 
         "\[IndentingNewLine]", 
         RowBox[{"ic", "===", "PunctuationOnly"}], ",", 
         RowBox[{"RegularExpression", "[", "\"\<\\\\W\>\"", "]"}], ",", 
         "\[IndentingNewLine]", "True", ",", 
         RowBox[{"Message", "[", 
          RowBox[{
           RowBox[{"StringTally", "::", "badopt"}], ",", "ic"}], "]"}]}], 
        "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}], "]"}]}],
    "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringTranspose", "[", 
   RowBox[{"str1_String", ",", "str2_String"}], "]"}], ":=", 
  RowBox[{"StringJoin", "[", 
   RowBox[{"Transpose", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"Characters", "[", "str1", "]"}], ",", 
      RowBox[{"Characters", "[", "str2", "]"}]}], "}"}], "]"}], 
   "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"UcLc", "[", "word_String", "]"}], ":=", 
  RowBox[{"StringReplace", "[", 
   RowBox[{"word", ",", 
    RowBox[{
     RowBox[{"RegularExpression", "[", "\"\<(.)([a-z]+)\>\"", "]"}], 
     "\[RuleDelayed]", 
     RowBox[{
      RowBox[{"ToUpperCase", "[", "\"\<$1\>\"", "]"}], "~~", 
      "\"\<$2\>\""}]}]}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"UniqueCharacters", "[", "str_String", "]"}], ":=", 
  RowBox[{"DeleteDuplicates", "[", 
   RowBox[{"Characters", "[", "str", "]"}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"XorEncode", "[", 
   RowBox[{"text_String", ",", "key_String"}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"lis", ",", "bitText", ",", "bitKey"}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"bitText", "=", 
      RowBox[{"IntegerDigits", "[", 
       RowBox[{
        RowBox[{"ToCharacterCode", "[", "text", "]"}], ",", "2", ",", "8"}], 
       "]"}]}], ";", 
     RowBox[{"bitKey", "=", 
      RowBox[{"First", "@", 
       RowBox[{"IntegerDigits", "[", 
        RowBox[{
         RowBox[{"ToCharacterCode", "[", "key", "]"}], ",", "2", ",", "8"}], 
        "]"}]}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"lis", "=", 
      RowBox[{"Map", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"BitXor", "[", 
          RowBox[{"#", ",", "bitKey"}], "]"}], "&"}], ",", "bitText"}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"FromCharacterCode", "[", 
      RowBox[{"Map", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"FromDigits", "[", 
          RowBox[{"#", ",", "2"}], "]"}], "&"}], ",", "lis"}], "]"}], 
      "]"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["End Private context", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"End", "[", "]"}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["EndPackage", "Subsection"],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{"EndPackage", "[", "]"}], "*)"}]], "Input"]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Examples", "Section"],

Cell[CellGroupData[{

Cell["Load package", "Subsection"],

Cell[BoxData["Quit"], "Input",ExpressionUUID->"8266f28a-a164-470c-85ae-2eb3dd300289"],

Cell[TextData[{
 "Load package (do ",
 StyleBox["not",
  FontSlant->"Italic"],
 " say \[OpenCurlyDoubleQuote]Yes\[CloseCurlyDoubleQuote] to evaluate init \
cells dialog)."
}], "Text"],

Cell[BoxData[
 RowBox[{"<<", "EPM`"}]], "Input",ExpressionUUID->"24cdf6d7-14ab-4803-8175-de385cebf250"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Test usage messages", "Subsection"],

Cell[BoxData[
 RowBox[{"?", "AbecedarianQ"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "Anagrams"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "Blanagrams"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "BlockSize"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "FibonacciWord"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "FilterText"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "FindSubsequence"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "FindWordsContaining"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "GCRatio"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "MakeVarList"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "palindromeQ"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "Palindromes"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "RandomString"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "SequenceTable"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "StringPad"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "stringPartition"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "StringPermutations"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "StringTally"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "StringTranspose"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "UcLc"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "UniqueCharacters"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "WordPosition"}]], "Input"],

Cell[BoxData[
 RowBox[{"?", "XorEncode"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Exercise the functions and options", "Subsection"],

Cell[CellGroupData[{

Cell["AbecedarianQ", "Subsubsection"],

Cell[BoxData[
 RowBox[{"AbecedarianQ", "[", "\"\<best\>\"", "]"}]], "Input",ExpressionUUID->"7e120884-9490-4371-bf0f-f129d99cce74"]
}, Closed]],

Cell[CellGroupData[{

Cell["Anagrams", "Subsubsection"],

Cell[BoxData[
 RowBox[{"Anagrams", "[", "\"\<parsley\>\"", "]"}]], "Input",ExpressionUUID->"77b86b1d-1070-4c3e-a695-ca941a7707ed"]
}, Closed]],

Cell[CellGroupData[{

Cell["Blanagrams", "Subsubsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Blanagrams", "[", "\"\<zydeco\>\"", "]"}], "//", 
  "Timing"}]], "Input",ExpressionUUID->"45ce46d4-2c9b-4bf5-9e88-88314c6de2f8"]
}, Closed]],

Cell[CellGroupData[{

Cell["BlockSize", "Subsubsection"],

Cell[BoxData[
 RowBox[{"str", "=", 
  RowBox[{"RandomString", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
     "\"\<C\>\"", ",", "\"\<A\>\"", ",", "\"\<T\>\"", ",", "\"\<G\>\""}], 
     "}"}], ",", "178"}], "]"}]}]], "Input",ExpressionUUID->"e770fd3d-c185-\
45a2-93dc-00497d23bb76"],

Cell[BoxData[
 RowBox[{"SequenceTable", "[", 
  RowBox[{"str", ",", 
   RowBox[{"BlockSize", "\[Rule]", "12"}], ",", 
   RowBox[{"Background", "\[Rule]", "LightYellow"}], ",", 
   RowBox[{"BaseStyle", "\[Rule]", 
    RowBox[{"Directive", "[", 
     RowBox[{"FontSize", "\[Rule]", "8"}], "]"}]}]}], "]"}]], "Input",Expressi\
onUUID->"c50994fa-58aa-4d16-8f40-114702336015"]
}, Closed]],

Cell[CellGroupData[{

Cell["FibonacciWord", "Subsubsection"],

Cell[BoxData[
 RowBox[{"FibonacciWord", "[", "12", "]"}]], "Input",ExpressionUUID->"7a065cc3-a80e-4af1-9b9e-3a1c70d123bd"]
}, Closed]],

Cell[CellGroupData[{

Cell["FilterText", "Subsubsection"],

Cell[BoxData[
 RowBox[{"file", "=", 
  RowBox[{"FileNameJoin", "[", 
   RowBox[{"{", 
    RowBox[{
    "$UserBaseDirectory", ",", "\"\<Applications\>\"", ",", "\"\<EPM\>\"", 
     ",", "\"\<Data\>\"", ",", "\"\<StopWords.dat\>\""}], "}"}], 
   "]"}]}]], "Input",ExpressionUUID->"b8e2c1c3-2ea8-45fc-a32c-0e6baf9eee0b"],

Cell[BoxData[
 RowBox[{"stopwords", "=", 
  RowBox[{"Rest", "@", 
   RowBox[{"Import", "[", 
    RowBox[{"file", ",", "\"\<List\>\""}], "]"}]}]}]], "Input",
 CellTags->
  "9.4 Solutions",ExpressionUUID->"6cd9d9f0-20d2-4914-a8ca-c2e6ffea9083"],

Cell[BoxData[
 RowBox[{"FilterText", "[", 
  RowBox[{"\"\<What is the meaning of life?\>\"", ",", "stopwords"}], 
  "]"}]], "Input",
 CellTags->
  "9.4 Solutions",ExpressionUUID->"88a18a2e-a3a3-4f09-bb28-56a3d8d7ef7d"],

Cell["Compare with built-in (10.2) function:", "Text"],

Cell[BoxData[
 RowBox[{"DeleteStopwords", "[", "\"\<What is the meaning of life?\>\"", 
  "]"}]], "Input",ExpressionUUID->"e7ab149e-4c61-45de-a1a9-3fc75aec7d89"]
}, Closed]],

Cell[CellGroupData[{

Cell["FindSubsequence", "Subsubsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"pidigs", "=", 
   RowBox[{"N", "[", 
    RowBox[{"\[Pi]", ",", 
     SuperscriptBox["10", "7"]}], "]"}]}], ";"}]], "Input",ExpressionUUID->\
"e1a2dd6e-6104-4041-92dc-a01fe9919803"],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindSubsequence", "[", 
   RowBox[{"pidigs", ",", "314159"}], "]"}], "//", "Timing"}]], "Input",Expres\
sionUUID->"d17af220-48a2-48e2-b545-4951b4c553f0"]
}, Closed]],

Cell[CellGroupData[{

Cell["FindWordsContaining", "Subsubsection"],

Cell[BoxData[
 RowBox[{"FindWordsContaining", "[", 
  RowBox[{"\"\<cite\>\"", ",", 
   RowBox[{"WordPosition", "\[Rule]", "\"\<Anywhere\>\""}]}], "]"}]], "Input",\
ExpressionUUID->"fd89d8b7-79eb-4f59-ab01-149ae9931451"]
}, Closed]],

Cell[CellGroupData[{

Cell["GCRatio", "Subsubsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"hsMito", "=", 
   RowBox[{"Import", "[", "\"\<ExampleData/mitochondrion.fa.gz\>\"", "]"}]}], 
  ";"}]], "Input",ExpressionUUID->"4cc9f65c-db32-4a40-8e73-96d16507e621"],

Cell[BoxData[
 RowBox[{"GCRatio", "[", 
  RowBox[{"hsMito", ",", "1000"}], "]"}]], "Input",ExpressionUUID->"795a7005-\
ab04-4cf4-98b7-7d675790204d"],

Cell[BoxData[
 RowBox[{"GCRatio", "[", 
  RowBox[{"hsMito", ",", "1000"}], "]"}]], "Input",ExpressionUUID->"0732b064-\
317b-403f-91b6-7bfbe23ab65e"]
}, Closed]],

Cell[CellGroupData[{

Cell["MakeVarList", "Subsubsection"],

Cell[BoxData[
 RowBox[{"MakeVarList", "[", 
  RowBox[{"tmp", ",", "6"}], "]"}]], "Input",ExpressionUUID->"20106cc6-2b7e-\
4746-9c2c-b1027c48aa32"],

Cell[BoxData[
 RowBox[{"MakeVarList", "[", 
  RowBox[{"tmp", ",", 
   RowBox[{"{", 
    RowBox[{"4", ",", "8"}], "}"}]}], "]"}]], "Input",ExpressionUUID->\
"183ed737-a3b4-43f0-ae63-25cbd0c45214"]
}, Closed]],

Cell[CellGroupData[{

Cell["palindromeQ", "Subsubsection"],

Cell[BoxData[
 RowBox[{"palindromeQ", "[", "\"\<mood\>\"", "]"}]], "Input",ExpressionUUID->"08893374-d111-4f07-a0ff-61ee5a9bfa07"],

Cell[BoxData[
 RowBox[{"palindromeQ", "[", "\"\<kayak\>\"", "]"}]], "Input",ExpressionUUID->"7f54ba0b-6bc4-4ad3-8c24-6e0b79ead1d7"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"words", "=", 
   RowBox[{"DictionaryLookup", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Select", "[", 
  RowBox[{"words", ",", "palindromeQ"}], "]"}]}], "Input",ExpressionUUID->\
"d1c97708-9afa-4883-812d-9085c0afaa2b"]
}, Closed]],

Cell[CellGroupData[{

Cell["Palindromes", "Subsubsection"],

Cell[BoxData[
 RowBox[{"Palindromes", "[", "]"}]], "Input",ExpressionUUID->"41bbd3f0-8eba-4133-8414-6e10e6a0648d"],

Cell[BoxData[
 RowBox[{"Palindromes", "[", "7", "]"}]], "Input",ExpressionUUID->"52bebffa-88c9-439e-84a3-e6fb006562a7"]
}, Closed]],

Cell[CellGroupData[{

Cell["RandomString", "Subsubsection"],

Cell[BoxData[
 RowBox[{"RandomString", "[", 
  RowBox[{"{", 
   RowBox[{"\"\<A\>\"", ",", "\"\<C\>\"", ",", "\"\<T\>\""}], "}"}], 
  "]"}]], "Input",ExpressionUUID->"039099c0-9f21-4618-82c8-8025aa81125d"],

Cell[BoxData[
 RowBox[{"RandomString", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"\"\<A\>\"", ",", "\"\<C\>\"", ",", "\"\<T\>\""}], "}"}], ",", 
   "10"}], "]"}]], "Input",ExpressionUUID->"b462011c-cfa2-421c-a099-\
41b639db0574"],

Cell[BoxData[
 RowBox[{"RandomString", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"\"\<A\>\"", ",", "\"\<C\>\"", ",", "\"\<T\>\""}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"4", ",", "10"}], "}"}]}], "]"}]], "Input",ExpressionUUID->\
"4a0223ae-a51f-4b19-9921-d6d54386fed2"],

Cell[BoxData[
 RowBox[{"RandomString", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"\"\<A\>\"", ",", "\"\<C\>\"", ",", "\"\<T\>\""}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"4", ",", "10"}], "}"}], ",", 
   RowBox[{"Weights", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{".2", ",", ".7", ",", ".1"}], "}"}]}]}], "]"}]], "Input",Expressi\
onUUID->"5fb21811-cc8a-4c89-9bef-1e2748b0f20f"],

Cell["Check bad input:", "Text"],

Cell[BoxData[
 RowBox[{"RandomString", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"\"\<A\>\"", ",", "\"\<C\>\"", ",", "\"\<T\>\""}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"4", ",", "10"}], "}"}], ",", 
   RowBox[{"Weights", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{".2", ",", ".7"}], "}"}]}]}], "]"}]], "Input",ExpressionUUID->\
"6120eb29-d3ac-4c60-a089-a3adb5d977c0"]
}, Closed]],

Cell[CellGroupData[{

Cell["SequenceTable", "Subsubsection"],

Cell[BoxData[
 RowBox[{"str", "=", 
  RowBox[{"RandomString", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
     "\"\<C\>\"", ",", "\"\<A\>\"", ",", "\"\<T\>\"", ",", "\"\<G\>\""}], 
     "}"}], ",", "178"}], "]"}]}]], "Input",ExpressionUUID->"9b690e70-622b-\
40a3-8212-f546af5de2a5"],

Cell[BoxData[
 RowBox[{"SequenceTable", "[", "str", "]"}]], "Input",ExpressionUUID->"b182130b-2628-45ec-b8f6-e2670c33cfa3"],

Cell[BoxData[
 RowBox[{"SequenceTable", "[", 
  RowBox[{"str", ",", 
   RowBox[{"BlockSize", "\[Rule]", "12"}], ",", 
   RowBox[{"Background", "\[Rule]", "LightYellow"}], ",", 
   RowBox[{"BaseStyle", "\[Rule]", 
    RowBox[{"Directive", "[", 
     RowBox[{"FontSize", "\[Rule]", "8"}], "]"}]}]}], "]"}]], "Input",Expressi\
onUUID->"5f85a7f1-2ed4-4ab2-b101-cb31797d3157"]
}, Closed]],

Cell[CellGroupData[{

Cell["StringPad", "Subsubsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringPad", "[", 
   RowBox[{"\"\<ciao\>\"", ",", "8"}], "]"}], "//", "FullForm"}]], "Input",Exp\
ressionUUID->"4c0cd9c5-b6db-43b3-9913-c37b22dfdcf4"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringPad", "[", 
   RowBox[{"\"\<ciao\>\"", ",", "5", ",", "5"}], "]"}], "//", 
  "FullForm"}]], "Input",ExpressionUUID->"df1aca31-7862-47f8-bb14-\
47519f48f871"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringPad", "[", 
   RowBox[{"\"\<ciao\>\"", ",", "3"}], "]"}], "//", "FullForm"}]], "Input",Exp\
ressionUUID->"c7431e13-648e-4287-b096-87e790945369"]
}, Closed]],

Cell[CellGroupData[{

Cell["stringPartition", "Subsubsection"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"str", "=", 
   RowBox[{"GenomeData", "[", "\"\<IGHVII671\>\"", "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"stringPartition", "[", 
  RowBox[{"str", ",", "12"}], "]"}]}], "Input",ExpressionUUID->"c9a333fb-6c27-\
4c86-8826-5003a59dd7a3"],

Cell[BoxData[
 RowBox[{
  RowBox[{"data", "=", 
   RowBox[{"RandomString", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "\"\<A\>\"", ",", "\"\<T\>\"", ",", "\"\<C\>\"", ",", "\"\<G\>\""}], 
      "}"}], ",", 
     SuperscriptBox["10", "2"]}], "]"}]}], ";"}]], "Input",ExpressionUUID->\
"95246187-68ec-4ae0-aaee-d610f1a30d37"],

Cell[BoxData[
 RowBox[{"stringPartition", "[", 
  RowBox[{"data", ",", "12"}], "]"}]], "Input",ExpressionUUID->"ab42884b-a9a7-\
490e-895c-bdc12eacd9ee"]
}, Closed]],

Cell[CellGroupData[{

Cell["StringPermutations", "Subsubsection"],

Cell[BoxData[
 RowBox[{"StringPermutations", "[", "\"\<ABC\>\"", "]"}]], "Input",ExpressionU\
UID->"01811852-26c6-4515-a6f0-9c11c5404591"]
}, Closed]],

Cell[CellGroupData[{

Cell["StringTally", "Subsubsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{
  "str", "=", 
   "\"\<Strings are used across many disciplines to represent data, \
filenames, and other objects: they are used by linguists studying \
representation, classi\[FiLigature]cation, and patterns involved in audio and \
text usage; biologists dealing working with genomic data as strings are \
interested in sequence structure and assembly and perform extensive \
statistical analysis on strings; programmers operate on string data for such \
tasks as text search, file manipulation, and text processing. Strings are so \
ubiquitous that almost every modern programming language has a string \
datatype and dozens of functions for operating on strings.\>\""}], 
  ";"}]], "Input",ExpressionUUID->"93fa80db-d52b-4f44-92b3-56dab1c6ed03"],

Cell[BoxData[
 RowBox[{"StringTally", "[", "str", "]"}]], "Input",ExpressionUUID->"4109ad4e-b6c5-4b7e-89af-bea8fd35927f"],

Cell[BoxData[
 RowBox[{"Options", "[", "StringTally", "]"}]], "Input",ExpressionUUID->"55a15a6e-6d3d-4667-86d5-86f57d8f2e3f"],

Cell[BoxData[
 RowBox[{"?", "IncludeCharacters"}]], "Input",ExpressionUUID->"d908c306-f926-43bb-93b8-706e5f08bd9a"],

Cell[BoxData[
 RowBox[{"StringTally", "[", 
  RowBox[{"str", ",", 
   RowBox[{"IncludeCharacters", "\[Rule]", "PunctuationOnly"}]}], 
  "]"}]], "Input",ExpressionUUID->"3fac1527-99ac-4bf7-a98f-81334b160617"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StringTally", "[", 
   RowBox[{"str", ",", 
    RowBox[{"IncludeCharacters", "\[Rule]", "WordCharacters"}], ",", 
    RowBox[{"IgnoreCase", "\[Rule]", "True"}]}], "]"}], "//", 
  "Sort"}]], "Input",ExpressionUUID->"e596f4a2-6847-40c3-ba21-0b4301fad243"]
}, Closed]],

Cell[CellGroupData[{

Cell["StringTranspose", "Subsubsection"],

Cell[BoxData[
 RowBox[{"StringTranspose", "[", 
  RowBox[{"\"\<abc\>\"", ",", "\"\<def\>\""}], "]"}]], "Input",ExpressionUUID-\
>"4d922f4b-5cb7-4089-b0a7-d445143b5747"]
}, Closed]],

Cell[CellGroupData[{

Cell["UcLc", "Subsubsection"],

Cell[BoxData[
 RowBox[{"UcLc", "[", "\"\<ciao\>\"", "]"}]], "Input",ExpressionUUID->"63517f66-0083-4839-8d4f-36f66605f72e"]
}, Closed]],

Cell[CellGroupData[{

Cell["UniqueCharacters", "Subsubsection"],

Cell[BoxData[
 RowBox[{"UniqueCharacters", "[", "\"\<Mississippi\>\"", "]"}]], "Input",Expre\
ssionUUID->"981003d2-9b7b-4b3b-931f-e86d1016f052"]
}, Closed]],

Cell[CellGroupData[{

Cell["WordPosition", "Subsubsection"],

Cell[BoxData[
 RowBox[{"FindWordsContaining", "[", 
  RowBox[{"\"\<cite\>\"", ",", 
   RowBox[{"WordPosition", "\[Rule]", "\"\<End\>\""}]}], "]"}]], "Input",Expre\
ssionUUID->"d759451a-17c1-4020-a8a1-014a27018917"]
}, Closed]],

Cell[CellGroupData[{

Cell["XorEncode", "Subsubsection"],

Cell[BoxData[
 RowBox[{"XorEncode", "[", 
  RowBox[{"\"\<Orange\>\"", ",", "\"\<K\>\""}], "]"}]], "Input",ExpressionUUID\
->"00a6dc59-5cc2-41d7-9cd5-a060847b7b32"]
}, Closed]]
}, Closed]]
}, Open  ]]
},
AutoGeneratedPackage->Automatic,
WindowSize->{885, 874},
WindowMargins->{{Automatic, 793}, {Automatic, 128}},
ShowSelection->True,
FrontEndVersion->"11.1 for Mac OS X x86 (32-bit, 64-bit Kernel) (March 16, \
2017)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "7.2"->{
  Cell[36325, 1097, 287, 7, 
  32, "Input", "ExpressionUUID" -> "fa386bb3-448b-4cbd-bf8b-f55e901c38a5",
   CellTags->{"7.2", "7.2 Exercises"}]},
 "7.2 Exercises"->{
  Cell[36325, 1097, 287, 7, 
  32, "Input", "ExpressionUUID" -> "fa386bb3-448b-4cbd-bf8b-f55e901c38a5",
   CellTags->{"7.2", "7.2 Exercises"}]},
 "9.4 Solutions"->{
  Cell[44492, 1402, 242, 6, 
  32, "Input", "ExpressionUUID" -> "6cd9d9f0-20d2-4914-a8ca-c2e6ffea9083",
   CellTags->"9.4 Solutions"],
  Cell[44737, 1410, 218, 5, 
  32, "Input", "ExpressionUUID" -> "88a18a2e-a3a3-4f09-bb28-56a3d8d7ef7d",
   CellTags->"9.4 Solutions"]},
 "9.5"->{
  Cell[16270, 490, 367, 11, 
  35, "Input", "ExpressionUUID" -> "2335e8a8-c764-4e37-aaf3-f03c0769e68c",
   CellTags->"9.5"],
  Cell[31872, 959, 2385, 66, 
  221, "InputOnly", "ExpressionUUID" -> "3f89522e-c873-4f79-86ae-d0df4efa37c5",
   CellTags->"9.5"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"7.2", 55397, 1774},
 {"7.2 Exercises", 55562, 1778},
 {"9.4 Solutions", 55727, 1782},
 {"9.5", 56008, 1789}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[422, 15, 59, 1, 64, "Section", "ExpressionUUID" -> \
"c603b883-d3cc-4cb1-a196-adff739d8ee5",
 InitializationGroup->True],
Cell[484, 18, 240, 9, 49, "Text", "ExpressionUUID" -> \
"e5eb7433-12a1-40f1-ae7b-968dd23af642"],
Cell[CellGroupData[{
Cell[749, 31, 31, 0, 44, "Subsection", "ExpressionUUID" -> \
"017961d9-ec6b-4052-bde9-acb749a6e9dc"],
Cell[783, 33, 108, 2, 32, "Input", "ExpressionUUID" -> \
"141a2947-f37b-4379-b757-492212a4a3ff"],
Cell[894, 37, 190, 5, 32, "Input", "ExpressionUUID" -> \
"4169e9f4-3cd5-47da-afa3-e8b0291cc941"],
Cell[1087, 44, 146, 4, 32, "Input", "ExpressionUUID" -> \
"e15dc9ac-6235-4092-868e-4a368a4df411"],
Cell[1236, 50, 278, 6, 32, "Input", "ExpressionUUID" -> \
"72b88a63-35f4-48a0-a11d-a3e7309cfc65"],
Cell[1517, 58, 111, 2, 32, "Input", "ExpressionUUID" -> \
"81c36b4f-1346-4607-af21-946778229210"],
Cell[1631, 62, 147, 4, 32, "Input", "ExpressionUUID" -> \
"0bb2a5cf-0e79-4a5a-a817-a49ffdc8f82b"],
Cell[1781, 68, 209, 5, 32, "Input", "ExpressionUUID" -> \
"7396e896-e1d1-491b-b4b1-5d6351d5d95f"],
Cell[1993, 75, 256, 8, 32, "Input", "ExpressionUUID" -> \
"b6e55a2c-2dd5-41ae-bf3f-6a599ef6fbf1"],
Cell[2252, 85, 735, 15, 96, "Input", "ExpressionUUID" -> \
"c924b289-a733-4dfb-97d0-867f7ba2b063"],
Cell[2990, 102, 130, 3, 32, "Input", "ExpressionUUID" -> \
"6aa9537b-fa6e-442d-9722-9c49aaecec05"],
Cell[3123, 107, 140, 4, 32, "Input", "ExpressionUUID" -> \
"f64b759b-d365-4bcb-97d3-6f71653b93e2"],
Cell[3266, 113, 181, 3, 32, "Input", "ExpressionUUID" -> \
"6a1c1117-64ca-4451-915a-a32b20dd6372"]
}, Closed]],
Cell[CellGroupData[{
Cell[3484, 121, 34, 0, 36, "Subsection", "ExpressionUUID" -> \
"7c4623d8-6a54-4163-b438-c3298ad8a708"],
Cell[3521, 123, 668, 11, 117, "Input", "ExpressionUUID" -> \
"38f1432e-e9c0-414f-ae9d-1b440e5a1896"],
Cell[4192, 136, 122, 3, 32, "Input", "ExpressionUUID" -> \
"40ced816-3a42-4991-8bad-3699d807a3c9"]
}, Closed]],
Cell[CellGroupData[{
Cell[4351, 144, 36, 0, 36, "Subsection", "ExpressionUUID" -> \
"f382c3cc-34c0-4be8-9fdf-8279d1cd936e"],
Cell[4390, 146, 286, 6, 75, "Input", "ExpressionUUID" -> \
"f077823e-3662-4a89-8524-3ccf0645124d"],
Cell[4679, 154, 243, 5, 32, "Input", "ExpressionUUID" -> \
"97b889ce-5895-4f3b-a7a9-5b23787ca5de"],
Cell[4925, 161, 252, 6, 32, "Input", "ExpressionUUID" -> \
"91716c22-95e1-49cf-9bcd-6469805b8ac2"],
Cell[5180, 169, 427, 9, 75, "Input", "ExpressionUUID" -> \
"a860ff1f-0e61-420f-9bdc-8c70f72f6ac9"],
Cell[5610, 180, 385, 9, 54, "Input", "ExpressionUUID" -> \
"ed0e75a1-b104-4be2-ae4a-c499095b19d4"],
Cell[5998, 191, 482, 12, 75, "Input", "ExpressionUUID" -> \
"645afeeb-1f89-4bfc-a8d2-d832ea64f754"],
Cell[6483, 205, 541, 11, 96, "Input", "ExpressionUUID" -> \
"c3e75648-876d-4f5e-a32e-6e4d78ab77ee"],
Cell[7027, 218, 392, 9, 54, "Input", "ExpressionUUID" -> \
"adbdbc2d-e776-470b-8d55-f3ef8a4216ec"],
Cell[7422, 229, 243, 5, 75, "Input", "ExpressionUUID" -> \
"945b632c-4313-4617-a5c4-d5d371d1170a"],
Cell[7668, 236, 205, 5, 54, "Input", "ExpressionUUID" -> \
"d2feb3ec-a1f8-45bc-8a51-071c024ccc9d"],
Cell[7876, 243, 207, 5, 54, "Input", "ExpressionUUID" -> \
"23a762de-720c-4818-895b-a06f914ea05a"],
Cell[8086, 250, 209, 5, 54, "Input", "ExpressionUUID" -> \
"ec3dbc4a-069f-444a-956c-0421f67cc957"],
Cell[8298, 257, 831, 23, 76, "Input", "ExpressionUUID" -> \
"34595340-55d3-44d2-b443-a4da9b35381f"],
Cell[9132, 282, 418, 9, 96, "Input", "ExpressionUUID" -> \
"b1b6d57c-3f0a-44cb-acbe-2eb6a2b73a46"],
Cell[9553, 293, 409, 9, 96, "Input", "ExpressionUUID" -> \
"e7c42c0c-7808-42b7-ab04-e264c4bd5042"],
Cell[9965, 304, 366, 9, 75, "Input", "ExpressionUUID" -> \
"971b695c-9096-47ae-b474-f5137fa3c583"],
Cell[10334, 315, 1068, 23, 117, "Input", "ExpressionUUID" -> \
"146e7c73-36b0-4fa5-ab82-2fe5f1091ef2"],
Cell[11405, 340, 191, 5, 32, "Input", "ExpressionUUID" -> \
"47f97209-cb55-4064-8145-8f6e965f741f"],
Cell[11599, 347, 205, 5, 54, "Input", "ExpressionUUID" -> \
"eeefebac-8e22-400c-ab23-ca38a625ae65"],
Cell[11807, 354, 277, 6, 75, "Input", "ExpressionUUID" -> \
"70ad719e-d657-495a-aeae-00be7dee6610"],
Cell[12087, 362, 496, 11, 75, "Input", "ExpressionUUID" -> \
"cb0a11a0-5e09-415e-9f27-99fd33316c7b"],
Cell[12586, 375, 180, 5, 32, "Input", "ExpressionUUID" -> \
"cdadbffb-c487-458d-8314-e8d5a73d4ea9"],
Cell[12769, 382, 405, 10, 75, "Input", "ExpressionUUID" -> \
"1238ed6a-fb31-4a84-854c-824423599e40"],
Cell[13177, 394, 254, 6, 32, "Input", "ExpressionUUID" -> \
"a379cfb8-1b4c-490b-9b35-3f2ef381ecdf"],
Cell[13434, 402, 392, 7, 96, "Input", "ExpressionUUID" -> \
"6cdffc0d-e292-4530-bd10-efeafc18667c"],
Cell[13829, 411, 252, 6, 75, "Input", "ExpressionUUID" -> \
"a9c980cd-8358-4dbb-abf7-9129aa632f9b"],
Cell[14084, 419, 513, 12, 75, "Input", "ExpressionUUID" -> \
"3e87a2db-6d90-4c0d-8755-7d0ab608a473"],
Cell[14600, 433, 240, 6, 32, "Input", "ExpressionUUID" -> \
"95341095-379d-4aa5-bdef-e3da525c3d53"],
Cell[14843, 441, 283, 7, 75, "Input", "ExpressionUUID" -> \
"78d506d9-ad9f-4e61-af09-3ea1dbec9c72"],
Cell[15129, 450, 303, 6, 75, "Input", "ExpressionUUID" -> \
"23896383-6b27-444a-868f-85a61f46000b"],
Cell[15435, 458, 364, 9, 32, "Input", "ExpressionUUID" -> \
"fa464625-8ee7-4c35-bbf8-08ad6c78888d"]
}, Closed]],
Cell[CellGroupData[{
Cell[15836, 472, 29, 0, 36, "Subsection", "ExpressionUUID" -> \
"6f069594-6c25-4b98-9743-9e728b0c7eb3"],
Cell[15868, 474, 201, 6, 35, "Input", "ExpressionUUID" -> \
"b394c92c-eafa-4fba-8509-fee0b5c9beb3"],
Cell[16072, 482, 195, 6, 35, "Input", "ExpressionUUID" -> \
"3f3c27ae-1372-4e2c-83bf-562a71132f5b"],
Cell[16270, 490, 367, 11, 35, "Input", "ExpressionUUID" -> \
"2335e8a8-c764-4e37-aaf3-f03c0769e68c",
 CellTags->"9.5"],
Cell[16640, 503, 266, 7, 35, "Input", "ExpressionUUID" -> \
"5421bf93-2ed5-46eb-bd4f-52302c175b1b"]
}, Closed]],
Cell[CellGroupData[{
Cell[16943, 515, 43, 0, 36, "Subsection", "ExpressionUUID" -> \
"770d504e-728b-4b2b-af0d-255f83c8a246"],
Cell[16989, 517, 92, 2, 28, "Input", "ExpressionUUID" -> \
"df511c6b-6f60-414a-8015-a4f1c71d8cf1"]
}, Closed]],
Cell[CellGroupData[{
Cell[17118, 524, 42, 0, 36, "Subsection", "ExpressionUUID" -> \
"5912a294-fd56-4776-90b8-4811d00d2d91"],
Cell[17163, 526, 180, 4, 32, "Input", "ExpressionUUID" -> \
"19854625-a790-4479-b33e-775c36c797a2"],
Cell[17346, 532, 924, 25, 96, "Input", "ExpressionUUID" -> \
"d44677d1-9971-4ae8-b508-bf69d93a7c3e"],
Cell[18273, 559, 1144, 30, 138, "Input", "ExpressionUUID" -> \
"d6200f59-bf68-4ba0-8190-09aac84bb724"],
Cell[19420, 591, 242, 8, 54, "Input", "ExpressionUUID" -> \
"4f6356cb-16bd-4eb8-b135-9134a8056fff"],
Cell[19665, 601, 247, 7, 32, "Input", "ExpressionUUID" -> \
"6798c18f-d85c-4e8d-aba8-2c67fb0fa0b7"],
Cell[19915, 610, 829, 22, 117, "Input", "ExpressionUUID" -> \
"8ca7ea7d-e78e-47e3-a29b-64b5acedfe14"],
Cell[20747, 634, 765, 22, 96, "Input", "ExpressionUUID" -> \
"ef8af8f0-97bd-465b-9ed3-2f72d4082bff"],
Cell[21515, 658, 706, 19, 117, "Input", "ExpressionUUID" -> \
"5ed760c0-750a-415d-b80f-8922760ba2d7"],
Cell[22224, 679, 1638, 37, 159, "Input", "ExpressionUUID" -> \
"27309694-5006-4e67-8575-bf1c7ec183ae"],
Cell[23865, 718, 526, 15, 96, "Input", "ExpressionUUID" -> \
"b026575f-ffa6-4880-8405-51e8dd542841"],
Cell[24394, 735, 905, 24, 117, "Input", "ExpressionUUID" -> \
"85bc2812-18b4-4834-bd64-62420abaa5e7"],
Cell[25302, 761, 226, 6, 32, "Input", "ExpressionUUID" -> \
"298845cf-1b1e-4f76-be73-c5ced172eea2"],
Cell[25531, 769, 386, 11, 32, "Input", "ExpressionUUID" -> \
"605932c9-9d93-42c1-8eb1-b687fd30f129"],
Cell[25920, 782, 540, 16, 54, "Input", "ExpressionUUID" -> \
"75843241-a071-46d7-851e-9c75246db34d"],
Cell[26463, 800, 291, 8, 54, "Input", "ExpressionUUID" -> \
"bb174126-28bf-48a5-9f3f-c214d541aa74"],
Cell[26757, 810, 309, 9, 54, "Input", "ExpressionUUID" -> \
"c3632583-1b37-41fb-98ef-6e679fa19b79"],
Cell[27069, 821, 296, 7, 54, "Input", "ExpressionUUID" -> \
"830ef354-2c07-4a50-9f77-cda8a82eaef2"],
Cell[27368, 830, 314, 8, 54, "Input", "ExpressionUUID" -> \
"34c20cbd-6d5a-497f-9bac-bfbf7407118c"],
Cell[27685, 840, 389, 11, 54, "Input", "ExpressionUUID" -> \
"1309fdc0-d234-4277-99b3-1e9d4fdbfd4e"],
Cell[28077, 853, 258, 8, 32, "Input", "ExpressionUUID" -> \
"89a7c215-c017-495d-bad1-68e804bd462e"],
Cell[28338, 863, 1227, 33, 138, "Input", "ExpressionUUID" -> \
"8a49f724-275e-444d-b271-aae38e53b409"],
Cell[29568, 898, 314, 9, 32, "Input", "ExpressionUUID" -> \
"22eae90a-582b-470b-ad2a-51fd126c8504"],
Cell[29885, 909, 1984, 48, 159, "Input", "ExpressionUUID" -> \
"03a587f9-7b71-4e0f-8255-b6b4545d6582"],
Cell[31872, 959, 2385, 66, 221, "InputOnly", "ExpressionUUID" -> \
"3f89522e-c873-4f79-86ae-d0df4efa37c5",
 CellTags->"9.5"],
Cell[34260, 1027, 303, 9, 32, "Input", "ExpressionUUID" -> \
"d6f89ba4-eb4a-4933-aa2a-f590c79cf1d2"],
Cell[34566, 1038, 669, 21, 75, "Input", "ExpressionUUID" -> \
"77ed82d9-a138-4eb1-89cc-197f8179e364"],
Cell[35238, 1061, 394, 11, 32, "Input", "ExpressionUUID" -> \
"7b82387e-23d7-4958-8466-4d627c2f5684"],
Cell[35635, 1074, 305, 9, 32, "Input", "ExpressionUUID" -> \
"1ed96204-77f2-4bda-a08c-96a17fb9a1ff"],
Cell[35943, 1085, 379, 10, 54, "Input", "ExpressionUUID" -> \
"47445917-5eef-4bec-9010-d639e9bf01b8"],
Cell[36325, 1097, 287, 7, 32, "Input", "ExpressionUUID" -> \
"fa386bb3-448b-4cbd-bf8b-f55e901c38a5",
 CellTags->{"7.2", "7.2 Exercises"}],
Cell[36615, 1106, 1477, 36, 222, "Input", "ExpressionUUID" -> \
"cae1b116-29be-4c91-8f01-d9105438dbb5"],
Cell[38095, 1144, 353, 10, 54, "Input", "ExpressionUUID" -> \
"16be96d0-093b-4d95-8819-fdc6fe3db5ee"],
Cell[38451, 1156, 361, 10, 54, "Input", "ExpressionUUID" -> \
"9e08fbca-44da-4197-a793-c4c20b80f5d2"],
Cell[38815, 1168, 185, 4, 32, "Input", "ExpressionUUID" -> \
"9d9f1711-e552-41f7-8858-b65a803253e9"],
Cell[39003, 1174, 1202, 34, 138, "Input", "ExpressionUUID" -> \
"227b461a-e2ce-4976-9277-7d73e8c19468"]
}, Closed]],
Cell[CellGroupData[{
Cell[40242, 1213, 41, 0, 36, "Subsection", "ExpressionUUID" -> \
"9f5525cb-f93e-49ec-bf24-01808276dfb1"],
Cell[40286, 1215, 69, 2, 28, "Input", "ExpressionUUID" -> \
"2bbb0468-ac52-4843-bae2-58ac34e84b3d"]
}, Closed]],
Cell[CellGroupData[{
Cell[40392, 1222, 32, 0, 36, "Subsection", "ExpressionUUID" -> \
"fcbcde7a-3147-4fca-a770-4ad6867655fe"],
Cell[40427, 1224, 83, 2, 262, "Input", "ExpressionUUID" -> \
"fc11f59a-cb44-46a1-890a-7f74b58a0430"]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[40559, 1232, 27, 0, 64, "Section", "ExpressionUUID" -> \
"7a555a70-d206-4060-af54-566ae2e2d48a"],
Cell[CellGroupData[{
Cell[40611, 1236, 34, 0, 44, "Subsection", "ExpressionUUID" -> \
"11aba968-7160-459e-a8ad-03c88df8c8f3"],
Cell[40648, 1238, 85, 0, 32, "Input", "ExpressionUUID" -> \
"8266f28a-a164-470c-85ae-2eb3dd300289"],
Cell[40736, 1240, 183, 6, 30, "Text", "ExpressionUUID" -> \
"43bd1ae1-b595-4f33-a0f4-2f3c3674e18c"],
Cell[40922, 1248, 103, 1, 32, "Input", "ExpressionUUID" -> \
"24cdf6d7-14ab-4803-8175-de385cebf250"]
}, Open  ]],
Cell[CellGroupData[{
Cell[41062, 1254, 41, 0, 44, "Subsection", "ExpressionUUID" -> \
"363df98e-4f7e-497b-bc55-6cb7665623ef"],
Cell[41106, 1256, 55, 1, 32, "Input", "ExpressionUUID" -> \
"44f8be02-ff29-4bb5-8d0a-221f401d82c9"],
Cell[41164, 1259, 51, 1, 32, "Input", "ExpressionUUID" -> \
"e0d2b359-c075-4600-911f-1ffee28db21e"],
Cell[41218, 1262, 53, 1, 32, "Input", "ExpressionUUID" -> \
"634ce2d1-5d11-4c52-a374-c20884377961"],
Cell[41274, 1265, 52, 1, 32, "Input", "ExpressionUUID" -> \
"e74ef3d8-c018-42a1-abdc-02dc17d5eb03"],
Cell[41329, 1268, 56, 1, 32, "Input", "ExpressionUUID" -> \
"1dcc0188-8861-472d-8f04-934416229b76"],
Cell[41388, 1271, 53, 1, 32, "Input", "ExpressionUUID" -> \
"df1fe6d0-74de-4718-abd7-bbd726ef0cd7"],
Cell[41444, 1274, 58, 1, 32, "Input", "ExpressionUUID" -> \
"c99ad70f-5ebe-4e69-8e29-9685584fd7b9"],
Cell[41505, 1277, 62, 1, 32, "Input", "ExpressionUUID" -> \
"89353c36-cdfa-4185-a7a4-cb2f8c5ffb46"],
Cell[41570, 1280, 50, 1, 32, "Input", "ExpressionUUID" -> \
"b1a6631a-78e8-4272-ab3c-479239e86d3f"],
Cell[41623, 1283, 54, 1, 32, "Input", "ExpressionUUID" -> \
"b6df3aac-dd61-4d7c-8499-576c11ea2ac0"],
Cell[41680, 1286, 54, 1, 32, "Input", "ExpressionUUID" -> \
"74d9912a-5bb0-402d-86e0-46887e89e113"],
Cell[41737, 1289, 54, 1, 32, "Input", "ExpressionUUID" -> \
"9a2ee731-78c1-48d1-bd60-7ea825c0f537"],
Cell[41794, 1292, 55, 1, 32, "Input", "ExpressionUUID" -> \
"fc1732e0-7789-47f9-b478-eb7717418b90"],
Cell[41852, 1295, 56, 1, 32, "Input", "ExpressionUUID" -> \
"d8a23e6d-a416-4414-bc78-64d258fee550"],
Cell[41911, 1298, 52, 1, 32, "Input", "ExpressionUUID" -> \
"708634e7-19c5-4f34-8e19-5f1d7e367632"],
Cell[41966, 1301, 58, 1, 32, "Input", "ExpressionUUID" -> \
"05f1fd3f-0cae-4746-8b4e-4723ff36e609"],
Cell[42027, 1304, 61, 1, 32, "Input", "ExpressionUUID" -> \
"1ffe07fe-8b19-46a3-9e5d-5900b7393aa0"],
Cell[42091, 1307, 54, 1, 32, "Input", "ExpressionUUID" -> \
"a120de11-c62d-419a-9196-e7fbcbc12a14"],
Cell[42148, 1310, 58, 1, 32, "Input", "ExpressionUUID" -> \
"3c360c5b-eb70-4f45-a879-54896b954f92"],
Cell[42209, 1313, 47, 1, 32, "Input", "ExpressionUUID" -> \
"bff98c86-d58a-41de-9fa2-f9a8f41ea250"],
Cell[42259, 1316, 59, 1, 32, "Input", "ExpressionUUID" -> \
"fbc5fccb-822f-4d2c-a100-7bfcaf9e93b5"],
Cell[42321, 1319, 55, 1, 32, "Input", "ExpressionUUID" -> \
"43cc2cfa-88a4-4c38-89e8-0ea7e07a059d"],
Cell[42379, 1322, 52, 1, 32, "Input", "ExpressionUUID" -> \
"ccd4219b-e5ff-472e-8d1f-b1e09e803b78"]
}, Closed]],
Cell[CellGroupData[{
Cell[42468, 1328, 56, 0, 36, "Subsection", "ExpressionUUID" -> \
"d60eac0e-01d4-4476-bcff-80defcbe8e38"],
Cell[CellGroupData[{
Cell[42549, 1332, 37, 0, 35, "Subsubsection", "ExpressionUUID" -> \
"f5da3cca-6183-4ac5-8fc9-101fefe8c687"],
Cell[42589, 1334, 131, 1, 32, "Input", "ExpressionUUID" -> \
"7e120884-9490-4371-bf0f-f129d99cce74"]
}, Closed]],
Cell[CellGroupData[{
Cell[42757, 1340, 33, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"fc8a34e4-bcd0-4a36-ac47-f5b07ac0ef01"],
Cell[42793, 1342, 130, 1, 32, "Input", "ExpressionUUID" -> \
"77b86b1d-1070-4c3e-a695-ca941a7707ed"]
}, Closed]],
Cell[CellGroupData[{
Cell[42960, 1348, 35, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"acca1181-37b4-4968-901a-9c476314e6de"],
Cell[42998, 1350, 163, 3, 32, "Input", "ExpressionUUID" -> \
"45ce46d4-2c9b-4bf5-9e88-88314c6de2f8"]
}, Closed]],
Cell[CellGroupData[{
Cell[43198, 1358, 34, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"c92ca9ca-cd8b-4d0e-aef9-fa99e00d89f4"],
Cell[43235, 1360, 288, 8, 32, "Input", "ExpressionUUID" -> \
"e770fd3d-c185-45a2-93dc-00497d23bb76"],
Cell[43526, 1370, 371, 8, 32, "Input", "ExpressionUUID" -> \
"c50994fa-58aa-4d16-8f40-114702336015"]
}, Closed]],
Cell[CellGroupData[{
Cell[43934, 1383, 38, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"5a93afaa-553e-43bf-a3eb-dbb37835a076"],
Cell[43975, 1385, 122, 1, 32, "Input", "ExpressionUUID" -> \
"7a065cc3-a80e-4af1-9b9e-3a1c70d123bd"]
}, Closed]],
Cell[CellGroupData[{
Cell[44134, 1391, 35, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"9dbc08cb-5e8f-4fb6-98ab-4a51fb0c864f"],
Cell[44172, 1393, 317, 7, 32, "Input", "ExpressionUUID" -> \
"b8e2c1c3-2ea8-45fc-a32c-0e6baf9eee0b"],
Cell[44492, 1402, 242, 6, 32, "Input", "ExpressionUUID" -> \
"6cd9d9f0-20d2-4914-a8ca-c2e6ffea9083",
 CellTags->"9.4 Solutions"],
Cell[44737, 1410, 218, 5, 32, "Input", "ExpressionUUID" -> \
"88a18a2e-a3a3-4f09-bb28-56a3d8d7ef7d",
 CellTags->"9.4 Solutions"],
Cell[44958, 1417, 54, 0, 30, "Text", "ExpressionUUID" -> \
"afe59bb6-328f-4450-adf7-7b67e22def3a"],
Cell[45015, 1419, 161, 2, 32, "Input", "ExpressionUUID" -> \
"e7ab149e-4c61-45de-a1a9-3fc75aec7d89"]
}, Closed]],
Cell[CellGroupData[{
Cell[45213, 1426, 40, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"0af343f7-1869-4cb1-8147-9e7257081643"],
Cell[45256, 1428, 215, 6, 35, "Input", "ExpressionUUID" -> \
"e1a2dd6e-6104-4041-92dc-a01fe9919803"],
Cell[45474, 1436, 188, 4, 32, "Input", "ExpressionUUID" -> \
"d17af220-48a2-48e2-b545-4951b4c553f0"]
}, Closed]],
Cell[CellGroupData[{
Cell[45699, 1445, 44, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"219cb03c-148f-4daf-8d20-04d3cc400312"],
Cell[45746, 1447, 219, 4, 32, "Input", "ExpressionUUID" -> \
"fd89d8b7-79eb-4f59-ab01-149ae9931451"]
}, Closed]],
Cell[CellGroupData[{
Cell[46002, 1456, 32, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"8b24a172-34a4-4a48-8b4c-71d562ff3543"],
Cell[46037, 1458, 202, 4, 32, "Input", "ExpressionUUID" -> \
"4cc9f65c-db32-4a40-8e73-96d16507e621"],
Cell[46242, 1464, 148, 3, 32, "Input", "ExpressionUUID" -> \
"795a7005-ab04-4cf4-98b7-7d675790204d"],
Cell[46393, 1469, 148, 3, 32, "Input", "ExpressionUUID" -> \
"0732b064-317b-403f-91b6-7bfbe23ab65e"]
}, Closed]],
Cell[CellGroupData[{
Cell[46578, 1477, 36, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"ba298d08-ae19-4a59-8fe3-60a07fa798c6"],
Cell[46617, 1479, 146, 3, 32, "Input", "ExpressionUUID" -> \
"20106cc6-2b7e-4746-9c2c-b1027c48aa32"],
Cell[46766, 1484, 195, 5, 32, "Input", "ExpressionUUID" -> \
"183ed737-a3b4-43f0-ae63-25cbd0c45214"]
}, Closed]],
Cell[CellGroupData[{
Cell[46998, 1494, 36, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"981eb5e5-7be8-4b51-87b4-dc10ad6cac49"],
Cell[47037, 1496, 130, 1, 32, "Input", "ExpressionUUID" -> \
"08893374-d111-4f07-a0ff-61ee5a9bfa07"],
Cell[47170, 1499, 131, 1, 32, "Input", "ExpressionUUID" -> \
"7f54ba0b-6bc4-4ad3-8c24-6e0b79ead1d7"],
Cell[47304, 1502, 266, 6, 54, "Input", "ExpressionUUID" -> \
"d1c97708-9afa-4883-812d-9085c0afaa2b"]
}, Closed]],
Cell[CellGroupData[{
Cell[47607, 1513, 36, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"6dc5876f-f48f-4cf9-bb50-dadc1eaead18"],
Cell[47646, 1515, 114, 1, 32, "Input", "ExpressionUUID" -> \
"41bbd3f0-8eba-4133-8414-6e10e6a0648d"],
Cell[47763, 1518, 119, 1, 32, "Input", "ExpressionUUID" -> \
"52bebffa-88c9-439e-84a3-e6fb006562a7"]
}, Closed]],
Cell[CellGroupData[{
Cell[47919, 1524, 37, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"9cdc76c6-8e1e-41dc-9bdf-c7e0ef8850d4"],
Cell[47959, 1526, 204, 4, 32, "Input", "ExpressionUUID" -> \
"039099c0-9f21-4618-82c8-8025aa81125d"],
Cell[48166, 1532, 233, 6, 32, "Input", "ExpressionUUID" -> \
"b462011c-cfa2-421c-a099-41b639db0574"],
Cell[48402, 1540, 278, 7, 32, "Input", "ExpressionUUID" -> \
"4a0223ae-a51f-4b19-9921-d6d54386fed2"],
Cell[48683, 1549, 388, 10, 32, "Input", "ExpressionUUID" -> \
"5fb21811-cc8a-4c89-9bef-1e2748b0f20f"],
Cell[49074, 1561, 32, 0, 30, "Text", "ExpressionUUID" -> \
"7c4b2485-fc7a-4a2d-b8a9-4a4f0bc322ff"],
Cell[49109, 1563, 377, 10, 32, "Input", "ExpressionUUID" -> \
"6120eb29-d3ac-4c60-a089-a3adb5d977c0"]
}, Closed]],
Cell[CellGroupData[{
Cell[49523, 1578, 38, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"71d266e9-3fd7-4365-aef3-dcc976590e6f"],
Cell[49564, 1580, 288, 8, 32, "Input", "ExpressionUUID" -> \
"9b690e70-622b-40a3-8212-f546af5de2a5"],
Cell[49855, 1590, 123, 1, 32, "Input", "ExpressionUUID" -> \
"b182130b-2628-45ec-b8f6-e2670c33cfa3"],
Cell[49981, 1593, 371, 8, 32, "Input", "ExpressionUUID" -> \
"5f85a7f1-2ed4-4ab2-b101-cb31797d3157"]
}, Closed]],
Cell[CellGroupData[{
Cell[50389, 1606, 34, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"17bb355d-715e-406d-a8f2-d76c989345e5"],
Cell[50426, 1608, 185, 4, 32, "Input", "ExpressionUUID" -> \
"4c0cd9c5-b6db-43b3-9913-c37b22dfdcf4"],
Cell[50614, 1614, 198, 5, 32, "Input", "ExpressionUUID" -> \
"df1aca31-7862-47f8-bb14-47519f48f871"],
Cell[50815, 1621, 185, 4, 32, "Input", "ExpressionUUID" -> \
"c7431e13-648e-4287-b096-87e790945369"]
}, Closed]],
Cell[CellGroupData[{
Cell[51037, 1630, 40, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"4aa37c9d-9539-4a20-b194-fbc6e3937146"],
Cell[51080, 1632, 280, 7, 54, "Input", "ExpressionUUID" -> \
"c9a333fb-6c27-4c86-8826-5003a59dd7a3"],
Cell[51363, 1641, 339, 10, 35, "Input", "ExpressionUUID" -> \
"95246187-68ec-4ae0-aaee-d610f1a30d37"],
Cell[51705, 1653, 152, 3, 32, "Input", "ExpressionUUID" -> \
"ab42884b-a9a7-490e-895c-bdc12eacd9ee"]
}, Closed]],
Cell[CellGroupData[{
Cell[51894, 1661, 43, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"24a6bfb8-72f9-4e19-ab63-0dec65d7d6d2"],
Cell[51940, 1663, 138, 2, 32, "Input", "ExpressionUUID" -> \
"01811852-26c6-4515-a6f0-9c11c5404591"]
}, Closed]],
Cell[CellGroupData[{
Cell[52115, 1670, 36, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"b68760a1-b060-4aa6-878c-a8f469499967"],
Cell[52154, 1672, 783, 13, 201, "Input", "ExpressionUUID" -> \
"93fa80db-d52b-4f44-92b3-56dab1c6ed03"],
Cell[52940, 1687, 121, 1, 32, "Input", "ExpressionUUID" -> \
"4109ad4e-b6c5-4b7e-89af-bea8fd35927f"],
Cell[53064, 1690, 125, 1, 32, "Input", "ExpressionUUID" -> \
"55a15a6e-6d3d-4667-86d5-86f57d8f2e3f"],
Cell[53192, 1693, 115, 1, 32, "Input", "ExpressionUUID" -> \
"d908c306-f926-43bb-93b8-706e5f08bd9a"],
Cell[53310, 1696, 207, 4, 32, "Input", "ExpressionUUID" -> \
"3fac1527-99ac-4bf7-a98f-81334b160617"],
Cell[53520, 1702, 288, 6, 32, "Input", "ExpressionUUID" -> \
"e596f4a2-6847-40c3-ba21-0b4301fad243"]
}, Closed]],
Cell[CellGroupData[{
Cell[53845, 1713, 40, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"92cdf8f2-88b8-487b-a202-5511925cb607"],
Cell[53888, 1715, 168, 3, 32, "Input", "ExpressionUUID" -> \
"4d922f4b-5cb7-4089-b0a7-d445143b5747"]
}, Closed]],
Cell[CellGroupData[{
Cell[54093, 1723, 29, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"ca530498-0c5a-436f-8c22-9178376d4ed0"],
Cell[54125, 1725, 123, 1, 32, "Input", "ExpressionUUID" -> \
"63517f66-0083-4839-8d4f-36f66605f72e"]
}, Closed]],
Cell[CellGroupData[{
Cell[54285, 1731, 41, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"c8b178e4-8b92-42a2-9fa8-7e6712bfbd3f"],
Cell[54329, 1733, 144, 2, 32, "Input", "ExpressionUUID" -> \
"981003d2-9b7b-4b3b-931f-e86d1016f052"]
}, Closed]],
Cell[CellGroupData[{
Cell[54510, 1740, 37, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"d8f151cd-4f71-4e5d-a9b0-5f4c5d6629cd"],
Cell[54550, 1742, 214, 4, 32, "Input", "ExpressionUUID" -> \
"d759451a-17c1-4020-a8a1-014a27018917"]
}, Closed]],
Cell[CellGroupData[{
Cell[54801, 1751, 34, 0, 29, "Subsubsection", "ExpressionUUID" -> \
"90ad5ed0-b09c-4a04-9a8f-11a8a1f9c8b0"],
Cell[54838, 1753, 163, 3, 32, "Input", "ExpressionUUID" -> \
"00a6dc59-5cc2-41d7-9cd5-a060847b7b32"]
}, Closed]]
}, Closed]]
}, Open  ]]
}
]
*)

