(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 237068, 6014] NotebookOptionsPosition[ 228884, 5730] NotebookOutlinePosition[ 229524, 5755] CellTagsIndexPosition[ 229481, 5752] WindowTitle->Clean Tile Problem - Source WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Clean Tile Problem", "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False, FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[BoxData[ GraphicsBox[RasterBox[CompressedData[" 1:eJztnVuSozgWQDNiPqa3MJ+zpVlCbaB3WlGVNV9dvYH6TQRUph/ZGIHQmwvG xoZzQu3Aku7VfUj4Nk53//fLn//78q+Xl5f/NP/88e+Xl8v154Xj5+fp89y0 4+X63L7VnQu02XqOt9FzjRK5qtRMoYZFpk11/Ji+WDye92+r7+fFfbnGkuu9 eIQ4LBVJ+YRo5DPnRdITDp0TLRg6m/62nY/n08f5+H461G37fWqum57z4Xy2 jby0prMZOh4/jodLOx2bt6fzRSEA3B/KMKGSBy/DSKVcyYOn8krHqajvqed6 G6iol4qkfAIVNQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADsizPA/lj72AEA AMCmWLu0AXh01j6jAAAAcdb+hNwUJ5e1zZnPDEeey/e1jx0AAABsirVLm03x XFVlhs1X1JNY+4wCAAB02B9PJ4BdsvYpBAAAgOeGihpADo9GAUDIr+Lnr7ef a9vw16/i73VtMPx6+2v1gGwMijeAE89FAQA2DRW1BxX14lBRA0wi+lx0baMA AAAAAAAAAAAAbkj0uegR4L4cDoe1TYA1YQMAbIaDy9rm3JU9+w4AjwB3np3D BgDYDHuuKu/su3k0ynNRACGLHMy93dm2ijCPpHvD7LliAQAAmA0VNRioqIGK GlYk9Vz0AAAAAAAAAAAAALBR9KPR8Kf0a9sFAAAAAAAAAAAAcCt4LgoAAAAA AAAAAAB7I/Vc9ONheH9/X9uEzUJsZ0PoAGBZ3gNuLQgggR21GUjl7SC2syF0 ALAsVNQgxMv14XAI/xOja9sIAAAAT0lYWM5jbT/msGffAQAAAGAp9lxV3sF3 b1r0uehSZgAAAAAAAAAAAAA8Ar9b6rpuXpu3+tf0PBcFWJcFvxYBAAAAANgh VNQAADCK5LnobwAAAAAAAAAAAIANUbcPRav+wehH7LmoUqpsqKqmNTSXRVE0 by593mtRXlrfo7mImTlVN6ebUOhR07q3jmxVWXqquqxVOUjZq1eDVNe662ro Nxe1Xr5o2lt5cUc7VWr3BpGindNL6TkDl5nVIGWtbuaXWbwJo/OVKjSX68oL shMTO4ylHf+yy5GbhU5EubJJPeWgx5ayBfvOIR2qD5QJXWmFtJs2pLsLvu40 4oOesh/tJ3TKW/3DomZONgVdVPtNXvVXYWydyBRl/NWNWNW62L06G344TcNW L/SVpaTqcmeOWGWOm3W+TFPWsbL8dE1yklUal73ghDtBH+Hu1dE/HBM7/t7h sjNoN29Calrl2GadWfsMeoc0elcR584clrm5qzO5a+5mQe4imy2Tu1qcu+g2 7od7mkvVtqJtajgInQuqzUrRtWFCzIAkzQdK0/RR1U33JEhtgOhosnmLKtX0 DArVhaJHtZOlmgPbVN+mWZhRGzNvEc13MD61kIRcEPS2WciRp/C97a0ow569 DCOVRurZU0lFnUoBFbWkKiv7I0xFLc4dFXUAFfVUtVTUYRD2V1EnfTd7u920 v+va/NXoSXM86qXVwFtzgNvS7vJG3730Ga76Wkq/6lFz3dlWOa+69XpUOSix ixQtrrVV1pxBleO+uesMsv6QjenXF+bViFjGO5rtObaUp7bVoENe21Kqy1Un 1M8xOaxNftysOh61q5joKStQpbkIQ2p54HRWXcqsOsbVU7oZNBr8Fbv+yotk GBkvbuFbu9/LkY6DF3ZvTvqtOVXdBi0dlN6WZekEsHfQ2flmjpnQ+25vfn// 2yH1eswnokp/tNkpsJNrTqJruX4tzAkKBJXJVdUbbJmtrwtrUfuoGm2Ru5S3 AcrEGQyPld3jzbFTH+oP+is3d+XVuev2wI1zN9w8rZM1I3dFf203xxKvuUyT TevJkd8JSzF7iVHBzJa+D0vFZJLapawNh6xiQ91ixaf03R+lDHvaMqwPCKl8 +lRGgkZF3W3Q0oGKmoq685yKmoo6L5jZ0vdhqZhMUruUteEQFfUk37VU98C8 qRvq+uPjQz8UPZ/P+snoZYIqVAwtaFY0r+E0+8l8VIM3Gs70JkelUoLR0XBm 2X5dldcmWS5lQ2r1jDue+DBaRvrzvidVpc2WOKJicRvVZu+HaFqjgpngC/MS Fek2rRvSjKCy9rnxfepWFFKokVMzWaEsU9GDbEYnbfuoYOpGkdcwql/Sv+fc CVdJcY1a+Yo3WuUaZsfE+9S+j3mTRuFZoAxL9eTtFK6ecccTH0bnlmGkMtXz dKnMLCTpifZTUUfnyNOR4QGrstQuHTXGFqSiXiV3wlVSXKNWvuKNVrmG2TGh ooZb0+T0rUWf/br9e1HvuWjR/z1/+JOUIujKPxYu+l9YCEX0kGVARDxjjHxa ygZv6ejF6KiE0cfp0eUk6JMrmVamQx1qkPTIRzNSo4LC0OnbV7S/tD7WRw32 ElFYP1/y7EkZn09lPhHedej7vDiHSkbzq79YsWcWfUUUzYgXf7mdqa04eiK0 ebYxe86d9yE+T3n+OzuVqHbMx01Up/kkCud7Q0ZJ5uvCRQhNGvVCoueayK9O mKP8qDDd9szol7b5AM5LSup0P7LvxXBX8dWGvlCGTTJm1IBwianK3QySyo2k clR/KtShBkmPfDQjNSpIRS0xexJRy8NjS0UtMfVBcmegoh6FijrkEarKPVfU Gd89w+rwd/Tt34uq/kuT6C2xsG5WhXvLsu+KUb+8/kxsvQMryUIxdp8PLc/c FiblXaJEcgvKuODFf54N8yYXwYejZ2fUbO8i5b7kXwRSPfJtFu1JWZ7BtlZu eRg9XXJEbcuriorIU2xkjYjQi2hJFjXeFvFmhjeNUWu9HhO3/LQoe8tdSKqC ys+f+tE5aZVoBSU0T87U+sr2emq4Ur7k9eQrhydiaqiF3LqSX4QFfacMk684 yaT7l2GkUr7iJJOoqKMrUlGPritxZ9RyT9aIUFHn133e3IVQUQvVUlHPhor6 1r6r/k9G9X1A/47+dDrZ/9+lb9++vbr8+PHDe7X7w077rafHU+JNTo1GF/Wu U52hhtCjqGEZJVGdoZsp5ZmZoRe2kc3Fd0tnKGKvJQ9UKr8pRh15dY0MZTOO e/pTa43OSUmFpn5Pbzzv7agveTNCJRnZ70FCX4OU5ZWn9KfiELrpLZ3aIZn0 RYmGN+NRPsIpd7y19pa7qIhQZ15coicVmamMLjpb1SLmLUgmzlOtzau6RRAm bYxFTJoh9Vy+U4aNKonqDN1MKc/MDL2wjXydWIaRylElz5LKVExSS2Scigqm HHl1jQxlM457+lNrjc5JSYWmUlF7jqQ2RmqHZNIXJRrejEf5CKfc8dbaW+6i IkKdeXGJnlRkpjK66GxVi5i3IJk4T7U2r+oWQZi0MRYxaYbUZnyPLvH/lte2 FP/69esnAAAAAAAAAAAAwM74B4thROM= "], {{0, 0}, {1800, 25}}, {0, 255}, ColorFunction->RGBColor], ImageSize->{1800, 25}, PlotRange->{{0, 1800}, {0, 25}}]], "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False], Cell[BoxData[ RowBox[{"(*", "Constants", "*)"}]], "Input", CellChangeTimes->{{3.3939457376867332`*^9, 3.39394573948873*^9}, { 3.3957659063458195`*^9, 3.3957659082051945`*^9}}, CellID->1471279108], Cell[BoxData[ RowBox[{ RowBox[{"$EstimatedPostingDate", "=", RowBox[{"{", RowBox[{"2007", ",", "8", ",", "20", ",", "15"}], "}"}]}], ";"}]], "Input",\ InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.3960986134332523`*^9, 3.396098620772303*^9}, { 3.396098731896995*^9, 3.3960987417507973`*^9}, {3.396627710723596*^9, 3.396627714907682*^9}, {3.3966395238061113`*^9, 3.3966395431474648`*^9}}, CellID->258331024], Cell[BoxData[ RowBox[{"(*", "Math", "*)"}]], "Input", CellChangeTimes->{{3.394981184247684*^9, 3.394981188784553*^9}, { 3.3957659109551945`*^9, 3.3957659129708195`*^9}}, CellID->1661256598], Cell[BoxData[{ RowBox[{ RowBox[{"\[Chi]", "=", FractionBox[ SqrtBox["3"], "2"]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Xi]", "=", FractionBox["1", "2"]}], ";"}], "\[IndentingNewLine]", RowBox[{}], "\[IndentingNewLine]", RowBox[{ RowBox[{"floorSide", "=", "5"}], ";"}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.3939457444644547`*^9, 3.393945753886484*^9}, { 3.394028089837852*^9, 3.3940281076549377`*^9}, {3.395510063642085*^9, 3.395510064141574*^9}}, CellID->1304747939], Cell[BoxData[{ RowBox[{ RowBox[{"\[Theta]min", "=", RowBox[{"\[Pi]", "/", "4"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Theta]0", "=", RowBox[{"2", RowBox[{"\[Pi]", "/", "5"}]}]}], ";"}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.3945564703429127`*^9, 3.3945564776356573`*^9}, 3.394556779597637*^9, {3.394990807163579*^9, 3.394990813272822*^9}}, CellID->943091256], Cell[BoxData[ RowBox[{ RowBox[{"hexVertices", "=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "\[Theta]", "}"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"\[Theta]", ",", "0", ",", RowBox[{"2", "\[Pi]"}], ",", RowBox[{"\[Pi]", "/", "3"}]}], "}"}]}], "]"}]}], "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394206461113415*^9, 3.394206522143517*^9}, 3.394206663336993*^9, {3.394207562698173*^9, 3.394207570913533*^9}}, CellID->2105424732], Cell[BoxData[ RowBox[{ RowBox[{"hexCenters", "=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Join", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", "y"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{ RowBox[{"-", "2"}], "\[Chi]"}], ",", RowBox[{"2", "\[Chi]"}], ",", RowBox[{"2", "\[Chi]"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "-", "\[Xi]"}], ",", "y"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{ RowBox[{"-", "3"}], "\[Chi]"}], ",", RowBox[{"3", "\[Chi]"}], ",", RowBox[{"2", "\[Chi]"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "y"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{ RowBox[{"-", "4"}], "\[Chi]"}], ",", RowBox[{"4", "\[Chi]"}], ",", RowBox[{"2", "\[Chi]"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "+", "\[Xi]"}], ",", "y"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{ RowBox[{"-", "3"}], "\[Chi]"}], ",", RowBox[{"3", "\[Chi]"}], ",", RowBox[{"2", "\[Chi]"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"3", ",", "y"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{ RowBox[{"-", "2"}], "\[Chi]"}], ",", RowBox[{"2", "\[Chi]"}], ",", RowBox[{"2", "\[Chi]"}]}], "}"}]}], "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394207500946308*^9, 3.394207610380124*^9}, { 3.3942076690296307`*^9, 3.394207777419713*^9}, {3.394210641900053*^9, 3.3942106956091213`*^9}, 3.394290330915306*^9}, CellID->1785419105], Cell[BoxData[ RowBox[{ RowBox[{"floorSide", "=", "5"}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3949935166078043`*^9, 3.394993521323251*^9}}, CellID->749898204], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"coinControl", "=", "Animator"}], ";"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"coinControl", "=", "Trigger"}], ";"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394980451641795*^9, 3.39498045847094*^9}, { 3.395156023320855*^9, 3.395156029538074*^9}, {3.3951562784020977`*^9, 3.395156288583129*^9}}, CellID->186171499], Cell[BoxData[ RowBox[{"(*", "Controls", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3932643059909897`*^9, 3.393264307257382*^9}, { 3.3957659205489445`*^9, 3.3957659225489445`*^9}}, CellID->416091462], Cell[BoxData[ RowBox[{ RowBox[{"symbolSize", "=", RowBox[{"25", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}]}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394981629021715*^9, 3.394981634614043*^9}, { 3.394981686650323*^9, 3.394981686902486*^9}, {3.394981865292111*^9, 3.394981881519938*^9}, {3.39498201066859*^9, 3.394982010873027*^9}}, CellID->1042447202], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"sym", "[", "Square", "]"}], ":=", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"FaceForm", "[", "Gray", "]"}], ",", RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "symbolSize"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"sym", "[", "Triangle", "]"}], ":=", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"FaceForm", "[", "Gray", "]"}], ",", RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", "\[Chi]"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "symbolSize"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"sym", "[", "Hexagon", "]"}], ":=", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"FaceForm", "[", "Gray", "]"}], ",", RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "+", "\[Xi]"}], ",", "\[Chi]"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", RowBox[{"2", "\[Chi]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"2", "\[Chi]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "\[Xi]"}], ",", "\[Chi]"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "symbolSize"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"sym", "[", "Rhombus", "]"}], ":=", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"FaceForm", "[", "Gray", "]"}], ",", RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "+", RowBox[{"Cos", "[", "\[Theta]0", "]"}]}], ",", RowBox[{"Sin", "[", "\[Theta]0", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]0", "]"}], ",", RowBox[{"Sin", "[", "\[Theta]0", "]"}]}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "symbolSize"}]}], "]"}]}]}]}]], "Input",\ InitializationCell->True, CellChangeTimes->{{3.3924862318367777`*^9, 3.392486301814466*^9}, { 3.39248635479883*^9, 3.3924864081364603`*^9}, {3.392488123183967*^9, 3.39248816106917*^9}, {3.393945765479683*^9, 3.393945767915566*^9}, { 3.394287406693367*^9, 3.39428741448878*^9}, {3.394287476229685*^9, 3.394287484499507*^9}, {3.394377096807789*^9, 3.3943771047323303`*^9}, { 3.3948950552338743`*^9, 3.3948950657772303`*^9}, {3.3949814992915993`*^9, 3.3949815669175797`*^9}, {3.394981639286294*^9, 3.394981671679389*^9}, { 3.394981709593959*^9, 3.3949818474867973`*^9}, {3.394982104655357*^9, 3.394982185253631*^9}, 3.394982662287002*^9, 3.3955954817301483`*^9, { 3.395669974465147*^9, 3.395670007374468*^9}}, CellID->51652599], Cell[BoxData[ RowBox[{ RowBox[{"shapeLabel", "[", RowBox[{"shapeLabelType_", ",", "shape_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Switch", "[", "\[IndentingNewLine]", RowBox[{"shapeLabelType", ",", "\[IndentingNewLine]", "Text", ",", RowBox[{"ToString", "[", "shape", "]"}], ",", "\[IndentingNewLine]", "Graphics", ",", RowBox[{"sym", "[", "shape", "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", CellChangeTimes->{{3.3955864245748863`*^9, 3.3955865070701313`*^9}, { 3.395586570504817*^9, 3.3955865917099123`*^9}, {3.3957662556739445`*^9, 3.3957662567676945`*^9}}, CellID->1366276859], Cell[BoxData[ RowBox[{"(*", "Simulation", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{ 3.35696210375764*^9, {3.395151822255657*^9, 3.3951518237169533`*^9}, { 3.3957659285958195`*^9, 3.3957659300801945`*^9}}, CellID->1132291991], Cell[BoxData[ RowBox[{"(*", RowBox[{"Lattice", " ", "Reductions"}], "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393942610607253*^9, 3.393942619760818*^9}, { 3.394282665575439*^9, 3.394282669094013*^9}, {3.3957659358301945`*^9, 3.3957659374083195`*^9}}, CellID->1547327654], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"RhombusReduce", "[", "\[Theta]_", "]"}], "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"With", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"vv", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}]}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"xy", "-", RowBox[{ RowBox[{"Floor", "[", RowBox[{"LinearSolve", "[", RowBox[{ RowBox[{"Transpose", "[", "vv", "]"}], ",", "xy"}], "]"}], "]"}], ".", "vv"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3939400128783817`*^9, 3.3939401385521717`*^9}, { 3.393940416720825*^9, 3.39394045125206*^9}, {3.393941765541687*^9, 3.393941776190596*^9}, {3.39394186495361*^9, 3.393941874267776*^9}, { 3.393942062263592*^9, 3.393942079601918*^9}, {3.393943555718403*^9, 3.393943566727212*^9}, {3.3943730505744247`*^9, 3.394373052392577*^9}, { 3.394373144536982*^9, 3.394373155573176*^9}, {3.3963544152171507`*^9, 3.3963544160921507`*^9}}, CellID->2056399255], Cell[BoxData[ RowBox[{ RowBox[{"TriangleReduce", "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"xyr", "=", RowBox[{ RowBox[{"RhombusReduce", "[", RowBox[{"\[Pi]", "/", "3"}], "]"}], "[", "xy", "]"}]}], "}"}], ",", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "=", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], ",", RowBox[{"u", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "\[Xi]"}], ",", "\[Chi]"}], "}"}]}]}], "}"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"!", RowBox[{ RowBox[{"inTriangle", "[", "1", "]"}], "[", "xyr", "]"}]}], ",", RowBox[{ RowBox[{"2", " ", RowBox[{"(", RowBox[{"p", "-", RowBox[{"u", " ", RowBox[{"u", ".", RowBox[{"(", RowBox[{"p", "-", "xyr"}], ")"}]}]}]}], ")"}]}], "-", "xyr"}], ",", "xyr"}], "]"}]}], "]"}]}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3943731899282427`*^9, 3.394373200772994*^9}, { 3.394993183056057*^9, 3.394993195861402*^9}}, CellID->1163839272], Cell[BoxData[ RowBox[{ RowBox[{"HexagonReduce", "[", RowBox[{"{", RowBox[{"x_", ",", "y_"}], "}"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"xr", ",", "yr"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"xr", ",", "yr"}], "}"}], "=", RowBox[{"Abs", "[", RowBox[{"{", RowBox[{ RowBox[{"Mod", "[", RowBox[{"x", ",", "3"}], "]"}], ",", RowBox[{"Mod", "[", RowBox[{"y", ",", RowBox[{"2", "\[Chi]"}], ",", RowBox[{"-", "\[Chi]"}]}], "]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"xr", ">", RowBox[{"3", "/", "2"}]}], ",", RowBox[{"xr", "=", RowBox[{"3", "-", "xr"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"yr", ">", RowBox[{"2", "\[Chi]", RowBox[{"(", RowBox[{"1", "-", "xr"}], ")"}]}]}], ",", RowBox[{ RowBox[{"{", RowBox[{"xr", ",", "yr"}], "}"}], "=", RowBox[{ RowBox[{"Reflect", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", RowBox[{"-", "\[Chi]"}]}], "}"}]}], "]"}], "[", RowBox[{"{", RowBox[{"xr", ",", "yr"}], "}"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"yr", "=", RowBox[{"Abs", "[", "yr", "]"}]}], ";"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"yr", ">", RowBox[{"2", "\[Chi]", " ", "xr"}]}], ",", RowBox[{ RowBox[{"{", RowBox[{"xr", ",", "yr"}], "}"}], "=", RowBox[{ RowBox[{"Reflect", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", "\[Chi]"}], "}"}]}], "]"}], "[", RowBox[{"{", RowBox[{"xr", ",", "yr"}], "}"}], "]"}]}]}], "]"}], ";"}], "*)"}], "\[IndentingNewLine]", RowBox[{"{", RowBox[{"xr", ",", "yr"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3939400128783817`*^9, 3.3939401385521717`*^9}, { 3.393940416720825*^9, 3.39394045125206*^9}, {3.393941765541687*^9, 3.393941776190596*^9}, {3.39394186495361*^9, 3.393941874267776*^9}, { 3.393942062263592*^9, 3.393942079601918*^9}, {3.393943555718403*^9, 3.393943566727212*^9}, {3.394281845292898*^9, 3.394281880004773*^9}, { 3.394283577297377*^9, 3.39428364255575*^9}, {3.394283718232383*^9, 3.3942837205877953`*^9}, {3.3942837522101717`*^9, 3.3942837709176083`*^9}, {3.39428383506628*^9, 3.394283948927554*^9}, { 3.394284166551222*^9, 3.394284200045473*^9}, {3.394285218263876*^9, 3.3942852901361*^9}, {3.394285625390621*^9, 3.394285638071587*^9}, 3.394285724688789*^9, {3.394286563658216*^9, 3.3942866812887993`*^9}, 3.394286717573501*^9, {3.394286750833976*^9, 3.394286780154099*^9}, { 3.39428682761657*^9, 3.3942869049008417`*^9}, {3.394287043911483*^9, 3.394287059016336*^9}, {3.394287832054624*^9, 3.3942878321013117`*^9}, { 3.3963544188577757`*^9, 3.3963544206859007`*^9}}, CellID->1365587628], Cell[BoxData[ RowBox[{"(*", "Distances", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394282678467607*^9, 3.39428268146212*^9}, { 3.3957659449708195`*^9, 3.3957659484083195`*^9}}, CellID->1273528307], Cell[BoxData[{ RowBox[{ RowBox[{"ddistance", "[", RowBox[{"{", RowBox[{"d1_", ",", "d2_"}], "}"}], "]"}], ":=", RowBox[{"Sqrt", "[", RowBox[{ FractionBox["4", "3"], RowBox[{"(", RowBox[{ SuperscriptBox["d1", "2"], "+", SuperscriptBox["d2", "2"], "+", RowBox[{"d1", " ", "d2"}]}], ")"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"hdistance", "[", RowBox[{"{", RowBox[{"d1_", ",", "d2_"}], "}"}], "]"}], ":=", RowBox[{"Sqrt", "[", RowBox[{ FractionBox["4", "3"], RowBox[{"(", RowBox[{ SuperscriptBox["d1", "2"], "+", SuperscriptBox["d2", "2"], "-", RowBox[{"d1", " ", "d2"}]}], ")"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"vdistance", "[", "\[Theta]_", "]"}], "[", RowBox[{"{", RowBox[{"d1_", ",", "d2_"}], "}"}], "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ SuperscriptBox["d1", "2"], "+", SuperscriptBox["d2", "2"], "+", RowBox[{"2", " ", "d1", " ", "d2", " ", RowBox[{"Cos", "[", "\[Theta]", "]"}]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"Csc", "[", "\[Theta]", "]"}], "2"]}]}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.3940353464460917`*^9, 3.3940353955502577`*^9}, { 3.394375060162616*^9, 3.3943750715337887`*^9}, {3.394481048565781*^9, 3.394481067174999*^9}, {3.3948230136960382`*^9, 3.3948230435364103`*^9}}, CellID->220746100], Cell[BoxData[ RowBox[{ RowBox[{"TriangleDistances", "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"xyr", "=", RowBox[{"TriangleReduce", "[", "xy", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ".", RowBox[{"(", RowBox[{"xyr", "-", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}], ")"}]}], ",", RowBox[{ RowBox[{"{", RowBox[{"\[Chi]", ",", RowBox[{"-", "\[Xi]"}]}], "}"}], ".", RowBox[{"(", RowBox[{"xyr", "-", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}], ")"}]}], ",", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "\[Chi]"}], ",", RowBox[{"-", "\[Xi]"}]}], "}"}], ".", RowBox[{"(", RowBox[{"xyr", "-", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], ")"}]}]}], "}"}]}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394993243707428*^9, 3.39499324826097*^9}}, CellID->1375444331], Cell[BoxData[ RowBox[{ RowBox[{"HexagonDistances", "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"xyr", "=", RowBox[{"HexagonReduce", "[", "xy", "]"}]}], "}"}], ",", RowBox[{"\[Chi]", "-", RowBox[{"Abs", "[", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ".", "xyr"}], ",", RowBox[{ RowBox[{"{", RowBox[{"\[Chi]", ",", "\[Xi]"}], "}"}], ".", "xyr"}], ",", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "\[Chi]"}], ",", "\[Xi]"}], "}"}], ".", "xyr"}]}], "}"}], "]"}]}]}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394287792076187*^9, 3.394287810714768*^9}, { 3.394287841169407*^9, 3.3942879004304523`*^9}, {3.394288475263349*^9, 3.3942885318730288`*^9}}, CellID->1578894809], Cell[BoxData[ RowBox[{ RowBox[{"rhombusVertices", "[", "\[Theta]_", "]"}], ":=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "+", RowBox[{"Cos", "[", "\[Theta]", "]"}]}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}]}], "}"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394886935022668*^9, 3.394886982181974*^9}, { 3.3948870165062523`*^9, 3.39488702204218*^9}}, CellID->29628884], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"RhombusDistances", "[", "\[Theta]_", "]"}], "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], "=", RowBox[{ RowBox[{"RhombusReduce", "[", "\[Theta]", "]"}], "[", "xy", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Abs", "[", RowBox[{"{", RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"x", "-", RowBox[{"y", " ", RowBox[{"Cot", "[", "\[Theta]", "]"}]}]}], ",", "1", ",", RowBox[{ RowBox[{"-", "1"}], "/", "2"}]}], "]"}], ",", RowBox[{"Mod", "[", RowBox[{"y", ",", RowBox[{"Sin", "[", "\[Theta]", "]"}], ",", RowBox[{ RowBox[{"-", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "/", "2"}]}], "]"}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Min", "[", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], ",", "#"}], "]"}], "&"}], ",", RowBox[{"rhombusVertices", "[", "\[Theta]", "]"}]}], "]"}], "]"}]}], "\[IndentingNewLine]", "}"}]}]}], "\n", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3945444312688*^9, 3.394544447621565*^9}, { 3.394544478414055*^9, 3.394544494842037*^9}, {3.394544532634453*^9, 3.394544574541795*^9}, {3.3945451966707582`*^9, 3.3945452754745007`*^9}, 3.394546298514195*^9, {3.394546349746127*^9, 3.394546352844915*^9}, { 3.394555698381837*^9, 3.394555698707993*^9}, {3.3948872057859907`*^9, 3.3948872187199497`*^9}}, CellID->1903930931], Cell[BoxData[ RowBox[{"(*", "Reflection", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3942850516824293`*^9, 3.394285053544504*^9}, { 3.3957659580645695`*^9, 3.3957659596739445`*^9}}, CellID->1860817017], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Reflect", "[", RowBox[{ RowBox[{"p", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], ",", RowBox[{"u", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}]}], "]"}], "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"un", "=", RowBox[{"Normalize", "[", "u", "]"}]}], "}"}], ",", RowBox[{ RowBox[{"2", RowBox[{"(", RowBox[{"p", "-", RowBox[{"un", RowBox[{"(", RowBox[{"un", ".", RowBox[{"(", RowBox[{"p", "-", "xy"}], ")"}]}], ")"}]}]}], ")"}]}], "-", "xy"}]}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3942842443688507`*^9, 3.3942843722361183`*^9}, { 3.394284549906149*^9, 3.3942845723186893`*^9}, {3.394284693506555*^9, 3.394284703346033*^9}, {3.394284916103052*^9, 3.394284970167561*^9}, { 3.394285001799996*^9, 3.394285006945045*^9}, {3.3963544291546507`*^9, 3.3963544305609007`*^9}}, CellID->1192593395], Cell[BoxData[ RowBox[{"(*", RowBox[{"Region", " ", "Tests"}], "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394282686284284*^9, 3.39428268896626*^9}, { 3.3963544349827757`*^9, 3.3963544367640257`*^9}}, CellID->1452312314], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"inTriangle", "[", "l_", "]"}], "[", RowBox[{"{", RowBox[{"x_", ",", "y_"}], "}"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{ RowBox[{"y", ">", "0"}], " ", "&&", " ", RowBox[{"y", "<", RowBox[{"2", "\[Chi]", " ", "x"}]}], "&&", RowBox[{"y", "<", RowBox[{"2", "\[Chi]", RowBox[{"(", RowBox[{"l", "-", "x"}], ")"}]}]}]}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393347739618142*^9, 3.393347756795101*^9}, { 3.393347922065652*^9, 3.393348033896244*^9}, {3.394993285696773*^9, 3.3949933150108957`*^9}}, CellID->713929596], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"inHexagon", "[", "l_", "]"}], "[", RowBox[{"{", RowBox[{"x_", ",", "y_"}], "}"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"Abs", "[", "y", "]"}], "<", RowBox[{"\[Chi]", " ", "l"}]}], " ", "&&", " ", RowBox[{ RowBox[{"Abs", "[", "y", "]"}], "<", RowBox[{"2", "\[Chi]", RowBox[{"(", RowBox[{"l", "-", RowBox[{"Abs", "[", "x", "]"}]}], ")"}]}]}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"inHexagon", "[", RowBox[{"l_", ",", "cent_"}], "]"}], "[", "xy_", "]"}], ":=", RowBox[{ RowBox[{"inHexagon", "[", "l", "]"}], "[", RowBox[{"xy", "-", "cent"}], "]"}]}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.394236364053932*^9, 3.394236369778657*^9}, { 3.3942364061585693`*^9, 3.3942364069793262`*^9}, 3.394236445199383*^9, { 3.3942367174554577`*^9, 3.394236762945059*^9}, 3.39499354914955*^9}, CellID->1023584183], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"onHexagonTable", "[", "xy_", "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Or", "@@", RowBox[{"Prepend", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"inHexagon", "[", RowBox[{"1", ",", "#"}], "]"}], "[", "xy", "]"}], "&"}], ",", RowBox[{"hexCenters", "\[LeftDoubleBracket]", RowBox[{"{", RowBox[{"1", ",", "3", ",", "8", ",", "12", ",", "17", ",", "19"}], "}"}], "\[RightDoubleBracket]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"inHexagon", "[", "4", "]"}], "[", "xy", "]"}]}], "\[IndentingNewLine]", "]"}]}]}], "\[IndentingNewLine]"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394236776308282*^9, 3.394236819994192*^9}, { 3.394236892507156*^9, 3.394236909538877*^9}, {3.3942369887671013`*^9, 3.394236993531231*^9}, {3.39423703557821*^9, 3.39423705042036*^9}, 3.394237190859096*^9, {3.3942372380501842`*^9, 3.394237288622993*^9}, { 3.3942373199162493`*^9, 3.394237367920586*^9}}, CellID->2035351211], Cell[BoxData[ RowBox[{"(*", "maxRadius", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394470359500367*^9, 3.394470361549572*^9}, { 3.3957659644551945`*^9, 3.3957659659864445`*^9}}, CellID->880790214], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"maxRadius", "[", "Square", "]"}], "=", RowBox[{"1", "/", "2"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"maxRadius", "[", "Triangle", "]"}], "=", RowBox[{"\[Chi]", "/", "3"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"maxRadius", "[", "Hexagon", "]"}], "=", "\[Chi]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"maxRadius", "[", RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], "]"}], ":=", RowBox[{ RowBox[{"Sin", "[", "\[Theta]", "]"}], "/", "2"}]}], ";"}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.3944703632196608`*^9, 3.394470435304882*^9}, { 3.394890926787262*^9, 3.394890945470455*^9}}, CellID->836347927], Cell[BoxData[ RowBox[{"(*", "nTiles", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393264639166758*^9, 3.393264648747467*^9}, { 3.3957659713145695`*^9, 3.3957659730020695`*^9}}, CellID->1219139474], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"nTiles", "[", RowBox[{"Square", ",", "\[Rho]_"}], "]"}], "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"dxy", "=", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{ RowBox[{"Round", "[", "#", "]"}], "-", "#"}], "]"}], "&"}], ",", "xy"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Xor", "[", RowBox[{ RowBox[{ RowBox[{"First", "[", "dxy", "]"}], "<", "\[Rho]"}], ",", RowBox[{ RowBox[{"Last", "[", "dxy", "]"}], "<", "\[Rho]"}]}], "]"}], ",", "2", ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"Norm", "[", "dxy", "]"}], "<", "\[Rho]"}], ",", "4", ",", "\[IndentingNewLine]", RowBox[{"And", "[", RowBox[{ RowBox[{ RowBox[{"First", "[", "dxy", "]"}], "<", "\[Rho]"}], ",", RowBox[{ RowBox[{"Last", "[", "dxy", "]"}], "<", "\[Rho]"}]}], "]"}], ",", "3", ",", "\[IndentingNewLine]", "True", ",", "1"}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input",\ InitializationCell->True, CellChangeTimes->{{3.3931640818473473`*^9, 3.393164096038971*^9}, { 3.393164489438501*^9, 3.393164496543172*^9}, 3.3931646199413137`*^9, { 3.393164802417345*^9, 3.393164827020092*^9}, {3.3931648579030533`*^9, 3.393164895060917*^9}, 3.393182060783421*^9}, CellID->935663491], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"nTiles", "[", RowBox[{"Triangle", ",", "\[Rho]_"}], "]"}], "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"dxy", "=", RowBox[{"TriangleDistances", "[", "xy", "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Count", "[", RowBox[{"dxy", ",", RowBox[{"_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", ">", "\[Rho]"}], "&"}], ")"}]}]}], "]"}], "\[Equal]", "3"}], ",", "1", ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"Count", "[", RowBox[{"dxy", ",", RowBox[{"_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", ">", "\[Rho]"}], "&"}], ")"}]}]}], "]"}], "\[Equal]", "2"}], ",", "2", ",", "\[IndentingNewLine]", RowBox[{"Or", " ", "@@", " ", RowBox[{"Thread", "[", RowBox[{ RowBox[{"Map", "[", RowBox[{"ddistance", ",", RowBox[{"Subsets", "[", RowBox[{"dxy", ",", RowBox[{"{", "2", "}"}]}], "]"}]}], "]"}], "<", "\[Rho]"}], "]"}]}], ",", "6", ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Chi]", "-", RowBox[{"Max", "[", "dxy", "]"}]}], "<", "\[Rho]"}], ",", "4", ",", "\[IndentingNewLine]", "True", ",", "3"}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393946980062134*^9, 3.393947009271708*^9}, { 3.393947076548238*^9, 3.3939471134253693`*^9}, {3.393947146294035*^9, 3.393947150178317*^9}, {3.393957574051591*^9, 3.3939575997138567`*^9}, 3.3939576477030497`*^9, {3.393976850428039*^9, 3.3939769680986834`*^9}, { 3.393977002307947*^9, 3.393977066347987*^9}, {3.394032292562933*^9, 3.394032318831469*^9}, 3.394035400037574*^9, {3.394198915582374*^9, 3.394198922916482*^9}, {3.394199473213109*^9, 3.394199473929792*^9}, { 3.39419963820689*^9, 3.3941996409134274`*^9}, {3.394199968986259*^9, 3.394199975280403*^9}, {3.3942000453933887`*^9, 3.394200047664136*^9}, { 3.394200220282358*^9, 3.394200226410575*^9}, 3.394200307828722*^9, 3.394229421092002*^9}, CellID->1821029903], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"nTileValues", "[", "Square", "]"}], "=", RowBox[{"Range", "[", "4", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileValues", "[", "Triangle", "]"}], "=", RowBox[{"{", RowBox[{"1", ",", "2", ",", "3", ",", "4", ",", "6"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileValues", "[", "Hexagon", "]"}], "=", RowBox[{"Range", "[", "4", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"nTileValues", "[", RowBox[{"Rhombus", "[", "_", "]"}], "]"}], ":=", RowBox[{"Range", "[", "4", "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileValues", "[", "Rhombus", "]"}], "=", RowBox[{"Range", "[", "4", "]"}]}], ";"}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.3942914202733517`*^9, 3.394291434100897*^9}, { 3.394374782280314*^9, 3.3943747927630653`*^9}, 3.394467323398459*^9, { 3.394893177268909*^9, 3.394893177738743*^9}, {3.3966273425124826`*^9, 3.396627342878921*^9}}, CellID->112642677], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"nTiles", "[", RowBox[{"Hexagon", ",", RowBox[{"\[Rho]_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", "\[LessEqual]", RowBox[{"1", "/", "2"}]}], "&"}], ")"}]}]}], "]"}], "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{"HexagonDistances", "[", "xy", "]"}], ",", RowBox[{"_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", "<", "\[Rho]"}], "&"}], ")"}]}]}], "]"}], "+", "1"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3931640818473473`*^9, 3.393164096038971*^9}, { 3.393164489438501*^9, 3.393164496543172*^9}, 3.3931646199413137`*^9, { 3.393164802417345*^9, 3.393164827020092*^9}, {3.3931648579030533`*^9, 3.393164895060917*^9}, 3.393182060783421*^9, {3.394374774907008*^9, 3.3943747775190697`*^9}, {3.394374808389412*^9, 3.394374818045457*^9}, { 3.394374856596466*^9, 3.394374878363905*^9}, {3.3943749748684587`*^9, 3.394374993121566*^9}, {3.394375122688374*^9, 3.394375130828204*^9}, { 3.3944496221172123`*^9, 3.394449631486731*^9}, {3.394449787007208*^9, 3.394449794218334*^9}, {3.3944625569792347`*^9, 3.394462568085905*^9}, { 3.39446400937236*^9, 3.394464150586178*^9}, {3.394464226670369*^9, 3.394464243915001*^9}, {3.394464375886191*^9, 3.394464398814036*^9}, { 3.394467084202876*^9, 3.394467118281295*^9}}, CellID->1252379332], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"nTiles", "[", RowBox[{"Hexagon", ",", RowBox[{"\[Rho]_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", ">", RowBox[{"1", "/", "2"}]}], "&"}], ")"}]}]}], "]"}], "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"dxy", "=", RowBox[{"HexagonDistances", "[", "xy", "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Switch", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Count", "[", RowBox[{"dxy", ",", RowBox[{"_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", "<", "\[Rho]"}], "&"}], ")"}]}]}], "]"}], ",", "\[IndentingNewLine]", "0", ",", "1", ",", "\[IndentingNewLine]", "1", ",", "2", ",", "\[IndentingNewLine]", "_", ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{"Map", "[", RowBox[{"hdistance", ",", RowBox[{"Subsets", "[", RowBox[{"dxy", ",", RowBox[{"{", "2", "}"}]}], "]"}]}], "]"}], ",", RowBox[{"_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", "<", "\[Rho]"}], "&"}], ")"}]}]}], "]"}], "<", "2"}], ",", "3", ",", "4"}], "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3931640818473473`*^9, 3.393164096038971*^9}, { 3.393164489438501*^9, 3.393164496543172*^9}, 3.3931646199413137`*^9, { 3.393164802417345*^9, 3.393164827020092*^9}, {3.3931648579030533`*^9, 3.393164895060917*^9}, 3.393182060783421*^9, {3.394374774907008*^9, 3.3943747775190697`*^9}, {3.394374808389412*^9, 3.394374818045457*^9}, { 3.394374856596466*^9, 3.394374878363905*^9}, {3.3943749748684587`*^9, 3.394374993121566*^9}, {3.394375122688374*^9, 3.394375130828204*^9}, { 3.3944496221172123`*^9, 3.394449631486731*^9}, {3.394449787007208*^9, 3.394449794218334*^9}, {3.3944625569792347`*^9, 3.394462568085905*^9}, { 3.39446400937236*^9, 3.394464150586178*^9}, {3.394464226670369*^9, 3.394464243915001*^9}, {3.394464375886191*^9, 3.394464398814036*^9}, { 3.394467084202876*^9, 3.394467125067664*^9}, 3.394467291766325*^9, 3.394473257675227*^9, {3.394473538396906*^9, 3.394473539455039*^9}}, CellID->1252208677], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{ RowBox[{"nTiles", "[", RowBox[{ RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], ",", "\[Rho]_"}], "]"}], "[", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"dxyv", "=", RowBox[{ RowBox[{"RhombusDistances", "[", "\[Theta]", "]"}], "[", "xy", "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"x", "=", RowBox[{"First", "[", RowBox[{"First", "[", "dxyv", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"y", "=", RowBox[{"Last", "[", RowBox[{"First", "[", "dxyv", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Which", "[", RowBox[{ RowBox[{"Xor", "[", RowBox[{ RowBox[{"x", "<", "\[Rho]"}], ",", RowBox[{"y", "<", "\[Rho]"}]}], "]"}], ",", "2", ",", RowBox[{ RowBox[{"Last", "[", "dxyv", "]"}], "<", "\[Rho]"}], ",", "4", ",", RowBox[{"And", "[", RowBox[{ RowBox[{"x", "<", "\[Rho]"}], ",", RowBox[{"y", "<", "\[Rho]"}]}], "]"}], ",", "3", ",", "True", ",", "1"}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}], "\n"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394889709697153*^9, 3.394889724707514*^9}}, CellID->531493739], Cell[BoxData[ RowBox[{"(*", "Statistics", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393334138035763*^9, 3.393334140100238*^9}, { 3.3957659792833195`*^9, 3.3957659807364445`*^9}}, CellID->1430783500], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Square", ",", "1"}], "]"}], "[", "\[Rho]_", "]"}], ":=", SuperscriptBox[ RowBox[{"(", RowBox[{"1", "-", RowBox[{"2", "\[Rho]"}]}], ")"}], "2"]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Square", ",", "2"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{"4", "\[Rho]", RowBox[{"(", RowBox[{"1", "-", RowBox[{"2", "\[Rho]"}]}], ")"}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Square", ",", "3"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{"4", "-", "\[Pi]"}], ")"}], SuperscriptBox["\[Rho]", "2"]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Square", ",", "4"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{"\[Pi]", " ", SuperscriptBox["\[Rho]", "2"]}]}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.393333100707377*^9, 3.393333132478088*^9}, { 3.393333327374649*^9, 3.393333336803014*^9}, {3.393333427584794*^9, 3.39333349912379*^9}, {3.3942156427075787`*^9, 3.394215645687937*^9}}, CellID->1803889041], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Triangle", ",", "6"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", "\[Pi]", " ", SuperscriptBox["\[Rho]", "2"]}], ")"}], "/", RowBox[{"(", RowBox[{"\[Chi]", "/", "2"}], ")"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Triangle", ",", "1"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"\[Chi]", "-", RowBox[{"3", " ", "\[Rho]"}]}], ")"}], "^", "2"}], "/", RowBox[{"(", RowBox[{"2", " ", "\[Chi]"}], ")"}]}], ")"}], "/", RowBox[{"(", RowBox[{"\[Chi]", "/", "2"}], ")"}]}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Triangle", ",", "2"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"3", "/", "2"}], " ", "\[Rho]", " ", RowBox[{"(", RowBox[{"2", "-", RowBox[{ RowBox[{"(", RowBox[{"5", " ", "\[Rho]"}], ")"}], "/", "\[Chi]"}]}], ")"}]}], ")"}], "/", RowBox[{"(", RowBox[{"\[Chi]", "/", "2"}], ")"}]}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Triangle", ",", "3"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", "2"}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{"\[Rho]", "^", "2"}], "/", "\[Chi]"}], ")"}], "*", "3"}], ")"}], "/", RowBox[{"(", RowBox[{"\[Chi]", "/", "2"}], ")"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Triangle", ",", "4"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "/", "2"}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{"\[Rho]", "^", "2"}], "/", "\[Chi]"}], ")"}], "*", "3"}], "-", RowBox[{ FractionBox["1", "2"], " ", "\[Pi]", " ", SuperscriptBox["\[Rho]", "2"]}]}], ")"}], "/", RowBox[{"(", RowBox[{"\[Chi]", "/", "2"}], ")"}]}]}], ";"}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.394202139504251*^9, 3.394202186609515*^9}, { 3.394208266785186*^9, 3.394208343420573*^9}, {3.3942109918750057`*^9, 3.39421104631242*^9}, {3.394214501041992*^9, 3.394214528970723*^9}, { 3.394214567703457*^9, 3.3942145686144133`*^9}, {3.394215153322359*^9, 3.394215199302402*^9}, {3.394215487032823*^9, 3.394215529036315*^9}, { 3.394215650691296*^9, 3.394215654671534*^9}, {3.394215907408061*^9, 3.394215996079769*^9}, 3.3942291830227623`*^9, {3.394231977237213*^9, 3.3942320052018147`*^9}, 3.394232066750906*^9, 3.3942326864709883`*^9, 3.394235383341751*^9}, CellID->1936467388], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "4"}], "]"}], "[", RowBox[{"\[Rho]_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", "\[LessEqual]", RowBox[{"1", "/", "2"}]}], "&"}], ")"}]}], "]"}], ":=", "0"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "4"}], "]"}], "[", RowBox[{"\[Rho]_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", ">", RowBox[{"1", "/", "2"}]}], "&"}], ")"}]}], "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"-", FractionBox["3", "2"]}], " ", SqrtBox[ RowBox[{ RowBox[{"-", "1"}], "+", RowBox[{"4", " ", SuperscriptBox["\[Rho]", "2"]}]}]]}], "+", RowBox[{"6", " ", SuperscriptBox["\[Rho]", "2"], " ", RowBox[{"ArcCos", "[", FractionBox["1", RowBox[{"2", " ", "\[Rho]"}]], "]"}]}]}], ")"}], "/", RowBox[{"(", RowBox[{"3", "\[Chi]"}], ")"}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "3"}], "]"}], "[", RowBox[{"\[Rho]_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", "\[LessEqual]", RowBox[{"\[Chi]", "/", "2"}]}], "&"}], ")"}]}], "]"}], ":=", RowBox[{"6", RowBox[{ RowBox[{ SuperscriptBox["\[Rho]", "2"], "/", "\[Chi]"}], "/", RowBox[{"(", RowBox[{"3", "\[Chi]"}], ")"}]}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "3"}], "]"}], "[", RowBox[{"\[Rho]_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", ">", RowBox[{"\[Chi]", "/", "2"}]}], "&"}], ")"}]}], "]"}], ":=", RowBox[{"1", "-", RowBox[{"2", RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "1"}], "]"}], "[", "\[Rho]", "]"}]}], "-", RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "4"}], "]"}], "[", "\[Rho]", "]"}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "2"}], "]"}], "[", RowBox[{"\[Rho]_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", "\[LessEqual]", RowBox[{"\[Chi]", "/", "2"}]}], "&"}], ")"}]}], "]"}], ":=", RowBox[{"6", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"3", "/", "2"}], " ", RowBox[{"\[Rho]", "/", "\[Chi]"}]}]}], ")"}], RowBox[{"\[Rho]", "/", RowBox[{"(", RowBox[{"3", "\[Chi]"}], ")"}]}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "2"}], "]"}], "[", RowBox[{"\[Rho]_", "?", RowBox[{"(", RowBox[{ RowBox[{"#", ">", RowBox[{"\[Chi]", "/", "2"}]}], "&"}], ")"}]}], "]"}], ":=", RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "1"}], "]"}], "[", "\[Rho]", "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Hexagon", ",", "1"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{"3", RowBox[{"(", RowBox[{"\[Chi]", "-", "\[Rho]"}], ")"}], RowBox[{"(", RowBox[{"1", "-", RowBox[{"\[Rho]", "/", "\[Chi]"}]}], ")"}]}], ")"}], "/", RowBox[{"(", RowBox[{"3", "\[Chi]"}], ")"}]}]}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.3943753883085957`*^9, 3.394375400521625*^9}, { 3.3943757688688993`*^9, 3.3943758399854918`*^9}, {3.394375916139886*^9, 3.394375940618622*^9}, {3.394375989393837*^9, 3.394376001881291*^9}, { 3.394376154928649*^9, 3.394376177301841*^9}, 3.3943764456685*^9, { 3.394376824886476*^9, 3.39437683092092*^9}, {3.394467436674355*^9, 3.394467463293688*^9}, {3.394467523020753*^9, 3.394467538586434*^9}, { 3.394467577701437*^9, 3.394467611050824*^9}, {3.394469500123767*^9, 3.394469504550481*^9}, 3.3944695780050783`*^9, {3.394469754980579*^9, 3.394469764875305*^9}, {3.39446991149763*^9, 3.3944700368563967`*^9}, { 3.3944701495851927`*^9, 3.394470151509984*^9}, 3.394472924882451*^9, { 3.394474446193445*^9, 3.39447445234383*^9}, 3.394474623850711*^9, 3.394474684720996*^9, {3.394476112116253*^9, 3.394476120102255*^9}, { 3.394476294940338*^9, 3.3944763044039803`*^9}, {3.39447634122192*^9, 3.394476377613666*^9}}, CellID->1092719831], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{ RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], ",", "1"}], "]"}], "[", "\[Rho]_", "]"}], ":=", SuperscriptBox[ RowBox[{"(", RowBox[{"1", "-", RowBox[{"2", " ", "\[Rho]", " ", RowBox[{"Csc", "[", "\[Theta]", "]"}]}]}], ")"}], "2"]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{ RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], ",", "2"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{"4", " ", "\[Rho]", " ", RowBox[{"Csc", "[", "\[Theta]", "]"}], " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"2", " ", "\[Rho]", " ", RowBox[{"Csc", "[", "\[Theta]", "]"}]}]}], ")"}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{ RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], ",", "3"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"4", " ", RowBox[{"Csc", "[", "\[Theta]", "]"}]}], "-", "\[Pi]"}], " ", ")"}], SuperscriptBox["\[Rho]", "2"], RowBox[{"Csc", "[", "\[Theta]", "]"}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{ RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], ",", "4"}], "]"}], "[", "\[Rho]_", "]"}], ":=", RowBox[{"\[Pi]", " ", SuperscriptBox["\[Rho]", "2"], RowBox[{"Csc", "[", "\[Theta]", "]"}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"Rhombus", ",", "_"}], "]"}], "[", "_", "]"}], ":=", "0"}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.3948915723332663`*^9, 3.394891711607424*^9}, { 3.396627351632731*^9, 3.39662735205125*^9}}, CellID->62050473], Cell[BoxData[ RowBox[{"(*", RowBox[{"Statistical", " ", "Tabulation"}], "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393264684042015*^9, 3.393264691075329*^9}, { 3.3957659862833195`*^9, 3.3957659878301945`*^9}}, CellID->1352730916], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"runningTouchingTilesTab", "//", "Clear"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"runningTouchingTilesTab", "[", RowBox[{"ntl_List", ",", "nttl_List"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"FoldList", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Function", "[", RowBox[{ RowBox[{"{", RowBox[{"l", ",", "n"}], "}"}], ",", RowBox[{"MapAt", "[", RowBox[{ RowBox[{"Function", "[", RowBox[{"#", "+", "1"}], "]"}], ",", "l", ",", "n"}], "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{"0", ",", RowBox[{"{", RowBox[{"Max", "[", "ntl", "]"}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", "nttl"}], "\[IndentingNewLine]", "]"}], "\[LeftDoubleBracket]", RowBox[{"All", ",", "ntl"}], "\[RightDoubleBracket]"}], "//", "Rest"}]}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.39324725691601*^9, 3.393247451950439*^9}, { 3.393248354007041*^9, 3.3932483780164557`*^9}, {3.39324841154688*^9, 3.3932484182608957`*^9}, {3.393250358295342*^9, 3.3932503730393744`*^9}, { 3.3933391934090548`*^9, 3.393339194541202*^9}, {3.394292057172738*^9, 3.394292096976472*^9}, {3.3942921827017117`*^9, 3.3942922177158127`*^9}, { 3.394292316480064*^9, 3.394292348046829*^9}, {3.3942924050808153`*^9, 3.394292437705988*^9}, {3.395151388138752*^9, 3.395151391295074*^9}}, CellID->2086618070], Cell[BoxData[ RowBox[{"(*", RowBox[{"Random", " ", "Positions"}], "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3933532875587*^9, 3.393353303535419*^9}, { 3.3957659930489445`*^9, 3.3957659947364445`*^9}}, CellID->1381946980], Cell[BoxData[ RowBox[{ RowBox[{"randomPosition", "[", RowBox[{"Square", ",", "l_"}], "]"}], ":=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "l"}], "}"}], ",", RowBox[{"{", "2", "}"}]}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393349401454349*^9, 3.393349433092087*^9}, { 3.393349480821801*^9, 3.3933495102974854`*^9}, 3.393349613462759*^9, { 3.393349710799385*^9, 3.393349725012833*^9}, {3.393350012626391*^9, 3.39335002039629*^9}, {3.393350084733683*^9, 3.393350085530794*^9}, { 3.393350123484988*^9, 3.3933501745241327`*^9}, {3.39420209228277*^9, 3.39420209540844*^9}, {3.394282623566386*^9, 3.394282642654696*^9}}, CellID->1347250555], Cell[BoxData[ RowBox[{ RowBox[{"randomPosition", "[", RowBox[{"Triangle", ",", "l_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"xy", "=", RowBox[{"randomPosition", "[", RowBox[{"Square", ",", "l"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"While", "[", RowBox[{ RowBox[{"Not", "[", RowBox[{ RowBox[{"inTriangle", "[", "l", "]"}], "[", "xy", "]"}], "]"}], ",", RowBox[{"xy", "=", RowBox[{"randomPosition", "[", RowBox[{"Square", ",", "l"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "xy"}]}], "\[IndentingNewLine]", "]"}]}]], "Input",\ InitializationCell->True, CellChangeTimes->{{3.393349401454349*^9, 3.393349433092087*^9}, { 3.393349480821801*^9, 3.3933495102974854`*^9}, 3.393349613462759*^9, { 3.393349710799385*^9, 3.393349725012833*^9}, {3.393350012626391*^9, 3.39335002039629*^9}, {3.393350084733683*^9, 3.393350085530794*^9}, { 3.393350123484988*^9, 3.3933501745241327`*^9}, {3.39420209228277*^9, 3.39420209540844*^9}, {3.394282623566386*^9, 3.394282642654696*^9}}, CellID->172503917], Cell[BoxData[ RowBox[{ RowBox[{"randomPosition", "[", RowBox[{"Hexagon", ",", "1"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"xy", "=", RowBox[{ RowBox[{"randomPosition", "[", RowBox[{"Square", ",", "2"}], "]"}], "-", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"While", "[", RowBox[{ RowBox[{"Not", "[", RowBox[{ RowBox[{"inHexagon", "[", "1", "]"}], "[", "xy", "]"}], "]"}], ",", RowBox[{"xy", "=", RowBox[{ RowBox[{"randomPosition", "[", RowBox[{"Square", ",", "2"}], "]"}], "-", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "xy"}]}], "\[IndentingNewLine]", "]"}]}]], "Input",\ InitializationCell->True, CellChangeTimes->{{3.3942821784062023`*^9, 3.39428223494886*^9}, { 3.3942824539792423`*^9, 3.3942824594310713`*^9}, {3.394282572348268*^9, 3.394282591078843*^9}}, CellID->170409569], Cell[BoxData[ RowBox[{ RowBox[{"randomPosition", "[", RowBox[{"Hexagon", ",", RowBox[{"l", ":", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}], ".."}], "}"}]}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{ RowBox[{"randomPosition", "[", RowBox[{"Hexagon", ",", "1"}], "]"}], "+", RowBox[{"RandomChoice", "[", "l", "]"}]}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394290634333643*^9, 3.394290698798347*^9}, 3.3943740927317*^9}, CellID->1477924732], Cell[BoxData[ RowBox[{ RowBox[{"randomPosition", "[", RowBox[{ RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], ",", "l_"}], "]"}], ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"y", "=", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0", ",", RowBox[{"l", " ", RowBox[{"Sin", "[", "\[Theta]", "]"}]}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x", "=", RowBox[{ RowBox[{"y", " ", RowBox[{"Cot", "[", "\[Theta]", "]"}]}], "+", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0", ",", "l"}], "}"}], "]"}]}]}], ",", "y"}], "}"}]}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394557221730756*^9, 3.394557235558216*^9}}, CellID->1685109522], Cell[BoxData[ RowBox[{"(*", "Graphics", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3932646700845613`*^9, 3.393264671683256*^9}, { 3.3957660029551945`*^9, 3.3957660047208195`*^9}}, CellID->621399618], Cell[BoxData[ RowBox[{"(*", "Polygons", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394290422189681*^9, 3.394290423480433*^9}, { 3.3957660133458195`*^9, 3.3957660153614445`*^9}}, CellID->650404365], Cell[BoxData[ RowBox[{ RowBox[{"Hexagon", "[", "cent_", "]"}], ":=", RowBox[{"Polygon", "[", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"cent", "+", "#"}], "&"}], ",", "hexVertices", ",", RowBox[{"{", "1", "}"}]}], "]"}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394206073137631*^9, 3.394206075237892*^9}, { 3.3942066469585047`*^9, 3.3942067060851927`*^9}, {3.394206740377975*^9, 3.394206741341916*^9}, {3.394206787530692*^9, 3.394206788165201*^9}}, CellID->654399325], Cell[BoxData[ RowBox[{"(*", "Parameters", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393264736902664*^9, 3.3932647389080153`*^9}, { 3.3957660199239445`*^9, 3.3957660213301945`*^9}}, CellID->1225698988], Cell[BoxData[ RowBox[{ RowBox[{"coinOpacity", "=", "0.5"}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393182742296623*^9, 3.393182744677884*^9}, 3.393183346360527*^9, {3.393253114160515*^9, 3.393253116989656*^9}}, CellID->1659749292], Cell[BoxData[ RowBox[{"(*", "Grids", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393264745841116*^9, 3.393264746667883*^9}, { 3.3957660264864445`*^9, 3.3957660279864445`*^9}}, CellID->1741259761], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"shapeGrid", "[", "Square", "]"}], "[", "l_", "]"}], ":=", RowBox[{"SquareGrid", "[", "l", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"shapeGrid", "[", "Triangle", "]"}], "[", "l_", "]"}], ":=", RowBox[{"TriangleGrid", "[", "l", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"shapeGrid", "[", RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], "]"}], "[", "l_", "]"}], ":=", RowBox[{"RhombusGrid", "[", RowBox[{"\[Theta]", ",", "l"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"shapeGrid", "[", "Hexagon", "]"}], "[", "___", "]"}], ":=", RowBox[{"HexagonGrid", "[", "]"}]}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.39420121093316*^9, 3.39420130650347*^9}, { 3.394374405866523*^9, 3.394374440369171*^9}, {3.3948922599286737`*^9, 3.394892268609127*^9}}, CellID->1593145458], Cell[BoxData[ RowBox[{ RowBox[{"SquareGrid", "[", "l_", "]"}], ":=", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"#", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"#", ",", "l"}], "}"}]}], "}"}], "]"}], "&"}], "/@", RowBox[{"Range", "[", RowBox[{"0", ",", "l"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "#"}], "}"}], ",", RowBox[{"{", RowBox[{"l", ",", "#"}], "}"}]}], "}"}], "]"}], "&"}], "/@", RowBox[{"Range", "[", RowBox[{"0", ",", "l"}], "]"}]}]}], "\[IndentingNewLine]", "}"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393182233033283*^9, 3.393182255120098*^9}, { 3.3933620495180063`*^9, 3.393362064410709*^9}}, CellID->1169601810], Cell[BoxData[ RowBox[{ RowBox[{"BorderedSquareGrid", "[", RowBox[{"x_", ",", "y_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"#", ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"#", ",", RowBox[{"y", "+", "1"}]}], "}"}]}], "}"}], "]"}], "&"}], "/@", RowBox[{"Range", "[", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"x", "+", "1"}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "#"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x", "+", "1"}], ",", "#"}], "}"}]}], "}"}], "]"}], "&"}], "/@", RowBox[{"Range", "[", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"y", "+", "1"}]}], "]"}]}]}], "\[IndentingNewLine]", "}"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3931830002592163`*^9, 3.393183052276613*^9}}, CellID->1579799679], Cell[BoxData[ RowBox[{"(*", RowBox[{"Use", " ", RowBox[{"\[Chi]", ":"}]}], "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394992928905916*^9, 3.3949929393565083`*^9}, { 3.3957660345176945`*^9, 3.3957660362676945`*^9}}, CellID->205393445], Cell[BoxData[ RowBox[{ RowBox[{"TriangleGrid", "[", "l_", "]"}], ":=", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"z", "/", "2"}], ",", RowBox[{"\[Chi]", " ", "z"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"l", "-", RowBox[{"z", "/", "2"}]}], ",", RowBox[{"\[Chi]", " ", "z"}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "0", ",", "l"}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"z", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ FractionBox[ RowBox[{"l", "+", "z"}], "2"], ",", RowBox[{"\[Chi]", RowBox[{"(", RowBox[{"l", "-", "z"}], ")"}]}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "0", ",", "l"}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"z", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ FractionBox["z", "2"], ",", RowBox[{"\[Chi]", " ", "z"}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "0", ",", "l"}], "}"}]}], "]"}]}], "\[IndentingNewLine]", "}"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393345572253009*^9, 3.393345698893215*^9}, { 3.393345822566331*^9, 3.393345854552194*^9}, {3.393346719462837*^9, 3.393346731431316*^9}, {3.393346853270896*^9, 3.393346977462686*^9}, { 3.39334714728251*^9, 3.393347165644162*^9}, {3.3933472048423357`*^9, 3.393347228706965*^9}, {3.393347270975801*^9, 3.393347314718544*^9}, { 3.393347451301256*^9, 3.393347465567741*^9}, {3.393362120152381*^9, 3.3933621202948217`*^9}, {3.393939600948505*^9, 3.393939616115199*^9}, { 3.394993595422379*^9, 3.394993626297731*^9}}, CellID->1041409386], Cell[BoxData[ RowBox[{ RowBox[{"RhombusGrid", "[", RowBox[{"\[Theta]_", ",", "l_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"With", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"s", "=", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], ",", RowBox[{"c", "=", RowBox[{"Cos", "[", "\[Theta]", "]"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"c", " ", "z"}], ",", RowBox[{"s", " ", "z"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"l", "+", RowBox[{"c", " ", "z"}]}], ",", RowBox[{"s", " ", "z"}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "0", ",", "l"}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"z", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"z", "+", RowBox[{"c", " ", "l"}]}], ",", RowBox[{"s", " ", "l"}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "0", ",", "l"}], "}"}]}], "]"}]}], "\[IndentingNewLine]", "}"}]}], "\[IndentingNewLine]", "]"}]}]], "Input",\ InitializationCell->True, CellChangeTimes->{{3.393345572253009*^9, 3.393345698893215*^9}, { 3.393345822566331*^9, 3.393345854552194*^9}, {3.393346719462837*^9, 3.393346731431316*^9}, {3.393346853270896*^9, 3.393346977462686*^9}, { 3.39334714728251*^9, 3.393347165644162*^9}, {3.3933472048423357`*^9, 3.393347228706965*^9}, {3.393347270975801*^9, 3.393347314718544*^9}, { 3.393347451301256*^9, 3.393347465567741*^9}, {3.3933621126024427`*^9, 3.39336212700701*^9}, {3.3933621920114202`*^9, 3.393362200320327*^9}, { 3.39336223997473*^9, 3.393362290063599*^9}, {3.394556520080194*^9, 3.394556539533577*^9}, {3.394556584088544*^9, 3.394556589923875*^9}, { 3.394556700371192*^9, 3.394556721989306*^9}, {3.394989307441229*^9, 3.39498931173388*^9}}, CellID->975827452], Cell[BoxData[ RowBox[{ RowBox[{"HexagonGrid", "[", "___", "]"}], ":=", RowBox[{"{", RowBox[{ RowBox[{"FaceForm", "[", "White", "]"}], ",", RowBox[{"EdgeForm", "[", "Black", "]"}], ",", RowBox[{"Map", "[", RowBox[{"Hexagon", ",", "hexCenters"}], "]"}]}], "}"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394374297217868*^9, 3.394374309725401*^9}, { 3.39437434919374*^9, 3.39437438791999*^9}, 3.394374449040847*^9}, CellID->399373625], Cell[BoxData[ RowBox[{"(*", RowBox[{"Plot", " ", "Range", " ", "Values"}], "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394991557160626*^9, 3.394991560451847*^9}, { 3.3957660409239445`*^9, 3.3957660423458195`*^9}}, CellID->1386118500], Cell[BoxData[ RowBox[{ RowBox[{"plotRangeValue", "[", RowBox[{ RowBox[{"shape", ":", RowBox[{"(", RowBox[{"Square", "|", "Triangle"}], ")"}]}], ",", "fl_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"With", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"\[Rho]max", "=", RowBox[{"maxRadius", "[", "shape", "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "\[Rho]max"}], ",", RowBox[{"fl", "+", "\[Rho]max"}]}], "}"}], ",", RowBox[{"{", "2", "}"}]}], "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394990399406106*^9, 3.394990423355069*^9}, { 3.394990482078248*^9, 3.394990604193512*^9}}, CellID->591026844], Cell[BoxData[ RowBox[{ RowBox[{"plotRangeValue", "[", RowBox[{"Hexagon", ",", "_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"With", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"\[Rho]max", "=", RowBox[{"maxRadius", "[", "Hexagon", "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"4", "+", "\[Rho]max"}], ")"}], RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"5", "\[Chi]"}], "+", "\[Rho]max"}], ")"}], RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}]}], "}"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394990611693039*^9, 3.394990612107555*^9}, { 3.394990687744638*^9, 3.39499072438074*^9}}, CellID->1276299733], Cell[BoxData[ RowBox[{ RowBox[{"plotRangeValue", "[", RowBox[{ RowBox[{"Rhombus", "[", "\[Theta]_", "]"}], ",", "_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"With", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"\[Rho]max", "=", RowBox[{"maxRadius", "[", RowBox[{"Rhombus", "[", "\[Theta]", "]"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "\[Rho]max"}], ",", RowBox[{ RowBox[{"floorSide", RowBox[{"(", RowBox[{"1", "+", RowBox[{"Cot", "[", "\[Theta]", "]"}]}], ")"}]}], "+", "\[Rho]max"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "\[Rho]max"}], ",", RowBox[{ RowBox[{"floorSide", " ", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "+", "\[Rho]max"}]}], "}"}]}], "}"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.394990611693039*^9, 3.394990612107555*^9}, { 3.394990687744638*^9, 3.394990782943864*^9}, {3.394990829295899*^9, 3.394990877591056*^9}, 3.394990962214917*^9, {3.394991178681336*^9, 3.3949911946136293`*^9}}, CellID->1702946295], Cell[BoxData[ RowBox[{"(*", RowBox[{"Coin", " ", "Colors"}], "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393264809733437*^9, 3.393264813564199*^9}, { 3.3957660474239445`*^9, 3.3957660488770695`*^9}}, CellID->1903816496], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"coinColor", "[", "1", "]"}], "=", "Red"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"coinColor", "[", "2", "]"}], "=", "Orange"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"coinColor", "[", "3", "]"}], "=", "Blue"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"coinColor", "[", "4", "]"}], "=", "Green"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"coinColor", "[", "6", "]"}], "=", "Purple"}], ";"}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.393252814638775*^9, 3.3932528625396338`*^9}, 3.393252996170026*^9, {3.393341552621179*^9, 3.3933415570267*^9}, { 3.3949937748688593`*^9, 3.394993778209413*^9}}, CellID->1963472434], Cell[BoxData[ RowBox[{"(*", "Coins", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3932648750916643`*^9, 3.393264877362446*^9}, { 3.3957660543770695`*^9, 3.3957660557520695`*^9}}, CellID->1847478436], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Coin", "[", "\[Rho]_", "]"}], "[", RowBox[{"color_", ",", RowBox[{"xy", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}]}], "]"}], ":=", RowBox[{"{", RowBox[{ RowBox[{"Opacity", "[", RowBox[{"coinOpacity", ",", "color"}], "]"}], ",", RowBox[{"Disk", "[", RowBox[{"xy", ",", "\[Rho]"}], "]"}]}], "}"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393181723816186*^9, 3.393181749265564*^9}, { 3.393181779867219*^9, 3.393181829018416*^9}, {3.393182838524468*^9, 3.393182839537961*^9}}, CellID->104021879], Cell[BoxData[ RowBox[{"(*", "TabularDisplay", "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393345042247592*^9, 3.393345049064887*^9}, { 3.3957660603301945`*^9, 3.3957660619551945`*^9}}, CellID->244031695], Cell[BoxData[ RowBox[{ RowBox[{"TabularDisplay", "[", RowBox[{"shape_", ",", "totals_", ",", "radius_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Grid", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Prepend", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Table", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Map", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Text", "@", RowBox[{"Style", "[", RowBox[{"#", ",", RowBox[{"FontColor", "\[Rule]", RowBox[{"coinColor", "[", RowBox[{ RowBox[{"nTileValues", "[", "shape", "]"}], "[", RowBox[{"[", "m", "]"}], "]"}], "]"}]}], ",", "11"}], "]"}]}], "&"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nTileValues", "[", "shape", "]"}], "\[LeftDoubleBracket]", "m", "\[RightDoubleBracket]"}], ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"AtomQ", "[", "totals", "]"}], ",", "0", ",", RowBox[{ "totals", "\[LeftDoubleBracket]", "m", "\[RightDoubleBracket]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"NumberForm", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"AtomQ", "[", "totals", "]"}], ",", "0", ",", RowBox[{"N", "[", RowBox[{ RowBox[{ "totals", "\[LeftDoubleBracket]", "m", "\[RightDoubleBracket]"}], "/", RowBox[{"Total", "[", "totals", "]"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"2", ",", "2"}], "}"}], ",", RowBox[{"ExponentFunction", "\[Rule]", RowBox[{"(", RowBox[{"Null", "&"}], ")"}]}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"shape", ",", RowBox[{ RowBox[{"nTileValues", "[", "shape", "]"}], "\[LeftDoubleBracket]", "m", "\[RightDoubleBracket]"}]}], "]"}], "[", "radius", "]"}], "//", "N"}], ",", RowBox[{"{", RowBox[{"2", ",", "2"}], "}"}], ",", RowBox[{"ExponentFunction", "\[Rule]", RowBox[{"(", RowBox[{"Null", "&"}], ")"}]}]}], "]"}]}], "\[IndentingNewLine]", "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"m", ",", RowBox[{"Length", "[", RowBox[{"nTileValues", "[", "shape", "]"}], "]"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Map", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Text", "@", RowBox[{"Style", "[", RowBox[{"#", ",", RowBox[{"TextAlignment", "\[Rule]", "Center"}], ",", "11"}], "]"}]}], "&"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Frame", "\[Rule]", "All"}], ",", "\[IndentingNewLine]", RowBox[{"Alignment", "\[Rule]", RowBox[{"{", RowBox[{"Automatic", ",", RowBox[{"{", RowBox[{"Center", ",", "Right"}], "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"ItemSize", "\[Rule]", "5"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.393344898932412*^9, 3.393345018085124*^9}, { 3.393345383596204*^9, 3.393345399816031*^9}, {3.393939134566016*^9, 3.393939148970331*^9}, 3.39422926514644*^9, {3.394294449926203*^9, 3.394294476583878*^9}, {3.394294653985568*^9, 3.394294676937838*^9}, { 3.3942947554440317`*^9, 3.3942947660355988`*^9}, 3.3942948664848537`*^9, { 3.39447239391234*^9, 3.394472394430057*^9}, {3.394979354577623*^9, 3.394979424067503*^9}, {3.3949815926786423`*^9, 3.394981595137496*^9}, { 3.3950701368751783`*^9, 3.395070142178856*^9}, {3.395152876701934*^9, 3.395152912905953*^9}, {3.395152965430718*^9, 3.395153002127247*^9}, { 3.3957662747676945`*^9, 3.3957662919395695`*^9}, {3.3957663543926945`*^9, 3.3957663544083195`*^9}, {3.3957669004551945`*^9, 3.3957669244395695`*^9}, {3.3957769132208195`*^9, 3.3957769300176945`*^9}, {3.3957771418301945`*^9, 3.3957771559395695`*^9}, {3.3963544690921507`*^9, 3.3963544905140257`*^9}, {3.3963546104359007`*^9, 3.3963546137484007`*^9}, {3.396640145152515*^9, 3.3966401519694*^9}, { 3.3966402880382013`*^9, 3.39664030000033*^9}, {3.396640493236058*^9, 3.396640498974214*^9}, {3.396640573663086*^9, 3.39664059453129*^9}, { 3.396641676932547*^9, 3.39664168822565*^9}}, CellID->1894415742], Cell[BoxData[ RowBox[{"(*", RowBox[{"Histogram", " ", "Display"}], "*)"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.395067492448655*^9, 3.3950674976192007`*^9}, { 3.3957660685176945`*^9, 3.3957660729864445`*^9}}, CellID->852825372], Cell[BoxData[ RowBox[{ RowBox[{"$UseHisto", "=", "True"}], ";"}]], "Input", InitializationCell->True, CellChangeTimes->{{3.395068204834526*^9, 3.395068219929822*^9}, { 3.3951545389058037`*^9, 3.3951545391752787`*^9}, {3.395670649883971*^9, 3.395670653877941*^9}}, CellID->1580335649], Cell[BoxData[ RowBox[{ RowBox[{"HistogramDisplay", "[", RowBox[{"_", ",", RowBox[{"_", "?", "AtomQ"}], ",", "_"}], "]"}], ":=", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "125"}]}], "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.395068204834526*^9, 3.395068219929822*^9}, { 3.3951545389058037`*^9, 3.3951545391752787`*^9}, {3.396640722304358*^9, 3.396640725092619*^9}}, CellID->1130167126], Cell[BoxData[ RowBox[{ RowBox[{"HistogramDisplay", "[", RowBox[{"shape_", ",", "totals_", ",", "radius_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"barFun", ",", RowBox[{"total", "=", RowBox[{"Total", "[", "totals", "]"}]}], ",", RowBox[{"barWidth", "=", "0.4"}], ",", RowBox[{"barSep", "=", "0.05"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"barFun", "[", RowBox[{"v_", ",", RowBox[{"{", "p_", "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", RowBox[{ RowBox[{"nTileValues", "[", "shape", "]"}], "\[LeftDoubleBracket]", "p", "\[RightDoubleBracket]"}]}], ",", "\[IndentingNewLine]", "prob"}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"prob", "=", RowBox[{"N", "[", RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"shape", ",", "n"}], "]"}], "[", "radius", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"coinColor", "[", "n", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"Rectangle", "[", RowBox[{ RowBox[{"{", RowBox[{"p", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"p", "+", "barWidth"}], ",", RowBox[{"N", "[", RowBox[{"v", "/", "total"}], "]"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"N", "[", RowBox[{"v", "/", "total"}], "]"}], ",", RowBox[{"{", RowBox[{"3", ",", "2"}], "}"}], ",", RowBox[{"ExponentFunction", "\[Rule]", RowBox[{"(", RowBox[{"Null", "&"}], ")"}]}]}], "]"}], ",", "7"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"p", "+", RowBox[{"barWidth", "/", "2"}]}], ",", RowBox[{"N", "[", RowBox[{"v", "/", "total"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{"n", ",", "9"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"p", "+", "barWidth", "+", RowBox[{"barSep", "/", "2"}]}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", "Gray", ",", "\[IndentingNewLine]", RowBox[{"Rectangle", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "+", "barWidth", "+", "barSep"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"p", "+", RowBox[{"2", "barWidth"}]}], ",", " ", "prob"}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"NumberForm", "[", RowBox[{"prob", ",", RowBox[{"{", RowBox[{"3", ",", "2"}], "}"}], ",", RowBox[{"ExponentFunction", "\[Rule]", RowBox[{"(", RowBox[{"Null", "&"}], ")"}]}]}], "]"}], ",", "7"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"p", "+", RowBox[{ RowBox[{"3", "/", "2"}], " ", "barWidth"}], "+", "barSep"}], ",", "prob"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}]}], "\[IndentingNewLine]", "}"}]}], "\[IndentingNewLine]", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Graphics", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"MapIndexed", "[", "\[IndentingNewLine]", RowBox[{"barFun", ",", "\[IndentingNewLine]", "totals"}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"AspectRatio", "\[Rule]", RowBox[{"1", "/", "GoldenRatio"}]}], ",", "\[IndentingNewLine]", RowBox[{"ImageSize", "\[Rule]", "200"}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"Automatic", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.1"}], ",", RowBox[{ RowBox[{"Max", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"nTileProbability", "[", RowBox[{"shape", ",", "nn"}], "]"}], "[", "radius", "]"}], ",", RowBox[{"{", RowBox[{"nn", ",", RowBox[{"nTileValues", "[", "shape", "]"}]}], "}"}]}], "]"}], "]"}], "+", "0.2"}]}], "}"}]}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input", InitializationCell->True, CellChangeTimes->{{3.3950676810799103`*^9, 3.3950677185053577`*^9}, { 3.395067853105424*^9, 3.3950678572537613`*^9}, {3.395068055419282*^9, 3.395068058230193*^9}, 3.3950681989762697`*^9, {3.395068301189869*^9, 3.3950683464480753`*^9}, {3.395068500565805*^9, 3.395068503488214*^9}, { 3.395068589669729*^9, 3.39506859976939*^9}, {3.395068654870077*^9, 3.395068760648328*^9}, {3.395068796675852*^9, 3.395068815075355*^9}, { 3.395068853061762*^9, 3.395068906901667*^9}, 3.395068950481965*^9, { 3.395068989584186*^9, 3.395069012060184*^9}, {3.3950690506968317`*^9, 3.395069111781336*^9}, {3.3950691620500917`*^9, 3.395069196502673*^9}, { 3.395069259497781*^9, 3.395069358938588*^9}, {3.395069442220129*^9, 3.395069450004917*^9}, {3.395069496398117*^9, 3.395069501223104*^9}, { 3.395069577263075*^9, 3.395069579051218*^9}, 3.3951531360013657`*^9, { 3.395153175015921*^9, 3.395153188644517*^9}, {3.3951533650251017`*^9, 3.3951533698124657`*^9}, {3.395153404627159*^9, 3.395153405304799*^9}, { 3.395153445220552*^9, 3.395153445537286*^9}, {3.395153531267293*^9, 3.395153544207642*^9}, {3.3957662971114445`*^9, 3.3957663148926945`*^9}, { 3.3957663544395695`*^9, 3.3957663882520695`*^9}, {3.3957671263145695`*^9, 3.3957671268926945`*^9}, {3.3957769404551945`*^9, 3.3957769460645695`*^9}, {3.3957769777208195`*^9, 3.3957769957676945`*^9}, {3.396640611072112*^9, 3.3966406297268248`*^9}, { 3.396640884139233*^9, 3.396640893096265*^9}, {3.396641668401565*^9, 3.3966416732604713`*^9}}, CellID->226028967], Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"shape", "=", "ishape"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"MatchQ", "[", RowBox[{"shape", ",", RowBox[{"Rhombus", "|", RowBox[{"Rhombus", "[", "_", "]"}]}]}], "]"}], ",", RowBox[{"shape", "=", RowBox[{"Rhombus", "[", "\[Theta]", "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"AbsoluteTime", "[", "]"}], ">", RowBox[{"AbsoluteTime", "[", "$EstimatedPostingDate", "]"}]}], ",", RowBox[{"n", "=", "0"}]}], "]"}], ";", "\[IndentingNewLine]", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{ "needed", " ", "to", " ", "pick", " ", "up", " ", "coins", " ", "when", " ", "shape", " ", "is", " ", "changed"}], " ", "-", " ", RowBox[{ "but", " ", "prevents", " ", "coins", " ", "from", " ", "appearing", " ", "in", " ", "Thumbnail"}]}], " ", "&"}], " ", "Snapshots"}], " ", "*)"}], FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", RowBox[{"n", "=", RowBox[{"Min", "[", RowBox[{"n", ",", "nCoins"}], "]"}]}], ";", " ", RowBox[{"(*", " ", RowBox[{ "needed", " ", "to", " ", "stop", " ", "pink", " ", "graphs", " ", "at", " ", "times", " ", "before", " ", "$EstimatedPostingDate"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"coinPositionList", "=", "\[IndentingNewLine]", RowBox[{"Table", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Switch", "[", "\[IndentingNewLine]", RowBox[{"shape", ",", "\[IndentingNewLine]", "Hexagon", ",", RowBox[{"randomPosition", "[", RowBox[{"Hexagon", ",", "hexCenters"}], "]"}], ",", "\[IndentingNewLine]", "_", ",", RowBox[{"randomPosition", "[", RowBox[{"shape", ",", "floorSide"}], "]"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", "nCoins", "}"}]}], "\[IndentingNewLine]", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"radius", "=", RowBox[{"Min", "[", RowBox[{ RowBox[{"maxRadius", "[", "shape", "]"}], ",", "radius"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"table", "=", RowBox[{ RowBox[{"shapeGrid", "[", "shape", "]"}], "[", "floorSide", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nTouchingTilesList", "=", RowBox[{"Map", "[", RowBox[{ RowBox[{"nTiles", "[", RowBox[{"shape", ",", "radius"}], "]"}], ",", "coinPositionList"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"coinList", "=", RowBox[{"Table", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Coin", "[", "radius", "]"}], "[", RowBox[{ RowBox[{"coinColor", "[", RowBox[{ "nTouchingTilesList", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}], "]"}], ",", RowBox[{ "coinPositionList", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"i", ",", "nCoins"}], "}"}]}], "\[IndentingNewLine]", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"runTab", "=", RowBox[{"runningTouchingTilesTab", "[", RowBox[{ RowBox[{"nTileValues", "[", "shape", "]"}], ",", "nTouchingTilesList"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Pane", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Column", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Row", "[", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Text", "@", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", RowBox[{"TextAlignment", "\[Rule]", "Left"}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"coinControl", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Dynamic", "[", RowBox[{"n", ",", RowBox[{"TrackedSymbols", "\[Rule]", RowBox[{"{", RowBox[{"n", ",", "shape", ",", "radius", ",", "nCoins"}], "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"0", ",", "nCoins", ",", "1"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"AnimationRate", "\[Rule]", "2"}], ",", "\[IndentingNewLine]", RowBox[{"DisplayAllSteps", "\[Rule]", "True"}], ",", "\[IndentingNewLine]", RowBox[{"AnimationRepetitions", "\[Rule]", "1"}], ",", "\[IndentingNewLine]", RowBox[{"BaseStyle", "\[Rule]", "\"\\""}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "}"}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Grid", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Graphics", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Dynamic", "[", RowBox[{"If", "[", RowBox[{ RowBox[{"n", ">", "0"}], ",", RowBox[{"{", RowBox[{"table", ",", RowBox[{"Take", "[", RowBox[{"coinList", ",", "n"}], "]"}]}], "}"}], ",", RowBox[{"{", "table", "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"plotRangeValue", "[", RowBox[{"shape", ",", "floorSide"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"220", ",", "220"}], "}"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Column", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Dynamic", "[", RowBox[{"TabularDisplay", "[", RowBox[{"shape", ",", RowBox[{ "runTab", "\[LeftDoubleBracket]", "n", "\[RightDoubleBracket]"}], ",", "radius"}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{"$UseHisto", ",", RowBox[{"Dynamic", "[", RowBox[{"HistogramDisplay", "[", RowBox[{"shape", ",", RowBox[{"runTab", "[", RowBox[{"[", "n", "]"}], "]"}], ",", "radius"}], "]"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"Alignment", "\[Rule]", RowBox[{"{", RowBox[{"Center", ",", "Baseline"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "}"}], "\[IndentingNewLine]", "}"}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"Alignment", "\[Rule]", RowBox[{"{", RowBox[{"Center", ",", "Center"}], "}"}]}]}], "\[IndentingNewLine]", "]"}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"550", ",", "300"}], "}"}]}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "shapeLabelType", ",", "Graphics", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Text", "\[Rule]", RowBox[{"ToString", "[", "Text", "]"}]}], ",", RowBox[{"Graphics", "\[Rule]", RowBox[{"ToString", "[", "Graphics", "]"}]}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "RadioButton"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"ishape", ",", "Square", ",", "\"\\""}], "}"}], ",", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"#", "\[RuleDelayed]", RowBox[{"Dynamic", "[", RowBox[{"shapeLabel", "[", RowBox[{"shapeLabelType", ",", "#"}], "]"}], "]"}]}], "&"}], ",", RowBox[{"{", RowBox[{"Square", ",", "Triangle", ",", "Hexagon", ",", "Rhombus"}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"ControlType", "\[Rule]", "SetterBar"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"shape", ",", "ishape"}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"radius", ",", RowBox[{ RowBox[{"maxRadius", "[", "Square", "]"}], "/", "2"}], ",", "\"\\""}], "}"}], ",", "0", ",", RowBox[{"maxRadius", "[", "shape", "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"nCoins", ",", "50", ",", "\"\\""}], "}"}], ",", "1", ",", "150", ",", "1"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Theta]", ",", "\[Theta]0", ",", "\"\\""}], "}"}], ",", "\[Theta]min", ",", RowBox[{"\[Pi]", "/", "2"}], ",", RowBox[{"Enabled", "\[RuleDelayed]", RowBox[{"MatchQ", "[", RowBox[{"ishape", ",", RowBox[{"Rhombus", "|", RowBox[{"Rhombus", "[", "_", "]"}]}]}], "]"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"i", ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"coinPositionList", ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"table", ",", RowBox[{ RowBox[{"shapeGrid", "[", "Square", "]"}], "[", "floorSide", "]"}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"nTouchingTilesList", ",", RowBox[{"{", "}"}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"coinList", ",", RowBox[{"{", "}"}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"runTab", ",", "List"}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n", ",", "0"}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"TrackedSymbols", "\[Rule]", RowBox[{"{", RowBox[{"ishape", ",", "radius", ",", "nCoins", ",", "\[Theta]"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"SaveDefinitions", "\[Rule]", "True"}], ",", RowBox[{"AutorunSequencing", "\[Rule]", RowBox[{"{", "4", "}"}]}]}], "\[IndentingNewLine]", "]"}]], "Input", CellChangeTimes->{{3.392482989948472*^9, 3.392483047030047*^9}, { 3.392483078752996*^9, 3.392483147135003*^9}, {3.392483177729418*^9, 3.3924832048908863`*^9}, {3.392483236517902*^9, 3.392483338146405*^9}, { 3.392483373565946*^9, 3.392483491487297*^9}, {3.392483521581091*^9, 3.39248353651655*^9}, {3.392483577663478*^9, 3.392483579624064*^9}, { 3.3924836152089453`*^9, 3.392483626206119*^9}, {3.392483847759026*^9, 3.392483864475924*^9}, {3.392483987588175*^9, 3.39248399250681*^9}, { 3.392484223839616*^9, 3.392484281042067*^9}, {3.3924843897608633`*^9, 3.3924843980653048`*^9}, {3.392484704994261*^9, 3.392484888525848*^9}, { 3.3924849914075317`*^9, 3.392484994427079*^9}, {3.392485055710752*^9, 3.392485060000657*^9}, {3.392486710402452*^9, 3.3924867195590982`*^9}, { 3.392486835611121*^9, 3.392486912950041*^9}, 3.39326432135395*^9, { 3.3932643708743067`*^9, 3.393264418576139*^9}, {3.393345978394758*^9, 3.39334612194086*^9}, {3.3933461536244907`*^9, 3.393346189462933*^9}, { 3.393346237686439*^9, 3.39334628300263*^9}, {3.393346505683511*^9, 3.393346507261085*^9}, {3.393938923465337*^9, 3.3939389237165613`*^9}, { 3.394201327708077*^9, 3.394201349609541*^9}, {3.394201393346542*^9, 3.394201454523394*^9}, {3.39420155625091*^9, 3.394201556824626*^9}, { 3.394202218538575*^9, 3.394202219057474*^9}, {3.394202266526609*^9, 3.39420227893617*^9}, {3.394202342379662*^9, 3.394202404644107*^9}, 3.3942862296418047`*^9, {3.394286309936898*^9, 3.394286395739699*^9}, { 3.394287204235585*^9, 3.3942872638989162`*^9}, {3.394287310112158*^9, 3.3942873146146317`*^9}, {3.394291064505785*^9, 3.394291076193132*^9}, 3.394291116445682*^9, {3.394291308479961*^9, 3.394291313955037*^9}, { 3.39429144687673*^9, 3.394291469140415*^9}, 3.394294262800057*^9, 3.3942949357032623`*^9, 3.394295374316743*^9, {3.3943769521794024`*^9, 3.39437696855833*^9}, {3.3943770510703382`*^9, 3.394377080004827*^9}, { 3.394470454643688*^9, 3.394470457879394*^9}, {3.394470648758204*^9, 3.394470682373514*^9}, 3.394470721996314*^9, {3.394472440256247*^9, 3.394472440760008*^9}, 3.3944765341690397`*^9, {3.394477224975637*^9, 3.3944772268015203`*^9}, {3.394797966151347*^9, 3.394797970178563*^9}, { 3.394892318788765*^9, 3.3948923201555147`*^9}, 3.394894589289937*^9, { 3.3948948560207767`*^9, 3.3948948710053253`*^9}, {3.394894930026834*^9, 3.3948949474783688`*^9}, {3.39489858341352*^9, 3.394898674104945*^9}, 3.39489876897744*^9, 3.394898878534699*^9, {3.394899257526433*^9, 3.39489927035912*^9}, {3.394899306219267*^9, 3.394899306528973*^9}, { 3.3948995185037394`*^9, 3.3948995436126957`*^9}, {3.394901635337347*^9, 3.394901653813036*^9}, {3.394901720661031*^9, 3.394901722004887*^9}, { 3.394902607450248*^9, 3.394902608011841*^9}, {3.394903427390724*^9, 3.394903445393673*^9}, {3.394903497206882*^9, 3.394903526577765*^9}, { 3.394913505666156*^9, 3.394913571899727*^9}, {3.394913616801428*^9, 3.394913627283679*^9}, 3.394913759798078*^9, {3.394913799193913*^9, 3.394913802577713*^9}, {3.394913834631921*^9, 3.3949138372491703`*^9}, { 3.394913942911955*^9, 3.394913976401248*^9}, {3.394914245158833*^9, 3.394914283942154*^9}, {3.394914314083375*^9, 3.394914314447256*^9}, { 3.394914423186846*^9, 3.3949144341549597`*^9}, 3.3949145611151876`*^9, { 3.3949146968797503`*^9, 3.39491469735395*^9}, {3.3949151037409897`*^9, 3.394915105474367*^9}, {3.39491514299522*^9, 3.394915147891786*^9}, 3.394915210394929*^9, {3.394915245758031*^9, 3.394915247113426*^9}, 3.3949188227656107`*^9, {3.394918899635223*^9, 3.3949189058770103`*^9}, { 3.3949189556379213`*^9, 3.3949189935618067`*^9}, {3.394919043142933*^9, 3.39491904563387*^9}, {3.39497849023592*^9, 3.394978556846784*^9}, { 3.394978646012624*^9, 3.394978693834394*^9}, {3.3949788126517982`*^9, 3.3949788175523148`*^9}, {3.3949788837016697`*^9, 3.394978992919386*^9}, { 3.394979042164879*^9, 3.394979042746623*^9}, {3.3949790878180733`*^9, 3.394979105336525*^9}, {3.394979150511779*^9, 3.394979151713913*^9}, { 3.3949792490935307`*^9, 3.394979259113675*^9}, {3.394979459826947*^9, 3.3949795084675007`*^9}, 3.394980308147073*^9, 3.394980487280224*^9, { 3.394980620424697*^9, 3.3949806253341312`*^9}, {3.394981307735177*^9, 3.394981312329961*^9}, {3.394981441486002*^9, 3.394981483092321*^9}, { 3.3949819044662437`*^9, 3.394981920609809*^9}, {3.394981994899228*^9, 3.394981999410727*^9}, 3.3949820415543823`*^9, {3.394982218959898*^9, 3.394982221912046*^9}, {3.394989041651018*^9, 3.394989042269356*^9}, { 3.394989441145595*^9, 3.394989517875592*^9}, {3.394989556449918*^9, 3.39498963087393*^9}, {3.394989767689165*^9, 3.394989784835752*^9}, 3.394989817353196*^9, {3.394989982355029*^9, 3.394989991621703*^9}, { 3.394990027683869*^9, 3.3949900343540783`*^9}, {3.39499013075086*^9, 3.394990164495598*^9}, {3.394990217758771*^9, 3.394990234945711*^9}, { 3.3949907913185863`*^9, 3.394990793153679*^9}, {3.39499091134478*^9, 3.3949909413066196`*^9}, {3.394991031372417*^9, 3.394991058807292*^9}, { 3.394991135654744*^9, 3.394991148142145*^9}, {3.3949912145661783`*^9, 3.394991223669744*^9}, {3.394991286066297*^9, 3.394991314792892*^9}, 3.3949915967107697`*^9, {3.395067551911418*^9, 3.3950675782058973`*^9}, { 3.3950684651496468`*^9, 3.3950684755027637`*^9}, {3.395150912158667*^9, 3.3951509405147533`*^9}, {3.395151444279175*^9, 3.395151456549962*^9}, { 3.395152258157982*^9, 3.3951522813656263`*^9}, {3.395152327755116*^9, 3.39515234488783*^9}, 3.3951525513680964`*^9, {3.395153046346142*^9, 3.3951530477190037`*^9}, {3.3951530853255*^9, 3.3951531108921747`*^9}, { 3.3951532249369164`*^9, 3.395153243116456*^9}, {3.395153305525262*^9, 3.39515330837704*^9}, {3.395153487318573*^9, 3.3951534887072573`*^9}, 3.3951555202994757`*^9, 3.395510057765245*^9, {3.3955101944695673`*^9, 3.3955102078884277`*^9}, 3.395595436880726*^9, {3.3955955090840473`*^9, 3.395595511546373*^9}, {3.395671144948029*^9, 3.39567115009394*^9}, { 3.395671659246089*^9, 3.395671659958167*^9}, 3.395671787800149*^9, { 3.39567194830737*^9, 3.3956719578573303`*^9}, {3.3956724956699038`*^9, 3.395672547584929*^9}, {3.395672625391814*^9, 3.3956726764557056`*^9}, { 3.3956727190923634`*^9, 3.395672748445086*^9}, {3.3957661183770695`*^9, 3.3957661545020695`*^9}, {3.3957662038926945`*^9, 3.3957662395333195`*^9}, {3.3957663197676945`*^9, 3.3957663201426945`*^9}, {3.3957663544551945`*^9, 3.3957663544708195`*^9}, {3.3957664602051945`*^9, 3.3957664861270695`*^9}, {3.3957665606583195`*^9, 3.3957666380176945`*^9}, {3.3957666750801945`*^9, 3.3957666841270695`*^9}, {3.3957667215020695`*^9, 3.3957667690176945`*^9}, {3.3957667995020695`*^9, 3.3957668002364445`*^9}, {3.3957714609708195`*^9, 3.3957714805333195`*^9}, {3.3957715612208195`*^9, 3.3957715623770695`*^9}, {3.3957716012833195`*^9, 3.3957716241426945`*^9}, {3.3957717782989445`*^9, 3.3957717946426945`*^9}, {3.3957718255801945`*^9, 3.3957718284551945`*^9}, 3.3957718824395695`*^9, {3.3957725545489445`*^9, 3.3957725610333195`*^9}, { 3.3957768535176945`*^9, 3.3957768535958195`*^9}, {3.3957770356114445`*^9, 3.3957770372989445`*^9}, {3.3957772189083195`*^9, 3.3957772263614445`*^9}, {3.396098770530684*^9, 3.396098849377747*^9}, { 3.396099100054084*^9, 3.396099103033777*^9}, {3.396099639336358*^9, 3.396099649544948*^9}, 3.3961001598249207`*^9, {3.396100204917263*^9, 3.396100237640011*^9}, 3.3961222447393446`*^9, {3.396613249593212*^9, 3.3966132647164097`*^9}, {3.39662742696808*^9, 3.396627498470063*^9}, 3.396627569537046*^9, 3.3966276422602882`*^9, {3.3966400017902603`*^9, 3.396640006350781*^9}, {3.396640400842695*^9, 3.3966404054060802`*^9}, { 3.396641042702581*^9, 3.396641049344954*^9}, {3.396641371410775*^9, 3.396641382926859*^9}, {3.396642569613975*^9, 3.396642576176248*^9}, { 3.396642723347728*^9, 3.3966427410548077`*^9}, {3.3966957544769955`*^9, 3.396695754767413*^9}, {3.3966961969532447`*^9, 3.3966962545761023`*^9}, { 3.4084528302234907`*^9, 3.4084528308797407`*^9}}, CellID->75534301] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`coinList$$ = {{ Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.937149317615475, 3.4570111251457183`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 0, 1]], Disk[{1.2350848468240294`, 3.90761519625908}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{0.9483946947728605, 0.11586580566008031`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.0123450096426363`, 0.20508761610609105`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.8177866468852102, 3.4949433224203617`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.990183807784616, 3.724786915907975}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.103786811051094, 3.9442324834367515`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.2138862257132144`, 3.5033662464073636`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.599707025255953, 1.2935266848173532`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.8922929101357877`, 2.427629613951808}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.523500770986093, 3.1291933745114573`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.136924815652933, 4.043947496407353}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.040079690873501, 4.883829740928275}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{0.12792697482180704`, 2.8166596443536838`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.72194838178027, 4.810605091107956}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.142107134270281, 0.4135105674398776}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.6983039937357023`, 2.8864401702504994`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.0509491449333985`, 3.6826540660807394`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.6232567875633404`, 0.5196292136854597}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.3381272382035991`, 4.550953297267309}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.5288688816732678, 4.983794394099133}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.521026408242161, 4.986527814412986}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.737466702757915, 2.4541431394603688`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.14941628322784, 0.6811225705484858}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.991994794040023, 4.349040209384844}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.320442049611745, 1.526436309850373}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.9607929504000827`, 2.491284087245168}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.348642644840126, 0.9439849416120494}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.2712385237802037`, 1.4902658414984704`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.454330307598348, 2.609942120496762}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{0.2916657092090136, 2.5818934988624918`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.3481633572487941, 0.1048221711676589}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{2.78944945687246, 2.8892851846259884`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.8752146417283817`, 3.2771514394884047`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.28808815786765196`, 1.0227069381313247`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.805840138767918, 2.371106820538956}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 0, 1]], Disk[{2.2169160883947328`, 2.2321871228646852`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.580111025915797, 0.4827829379731674}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.6368623005631475`, 3.229508892450802}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.3990343435973707`, 2.942007643754474}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{0.005598767512290381, 1.8836605147239172`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.281986576888441, 0.30669742206581696`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{0.7653206873163609, 3.9409208245707816`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.3502417809002165`, 1.3621528738915833`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.342495440193538, 1.8835595912243541`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.029135288593366, 1.709902951828336}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.3762408007792355`, 0.1613079145776497}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.5631825822180723`, 0.09074105553001477}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.584264313083789, 1.914941410151867}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.437965581663023, 4.196456775834193}, Rational[1, 4]]}}, $CellContext`coinPositionList$$ = CompressedData[" 1:eJwBMQPO/CFib1JlAgAAADIAAAACAAAAeAQ1JEh/D0CuReNy9acLQF1PDlTo wvM/cEiKwctCD0CU+rfUP1nuP4DkCKZhqb0/r3glV0gZCED4wP6dT0DKP4BH 7+ZOK+o/MFo52KT1C0DO2n2+8vUTQMwlIxVdzA1Af4fzWxyp8T8kdKHCyY0P QNIMiPYTbPM/2Nbx4eQGDEABP2UyM8wEQImzfAlJsvQ/JcY37tRG/j8AyzUT yWsDQKRDC5YQGBJAvBcziZYICUDh66kJbBgJQB0+j5IALRBAUJEYmiqk8D+N E+KpCokTQGhkkT7pX8A/TrID2oSIBkDKK4nfjMYNQHwe0UIPPhNAZuBYiISR EEBsGe0G9XbaP5cWfmcglgVASrGo8W0XB0BD+PMMsNDwP7ZiwlUTdg1ArMH8 DW78BEBoaNpxzaDgP0iKXxv4aPU/vIvlGS00EkC4FNVufuzgP16TMsxn7xNA fAJf8ocVEkAW/u1YNPITQEa/o+KpzPs//HpdzBWiA0BU0AeVAJkQQKZXoo/B y+U/DtG4e833E0AGMPHLamURQObD2utDkAJAl7/jekhs+D/OkOE2tK8HQAwb /lkm7gNAMFHWkwJlEUCyfIToHzXuPxnS0DT+VvQ/Qk+5/iDY9z9xu6Xtd6IL QFLkn1Up4QRABLaapqaq0j+Q9FrHt6cEQAglQ/ZOSNY/MJEPNaDVuj++5Xjg ylAGQJxJBo1BHQdAS6G5iHAAD0DcIoUsmzcKQEgDGlAJcNI/T6lK8wFd8D+c f45QXHIGQIJMTNoG+AJAkA2NgD68AUCcDBrshNsBQO9t8Z8IUhJA2FZqaOrl 3j/WygdDSxgFQDC9GcII1glAXbT71XFi9j9UD7RNO4kHQAClz7W77nY/jhc4 NXkj/j+8LK0tgkECQISSYjnuoNM/fjtfz4F96D9AQU1/AYcPQDKMKiCXmvU/ qUTYz2DL9T9wSNU/br0KQP0CxmEPI/4/EKwepNUdEEAt/JYyw1v7Py8kdomK AgtAODbZ3LylxD94baLeZYEEQEDr50nOOrc/vKhTYklWEkD4u6WamaP+P7EQ qAx6wBFAUCQN9yvJEECfTGft "], $CellContext`i$$ = Null, $CellContext`ishape$$ = Square, $CellContext`n$$ = 0, $CellContext`nCoins$$ = 50, $CellContext`nTouchingTilesList$$ = {2, 3, 4, 4, 2, 2, 4, 2, 1, 2, 2, 4, 4, 4, 2, 2, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 4, 2, 2, 2, 3, 1, 2, 2, 4, 1, 4, 1, 2, 2, 2, 2, 2, 2}, $CellContext`radius$$ = Rational[1, 4], $CellContext`runTab$$ = {{0, 1, 0, 0}, {0, 1, 1, 0}, {0, 1, 1, 1}, {0, 1, 1, 2}, {0, 2, 1, 2}, {0, 3, 1, 2}, {0, 3, 1, 3}, {0, 4, 1, 3}, {1, 4, 1, 3}, {1, 5, 1, 3}, {1, 6, 1, 3}, {1, 6, 1, 4}, {1, 6, 1, 5}, {1, 6, 1, 6}, {1, 7, 1, 6}, {1, 8, 1, 6}, {1, 9, 1, 6}, {1, 10, 1, 6}, {2, 10, 1, 6}, {3, 10, 1, 6}, {3, 11, 1, 6}, {3, 12, 1, 6}, {4, 12, 1, 6}, {4, 13, 1, 6}, {4, 14, 1, 6}, {5, 14, 1, 6}, {5, 15, 1, 6}, {5, 16, 1, 6}, {6, 16, 1, 6}, {7, 16, 1, 6}, {8, 16, 1, 6}, {8, 17, 1, 6}, {8, 17, 1, 7}, {8, 18, 1, 7}, {8, 19, 1, 7}, {8, 20, 1, 7}, {8, 20, 2, 7}, {9, 20, 2, 7}, {9, 21, 2, 7}, {9, 22, 2, 7}, {9, 22, 2, 8}, {10, 22, 2, 8}, {10, 22, 2, 9}, {11, 22, 2, 9}, {11, 23, 2, 9}, {11, 24, 2, 9}, {11, 25, 2, 9}, {11, 26, 2, 9}, {11, 27, 2, 9}, {11, 28, 2, 9}}, $CellContext`shape$$ = $CellContext`ishape$$, \ $CellContext`shapeLabelType$$ = Graphics, $CellContext`table$$ = {{ Line[{{0, 0}, {0, 5}}], Line[{{1, 0}, {1, 5}}], Line[{{2, 0}, {2, 5}}], Line[{{3, 0}, {3, 5}}], Line[{{4, 0}, {4, 5}}], Line[{{5, 0}, {5, 5}}]}, { Line[{{0, 0}, {5, 0}}], Line[{{0, 1}, {5, 1}}], Line[{{0, 2}, {5, 2}}], Line[{{0, 3}, {5, 3}}], Line[{{0, 4}, {5, 4}}], Line[{{0, 5}, {5, 5}}]}}, $CellContext`\[Theta]$$ = Rational[2, 5] Pi, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`shapeLabelType$$], Graphics, "shape labels"}, { Text -> "Text", Graphics -> "Graphics"}}, {{ Hold[$CellContext`ishape$$], Square, "tile shape"}, Dynamic[ Map[# :> Dynamic[ $CellContext`shapeLabel[$CellContext`shapeLabelType$$, #]]& , { Square, $CellContext`Triangle, $CellContext`Hexagon, \ $CellContext`Rhombus}]]}, {{ Hold[$CellContext`shape$$], $CellContext`ishape$$}}, {{ Hold[$CellContext`radius$$], Rational[1, 4], "coin size"}, 0, Dynamic[ $CellContext`maxRadius[$CellContext`shape$$]]}, {{ Hold[$CellContext`nCoins$$], 50, "number of coins"}, 1, 150, 1}, {{ Hold[$CellContext`\[Theta]$$], Rational[2, 5] Pi, "vertex angle"}, Rational[1, 4] Pi, Rational[1, 2] Pi}, {{ Hold[$CellContext`i$$], Null}}, {{ Hold[$CellContext`coinPositionList$$], CompressedData[" 1:eJwBMQPO/CFib1JlAgAAADIAAAACAAAAhrrt1SulDUBm1D4Qg+AEQOQLcpIO 7BNAtnyEQuGIDkAtS4hhxH8NQBY5iEjSEgxAdn53Twie4T8gxg2GlXf+P0dH iwwQ7wtAUqFXyshZE0A+ijI90cD8P+zFJ4zcHxJAgKGPoNxh/z8uceD8in7v P7q3vjF02gJASJTh+UU8E0B9RorMEJDyP+u+yQvlVgJA5IcTGLvVCECbfHkA 5kcIQOGlZo1QXBBAXCvL7F+eE0Da4Uo/hQLuPxgGWMB9Q9c/0q4lMH+/7D86 il0BuZPyP//RYBZ8CxNAakMHRNyW9j+gkAqVkxn0PydSJYt5dBBAKNUUye3h 0z+fd5ME5tAMQOX1UFy6wxJAaizHHCvTAEAiIz6c8V0NQEwynGJj//o/lJom 96Fg/z+6OcTFhfjyP8xr6rycw9o/dIo+dRBKBkCUQ4Vm1OUFQFI8nBxM6w9A rh+usfSGDUD54ZrkYRoPQHwwstJzEPM/ujuYwuAYDUDKGW8aeJgFQPoMzv5h 3ABAyPsKJY80C0DqiYIAF3roP/oDgRs9yQhA0LkvlmZUAEA4UF01CDLOP8jJ MV3HXtM/gP9UuWsmEECEg//LkboTQDQ0kOZKBwxA3KVeP48I+z9M3XMSAk4L QPbXv9TE3QVAgl6Yk2h3CEAHAaF0r+8AQJxVHRoKhwNAMKkG6FZq7D/WcV5x kiH7P/TJIKvYzNs/LzRIvbJBEkAIXbwzzR8DQBIzXNkBaglA1jWV5rnYCkDC LswlHbAAQHZtZUWLRAhAXCmRfKu66j+woNQJd1YEQEta7Q/F0QFAzDTgnITZ EUATHngo7V8SQDD5zWq/f9g/JOizkzx2BEBsBnLnhrPiPzYEiekgPRNAY3xq Huyl9D8gVS7uStEQQKxb9v1NAe4/jTl6jDXV+D97zIOWzMMTQGBpBm/3Ses/ Lq20AisEA0DXF+mfgCj7PxdBm7o3JgJAPgqmoImHBEBe7pDrW48CQOrYloVW Zug/gR1u7TeRDkBfFeJ1WtHxP5rpcTNRGQdAf+ptpsPGBUA8jm+5ZPwEQDbg mpJZpBJAmFMBP9Cq4j+qAGYE "]}}, {{ Hold[$CellContext`table$$], {{ Line[{{0, 0}, {0, 5}}], Line[{{1, 0}, {1, 5}}], Line[{{2, 0}, {2, 5}}], Line[{{3, 0}, {3, 5}}], Line[{{4, 0}, {4, 5}}], Line[{{5, 0}, {5, 5}}]}, { Line[{{0, 0}, {5, 0}}], Line[{{0, 1}, {5, 1}}], Line[{{0, 2}, {5, 2}}], Line[{{0, 3}, {5, 3}}], Line[{{0, 4}, {5, 4}}], Line[{{0, 5}, {5, 5}}]}}}}, {{ Hold[$CellContext`nTouchingTilesList$$], {1, 4, 1, 2, 2, 2, 4, 2, 2, 4, 4, 2, 4, 2, 2, 1, 2, 1, 4, 2, 2, 2, 2, 2, 2, 4, 2, 4, 1, 1, 4, 2, 1, 1, 2, 4, 2, 2, 1, 1, 2, 4, 2, 2, 1, 1, 3, 4, 1, 1}}}, {{ Hold[$CellContext`coinList$$], {{ Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.705650016133691, 2.6096249837087724`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.98052433796963, 3.816835899036586}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.6873862857550166`, 3.5091901461193045`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.5505410720906656, 1.9041953312374815`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.491729829788628, 4.837680017088433}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.797074545910291, 4.531114759376106}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.9613920471111612`, 0.9841971339224409}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.3566669355704706`, 4.808860687630904}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.1601722707604545`, 2.2924290581648754`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.104360759826692, 3.0351066624712764`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.090151032819876, 4.90466279974029}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.9378076778585254, 0.36349433692530075`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{0.8983760776877381, 1.1610651067100108`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.761215543422167, 1.4118311555250451`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.2562442609715063`, 4.113744901802909}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{0.3106646026311233, 3.6020012242797317`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.691140596810759, 2.103109574154179}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.6708709913695126`, 1.6873506404837313`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.9610919622734047`, 1.1856744504217276`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.4181892247085528, 2.7861642036162326`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.7372215279978693`, 3.9898912654094056`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.69089640438684, 3.887882028557439}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.1915167074503463`, 3.637147445936958}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.69944782878449, 2.1076087862617188`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.400663651845637, 0.7649035463294329}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.098261084437124, 2.041211293536641}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.23590185743035064`, 0.3026598367788691}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.03752030926978, 4.932196795912095}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.503560830379252, 1.689589736497843}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.4130898896798154`, 2.7332855816885013`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.0583049326776868`, 2.117033873713925}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.4409372368051674`, 0.8879808933027444}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.69569629940735, 0.43437782966353145`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.564158399135564, 2.3905281106814336`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.1767613393079808`, 3.355823327473199}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{2.085993094724331, 3.0334687635019533`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.8352868493032406, 2.54221923523081}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.227426647597246, 4.462419940170729}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.593678123790158, 0.38279710226187813`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.5577327288892935`, 0.5844149132173704}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.809695862758465, 1.2905083835719544`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.204387399270928, 0.9376592598153954}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.5520530211830164`, 4.941210128588064}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.8527791183908384, 2.37703516115075}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.6973882910256088`, 2.2686609820012893`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.566180472437991, 2.319999542580077}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 0, 1]], Disk[{0.762492428699969, 3.8209074544171817`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.1136116604623891`, 2.8873619097841585`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.722052860478754, 2.623238991467387}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.660497942641134, 0.5833512526102025}, Rational[1, 4]]}}}}, {{ Hold[$CellContext`runTab$$], {{1, 0, 0, 0}, {1, 0, 0, 1}, {2, 0, 0, 1}, {2, 1, 0, 1}, {2, 2, 0, 1}, {2, 3, 0, 1}, {2, 3, 0, 2}, {2, 4, 0, 2}, {2, 5, 0, 2}, {2, 5, 0, 3}, {2, 5, 0, 4}, {2, 6, 0, 4}, {2, 6, 0, 5}, {2, 7, 0, 5}, {2, 8, 0, 5}, {3, 8, 0, 5}, {3, 9, 0, 5}, {4, 9, 0, 5}, {4, 9, 0, 6}, {4, 10, 0, 6}, {4, 11, 0, 6}, {4, 12, 0, 6}, {4, 13, 0, 6}, {4, 14, 0, 6}, {4, 15, 0, 6}, {4, 15, 0, 7}, {4, 16, 0, 7}, {4, 16, 0, 8}, {5, 16, 0, 8}, {6, 16, 0, 8}, {6, 16, 0, 9}, {6, 17, 0, 9}, {7, 17, 0, 9}, {8, 17, 0, 9}, {8, 18, 0, 9}, {8, 18, 0, 10}, {8, 19, 0, 10}, {8, 20, 0, 10}, {9, 20, 0, 10}, {10, 20, 0, 10}, {10, 21, 0, 10}, {10, 21, 0, 11}, {10, 22, 0, 11}, {10, 23, 0, 11}, {11, 23, 0, 11}, {12, 23, 0, 11}, {12, 23, 1, 11}, {12, 23, 1, 12}, {13, 23, 1, 12}, {14, 23, 1, 12}}}}, {{ Hold[$CellContext`n$$], 0}}}, Typeset`size$$ = {550., {147.5, 152.5}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`shapeLabelType$83820$$ = False, $CellContext`radius$83821$$ = 0, $CellContext`nCoins$83822$$ = 0, $CellContext`\[Theta]$83823$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`coinList$$ = {{ Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.705650016133691, 2.6096249837087724`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.98052433796963, 3.816835899036586}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.6873862857550166`, 3.5091901461193045`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.5505410720906656, 1.9041953312374815`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.491729829788628, 4.837680017088433}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.797074545910291, 4.531114759376106}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.9613920471111612`, 0.9841971339224409}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.3566669355704706`, 4.808860687630904}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.1601722707604545`, 2.2924290581648754`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.104360759826692, 3.0351066624712764`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.090151032819876, 4.90466279974029}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.9378076778585254, 0.36349433692530075`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{0.8983760776877381, 1.1610651067100108`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.761215543422167, 1.4118311555250451`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.2562442609715063`, 4.113744901802909}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{0.3106646026311233, 3.6020012242797317`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.691140596810759, 2.103109574154179}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.6708709913695126`, 1.6873506404837313`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.9610919622734047`, 1.1856744504217276`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.4181892247085528, 2.7861642036162326`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.7372215279978693`, 3.9898912654094056`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.69089640438684, 3.887882028557439}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.1915167074503463`, 3.637147445936958}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.69944782878449, 2.1076087862617188`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.400663651845637, 0.7649035463294329}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.098261084437124, 2.041211293536641}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.23590185743035064`, 0.3026598367788691}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.03752030926978, 4.932196795912095}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.503560830379252, 1.689589736497843}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.4130898896798154`, 2.7332855816885013`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.0583049326776868`, 2.117033873713925}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.4409372368051674`, 0.8879808933027444}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.69569629940735, 0.43437782966353145`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.564158399135564, 2.3905281106814336`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.1767613393079808`, 3.355823327473199}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{2.085993094724331, 3.0334687635019533`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.8352868493032406, 2.54221923523081}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.227426647597246, 4.462419940170729}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.593678123790158, 0.38279710226187813`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.5577327288892935`, 0.5844149132173704}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.809695862758465, 1.2905083835719544`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.204387399270928, 0.9376592598153954}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.5520530211830164`, 4.941210128588064}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.8527791183908384, 2.37703516115075}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.6973882910256088`, 2.2686609820012893`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.566180472437991, 2.319999542580077}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 0, 1]], Disk[{0.762492428699969, 3.8209074544171817`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.1136116604623891`, 2.8873619097841585`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.722052860478754, 2.623238991467387}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.660497942641134, 0.5833512526102025}, Rational[ 1, 4]]}}, $CellContext`coinPositionList$$ = CompressedData[" 1:eJwBMQPO/CFib1JlAgAAADIAAAACAAAAhrrt1SulDUBm1D4Qg+AEQOQLcpIO 7BNAtnyEQuGIDkAtS4hhxH8NQBY5iEjSEgxAdn53Twie4T8gxg2GlXf+P0dH iwwQ7wtAUqFXyshZE0A+ijI90cD8P+zFJ4zcHxJAgKGPoNxh/z8uceD8in7v P7q3vjF02gJASJTh+UU8E0B9RorMEJDyP+u+yQvlVgJA5IcTGLvVCECbfHkA 5kcIQOGlZo1QXBBAXCvL7F+eE0Da4Uo/hQLuPxgGWMB9Q9c/0q4lMH+/7D86 il0BuZPyP//RYBZ8CxNAakMHRNyW9j+gkAqVkxn0PydSJYt5dBBAKNUUye3h 0z+fd5ME5tAMQOX1UFy6wxJAaizHHCvTAEAiIz6c8V0NQEwynGJj//o/lJom 96Fg/z+6OcTFhfjyP8xr6rycw9o/dIo+dRBKBkCUQ4Vm1OUFQFI8nBxM6w9A rh+usfSGDUD54ZrkYRoPQHwwstJzEPM/ujuYwuAYDUDKGW8aeJgFQPoMzv5h 3ABAyPsKJY80C0DqiYIAF3roP/oDgRs9yQhA0LkvlmZUAEA4UF01CDLOP8jJ MV3HXtM/gP9UuWsmEECEg//LkboTQDQ0kOZKBwxA3KVeP48I+z9M3XMSAk4L QPbXv9TE3QVAgl6Yk2h3CEAHAaF0r+8AQJxVHRoKhwNAMKkG6FZq7D/WcV5x kiH7P/TJIKvYzNs/LzRIvbJBEkAIXbwzzR8DQBIzXNkBaglA1jWV5rnYCkDC LswlHbAAQHZtZUWLRAhAXCmRfKu66j+woNQJd1YEQEta7Q/F0QFAzDTgnITZ EUATHngo7V8SQDD5zWq/f9g/JOizkzx2BEBsBnLnhrPiPzYEiekgPRNAY3xq Huyl9D8gVS7uStEQQKxb9v1NAe4/jTl6jDXV+D97zIOWzMMTQGBpBm/3Ses/ Lq20AisEA0DXF+mfgCj7PxdBm7o3JgJAPgqmoImHBEBe7pDrW48CQOrYloVW Zug/gR1u7TeRDkBfFeJ1WtHxP5rpcTNRGQdAf+ptpsPGBUA8jm+5ZPwEQDbg mpJZpBJAmFMBP9Cq4j+qAGYE "], $CellContext`i$$ = Null, $CellContext`ishape$$ = Square, $CellContext`n$$ = 0, $CellContext`nCoins$$ = 50, $CellContext`nTouchingTilesList$$ = {1, 4, 1, 2, 2, 2, 4, 2, 2, 4, 4, 2, 4, 2, 2, 1, 2, 1, 4, 2, 2, 2, 2, 2, 2, 4, 2, 4, 1, 1, 4, 2, 1, 1, 2, 4, 2, 2, 1, 1, 2, 4, 2, 2, 1, 1, 3, 4, 1, 1}, $CellContext`radius$$ = Rational[1, 4], $CellContext`runTab$$ = {{1, 0, 0, 0}, {1, 0, 0, 1}, { 2, 0, 0, 1}, {2, 1, 0, 1}, {2, 2, 0, 1}, {2, 3, 0, 1}, {2, 3, 0, 2}, {2, 4, 0, 2}, {2, 5, 0, 2}, {2, 5, 0, 3}, {2, 5, 0, 4}, {2, 6, 0, 4}, {2, 6, 0, 5}, {2, 7, 0, 5}, {2, 8, 0, 5}, {3, 8, 0, 5}, {3, 9, 0, 5}, {4, 9, 0, 5}, {4, 9, 0, 6}, {4, 10, 0, 6}, {4, 11, 0, 6}, {4, 12, 0, 6}, {4, 13, 0, 6}, {4, 14, 0, 6}, {4, 15, 0, 6}, {4, 15, 0, 7}, {4, 16, 0, 7}, {4, 16, 0, 8}, {5, 16, 0, 8}, {6, 16, 0, 8}, {6, 16, 0, 9}, {6, 17, 0, 9}, {7, 17, 0, 9}, {8, 17, 0, 9}, {8, 18, 0, 9}, {8, 18, 0, 10}, {8, 19, 0, 10}, {8, 20, 0, 10}, {9, 20, 0, 10}, { 10, 20, 0, 10}, {10, 21, 0, 10}, {10, 21, 0, 11}, {10, 22, 0, 11}, { 10, 23, 0, 11}, {11, 23, 0, 11}, {12, 23, 0, 11}, {12, 23, 1, 11}, { 12, 23, 1, 12}, {13, 23, 1, 12}, {14, 23, 1, 12}}, $CellContext`shape$$ = $CellContext`ishape$$, \ $CellContext`shapeLabelType$$ = Graphics, $CellContext`table$$ = {{ Line[{{0, 0}, {0, 5}}], Line[{{1, 0}, {1, 5}}], Line[{{2, 0}, {2, 5}}], Line[{{3, 0}, {3, 5}}], Line[{{4, 0}, {4, 5}}], Line[{{5, 0}, {5, 5}}]}, { Line[{{0, 0}, {5, 0}}], Line[{{0, 1}, {5, 1}}], Line[{{0, 2}, {5, 2}}], Line[{{0, 3}, {5, 3}}], Line[{{0, 4}, {5, 4}}], Line[{{0, 5}, {5, 5}}]}}, $CellContext`\[Theta]$$ = Rational[2, 5] Pi}, "ControllerVariables" :> { Hold[$CellContext`shapeLabelType$$, \ $CellContext`shapeLabelType$83820$$, False], Hold[$CellContext`radius$$, $CellContext`radius$83821$$, 0], Hold[$CellContext`nCoins$$, $CellContext`nCoins$83822$$, 0], Hold[$CellContext`\[Theta]$$, $CellContext`\[Theta]$83823$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> ($CellContext`shape$$ = $CellContext`ishape$$; If[ MatchQ[$CellContext`shape$$, Alternatives[$CellContext`Rhombus, $CellContext`Rhombus[ Blank[]]]], $CellContext`shape$$ = \ $CellContext`Rhombus[$CellContext`\[Theta]$$]]; If[AbsoluteTime[] > AbsoluteTime[$CellContext`$EstimatedPostingDate], $CellContext`n$$ = 0]; $CellContext`n$$ = Min[$CellContext`n$$, $CellContext`nCoins$$]; \ $CellContext`coinPositionList$$ = Table[ Switch[$CellContext`shape$$, $CellContext`Hexagon, $CellContext`randomPosition[$CellContext`Hexagon, \ $CellContext`hexCenters], Blank[], $CellContext`randomPosition[$CellContext`shape$$, \ $CellContext`floorSide]], {$CellContext`nCoins$$}]; $CellContext`radius$$ = Min[ $CellContext`maxRadius[$CellContext`shape$$], \ $CellContext`radius$$]; $CellContext`table$$ = \ $CellContext`shapeGrid[$CellContext`shape$$][$CellContext`floorSide]; \ $CellContext`nTouchingTilesList$$ = Map[ $CellContext`nTiles[$CellContext`shape$$, $CellContext`radius$$], \ $CellContext`coinPositionList$$]; $CellContext`coinList$$ = Table[ $CellContext`Coin[$CellContext`radius$$][ $CellContext`coinColor[ Part[$CellContext`nTouchingTilesList$$, $CellContext`i$$]], Part[$CellContext`coinPositionList$$, $CellContext`i$$]], \ {$CellContext`i$$, $CellContext`nCoins$$}]; $CellContext`runTab$$ = \ $CellContext`runningTouchingTilesTab[ $CellContext`nTileValues[$CellContext`shape$$], \ $CellContext`nTouchingTilesList$$]; Pane[ Column[{ Row[{ Text[ Style["drop coins ", TextAlignment -> Left]], $CellContext`coinControl[ Dynamic[$CellContext`n$$, TrackedSymbols -> {$CellContext`n$$, $CellContext`shape$$, \ $CellContext`radius$$, $CellContext`nCoins$$}], {0, $CellContext`nCoins$$, 1}, AnimationRate -> 2, DisplayAllSteps -> True, AnimationRepetitions -> 1, BaseStyle -> "VerticalSlider"]}], Grid[{{ Graphics[ Dynamic[ If[$CellContext`n$$ > 0, {$CellContext`table$$, Take[$CellContext`coinList$$, $CellContext`n$$]}, \ {$CellContext`table$$}]], PlotRange -> $CellContext`plotRangeValue[$CellContext`shape$$, \ $CellContext`floorSide], ImageSize -> {220, 220}, AspectRatio -> Automatic], Column[{ Dynamic[ $CellContext`TabularDisplay[$CellContext`shape$$, Part[$CellContext`runTab$$, $CellContext`n$$], \ $CellContext`radius$$]], If[$CellContext`$UseHisto, Dynamic[ $CellContext`HistogramDisplay[$CellContext`shape$$, Part[$CellContext`runTab$$, $CellContext`n$$], \ $CellContext`radius$$]]]}, Alignment -> {Center, Baseline}]}}]}, Alignment -> {Center, Center}], ImageSize -> {550, 300}]), "Specifications" :> {{{$CellContext`shapeLabelType$$, Graphics, "shape labels"}, {Text -> "Text", Graphics -> "Graphics"}, ControlType -> RadioButton}, {{$CellContext`ishape$$, Square, "tile shape"}, Dynamic[ Map[# :> Dynamic[ $CellContext`shapeLabel[$CellContext`shapeLabelType$$, #]]& , { Square, $CellContext`Triangle, $CellContext`Hexagon, \ $CellContext`Rhombus}]], ControlType -> SetterBar}, {{$CellContext`shape$$, $CellContext`ishape$$}, ControlType -> None}, {{$CellContext`radius$$, Rational[1, 4], "coin size"}, 0, Dynamic[ $CellContext`maxRadius[$CellContext`shape$$]]}, \ {{$CellContext`nCoins$$, 50, "number of coins"}, 1, 150, 1}, {{$CellContext`\[Theta]$$, Rational[2, 5] Pi, "vertex angle"}, Rational[1, 4] Pi, Rational[1, 2] Pi, Enabled :> Dynamic[ MatchQ[$CellContext`ishape$$, Alternatives[$CellContext`Rhombus, $CellContext`Rhombus[ Blank[]]]]]}, {{$CellContext`i$$, Null}, ControlType -> None}, {{$CellContext`coinPositionList$$, CompressedData[" 1:eJwBMQPO/CFib1JlAgAAADIAAAACAAAAhrrt1SulDUBm1D4Qg+AEQOQLcpIO 7BNAtnyEQuGIDkAtS4hhxH8NQBY5iEjSEgxAdn53Twie4T8gxg2GlXf+P0dH iwwQ7wtAUqFXyshZE0A+ijI90cD8P+zFJ4zcHxJAgKGPoNxh/z8uceD8in7v P7q3vjF02gJASJTh+UU8E0B9RorMEJDyP+u+yQvlVgJA5IcTGLvVCECbfHkA 5kcIQOGlZo1QXBBAXCvL7F+eE0Da4Uo/hQLuPxgGWMB9Q9c/0q4lMH+/7D86 il0BuZPyP//RYBZ8CxNAakMHRNyW9j+gkAqVkxn0PydSJYt5dBBAKNUUye3h 0z+fd5ME5tAMQOX1UFy6wxJAaizHHCvTAEAiIz6c8V0NQEwynGJj//o/lJom 96Fg/z+6OcTFhfjyP8xr6rycw9o/dIo+dRBKBkCUQ4Vm1OUFQFI8nBxM6w9A rh+usfSGDUD54ZrkYRoPQHwwstJzEPM/ujuYwuAYDUDKGW8aeJgFQPoMzv5h 3ABAyPsKJY80C0DqiYIAF3roP/oDgRs9yQhA0LkvlmZUAEA4UF01CDLOP8jJ MV3HXtM/gP9UuWsmEECEg//LkboTQDQ0kOZKBwxA3KVeP48I+z9M3XMSAk4L QPbXv9TE3QVAgl6Yk2h3CEAHAaF0r+8AQJxVHRoKhwNAMKkG6FZq7D/WcV5x kiH7P/TJIKvYzNs/LzRIvbJBEkAIXbwzzR8DQBIzXNkBaglA1jWV5rnYCkDC LswlHbAAQHZtZUWLRAhAXCmRfKu66j+woNQJd1YEQEta7Q/F0QFAzDTgnITZ EUATHngo7V8SQDD5zWq/f9g/JOizkzx2BEBsBnLnhrPiPzYEiekgPRNAY3xq Huyl9D8gVS7uStEQQKxb9v1NAe4/jTl6jDXV+D97zIOWzMMTQGBpBm/3Ses/ Lq20AisEA0DXF+mfgCj7PxdBm7o3JgJAPgqmoImHBEBe7pDrW48CQOrYloVW Zug/gR1u7TeRDkBfFeJ1WtHxP5rpcTNRGQdAf+ptpsPGBUA8jm+5ZPwEQDbg mpJZpBJAmFMBP9Cq4j+qAGYE "]}, ControlType -> None}, {{$CellContext`table$$, {{ Line[{{0, 0}, {0, 5}}], Line[{{1, 0}, {1, 5}}], Line[{{2, 0}, {2, 5}}], Line[{{3, 0}, {3, 5}}], Line[{{4, 0}, {4, 5}}], Line[{{5, 0}, {5, 5}}]}, { Line[{{0, 0}, {5, 0}}], Line[{{0, 1}, {5, 1}}], Line[{{0, 2}, {5, 2}}], Line[{{0, 3}, {5, 3}}], Line[{{0, 4}, {5, 4}}], Line[{{0, 5}, {5, 5}}]}}}, ControlType -> None}, {{$CellContext`nTouchingTilesList$$, {1, 4, 1, 2, 2, 2, 4, 2, 2, 4, 4, 2, 4, 2, 2, 1, 2, 1, 4, 2, 2, 2, 2, 2, 2, 4, 2, 4, 1, 1, 4, 2, 1, 1, 2, 4, 2, 2, 1, 1, 2, 4, 2, 2, 1, 1, 3, 4, 1, 1}}, ControlType -> None}, {{$CellContext`coinList$$, {{ Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.705650016133691, 2.6096249837087724`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.98052433796963, 3.816835899036586}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.6873862857550166`, 3.5091901461193045`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.5505410720906656, 1.9041953312374815`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.491729829788628, 4.837680017088433}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.797074545910291, 4.531114759376106}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.9613920471111612`, 0.9841971339224409}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.3566669355704706`, 4.808860687630904}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.1601722707604545`, 2.2924290581648754`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.104360759826692, 3.0351066624712764`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.090151032819876, 4.90466279974029}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.9378076778585254, 0.36349433692530075`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{0.8983760776877381, 1.1610651067100108`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.761215543422167, 1.4118311555250451`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.2562442609715063`, 4.113744901802909}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{0.3106646026311233, 3.6020012242797317`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.691140596810759, 2.103109574154179}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.6708709913695126`, 1.6873506404837313`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.9610919622734047`, 1.1856744504217276`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.4181892247085528, 2.7861642036162326`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.7372215279978693`, 3.9898912654094056`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.69089640438684, 3.887882028557439}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.1915167074503463`, 3.637147445936958}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.69944782878449, 2.1076087862617188`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.400663651845637, 0.7649035463294329}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.098261084437124, 2.041211293536641}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.23590185743035064`, 0.3026598367788691}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.03752030926978, 4.932196795912095}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.503560830379252, 1.689589736497843}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{3.4130898896798154`, 2.7332855816885013`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{3.0583049326776868`, 2.117033873713925}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.4409372368051674`, 0.8879808933027444}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.69569629940735, 0.43437782966353145`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.564158399135564, 2.3905281106814336`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{3.1767613393079808`, 3.355823327473199}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{2.085993094724331, 3.0334687635019533`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.8352868493032406, 2.54221923523081}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{2.227426647597246, 4.462419940170729}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.593678123790158, 0.38279710226187813`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.5577327288892935`, 0.5844149132173704}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{4.809695862758465, 1.2905083835719544`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{4.204387399270928, 0.9376592598153954}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{1.5520530211830164`, 4.941210128588064}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0.5, 0]], Disk[{0.8527791183908384, 2.37703516115075}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{1.6973882910256088`, 2.2686609820012893`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.566180472437991, 2.319999542580077}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 0, 1]], Disk[{0.762492428699969, 3.8209074544171817`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[0, 1, 0]], Disk[{1.1136116604623891`, 2.8873619097841585`}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{2.722052860478754, 2.623238991467387}, Rational[1, 4]]}, { Opacity[0.5, RGBColor[1, 0, 0]], Disk[{4.660497942641134, 0.5833512526102025}, Rational[1, 4]]}}}, ControlType -> None}, {{$CellContext`runTab$$, {{1, 0, 0, 0}, {1, 0, 0, 1}, {2, 0, 0, 1}, {2, 1, 0, 1}, {2, 2, 0, 1}, {2, 3, 0, 1}, {2, 3, 0, 2}, {2, 4, 0, 2}, {2, 5, 0, 2}, {2, 5, 0, 3}, {2, 5, 0, 4}, {2, 6, 0, 4}, { 2, 6, 0, 5}, {2, 7, 0, 5}, {2, 8, 0, 5}, {3, 8, 0, 5}, {3, 9, 0, 5}, {4, 9, 0, 5}, {4, 9, 0, 6}, {4, 10, 0, 6}, {4, 11, 0, 6}, {4, 12, 0, 6}, {4, 13, 0, 6}, {4, 14, 0, 6}, {4, 15, 0, 6}, {4, 15, 0, 7}, {4, 16, 0, 7}, {4, 16, 0, 8}, {5, 16, 0, 8}, {6, 16, 0, 8}, {6, 16, 0, 9}, {6, 17, 0, 9}, {7, 17, 0, 9}, {8, 17, 0, 9}, {8, 18, 0, 9}, {8, 18, 0, 10}, {8, 19, 0, 10}, {8, 20, 0, 10}, {9, 20, 0, 10}, {10, 20, 0, 10}, {10, 21, 0, 10}, {10, 21, 0, 11}, {10, 22, 0, 11}, {10, 23, 0, 11}, {11, 23, 0, 11}, {12, 23, 0, 11}, {12, 23, 1, 11}, {12, 23, 1, 12}, {13, 23, 1, 12}, {14, 23, 1, 12}}}, ControlType -> None}, {{$CellContext`n$$, 0}, ControlType -> None}}, "Options" :> { TrackedSymbols -> {$CellContext`ishape$$, $CellContext`radius$$, \ $CellContext`nCoins$$, $CellContext`\[Theta]$$}, AutorunSequencing -> {4}}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{595., {246., 251.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>(({$CellContext`$EstimatedPostingDate = {2007, 8, 20, 15}, $CellContext`Hexagon[ Pattern[$CellContext`cent, Blank[]]] := Polygon[ Map[$CellContext`cent + #& , $CellContext`hexVertices, { 1}]], $CellContext`hexVertices = {{1, 0}, { 1/2, Sqrt[3]/2}, {(-1)/2, Sqrt[3]/2}, {-1, 0}, {(-1)/2, -Sqrt[3]/2}, {1/2, -Sqrt[3]/2}, {1, 0}}, $CellContext`randomPosition[$CellContext`Hexagon, 1] := Module[{$CellContext`xy = $CellContext`randomPosition[Square, 2] - {1, 1}}, While[ Not[ $CellContext`inHexagon[ 1][$CellContext`xy]], $CellContext`xy = \ $CellContext`randomPosition[Square, 2] - {1, 1}]; $CellContext`xy], $CellContext`randomPosition[Square, Pattern[$CellContext`l, Blank[]]] := RandomReal[{0, $CellContext`l}, { 2}], $CellContext`randomPosition[$CellContext`Triangle, Pattern[$CellContext`l, Blank[]]] := Module[{$CellContext`xy = $CellContext`randomPosition[ Square, $CellContext`l]}, While[ Not[ $CellContext`inTriangle[$CellContext`l][$CellContext`xy]], \ $CellContext`xy = $CellContext`randomPosition[ Square, $CellContext`l]]; $CellContext`xy], \ $CellContext`randomPosition[$CellContext`Hexagon, Pattern[$CellContext`l, { Repeated[{ Blank[], Blank[]}]}]] := \ $CellContext`randomPosition[$CellContext`Hexagon, 1] + RandomChoice[$CellContext`l], $CellContext`randomPosition[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], Pattern[$CellContext`l, Blank[]]] := With[{$CellContext`y = RandomReal[{ 0, $CellContext`l Sin[$CellContext`\[Theta]]}]}, {$CellContext`x = $CellContext`y Cot[$CellContext`\[Theta]] + RandomReal[{ 0, $CellContext`l}], $CellContext`y}], $CellContext`inHexagon[ Pattern[$CellContext`l, Blank[]]][{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]}] := And[Abs[$CellContext`y] < $CellContext`\[Chi] $CellContext`l, Abs[$CellContext`y] < (2 $CellContext`\[Chi]) ($CellContext`l - Abs[$CellContext`x])], $CellContext`inHexagon[ Pattern[$CellContext`l, Blank[]], Pattern[$CellContext`cent, Blank[]]][ Pattern[$CellContext`xy, Blank[]]] := \ $CellContext`inHexagon[$CellContext`l][$CellContext`xy - $CellContext`cent], \ $CellContext`x = 0.3011799305415316, $CellContext`y = 0.06785466440159538, $CellContext`\[Chi] = Sqrt[3]/2, $CellContext`inTriangle[ Pattern[$CellContext`l, Blank[]]][{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]}] := And[$CellContext`y > 0, $CellContext`y < ( 2 $CellContext`\[Chi]) $CellContext`x, $CellContext`y < ( 2 $CellContext`\[Chi]) ($CellContext`l - $CellContext`x)], \ $CellContext`hexCenters = {{-3, -Sqrt[3]}, {-3, 0}, {-3, Sqrt[3]}, {(-3)/2, ((-3) Sqrt[3])/2}, {(-3)/2, -Sqrt[3]/2}, {(-3)/ 2, Sqrt[3]/2}, {(-3)/2, (3 Sqrt[3])/2}, {0, (-2) Sqrt[3]}, { 0, -Sqrt[3]}, {0, 0}, {0, Sqrt[3]}, {0, 2 Sqrt[3]}, {3/2, ((-3) Sqrt[3])/2}, { 3/2, -Sqrt[3]/2}, {3/2, Sqrt[3]/2}, {3/2, (3 Sqrt[3])/2}, { 3, -Sqrt[3]}, {3, 0}, {3, Sqrt[3]}}, $CellContext`floorSide = 5, $CellContext`maxRadius[$CellContext`Hexagon] = Sqrt[3]/2, $CellContext`maxRadius[Square] = 1/2, $CellContext`maxRadius[$CellContext`Triangle] = 1/(2 Sqrt[3]), $CellContext`maxRadius[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]]] := Sin[$CellContext`\[Theta]]/2, $CellContext`shapeGrid[Square][ Pattern[$CellContext`l, Blank[]]] := $CellContext`SquareGrid[$CellContext`l], \ $CellContext`shapeGrid[$CellContext`Triangle][ Pattern[$CellContext`l, Blank[]]] := $CellContext`TriangleGrid[$CellContext`l], \ $CellContext`shapeGrid[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]]][ Pattern[$CellContext`l, Blank[]]] := $CellContext`RhombusGrid[$CellContext`\[Theta], \ $CellContext`l], $CellContext`shapeGrid[$CellContext`Hexagon][ BlankNullSequence[]] := $CellContext`HexagonGrid[], \ $CellContext`SquareGrid[ Pattern[$CellContext`l, Blank[]]] := { Map[Line[{{#, 0}, {#, $CellContext`l}}]& , Range[0, $CellContext`l]], Map[Line[{{0, #}, {$CellContext`l, #}}]& , Range[0, $CellContext`l]]}, $CellContext`TriangleGrid[ Pattern[$CellContext`l, Blank[]]] := { Table[ Line[{{$CellContext`z/ 2, $CellContext`\[Chi] $CellContext`z}, {$CellContext`l - \ $CellContext`z/2, $CellContext`\[Chi] $CellContext`z}}], {$CellContext`z, 0, $CellContext`l}], Table[ Line[{{$CellContext`z, 0}, {($CellContext`l + $CellContext`z)/ 2, $CellContext`\[Chi] ($CellContext`l - $CellContext`z)}}], \ {$CellContext`z, 0, $CellContext`l}], Table[ Line[{{$CellContext`z, 0}, {$CellContext`z/ 2, $CellContext`\[Chi] $CellContext`z}}], {$CellContext`z, 0, $CellContext`l}]}, $CellContext`RhombusGrid[ Pattern[$CellContext`\[Theta], Blank[]], Pattern[$CellContext`l, Blank[]]] := With[{$CellContext`s = Sin[$CellContext`\[Theta]], $CellContext`c = Cos[$CellContext`\[Theta]]}, { Table[ Line[{{$CellContext`c $CellContext`z, $CellContext`s \ $CellContext`z}, {$CellContext`l + $CellContext`c $CellContext`z, \ $CellContext`s $CellContext`z}}], {$CellContext`z, 0, $CellContext`l}], Table[ Line[{{$CellContext`z, 0}, {$CellContext`z + $CellContext`c $CellContext`l, \ $CellContext`s $CellContext`l}}], {$CellContext`z, 0, $CellContext`l}]}], $CellContext`HexagonGrid[ BlankNullSequence[]] := { FaceForm[White], EdgeForm[Black], Map[$CellContext`Hexagon, $CellContext`hexCenters]}, \ $CellContext`nTiles[Square, Pattern[$CellContext`\[Rho], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`dxy = Map[Abs[Round[#] - #]& , $CellContext`xy]}, Which[ Xor[ First[$CellContext`dxy] < $CellContext`\[Rho], Last[$CellContext`dxy] < $CellContext`\[Rho]], 2, Norm[$CellContext`dxy] < $CellContext`\[Rho], 4, And[ First[$CellContext`dxy] < $CellContext`\[Rho], Last[$CellContext`dxy] < $CellContext`\[Rho]], 3, True, 1]], $CellContext`nTiles[$CellContext`Triangle, Pattern[$CellContext`\[Rho], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`dxy = \ $CellContext`TriangleDistances[$CellContext`xy]}, Which[Count[$CellContext`dxy, PatternTest[ Blank[], # > $CellContext`\[Rho]& ]] == 3, 1, Count[$CellContext`dxy, PatternTest[ Blank[], # > $CellContext`\[Rho]& ]] == 2, 2, Apply[Or, Thread[Map[$CellContext`ddistance, Subsets[$CellContext`dxy, {2}]] < $CellContext`\[Rho]]], 6, $CellContext`\[Chi] - Max[$CellContext`dxy] < $CellContext`\[Rho], 4, True, 3]], $CellContext`nTiles[$CellContext`Hexagon, PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # <= 1/2& ]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Count[ $CellContext`HexagonDistances[$CellContext`xy], PatternTest[ Blank[], # < $CellContext`\[Rho]& ]] + 1, $CellContext`nTiles[$CellContext`Hexagon, PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # > 1/2& ]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`dxy = \ $CellContext`HexagonDistances[$CellContext`xy]}, Switch[ Count[$CellContext`dxy, PatternTest[ Blank[], # < $CellContext`\[Rho]& ]], 0, 1, 1, 2, Blank[], If[Count[ Map[$CellContext`hdistance, Subsets[$CellContext`dxy, {2}]], PatternTest[ Blank[], # < $CellContext`\[Rho]& ]] < 2, 3, 4]]], $CellContext`nTiles[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], Pattern[$CellContext`\[Rho], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`dxyv = \ $CellContext`RhombusDistances[$CellContext`\[Theta]][$CellContext`xy]}, \ $CellContext`x = First[ First[$CellContext`dxyv]]; $CellContext`y = Last[ First[$CellContext`dxyv]]; Which[ Xor[$CellContext`x < $CellContext`\[Rho], $CellContext`y < \ $CellContext`\[Rho]], 2, Last[$CellContext`dxyv] < $CellContext`\[Rho], 4, And[$CellContext`x < $CellContext`\[Rho], $CellContext`y < \ $CellContext`\[Rho]], 3, True, 1]], $CellContext`TriangleDistances[ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`xyr = \ $CellContext`TriangleReduce[$CellContext`xy]}, { Dot[{0, 1}, $CellContext`xyr - {0, 0}], Dot[{$CellContext`\[Chi], -$CellContext`\[Xi]}, $CellContext`xyr - \ {0, 0}], Dot[{-$CellContext`\[Chi], -$CellContext`\[Xi]}, $CellContext`xyr - \ {1, 0}]}], $CellContext`TriangleReduce[ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`xyr = $CellContext`RhombusReduce[ Pi/3][$CellContext`xy]}, With[{$CellContext`p = {1, 0}, $CellContext`u = {-$CellContext`\[Xi], $CellContext`\[Chi]}}, If[ Not[ $CellContext`inTriangle[1][$CellContext`xyr]], 2 ($CellContext`p - $CellContext`u Dot[$CellContext`u, $CellContext`p - $CellContext`xyr]) - \ $CellContext`xyr, $CellContext`xyr]]], $CellContext`RhombusReduce[ Pattern[$CellContext`\[Theta], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := With[{$CellContext`vv = {{1, 0}, { Cos[$CellContext`\[Theta]], Sin[$CellContext`\[Theta]]}}}, $CellContext`xy - Dot[ Floor[ LinearSolve[ Transpose[$CellContext`vv], $CellContext`xy]], \ $CellContext`vv]], $CellContext`\[Xi] = 1/2, $CellContext`ddistance[{ Pattern[$CellContext`d1, Blank[]], Pattern[$CellContext`d2, Blank[]]}] := Sqrt[(4/3) ($CellContext`d1^2 + $CellContext`d2^2 + $CellContext`d1 \ $CellContext`d2)], $CellContext`HexagonDistances[ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`xyr = \ $CellContext`HexagonReduce[$CellContext`xy]}, $CellContext`\[Chi] - Abs[{ Dot[{0, 1}, $CellContext`xyr], Dot[{$CellContext`\[Chi], $CellContext`\[Xi]}, $CellContext`xyr], Dot[{-$CellContext`\[Chi], $CellContext`\[Xi]}, \ $CellContext`xyr]}]], $CellContext`HexagonReduce[{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]}] := Module[{$CellContext`xr, $CellContext`yr}, {$CellContext`xr, \ $CellContext`yr} = Abs[{ Mod[$CellContext`x, 3], Mod[$CellContext`y, 2 $CellContext`\[Chi], -$CellContext`\[Chi]]}]; If[$CellContext`xr > 3/2, $CellContext`xr = 3 - $CellContext`xr]; If[$CellContext`yr > (2 $CellContext`\[Chi]) ( 1 - $CellContext`xr), {$CellContext`xr, $CellContext`yr} = \ $CellContext`Reflect[{1, 0}, {$CellContext`\[Xi], \ -$CellContext`\[Chi]}][{$CellContext`xr, $CellContext`yr}]]; \ {$CellContext`xr, $CellContext`yr}], $CellContext`Reflect[ Pattern[$CellContext`p, { Blank[], Blank[]}], Pattern[$CellContext`u, { Blank[], Blank[]}]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := With[{$CellContext`un = Normalize[$CellContext`u]}, 2 ($CellContext`p - $CellContext`un Dot[$CellContext`un, $CellContext`p - $CellContext`xy]) - \ $CellContext`xy], $CellContext`hdistance[{ Pattern[$CellContext`d1, Blank[]], Pattern[$CellContext`d2, Blank[]]}] := Sqrt[(4/3) ($CellContext`d1^2 + $CellContext`d2^2 - $CellContext`d1 \ $CellContext`d2)], $CellContext`RhombusDistances[ Pattern[$CellContext`\[Theta], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`x, $CellContext`y}, {$CellContext`x, \ $CellContext`y} = \ $CellContext`RhombusReduce[$CellContext`\[Theta]][$CellContext`xy]; { Abs[{ Mod[$CellContext`x - $CellContext`y Cot[$CellContext`\[Theta]], 1, (-1)/2], Mod[$CellContext`y, Sin[$CellContext`\[Theta]], -(Sin[$CellContext`\[Theta]]/2)]}], Min[ Map[EuclideanDistance[{$CellContext`x, $CellContext`y}, #]& , $CellContext`rhombusVertices[$CellContext`\[Theta]]]]}], \ $CellContext`rhombusVertices[ Pattern[$CellContext`\[Theta], Blank[]]] := {{0, 0}, {1, 0}, {1 + Cos[$CellContext`\[Theta]], Sin[$CellContext`\[Theta]]}, { Cos[$CellContext`\[Theta]], Sin[$CellContext`\[Theta]]}}, $CellContext`Coin[ Pattern[$CellContext`\[Rho], Blank[]]][ Pattern[$CellContext`color, Blank[]], Pattern[$CellContext`xy, { Blank[], Blank[]}]] := { Opacity[$CellContext`coinOpacity, $CellContext`color], Disk[$CellContext`xy, $CellContext`\[Rho]]}, \ $CellContext`coinOpacity = 0.5, $CellContext`coinColor[1] = RGBColor[1, 0, 0], $CellContext`coinColor[2] = RGBColor[1, 0.5, 0], $CellContext`coinColor[3] = RGBColor[0, 0, 1], $CellContext`coinColor[4] = RGBColor[0, 1, 0], $CellContext`coinColor[6] = RGBColor[0.5, 0, 0.5], $CellContext`runningTouchingTilesTab[ Pattern[$CellContext`ntl, Blank[List]], Pattern[$CellContext`nttl, Blank[List]]] := Rest[ Part[ FoldList[ Function[{$CellContext`l, $CellContext`n}, MapAt[# + 1& , $CellContext`l, $CellContext`n]], Table[0, { Max[$CellContext`ntl]}], $CellContext`nttl], All, $CellContext`ntl]], \ $CellContext`nTileValues[$CellContext`Hexagon] = {1, 2, 3, 4}, $CellContext`nTileValues[$CellContext`Rhombus] = {1, 2, 3, 4}, $CellContext`nTileValues[Square] = {1, 2, 3, 4}, $CellContext`nTileValues[$CellContext`Triangle] = {1, 2, 3, 4, 6}, $CellContext`nTileValues[ $CellContext`Rhombus[ Blank[]]] := Range[4], $CellContext`coinControl = Trigger, Attributes[PlotRange] = {ReadProtected}, $CellContext`plotRangeValue[ Pattern[$CellContext`shape, Alternatives[Square, $CellContext`Triangle]], Pattern[$CellContext`fl, Blank[]]] := With[{$CellContext`\[Rho]max = \ $CellContext`maxRadius[$CellContext`shape]}, Table[{-$CellContext`\[Rho]max, $CellContext`fl + $CellContext`\ \[Rho]max}, {2}]], $CellContext`plotRangeValue[$CellContext`Hexagon, Blank[]] := With[{$CellContext`\[Rho]max = \ $CellContext`maxRadius[$CellContext`Hexagon]}, {( 4 + $CellContext`\[Rho]max) {-1, 1}, ( 5 $CellContext`\[Chi] + $CellContext`\[Rho]max) {-1, 1}}], $CellContext`plotRangeValue[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], Blank[]] := With[{$CellContext`\[Rho]max = $CellContext`maxRadius[ $CellContext`Rhombus[$CellContext`\[Theta]]]}, {{-$CellContext`\ \[Rho]max, $CellContext`floorSide (1 + Cot[$CellContext`\[Theta]]) + $CellContext`\[Rho]max}, \ {-$CellContext`\[Rho]max, $CellContext`floorSide Sin[$CellContext`\[Theta]] + $CellContext`\[Rho]max}}], \ $CellContext`TabularDisplay[ Pattern[$CellContext`shape, Blank[]], Pattern[$CellContext`totals, Blank[]], Pattern[$CellContext`radius, Blank[]]] := Grid[ Prepend[ Table[ Map[Text[ Style[#, FontColor -> $CellContext`coinColor[ Part[ $CellContext`nTileValues[$CellContext`shape], \ $CellContext`m]], 11]]& , { Part[ $CellContext`nTileValues[$CellContext`shape], $CellContext`m], If[ AtomQ[$CellContext`totals], 0, Part[$CellContext`totals, $CellContext`m]], NumberForm[ If[ AtomQ[$CellContext`totals], 0, N[ Part[$CellContext`totals, $CellContext`m]/ Total[$CellContext`totals]]], {2, 2}, ExponentFunction -> (Null& )], NumberForm[ N[ $CellContext`nTileProbability[$CellContext`shape, Part[ $CellContext`nTileValues[$CellContext`shape], \ $CellContext`m]][$CellContext`radius]], {2, 2}, ExponentFunction -> (Null& )]}], {$CellContext`m, Length[ $CellContext`nTileValues[$CellContext`shape]]}], Map[Text[ Style[#, TextAlignment -> Center, 11]]& , { "number of tiles touched", "observed count", "observed proportion", "theoretical probability"}]], Frame -> All, Alignment -> {Automatic, {Center, Right}}, ItemSize -> 5], $CellContext`nTileProbability[Square, 1][ Pattern[$CellContext`\[Rho], Blank[]]] := (1 - 2 $CellContext`\[Rho])^2, $CellContext`nTileProbability[Square, 2][ Pattern[$CellContext`\[Rho], Blank[]]] := (4 $CellContext`\[Rho]) (1 - 2 $CellContext`\[Rho]), $CellContext`nTileProbability[Square, 3][ Pattern[$CellContext`\[Rho], Blank[]]] := (4 - Pi) $CellContext`\[Rho]^2, $CellContext`nTileProbability[Square, 4][ Pattern[$CellContext`\[Rho], Blank[]]] := Pi $CellContext`\[Rho]^2, \ $CellContext`nTileProbability[$CellContext`Triangle, 6][ Pattern[$CellContext`\[Rho], Blank[]]] := (((1/2) Pi) $CellContext`\[Rho]^2)/($CellContext`\[Chi]/ 2), $CellContext`nTileProbability[$CellContext`Triangle, 1][ Pattern[$CellContext`\[Rho], Blank[]]] := ($CellContext`\[Chi] - 3 $CellContext`\[Rho])^2/(( 2 $CellContext`\[Chi]) ($CellContext`\[Chi]/ 2)), $CellContext`nTileProbability[$CellContext`Triangle, 2][ Pattern[$CellContext`\[Rho], Blank[]]] := (((3/2) $CellContext`\[Rho]) ( 2 - (5 $CellContext`\[Rho])/$CellContext`\[Chi]))/($CellContext`\ \[Chi]/2), $CellContext`nTileProbability[$CellContext`Triangle, 3][ Pattern[$CellContext`\[Rho], Blank[]]] := (((1/2) ($CellContext`\[Rho]^2/$CellContext`\[Chi])) 3)/($CellContext`\[Chi]/ 2), $CellContext`nTileProbability[$CellContext`Triangle, 4][ Pattern[$CellContext`\[Rho], Blank[]]] := (((1/2) ($CellContext`\[Rho]^2/$CellContext`\[Chi])) 3 - ((1/2) Pi) $CellContext`\[Rho]^2)/($CellContext`\[Chi]/ 2), $CellContext`nTileProbability[$CellContext`Hexagon, 4][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # <= 1/2& ]] := 0, $CellContext`nTileProbability[$CellContext`Hexagon, 4][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # > 1/2& ]] := ((-(3/2)) Sqrt[-1 + 4 $CellContext`\[Rho]^2] + (6 $CellContext`\[Rho]^2) ArcCos[1/(2 $CellContext`\[Rho])])/( 3 $CellContext`\[Chi]), \ $CellContext`nTileProbability[$CellContext`Hexagon, 3][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # <= $CellContext`\[Chi]/2& ]] := 6 ($CellContext`\[Rho]^2/($CellContext`\[Chi] ( 3 $CellContext`\[Chi]))), \ $CellContext`nTileProbability[$CellContext`Hexagon, 3][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # > $CellContext`\[Chi]/2& ]] := 1 - 2 $CellContext`nTileProbability[$CellContext`Hexagon, 1][$CellContext`\[Rho]] - \ $CellContext`nTileProbability[$CellContext`Hexagon, 4][$CellContext`\[Rho]], \ $CellContext`nTileProbability[$CellContext`Hexagon, 2][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # <= $CellContext`\[Chi]/2& ]] := ( 6 (1 - (3/ 2) ($CellContext`\[Rho]/$CellContext`\[Chi]))) ($CellContext`\ \[Rho]/(3 $CellContext`\[Chi])), \ $CellContext`nTileProbability[$CellContext`Hexagon, 2][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # > $CellContext`\[Chi]/ 2& ]] := $CellContext`nTileProbability[$CellContext`Hexagon, 1][$CellContext`\[Rho]], \ $CellContext`nTileProbability[$CellContext`Hexagon, 1][ Pattern[$CellContext`\[Rho], Blank[]]] := ((3 ($CellContext`\[Chi] - $CellContext`\[Rho])) ( 1 - $CellContext`\[Rho]/$CellContext`\[Chi]))/( 3 $CellContext`\[Chi]), $CellContext`nTileProbability[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], 1][ Pattern[$CellContext`\[Rho], Blank[]]] := (1 - (2 $CellContext`\[Rho]) Csc[$CellContext`\[Theta]])^2, $CellContext`nTileProbability[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], 2][ Pattern[$CellContext`\[Rho], Blank[]]] := ((4 $CellContext`\[Rho]) Csc[$CellContext`\[Theta]]) ( 1 - (2 $CellContext`\[Rho]) Csc[$CellContext`\[Theta]]), $CellContext`nTileProbability[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], 3][ Pattern[$CellContext`\[Rho], Blank[]]] := ((4 Csc[$CellContext`\[Theta]] - Pi) $CellContext`\[Rho]^2) Csc[$CellContext`\[Theta]], $CellContext`nTileProbability[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], 4][ Pattern[$CellContext`\[Rho], Blank[]]] := (Pi $CellContext`\[Rho]^2) Csc[$CellContext`\[Theta]], \ $CellContext`nTileProbability[$CellContext`Rhombus, Blank[]][ Blank[]] := 0, $CellContext`$UseHisto = True, $CellContext`HistogramDisplay[ Blank[], PatternTest[ Blank[], AtomQ], Blank[]] := Graphics[{}, ImageSize -> 125], $CellContext`HistogramDisplay[ Blank[], List, Blank[]] := Graphics[{}, ImageSize -> 125], $CellContext`HistogramDisplay[ Pattern[$CellContext`shape, Blank[]], Pattern[$CellContext`totals, Blank[]], Pattern[$CellContext`radius, Blank[]]] := Module[{$CellContext`barFun, $CellContext`total = Total[$CellContext`totals], $CellContext`barWidth = 0.4, $CellContext`barSep = 0.05}, $CellContext`barFun[ Pattern[$CellContext`v, Blank[]], { Pattern[$CellContext`p, Blank[]]}] := Module[{$CellContext`n = Part[ $CellContext`nTileValues[$CellContext`shape], \ $CellContext`p], $CellContext`prob}, {$CellContext`prob = N[ $CellContext`nTileProbability[$CellContext`shape, \ $CellContext`n][$CellContext`radius]]; $CellContext`coinColor[$CellContext`n], Rectangle[{$CellContext`p, 0}, {$CellContext`p + $CellContext`barWidth, N[$CellContext`v/$CellContext`total]}], Text[ Style[ NumberForm[ N[$CellContext`v/$CellContext`total], {3, 2}, ExponentFunction -> (Null& )], 7], {$CellContext`p + $CellContext`barWidth/2, N[$CellContext`v/$CellContext`total]}, {0, -1}], Text[ Style[$CellContext`n, 9], {$CellContext`p + $CellContext`barWidth + \ $CellContext`barSep/2, 0}, {0, 1}], Gray, Rectangle[{$CellContext`p + $CellContext`barWidth + \ $CellContext`barSep, 0}, {$CellContext`p + 2 $CellContext`barWidth, $CellContext`prob}], Text[ Style[ NumberForm[$CellContext`prob, {3, 2}, ExponentFunction -> (Null& )], 7], {$CellContext`p + (3/ 2) $CellContext`barWidth + $CellContext`barSep, \ $CellContext`prob}, {0, -1}]}]; Graphics[ MapIndexed[$CellContext`barFun, $CellContext`totals], AspectRatio -> 1/GoldenRatio, ImageSize -> 200, PlotRange -> {Automatic, {-0.1, Max[ Table[ $CellContext`nTileProbability[$CellContext`shape, \ $CellContext`nn][$CellContext`radius], {$CellContext`nn, $CellContext`nTileValues[$CellContext`shape]}]] + 0.2}}]], $CellContext`shapeLabel[ Pattern[$CellContext`shapeLabelType, Blank[]], Pattern[$CellContext`shape, Blank[]]] := Switch[$CellContext`shapeLabelType, Text, ToString[$CellContext`shape], Graphics, $CellContext`sym[$CellContext`shape]], \ $CellContext`sym[$CellContext`Hexagon] := Graphics[{ FaceForm[Gray], Polygon[{{0, 0}, {1, 0}, { 1 + $CellContext`\[Xi], $CellContext`\[Chi]}, { 1, 2 $CellContext`\[Chi]}, { 0, 2 $CellContext`\[Chi]}, {-$CellContext`\[Xi], $CellContext`\ \[Chi]}}]}, ImageSize -> $CellContext`symbolSize], \ $CellContext`sym[$CellContext`Rhombus] := Graphics[{ FaceForm[Gray], Polygon[{{0, 0}, {1, 0}, {1 + Cos[$CellContext`\[Theta]0], Sin[$CellContext`\[Theta]0]}, { Cos[$CellContext`\[Theta]0], Sin[$CellContext`\[Theta]0]}}]}, ImageSize -> $CellContext`symbolSize], $CellContext`sym[Square] := Graphics[{ FaceForm[Gray], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}, ImageSize -> $CellContext`symbolSize], \ $CellContext`sym[$CellContext`Triangle] := Graphics[{ FaceForm[Gray], Polygon[{{0, 0}, {1, 0}, {$CellContext`\[Xi], $CellContext`\[Chi]}}]}, ImageSize -> $CellContext`symbolSize], $CellContext`symbolSize = { 25, 25}, $CellContext`\[Theta]0 = (2 Pi)/5}; Typeset`initDone$$ = True); ReleaseHold[ HoldComplete[{ Null, $CellContext`$EstimatedPostingDate = {2007, 8, 20, 15}; Null, Null, { HoldComplete[$CellContext`\[Chi] = 3^Rational[1, 2]/2; Null], HoldComplete[Null], HoldComplete[$CellContext`\[Xi] = 1/2; Null], HoldComplete[Null], HoldComplete[Null], HoldComplete[Null], HoldComplete[$CellContext`floorSide = 5; Null]}, { HoldComplete[$CellContext`\[Theta]min = Pi/4; Null], HoldComplete[Null], HoldComplete[$CellContext`\[Theta]0 = 2 (Pi/5); Null]}, $CellContext`hexVertices = Module[{$CellContext`\[Theta]}, Table[{ Cos[$CellContext`\[Theta]], Sin[$CellContext`\[Theta]]}, {$CellContext`\[Theta], 0, 2 Pi, Pi/3}]]; Null, $CellContext`hexCenters = Module[{$CellContext`x, $CellContext`y}, Join[ Table[{-3, $CellContext`y}, {$CellContext`y, (-2) $CellContext`\ \[Chi], 2 $CellContext`\[Chi], 2 $CellContext`\[Chi]}], Table[{-1 - $CellContext`\[Xi], $CellContext`y}, \ {$CellContext`y, (-3) $CellContext`\[Chi], 3 $CellContext`\[Chi], 2 $CellContext`\[Chi]}], Table[{0, $CellContext`y}, {$CellContext`y, (-4) $CellContext`\ \[Chi], 4 $CellContext`\[Chi], 2 $CellContext`\[Chi]}], Table[{1 + $CellContext`\[Xi], $CellContext`y}, {$CellContext`y, \ (-3) $CellContext`\[Chi], 3 $CellContext`\[Chi], 2 $CellContext`\[Chi]}], Table[{3, $CellContext`y}, {$CellContext`y, (-2) $CellContext`\ \[Chi], 2 $CellContext`\[Chi], 2 $CellContext`\[Chi]}]]]; Null, $CellContext`floorSide = 5; Null, $CellContext`coinControl = Trigger; Null, Null, $CellContext`symbolSize = 25 {1, 1}; Null, ($CellContext`sym[Square] := Graphics[{ FaceForm[Gray], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}, ImageSize -> $CellContext`symbolSize]) \ ($CellContext`sym[$CellContext`Triangle] := Graphics[{ FaceForm[Gray], Polygon[{{0, 0}, {1, 0}, {$CellContext`\[Xi], $CellContext`\[Chi]}}]}, ImageSize -> $CellContext`symbolSize]) \ ($CellContext`sym[$CellContext`Hexagon] := Graphics[{ FaceForm[Gray], Polygon[{{0, 0}, {1, 0}, { 1 + $CellContext`\[Xi], $CellContext`\[Chi]}, { 1, 2 $CellContext`\[Chi]}, { 0, 2 $CellContext`\[Chi]}, {-$CellContext`\[Xi], $CellContext`\ \[Chi]}}]}, ImageSize -> $CellContext`symbolSize]) \ ($CellContext`sym[$CellContext`Rhombus] := Graphics[{ FaceForm[Gray], Polygon[{{0, 0}, {1, 0}, {1 + Cos[$CellContext`\[Theta]0], Sin[$CellContext`\[Theta]0]}, { Cos[$CellContext`\[Theta]0], Sin[$CellContext`\[Theta]0]}}]}, ImageSize -> $CellContext`symbolSize]), $CellContext`shapeLabel[ Pattern[$CellContext`shapeLabelType, Blank[]], Pattern[$CellContext`shape, Blank[]]] := Switch[$CellContext`shapeLabelType, Text, ToString[$CellContext`shape], Graphics, $CellContext`sym[$CellContext`shape]], Null, Null, $CellContext`RhombusReduce[ Pattern[$CellContext`\[Theta], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := With[{$CellContext`vv = {{1, 0}, { Cos[$CellContext`\[Theta]], Sin[$CellContext`\[Theta]]}}}, $CellContext`xy - Dot[ Floor[ LinearSolve[ Transpose[$CellContext`vv], $CellContext`xy]], \ $CellContext`vv]], $CellContext`TriangleReduce[ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`xyr = $CellContext`RhombusReduce[ Pi/3][$CellContext`xy]}, With[{$CellContext`p = {1, 0}, $CellContext`u = {-$CellContext`\[Xi], \ $CellContext`\[Chi]}}, If[ Not[ $CellContext`inTriangle[1][$CellContext`xyr]], 2 ($CellContext`p - $CellContext`u Dot[$CellContext`u, $CellContext`p - $CellContext`xyr]) - \ $CellContext`xyr, $CellContext`xyr]]], $CellContext`HexagonReduce[{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]}] := Module[{$CellContext`xr, $CellContext`yr}, {$CellContext`xr, \ $CellContext`yr} = Abs[{ Mod[$CellContext`x, 3], Mod[$CellContext`y, 2 $CellContext`\[Chi], -$CellContext`\[Chi]]}]; If[$CellContext`xr > 3/2, $CellContext`xr = 3 - $CellContext`xr]; If[$CellContext`yr > 2 $CellContext`\[Chi] ( 1 - $CellContext`xr), {$CellContext`xr, $CellContext`yr} = \ $CellContext`Reflect[{1, 0}, {$CellContext`\[Xi], \ -$CellContext`\[Chi]}][{$CellContext`xr, $CellContext`yr}]]; \ {$CellContext`xr, $CellContext`yr}], Null, { HoldComplete[$CellContext`ddistance[{ Pattern[$CellContext`d1, Blank[]], Pattern[$CellContext`d2, Blank[]]}] := Sqrt[(4/3) ($CellContext`d1^2 + $CellContext`d2^2 + \ $CellContext`d1 $CellContext`d2)]], HoldComplete[Null], HoldComplete[$CellContext`hdistance[{ Pattern[$CellContext`d1, Blank[]], Pattern[$CellContext`d2, Blank[]]}] := Sqrt[(4/3) ($CellContext`d1^2 + $CellContext`d2^2 - \ $CellContext`d1 $CellContext`d2)]], HoldComplete[Null], HoldComplete[$CellContext`vdistance[ Pattern[$CellContext`\[Theta], Blank[]]][{ Pattern[$CellContext`d1, Blank[]], Pattern[$CellContext`d2, Blank[]]}] := ($CellContext`d1^2 + $CellContext`d2^2 + 2 $CellContext`d1 $CellContext`d2 Cos[$CellContext`\[Theta]]) Csc[$CellContext`\[Theta]]^2]}, $CellContext`TriangleDistances[ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`xyr = \ $CellContext`TriangleReduce[$CellContext`xy]}, { Dot[{0, 1}, $CellContext`xyr - {0, 0}], Dot[{$CellContext`\[Chi], -$CellContext`\[Xi]}, $CellContext`xyr - \ {0, 0}], Dot[{-$CellContext`\[Chi], -$CellContext`\[Xi]}, $CellContext`xyr - \ {1, 0}]}], $CellContext`HexagonDistances[ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`xyr = \ $CellContext`HexagonReduce[$CellContext`xy]}, $CellContext`\[Chi] - Abs[{ Dot[{0, 1}, $CellContext`xyr], Dot[{$CellContext`\[Chi], $CellContext`\[Xi]}, $CellContext`xyr], Dot[{-$CellContext`\[Chi], $CellContext`\[Xi]}, \ $CellContext`xyr]}]], $CellContext`rhombusVertices[ Pattern[$CellContext`\[Theta], Blank[]]] := {{0, 0}, {1, 0}, {1 + Cos[$CellContext`\[Theta]], Sin[$CellContext`\[Theta]]}, { Cos[$CellContext`\[Theta]], Sin[$CellContext`\[Theta]]}}, $CellContext`RhombusDistances[ Pattern[$CellContext`\[Theta], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`x, $CellContext`y}, {$CellContext`x, \ $CellContext`y} = \ $CellContext`RhombusReduce[$CellContext`\[Theta]][$CellContext`xy]; { Abs[{ Mod[$CellContext`x - $CellContext`y Cot[$CellContext`\[Theta]], 1, (-1)/2], Mod[$CellContext`y, Sin[$CellContext`\[Theta]], (-Sin[$CellContext`\[Theta]])/ 2]}], Min[ Map[EuclideanDistance[{$CellContext`x, $CellContext`y}, #]& , $CellContext`rhombusVertices[$CellContext`\[Theta]]]]}], Null, $CellContext`Reflect[ Pattern[$CellContext`p, { Blank[], Blank[]}], Pattern[$CellContext`u, { Blank[], Blank[]}]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := With[{$CellContext`un = Normalize[$CellContext`u]}, 2 ($CellContext`p - $CellContext`un Dot[$CellContext`un, $CellContext`p - $CellContext`xy]) - \ $CellContext`xy], Null, $CellContext`inTriangle[ Pattern[$CellContext`l, Blank[]]][{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]}] := And[$CellContext`y > 0, $CellContext`y < 2 $CellContext`\[Chi] $CellContext`x, $CellContext`y < 2 $CellContext`\[Chi] ($CellContext`l - $CellContext`x)], { HoldComplete[$CellContext`inHexagon[ Pattern[$CellContext`l, Blank[]]][{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]}] := And[Abs[$CellContext`y] < $CellContext`\[Chi] $CellContext`l, Abs[$CellContext`y] < 2 $CellContext`\[Chi] ($CellContext`l - Abs[$CellContext`x])]], HoldComplete[Null], HoldComplete[$CellContext`inHexagon[ Pattern[$CellContext`l, Blank[]], Pattern[$CellContext`cent, Blank[]]][ Pattern[$CellContext`xy, Blank[]]] := \ $CellContext`inHexagon[$CellContext`l][$CellContext`xy - \ $CellContext`cent]]}, $CellContext`onHexagonTable[ Pattern[$CellContext`xy, Blank[]]] := Apply[Or, Prepend[ Map[$CellContext`inHexagon[1, #][$CellContext`xy]& , Part[$CellContext`hexCenters, {1, 3, 8, 12, 17, 19}]], $CellContext`inHexagon[4][$CellContext`xy]]], Null, { HoldComplete[$CellContext`maxRadius[Square] = 1/2; Null], HoldComplete[Null], HoldComplete[$CellContext`maxRadius[$CellContext`Triangle] = \ $CellContext`\[Chi]/3; Null], HoldComplete[Null], HoldComplete[$CellContext`maxRadius[$CellContext`Hexagon] = \ $CellContext`\[Chi]; Null], HoldComplete[Null], HoldComplete[$CellContext`maxRadius[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]]] := Sin[$CellContext`\[Theta]]/2; Null]}, Null, $CellContext`nTiles[Square, Pattern[$CellContext`\[Rho], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`dxy = Map[Abs[Round[#] - #]& , $CellContext`xy]}, Which[ Xor[ First[$CellContext`dxy] < $CellContext`\[Rho], Last[$CellContext`dxy] < $CellContext`\[Rho]], 2, Norm[$CellContext`dxy] < $CellContext`\[Rho], 4, And[ First[$CellContext`dxy] < $CellContext`\[Rho], Last[$CellContext`dxy] < $CellContext`\[Rho]], 3, True, 1]], $CellContext`nTiles[$CellContext`Triangle, Pattern[$CellContext`\[Rho], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`dxy = \ $CellContext`TriangleDistances[$CellContext`xy]}, Which[Count[$CellContext`dxy, PatternTest[ Blank[], # > $CellContext`\[Rho]& ]] == 3, 1, Count[$CellContext`dxy, PatternTest[ Blank[], # > $CellContext`\[Rho]& ]] == 2, 2, Apply[Or, Thread[Map[$CellContext`ddistance, Subsets[$CellContext`dxy, {2}]] < $CellContext`\[Rho]]], 6, $CellContext`\[Chi] - Max[$CellContext`dxy] < $CellContext`\[Rho], 4, True, 3]], { HoldComplete[$CellContext`nTileValues[Square] = Range[4]; Null], HoldComplete[Null], HoldComplete[$CellContext`nTileValues[$CellContext`Triangle] = {1, 2, 3, 4, 6}; Null], HoldComplete[Null], HoldComplete[$CellContext`nTileValues[$CellContext`Hexagon] = Range[4]; Null], HoldComplete[Null], HoldComplete[$CellContext`nTileValues[ $CellContext`Rhombus[ Blank[]]] := Range[4]], HoldComplete[Null], HoldComplete[$CellContext`nTileValues[$CellContext`Rhombus] = Range[4]; Null]}, $CellContext`nTiles[$CellContext`Hexagon, PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # <= 1/2& ]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Count[ $CellContext`HexagonDistances[$CellContext`xy], PatternTest[ Blank[], # < $CellContext`\[Rho]& ]] + 1, $CellContext`nTiles[$CellContext`Hexagon, PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # > 1/2& ]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`dxy = \ $CellContext`HexagonDistances[$CellContext`xy]}, Switch[ Count[$CellContext`dxy, PatternTest[ Blank[], # < $CellContext`\[Rho]& ]], 0, 1, 1, 2, Blank[], If[Count[ Map[$CellContext`hdistance, Subsets[$CellContext`dxy, {2}]], PatternTest[ Blank[], # < $CellContext`\[Rho]& ]] < 2, 3, 4]]], $CellContext`nTiles[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], Pattern[$CellContext`\[Rho], Blank[]]][ Pattern[$CellContext`xy, { Blank[], Blank[]}]] := Module[{$CellContext`dxyv = \ $CellContext`RhombusDistances[$CellContext`\[Theta]][$CellContext`xy]}, \ $CellContext`x = First[ First[$CellContext`dxyv]]; $CellContext`y = Last[ First[$CellContext`dxyv]]; Which[ Xor[$CellContext`x < $CellContext`\[Rho], $CellContext`y < \ $CellContext`\[Rho]], 2, Last[$CellContext`dxyv] < $CellContext`\[Rho], 4, And[$CellContext`x < $CellContext`\[Rho], $CellContext`y < \ $CellContext`\[Rho]], 3, True, 1]], Null, { HoldComplete[$CellContext`nTileProbability[Square, 1][ Pattern[$CellContext`\[Rho], Blank[]]] := (1 - 2 $CellContext`\[Rho])^2], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[Square, 2][ Pattern[$CellContext`\[Rho], Blank[]]] := 4 $CellContext`\[Rho] (1 - 2 $CellContext`\[Rho])], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[Square, 3][ Pattern[$CellContext`\[Rho], Blank[]]] := (4 - Pi) $CellContext`\[Rho]^2], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[Square, 4][ Pattern[$CellContext`\[Rho], Blank[]]] := Pi $CellContext`\[Rho]^2]}, { HoldComplete[$CellContext`nTileProbability[$CellContext`Triangle, 6][ Pattern[$CellContext`\[Rho], Blank[]]] := ((1/2) Pi $CellContext`\[Rho]^2)/($CellContext`\[Chi]/2); Null], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Triangle, 1][ Pattern[$CellContext`\[Rho], Blank[]]] := (($CellContext`\[Chi] - 3 $CellContext`\[Rho])^2/( 2 $CellContext`\[Chi]))/($CellContext`\[Chi]/2); Null], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Triangle, 2][ Pattern[$CellContext`\[Rho], Blank[]]] := ((3/2) $CellContext`\[Rho] ( 2 - (5 $CellContext`\[Rho])/$CellContext`\[Chi]))/($\ CellContext`\[Chi]/2); Null], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Triangle, 3][ Pattern[$CellContext`\[Rho], Blank[]]] := ((1/2) ($CellContext`\[Rho]^2/$CellContext`\[Chi]) 3)/($CellContext`\[Chi]/2); Null], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Triangle, 4][ Pattern[$CellContext`\[Rho], Blank[]]] := ((1/2) ($CellContext`\[Rho]^2/$CellContext`\[Chi]) 3 - (1/2) Pi $CellContext`\[Rho]^2)/($CellContext`\[Chi]/2); Null]}, { HoldComplete[$CellContext`nTileProbability[$CellContext`Hexagon, 4][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # <= 1/2& ]] := 0], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Hexagon, 4][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # > 1/2& ]] := ((-(3/2)) (-1 + 4 $CellContext`\[Rho]^2)^ Rational[1, 2] + 6 $CellContext`\[Rho]^2 ArcCos[1/(2 $CellContext`\[Rho])])/( 3 $CellContext`\[Chi])], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Hexagon, 3][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # <= $CellContext`\[Chi]/2& ]] := 6 (($CellContext`\[Rho]^2/$CellContext`\[Chi])/( 3 $CellContext`\[Chi]))], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Hexagon, 3][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # > $CellContext`\[Chi]/2& ]] := 1 - 2 $CellContext`nTileProbability[$CellContext`Hexagon, 1][$CellContext`\[Rho]] - \ $CellContext`nTileProbability[$CellContext`Hexagon, 4][$CellContext`\[Rho]]], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Hexagon, 2][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # <= $CellContext`\[Chi]/2& ]] := 6 (1 - (3/ 2) ($CellContext`\[Rho]/$CellContext`\[Chi])) ($CellContext`\ \[Rho]/(3 $CellContext`\[Chi]))], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Hexagon, 2][ PatternTest[ Pattern[$CellContext`\[Rho], Blank[]], # > $CellContext`\[Chi]/ 2& ]] := $CellContext`nTileProbability[$CellContext`Hexagon, 1][$CellContext`\[Rho]]], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Hexagon, 1][ Pattern[$CellContext`\[Rho], Blank[]]] := ( 3 ($CellContext`\[Chi] - $CellContext`\[Rho]) ( 1 - $CellContext`\[Rho]/$CellContext`\[Chi]))/( 3 $CellContext`\[Chi])]}, { HoldComplete[$CellContext`nTileProbability[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], 1][ Pattern[$CellContext`\[Rho], Blank[]]] := (1 - 2 $CellContext`\[Rho] Csc[$CellContext`\[Theta]])^2], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], 2][ Pattern[$CellContext`\[Rho], Blank[]]] := 4 $CellContext`\[Rho] Csc[$CellContext`\[Theta]] (1 - 2 $CellContext`\[Rho] Csc[$CellContext`\[Theta]])], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], 3][ Pattern[$CellContext`\[Rho], Blank[]]] := (4 Csc[$CellContext`\[Theta]] - Pi) $CellContext`\[Rho]^2 Csc[$CellContext`\[Theta]]], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], 4][ Pattern[$CellContext`\[Rho], Blank[]]] := Pi $CellContext`\[Rho]^2 Csc[$CellContext`\[Theta]]], HoldComplete[Null], HoldComplete[$CellContext`nTileProbability[$CellContext`Rhombus, Blank[]][ Blank[]] := 0]}, Null, $CellContext`runningTouchingTilesTab[ Pattern[$CellContext`ntl, Blank[List]], Pattern[$CellContext`nttl, Blank[List]]] := Rest[ Part[ FoldList[ Function[{$CellContext`l, $CellContext`n}, MapAt[# + 1& , $CellContext`l, $CellContext`n]], Table[0, { Max[$CellContext`ntl]}], $CellContext`nttl], All, $CellContext`ntl]], Null, $CellContext`randomPosition[Square, Pattern[$CellContext`l, Blank[]]] := RandomReal[{0, $CellContext`l}, { 2}], $CellContext`randomPosition[$CellContext`Triangle, Pattern[$CellContext`l, Blank[]]] := Module[{$CellContext`xy = $CellContext`randomPosition[ Square, $CellContext`l]}, While[ Not[ $CellContext`inTriangle[$CellContext`l][$CellContext`xy]], \ $CellContext`xy = $CellContext`randomPosition[ Square, $CellContext`l]]; $CellContext`xy], \ $CellContext`randomPosition[$CellContext`Hexagon, 1] := Module[{$CellContext`xy = $CellContext`randomPosition[Square, 2] - { 1, 1}}, While[ Not[ $CellContext`inHexagon[ 1][$CellContext`xy]], $CellContext`xy = \ $CellContext`randomPosition[Square, 2] - {1, 1}]; $CellContext`xy], \ $CellContext`randomPosition[$CellContext`Hexagon, Pattern[$CellContext`l, { Repeated[{ Blank[], Blank[]}]}]] := \ $CellContext`randomPosition[$CellContext`Hexagon, 1] + RandomChoice[$CellContext`l], $CellContext`randomPosition[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], Pattern[$CellContext`l, Blank[]]] := With[{$CellContext`y = RandomReal[{ 0, $CellContext`l Sin[$CellContext`\[Theta]]}]}, {$CellContext`x = \ $CellContext`y Cot[$CellContext`\[Theta]] + RandomReal[{0, $CellContext`l}], $CellContext`y}], Null, Null, $CellContext`Hexagon[ Pattern[$CellContext`cent, Blank[]]] := Polygon[ Map[$CellContext`cent + #& , $CellContext`hexVertices, {1}]], Null, $CellContext`coinOpacity = 0.5; Null, Null, { HoldComplete[$CellContext`shapeGrid[Square][ Pattern[$CellContext`l, Blank[]]] := $CellContext`SquareGrid[$CellContext`l]; Null], HoldComplete[Null], HoldComplete[$CellContext`shapeGrid[$CellContext`Triangle][ Pattern[$CellContext`l, Blank[]]] := $CellContext`TriangleGrid[$CellContext`l]; Null], HoldComplete[Null], HoldComplete[$CellContext`shapeGrid[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]]][ Pattern[$CellContext`l, Blank[]]] := $CellContext`RhombusGrid[$CellContext`\[Theta], \ $CellContext`l]; Null], HoldComplete[Null], HoldComplete[$CellContext`shapeGrid[$CellContext`Hexagon][ BlankNullSequence[]] := $CellContext`HexagonGrid[]]}, \ $CellContext`SquareGrid[ Pattern[$CellContext`l, Blank[]]] := { Map[Line[{{#, 0}, {#, $CellContext`l}}]& , Range[0, $CellContext`l]], Map[Line[{{0, #}, {$CellContext`l, #}}]& , Range[0, $CellContext`l]]}, $CellContext`BorderedSquareGrid[ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]] := { Map[Line[{{#, -1}, {#, $CellContext`y + 1}}]& , Range[-1, $CellContext`x + 1]], Map[Line[{{-1, #}, {$CellContext`x + 1, #}}]& , Range[-1, $CellContext`y + 1]]}, Null, $CellContext`TriangleGrid[ Pattern[$CellContext`l, Blank[]]] := { Table[ Line[{{$CellContext`z/ 2, $CellContext`\[Chi] $CellContext`z}, {$CellContext`l - \ $CellContext`z/2, $CellContext`\[Chi] $CellContext`z}}], {$CellContext`z, 0, $CellContext`l}], Table[ Line[{{$CellContext`z, 0}, {($CellContext`l + $CellContext`z)/ 2, $CellContext`\[Chi] ($CellContext`l - $CellContext`z)}}], \ {$CellContext`z, 0, $CellContext`l}], Table[ Line[{{$CellContext`z, 0}, {$CellContext`z/ 2, $CellContext`\[Chi] $CellContext`z}}], {$CellContext`z, 0, $CellContext`l}]}, $CellContext`RhombusGrid[ Pattern[$CellContext`\[Theta], Blank[]], Pattern[$CellContext`l, Blank[]]] := With[{$CellContext`s = Sin[$CellContext`\[Theta]], $CellContext`c = Cos[$CellContext`\[Theta]]}, { Table[ Line[{{$CellContext`c $CellContext`z, $CellContext`s \ $CellContext`z}, {$CellContext`l + $CellContext`c $CellContext`z, \ $CellContext`s $CellContext`z}}], {$CellContext`z, 0, $CellContext`l}], Table[ Line[{{$CellContext`z, 0}, {$CellContext`z + $CellContext`c $CellContext`l, \ $CellContext`s $CellContext`l}}], {$CellContext`z, 0, $CellContext`l}]}], $CellContext`HexagonGrid[ BlankNullSequence[]] := { FaceForm[White], EdgeForm[Black], Map[$CellContext`Hexagon, $CellContext`hexCenters]}, Null, $CellContext`plotRangeValue[ Pattern[$CellContext`shape, Alternatives[Square, $CellContext`Triangle]], Pattern[$CellContext`fl, Blank[]]] := With[{$CellContext`\[Rho]max = \ $CellContext`maxRadius[$CellContext`shape]}, Table[{-$CellContext`\[Rho]max, $CellContext`fl + $CellContext`\ \[Rho]max}, {2}]], $CellContext`plotRangeValue[$CellContext`Hexagon, Blank[]] := With[{$CellContext`\[Rho]max = \ $CellContext`maxRadius[$CellContext`Hexagon]}, {( 4 + $CellContext`\[Rho]max) {-1, 1}, ( 5 $CellContext`\[Chi] + $CellContext`\[Rho]max) {-1, 1}}], $CellContext`plotRangeValue[ $CellContext`Rhombus[ Pattern[$CellContext`\[Theta], Blank[]]], Blank[]] := With[{$CellContext`\[Rho]max = $CellContext`maxRadius[ $CellContext`Rhombus[$CellContext`\[Theta]]]}, {{-$CellContext`\ \[Rho]max, $CellContext`floorSide (1 + Cot[$CellContext`\[Theta]]) + $CellContext`\[Rho]max}, \ {-$CellContext`\[Rho]max, $CellContext`floorSide Sin[$CellContext`\[Theta]] + $CellContext`\[Rho]max}}], Null, { HoldComplete[$CellContext`coinColor[1] = Red; Null], HoldComplete[Null], HoldComplete[$CellContext`coinColor[2] = Orange; Null], HoldComplete[Null], HoldComplete[$CellContext`coinColor[3] = Blue; Null], HoldComplete[Null], HoldComplete[$CellContext`coinColor[4] = Green; Null], HoldComplete[Null], HoldComplete[$CellContext`coinColor[6] = Purple; Null]}, Null, $CellContext`Coin[ Pattern[$CellContext`\[Rho], Blank[]]][ Pattern[$CellContext`color, Blank[]], Pattern[$CellContext`xy, { Blank[], Blank[]}]] := { Opacity[$CellContext`coinOpacity, $CellContext`color], Disk[$CellContext`xy, $CellContext`\[Rho]]}, Null, $CellContext`TabularDisplay[ Pattern[$CellContext`shape, Blank[]], Pattern[$CellContext`totals, Blank[]], Pattern[$CellContext`radius, Blank[]]] := Grid[ Prepend[ Table[ Map[Text[ Style[#, FontColor -> $CellContext`coinColor[ Part[ $CellContext`nTileValues[$CellContext`shape], \ $CellContext`m]], 11]]& , { Part[ $CellContext`nTileValues[$CellContext`shape], $CellContext`m], If[ AtomQ[$CellContext`totals], 0, Part[$CellContext`totals, $CellContext`m]], NumberForm[ If[ AtomQ[$CellContext`totals], 0, N[ Part[$CellContext`totals, $CellContext`m]/ Total[$CellContext`totals]]], {2, 2}, ExponentFunction -> (Null& )], NumberForm[ N[ $CellContext`nTileProbability[$CellContext`shape, Part[ $CellContext`nTileValues[$CellContext`shape], \ $CellContext`m]][$CellContext`radius]], {2, 2}, ExponentFunction -> (Null& )]}], {$CellContext`m, Length[ $CellContext`nTileValues[$CellContext`shape]]}], Map[Text[ Style[#, TextAlignment -> Center, 11]]& , { "number of tiles touched", "observed count", "observed proportion", "theoretical probability"}]], Frame -> All, Alignment -> {Automatic, {Center, Right}}, ItemSize -> 5], Null, $CellContext`$UseHisto = True; Null, $CellContext`HistogramDisplay[ Blank[], PatternTest[ Blank[], AtomQ], Blank[]] := Graphics[{}, ImageSize -> 125], $CellContext`HistogramDisplay[ Pattern[$CellContext`shape, Blank[]], Pattern[$CellContext`totals, Blank[]], Pattern[$CellContext`radius, Blank[]]] := Module[{$CellContext`barFun, $CellContext`total = Total[$CellContext`totals], $CellContext`barWidth = 0.4, $CellContext`barSep = 0.05}, $CellContext`barFun[ Pattern[$CellContext`v, Blank[]], { Pattern[$CellContext`p, Blank[]]}] := Module[{$CellContext`n = Part[ $CellContext`nTileValues[$CellContext`shape], \ $CellContext`p], $CellContext`prob}, {$CellContext`prob = N[ $CellContext`nTileProbability[$CellContext`shape, \ $CellContext`n][$CellContext`radius]]; $CellContext`coinColor[$CellContext`n], Rectangle[{$CellContext`p, 0}, {$CellContext`p + $CellContext`barWidth, N[$CellContext`v/$CellContext`total]}], Text[ Style[ NumberForm[ N[$CellContext`v/$CellContext`total], {3, 2}, ExponentFunction -> (Null& )], 7], {$CellContext`p + $CellContext`barWidth/2, N[$CellContext`v/$CellContext`total]}, {0, -1}], Text[ Style[$CellContext`n, 9], {$CellContext`p + $CellContext`barWidth + \ $CellContext`barSep/2, 0}, {0, 1}], Gray, Rectangle[{$CellContext`p + $CellContext`barWidth + \ $CellContext`barSep, 0}, {$CellContext`p + 2 $CellContext`barWidth, $CellContext`prob}], Text[ Style[ NumberForm[$CellContext`prob, {3, 2}, ExponentFunction -> (Null& )], 7], {$CellContext`p + (3/ 2) $CellContext`barWidth + $CellContext`barSep, \ $CellContext`prob}, {0, -1}]}]; Graphics[ MapIndexed[$CellContext`barFun, $CellContext`totals], AspectRatio -> 1/GoldenRatio, ImageSize -> 200, PlotRange -> {Automatic, {-0.1, Max[ Table[ $CellContext`nTileProbability[$CellContext`shape, \ $CellContext`nn][$CellContext`radius], {$CellContext`nn, $CellContext`nTileValues[$CellContext`shape]}]] + 0.2}}]]}]]; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellID->745451320], Cell[CellGroupData[{ Cell["CAPTION", "Section", CellFrame->{{0, 0}, {1, 0}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell["\<\ Buffon studied the clean tile game for various tilings, in which players bet \ on how many tiles are partly covered by a thrown coin. Assume that the coin \ is not too big to fit on a single tile. In this simulation, the observed \ frequencies of the number of touched tiles are compared with the theoretical \ values.\ \>", "Text"] }, Close]] }, Open ]], Cell[CellGroupData[{ Cell["THIS NOTEBOOK IS THE SOURCE CODE FROM", "Text", CellFrame->{{0, 0}, {0, 0}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[TextData[{ "\"", ButtonBox["Clean Tile Problem", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/CleanTileProblem/"], None}, ButtonNote->"http://demonstrations.wolfram.com/CleanTileProblem/"], "\"", " from ", ButtonBox["the Wolfram Demonstrations Project", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], "\[ParagraphSeparator]\[NonBreakingSpace]", ButtonBox["http://demonstrations.wolfram.com/CleanTileProblem/", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/CleanTileProblem/"], None}, ButtonNote->"http://demonstrations.wolfram.com/CleanTileProblem/"] }], "Text", CellMargins->{{48, Inherited}, {0, Inherited}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.5]], Cell[CellGroupData[{ Cell[TextData[{ "Contributed by: ", ButtonBox["Jacqueline D. Wandzura", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=Jacqueline+D.+\ Wandzura"], None}, ButtonNote-> "http://demonstrations.wolfram.com/author.html?author=Jacqueline+D.+\ Wandzura"], " and ", ButtonBox["Stephen M. Wandzura", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=Stephen+M.+\ Wandzura"], None}, ButtonNote-> "http://demonstrations.wolfram.com/author.html?author=Stephen+M.+Wandzura"]\ }], "Text", CellDingbat->"\[FilledSmallSquare]", CellMargins->{{66, 48}, {2, 4}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.6]], Cell[TextData[{ "Based on work by: ", ButtonBox["Eric W. Weisstein", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=Eric+W.+\ Weisstein"], None}, ButtonNote-> "http://demonstrations.wolfram.com/author.html?author=Eric+W.+Weisstein"] }], "Text", CellDingbat->"\[FilledSmallSquare]", CellMargins->{{66, 48}, {2, 4}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.6], CellID->1730094915] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "A full-function Wolfram ", StyleBox["Mathematica", FontSlant->"Italic"], " system (Version 6 or higher) is required to edit this notebook.\n", StyleBox[ButtonBox["GET WOLFRAM MATHEMATICA \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://www.wolfram.com/products/mathematica/"], None}, ButtonNote->"http://www.wolfram.com/products/mathematica/"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0.42, 0]] }], "Text", CellFrame->True, CellMargins->{{48, 68}, {8, 28}}, CellFrameMargins->12, CellFrameColor->RGBColor[0.87, 0.87, 0.87], CellChangeTimes->{3.3750111182355957`*^9}, ParagraphSpacing->{1., 1.}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.411765], Background->RGBColor[1, 1, 1]], Cell[TextData[{ "\[Copyright] ", StyleBox[ButtonBox["Wolfram Demonstrations Project & Contributors", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Terms of Use", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/termsofuse.html"], None}, ButtonNote->"http://demonstrations.wolfram.com/termsofuse.html"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Make a new version of this Demonstration \ \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/participate/upload.jsp?id=\ CleanTileProblem"], None}, ButtonNote->None], FontColor->GrayLevel[0.6]] }], "Text", CellFrame->{{0, 0}, {0, 0.5}}, CellMargins->{{48, 10}, {20, 50}}, CellFrameMargins->{{6, 0}, {6, 6}}, CellFrameColor->GrayLevel[0.6], FontFamily->"Verdana", FontSize->9, FontColor->GrayLevel[0.6]] }, Open ]] }, Open ]] }, Editable->True, Saveable->False, ScreenStyleEnvironment->"Working", CellInsertionPointCell->None, WindowSize->{780, 650}, WindowMargins->{{Inherited, Inherited}, {Inherited, 0}}, WindowElements->{ "StatusArea", "MemoryMonitor", "MagnificationPopUp", "VerticalScrollBar", "MenuBar"}, WindowTitle->"Clean Tile Problem - Source", DockedCells->{}, CellContext->Notebook, FrontEndVersion->"8.0 for Microsoft Windows (32-bit) (November 7, 2010)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[620, 23, 138, 3, 70, "Section"], Cell[761, 28, 3700, 64, 70, "Section"], Cell[4464, 94, 200, 4, 70, "Input", CellID->1471279108], Cell[4667, 100, 454, 11, 70, "Input", InitializationCell->True, CellID->258331024], Cell[5124, 113, 194, 4, 70, "Input", CellID->1661256598], Cell[5321, 119, 533, 15, 70, "Input", InitializationCell->True, CellID->1304747939], Cell[5857, 136, 420, 11, 70, "Input", InitializationCell->True, CellID->943091256], Cell[6280, 149, 712, 20, 70, "Input", InitializationCell->True, CellID->2105424732], Cell[6995, 171, 2575, 72, 70, "Input", InitializationCell->True, CellID->1785419105], Cell[9573, 245, 190, 5, 70, "Input", InitializationCell->True, CellID->749898204], Cell[9766, 252, 426, 12, 70, "Input", InitializationCell->True, CellID->186171499], Cell[10195, 266, 226, 5, 70, "Input", InitializationCell->True, CellID->416091462], Cell[10424, 273, 404, 10, 70, "Input", InitializationCell->True, CellID->1042447202], Cell[10831, 285, 4045, 108, 70, "Input", InitializationCell->True, CellID->51652599], Cell[14879, 395, 639, 14, 70, "Input", CellID->1366276859], Cell[15521, 411, 254, 6, 70, "Input", InitializationCell->True, CellID->1132291991], Cell[15778, 419, 305, 7, 70, "Input", InitializationCell->True, CellID->1547327654], Cell[16086, 428, 1391, 35, 70, "Input", InitializationCell->True, CellID->2056399255], Cell[17480, 465, 1335, 41, 70, "Input", InitializationCell->True, CellID->1163839272], Cell[18818, 508, 3590, 92, 70, "Input", InitializationCell->True, CellID->1365587628], Cell[22411, 602, 225, 5, 70, "Input", InitializationCell->True, CellID->1273528307], Cell[22639, 609, 1458, 43, 70, "Input", InitializationCell->True, CellID->220746100], Cell[24100, 654, 1209, 40, 70, "Input", InitializationCell->True, CellID->1375444331], Cell[25312, 696, 997, 30, 70, "Input", InitializationCell->True, CellID->1578894809], Cell[26312, 728, 725, 21, 70, "Input", InitializationCell->True, CellID->29628884], Cell[27040, 751, 2115, 54, 70, "Input", InitializationCell->True, CellID->1903930931], Cell[29158, 807, 229, 5, 70, "Input", InitializationCell->True, CellID->1860817017], Cell[29390, 814, 1173, 35, 70, "Input", InitializationCell->True, CellID->1192593395], Cell[30566, 851, 249, 6, 70, "Input", InitializationCell->True, CellID->1452312314], Cell[30818, 859, 639, 18, 70, "Input", InitializationCell->True, CellID->713929596], Cell[31460, 879, 967, 27, 70, "Input", InitializationCell->True, CellID->1023584183], Cell[32430, 908, 1178, 27, 70, "Input", InitializationCell->True, CellID->2035351211], Cell[33611, 937, 225, 5, 70, "Input", InitializationCell->True, CellID->880790214], Cell[33839, 944, 772, 22, 70, "Input", InitializationCell->True, CellID->836347927], Cell[34614, 968, 223, 5, 70, "Input", InitializationCell->True, CellID->1219139474], Cell[34840, 975, 1703, 45, 70, "Input", InitializationCell->True, CellID->935663491], Cell[36546, 1022, 2464, 58, 70, "Input", InitializationCell->True, CellID->1821029903], Cell[39013, 1082, 1081, 28, 70, "Input", InitializationCell->True, CellID->112642677], Cell[40097, 1112, 1541, 35, 70, "Input", InitializationCell->True, CellID->1252379332], Cell[41641, 1149, 2558, 59, 70, "Input", InitializationCell->True, CellID->1252208677], Cell[44202, 1210, 1506, 42, 70, "Input", InitializationCell->True, CellID->531493739], Cell[45711, 1254, 227, 5, 70, "Input", InitializationCell->True, CellID->1430783500], Cell[45941, 1261, 1256, 35, 70, "Input", InitializationCell->True, CellID->1803889041], Cell[47200, 1298, 3112, 92, 70, "Input", InitializationCell->True, CellID->1936467388], Cell[50315, 1392, 4507, 131, 70, "Input", InitializationCell->True, CellID->1092719831], Cell[54825, 1525, 1830, 56, 70, "Input", InitializationCell->True, CellID->62050473], Cell[56658, 1583, 260, 6, 70, "Input", InitializationCell->True, CellID->1352730916], Cell[56921, 1591, 1594, 38, 70, "Input", InitializationCell->True, CellID->2086618070], Cell[58518, 1631, 252, 6, 70, "Input", InitializationCell->True, CellID->1381946980], Cell[58773, 1639, 737, 16, 70, "Input", InitializationCell->True, CellID->1347250555], Cell[59513, 1657, 1237, 30, 70, "Input", InitializationCell->True, CellID->172503917], Cell[60753, 1689, 1137, 31, 70, "Input", InitializationCell->True, CellID->170409569], Cell[61893, 1722, 552, 17, 70, "Input", InitializationCell->True, CellID->1477924732], Cell[62448, 1741, 845, 27, 70, "Input", InitializationCell->True, CellID->1685109522], Cell[63296, 1770, 226, 5, 70, "Input", InitializationCell->True, CellID->621399618], Cell[63525, 1777, 224, 5, 70, "Input", InitializationCell->True, CellID->650404365], Cell[63752, 1784, 536, 13, 70, "Input", InitializationCell->True, CellID->654399325], Cell[64291, 1799, 229, 5, 70, "Input", InitializationCell->True, CellID->1225698988], Cell[64523, 1806, 265, 6, 70, "Input", InitializationCell->True, CellID->1659749292], Cell[64791, 1814, 222, 5, 70, "Input", InitializationCell->True, CellID->1741259761], Cell[65016, 1821, 987, 26, 70, "Input", InitializationCell->True, CellID->1593145458], Cell[66006, 1849, 1042, 31, 70, "Input", InitializationCell->True, CellID->1169601810], Cell[67051, 1882, 1252, 40, 70, "Input", InitializationCell->True, CellID->1579799679], Cell[68306, 1924, 268, 7, 70, "Input", InitializationCell->True, CellID->205393445], Cell[68577, 1933, 2291, 62, 70, "Input", InitializationCell->True, CellID->1041409386], Cell[70871, 1997, 2382, 60, 70, "Input", InitializationCell->True, CellID->975827452], Cell[73256, 2059, 485, 12, 70, "Input", InitializationCell->True, CellID->399373625], Cell[73744, 2073, 263, 6, 70, "Input", InitializationCell->True, CellID->1386118500], Cell[74010, 2081, 847, 25, 70, "Input", InitializationCell->True, CellID->591026844], Cell[74860, 2108, 963, 29, 70, "Input", InitializationCell->True, CellID->1276299733], Cell[75826, 2139, 1290, 36, 70, "Input", InitializationCell->True, CellID->1702946295], Cell[77119, 2177, 249, 6, 70, "Input", InitializationCell->True, CellID->1903816496], Cell[77371, 2185, 795, 24, 70, "Input", InitializationCell->True, CellID->1963472434], Cell[78169, 2211, 224, 5, 70, "Input", InitializationCell->True, CellID->1847478436], Cell[78396, 2218, 623, 18, 70, "Input", InitializationCell->True, CellID->104021879], Cell[79022, 2238, 230, 5, 70, "Input", InitializationCell->True, CellID->244031695], Cell[79255, 2245, 5461, 118, 70, "Input", InitializationCell->True, CellID->1894415742], Cell[84719, 2365, 256, 6, 70, "Input", InitializationCell->True, CellID->852825372], Cell[84978, 2373, 294, 7, 70, "Input", InitializationCell->True, CellID->1580335649], Cell[85275, 2382, 492, 13, 70, "Input", InitializationCell->True, CellID->1130167126], Cell[85770, 2397, 7359, 168, 70, "Input", InitializationCell->True, CellID->226028967], Cell[93132, 2567, 20404, 411, 70, "Input", CellID->75534301] }, Open ]], Cell[CellGroupData[{ Cell[113573, 2983, 110145, 2575, 70, "Output", CellID->745451320], Cell[CellGroupData[{ Cell[223743, 5562, 209, 6, 70, "Section"], Cell[223955, 5570, 342, 6, 70, "Text"] }, Close]] }, Open ]], Cell[CellGroupData[{ Cell[224345, 5582, 355, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[224703, 5593, 875, 24, 70, "Text"], Cell[CellGroupData[{ Cell[225603, 5621, 739, 24, 70, "Text"], Cell[226345, 5647, 468, 15, 70, "Text", CellID->1730094915] }, Open ]], Cell[CellGroupData[{ Cell[226850, 5667, 815, 24, 70, "Text"], Cell[227668, 5693, 1188, 33, 70, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature #RN6#lTjsgNuwC0lSDzjuea4 *)