(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 22196, 612] NotebookOptionsPosition[ 18701, 523] NotebookOutlinePosition[ 20455, 575] CellTagsIndexPosition[ 20412, 572] WindowTitle->InversionVectorQ | Example Notebook WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Basic Examples", "\[NonBreakingSpace]", Cell["(2)", "ExampleCount"], "\[NonBreakingSpace]" }], "Subsection", TaggingRules->{}, CellID->462042388], Cell["\<\ This permutation has three numbers greater than 1 before 1, two numbers \ greater than 2 before 2 and so on:\ \>", "Text", TaggingRules->{}, CellChangeTimes->{{3.767553608364048*^9, 3.767553620299781*^9}, { 3.767553673962502*^9, 3.76755373187281*^9}, {3.7727659794577856`*^9, 3.772765986888056*^9}}, CellID->13078159], Cell[BoxData[ RowBox[{ RowBox[{"{", RowBox[{"4", ",", "3", ",", "2", ",", "1"}], "}"}], ";"}]], "Input", TaggingRules->{}, CellChangeTimes->{ 3.767553624286113*^9, {3.767553661618841*^9, 3.767553668194352*^9}, 3.767553737482175*^9}, CellLabel->"In[609]:=", CellID->427572183], Cell["Therefore this is its inversion vector:", "Text", TaggingRules->{}, CellChangeTimes->{{3.767553752048275*^9, 3.7675537617917423`*^9}}, CellID->1822802098], Cell[BoxData[ RowBox[{ RowBox[{"{", RowBox[{"3", ",", "2", ",", "1", ",", "0"}], "}"}], ";"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.7675537748808403`*^9, 3.767553787663137*^9}}, CellLabel->"In[610]:=", CellID->1196304152], Cell["Here is a check:", "Text", TaggingRules->{}, CellChangeTimes->{{3.76755380084715*^9, 3.767553805110894*^9}}, CellID->1552278743], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ DynamicModuleBox[{Typeset`open = False}, FrameBox[ PaneSelectorBox[{False->GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["InversionVectorQ", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"], ImageSizeCache->{11., {1., 10.}}], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"], ImageSizeCache->{11., {1., 10.}}]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True-> GridBox[{ {GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["InversionVectorQ", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"]], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"]]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]}, { StyleBox[ PaneBox[GridBox[{ { RowBox[{ TagBox["\<\"Version (latest): \"\>", "IconizedLabel"], " ", TagBox["\<\"1.0.0\"\>", "IconizedItem"]}]}, { TagBox[ TemplateBox[{ "\"Documentation \[RightGuillemet]\"", "https://resources.wolframcloud.com/FunctionRepository/\ resources/InversionVectorQ"}, "HyperlinkURL"], "IconizedItem"]} }, DefaultBaseStyle->"Column", GridBoxAlignment->{"Columns" -> {{Left}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle", FontFamily->"Roboto", FontSize->11]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, { GrayLevel[0.8]}, False}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[ Typeset`open], BaselinePosition->Baseline, ImageSize->Automatic], Background->RGBColor[ 0.9686274509803922, 0.9764705882352941, 0.984313725490196], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 0}}, FrameStyle->RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627], RoundingRadius->4]], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "InversionVectorQ"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["InversionVectorQ"], BoxID -> "InversionVectorQ", Selectable->False], "[", RowBox[{"{", RowBox[{"3", ",", "2", ",", "1", ",", "0"}], "}"}], "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.7675535852933493`*^9, 3.7675535866129827`*^9}}, CellLabel->"In[6]:=", CellID->518000000], Cell[BoxData["True"], "Output", TaggingRules->{}, CellChangeTimes->{3.767553587865119*^9}, CellLabel->"Out[6]=", CellID->2103468084] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[Cell["\t", "ExampleDelimiter"], $Line = 0; Null]], "ExampleDelimiter", TaggingRules->{}, CellID->666845608], Cell[TextData[{ "The positive integer 23 gives ", Cell[BoxData[ RowBox[{"{", RowBox[{"3", ",", "2", ",", "1", ",", "0"}], "}"}]], "InlineFormula", FontFamily->"Source Sans Pro"], " in the factorial base, so ", Cell[BoxData[ RowBox[{"{", RowBox[{"3", ",", "2", ",", "1", ",", "0"}], "}"}]], "InlineFormula", FontFamily->"Source Sans Pro"], " is an inversion vector:" }], "Text", TaggingRules->{}, CellChangeTimes->{{3.7675544964609737`*^9, 3.767554620873152*^9}, { 3.848749019580665*^9, 3.848749050090914*^9}}, CellID->507262383], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"IntegerDigits", "[", RowBox[{"23", ",", RowBox[{"MixedRadix", "[", RowBox[{"{", RowBox[{"4", ",", "3", ",", "2", ",", "1"}], "}"}], "]"}]}], "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.7675543172583857`*^9, 3.7675543213056087`*^9}, { 3.7675543600625143`*^9, 3.7675543907035007`*^9}, {3.767554480498*^9, 3.767554480709094*^9}}, CellLabel->"In[9]:=", CellID->1450040096], Cell[BoxData[ RowBox[{"{", RowBox[{"3", ",", "2", ",", "1", ",", "0"}], "}"}]], "Output", TaggingRules->{}, CellChangeTimes->{3.76755439198566*^9, 3.76755448191358*^9}, CellLabel->"Out[9]=", CellID->294280144] }, Open ]], Cell["\<\ Every inversion vector must end in 0 because the largest entry in a \ permutation list has nothing but smaller entries before it: \ \>", "Text", TaggingRules->{}, CellChangeTimes->{{3.7675538274304*^9, 3.767553846141663*^9}, { 3.76755397625229*^9, 3.7675540764877*^9}, 3.767554652456558*^9, { 3.7676196464087553`*^9, 3.767619655207904*^9}, 3.7727663186837993`*^9}, CellID->556017944], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ DynamicModuleBox[{Typeset`open = False}, FrameBox[ PaneSelectorBox[{False->GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["InversionVectorQ", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"], ImageSizeCache->{11., {1., 10.}}], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"], ImageSizeCache->{11., {1., 10.}}]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True-> GridBox[{ {GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["InversionVectorQ", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"]], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"]]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]}, { StyleBox[ PaneBox[GridBox[{ { RowBox[{ TagBox["\<\"Version (latest): \"\>", "IconizedLabel"], " ", TagBox["\<\"1.0.0\"\>", "IconizedItem"]}]}, { TagBox[ TemplateBox[{ "\"Documentation \[RightGuillemet]\"", "https://resources.wolframcloud.com/FunctionRepository/\ resources/InversionVectorQ"}, "HyperlinkURL"], "IconizedItem"]} }, DefaultBaseStyle->"Column", GridBoxAlignment->{"Columns" -> {{Left}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle", FontFamily->"Roboto", FontSize->11]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, { GrayLevel[0.8]}, False}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[ Typeset`open], BaselinePosition->Baseline, ImageSize->Automatic], Background->RGBColor[ 0.9686274509803922, 0.9764705882352941, 0.984313725490196], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 0}}, FrameStyle->RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627], RoundingRadius->4]], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "InversionVectorQ"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["InversionVectorQ"], BoxID -> "InversionVectorQ", Selectable->False], "[", RowBox[{"{", RowBox[{"0", ",", "1", ",", "2", ",", "3"}], "}"}], "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.767553551846158*^9, 3.767553571869472*^9}}, CellLabel->"In[5]:=", CellID->443871870], Cell[BoxData["False"], "Output", TaggingRules->{}, CellChangeTimes->{3.7675535730111094`*^9}, CellLabel->"Out[5]=", CellID->935585962] }, Open ]] }, Open ]] }, Open ]] }, ClosingSaveDialog->False, WindowSize->Automatic, WindowMargins->Automatic, WindowTitle->"InversionVectorQ | Example Notebook", Visible->False, FrontEndVersion->"12.3 for Mac OS X x86 (64-bit) (May 11, 2021)", StyleDefinitions->Notebook[{ Cell[ StyleData[ StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb", CharacterEncoding -> "UTF-8"]]], Cell[ StyleData[All, "Working"], Editable -> True, DockedCells -> {}], Cell[ StyleData["Notebook"], Editable -> True, DockedCells -> {}, ScrollingOptions -> {"VerticalScrollRange" -> Automatic}], Cell[ StyleData[ "Section", StyleDefinitions -> StyleData["PrimaryExamplesSection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData["Subsection", StyleDefinitions -> StyleData["ExampleSection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData[ "Subsubsection", StyleDefinitions -> StyleData["ExampleSubsection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData[ "Subsubsubsection", StyleDefinitions -> StyleData["ExampleSubsubsection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData["Text", StyleDefinitions -> StyleData["ExampleText"]], Editable -> True]}, Visible -> False, FrontEndVersion -> "12.3 for Mac OS X x86 (64-bit) (May 11, 2021)", StyleDefinitions -> "PrivateStylesheetFormatting.nb"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[629, 23, 168, 7, 70, "Subsection",ExpressionUUID->"282ce350-e89d-4228-9a92-528c374d585f", CellID->462042388], Cell[800, 32, 335, 8, 70, "Text",ExpressionUUID->"7f935215-dbb9-4b85-afad-3b3b6205315f", CellID->13078159], Cell[1138, 42, 292, 9, 70, "Input",ExpressionUUID->"42b0d1a8-cf11-44ee-8fd7-9d71d22d6a60", CellID->427572183], Cell[1433, 53, 163, 3, 70, "Text",ExpressionUUID->"acb20498-a7ac-4fce-a83c-200d4b1343bb", CellID->1822802098], Cell[1599, 58, 244, 7, 70, "Input",ExpressionUUID->"85d15a64-8520-4342-90eb-cf3ab36f5dbf", CellID->1196304152], Cell[1846, 67, 137, 3, 70, "Text",ExpressionUUID->"72f43299-0295-475f-adfc-c38c06d996eb", CellID->1552278743], Cell[CellGroupData[{ Cell[2008, 74, 7259, 183, 70, "Input",ExpressionUUID->"9ce752fb-d53b-4c20-bbf6-cc76646dc3d0", CellID->518000000], Cell[9270, 259, 136, 4, 70, "Output",ExpressionUUID->"098c3894-5929-4e99-84a8-52cff331cf85", CellID->2103468084] }, Open ]], Cell[CellGroupData[{ Cell[9443, 268, 144, 4, 70, "ExampleDelimiter",ExpressionUUID->"78db27b2-c9a9-478c-a192-d3a6218dec4d", CellID->666845608], Cell[9590, 274, 554, 16, 70, "Text",ExpressionUUID->"d592825c-f305-4738-93b2-d38369131051", CellID->507262383], Cell[CellGroupData[{ Cell[10169, 294, 434, 12, 70, "Input",ExpressionUUID->"de663bea-17f3-4fef-b2c2-385f4677618b", CellID->1450040096], Cell[10606, 308, 217, 6, 70, "Output",ExpressionUUID->"aa9ba979-771b-4b88-af4d-591456952f8f", CellID->294280144] }, Open ]], Cell[10838, 317, 402, 8, 70, "Text",ExpressionUUID->"a0f8e723-881b-44ce-a775-9ecfb37e3a68", CellID->556017944], Cell[CellGroupData[{ Cell[11265, 329, 7255, 183, 70, "Input",ExpressionUUID->"5de159e4-85fc-4f94-a7c8-f19aa7922e6a", CellID->443871870], Cell[18523, 514, 138, 4, 70, "Output",ExpressionUUID->"1c0496a4-bf25-4dd0-8a44-274051ef16b4", CellID->935585962] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)