Let’s input the puzzle pieces first. Each is a list; first element stands their point value, second for the reward piece, third is the puzzle matrix, following Brad’s convention above. We call the reward pieces 1I, 2I, 3I, 3L, 4I, 4L, 4S, 4T, and 4Q, encoding their size and shape.
puzzle=ConstantArray[{},52];;
Phew. We have what we want.
We can check the distribution of point rewards:
We can check the distribution of point rewards:
In[]:=
Histogram[puzzle[[All,1]]]
Out[]=
Piece rewards of the same size appear with approximately equally likelihood. The most common reward is the domino.
In[]:=
List@@@Normal@Counts[puzzle[[All,2]]]
Out[]=
{{1I,7},{2I,9},{3I,8},{3L,8},{4I,4},{4L,4},{4S,4},{4T,4},{4Q,4}}
The 5-pointers all only give a monomino:
In[]:=
Cases[puzzle,{5,_,_}][[All,2]]
Out[]=
{1I,1I,1I,1I,1I}
But the other puzzles are more diverse in terms of rewards:
In[]:=
Cases[puzzle,{4,_,_}][[All,2]]Cases[puzzle,{3,_,_}][[All,2]]Cases[puzzle,{2,_,_}][[All,2]]Cases[puzzle,{1,_,_}][[All,2]]Cases[puzzle,{0,_,_}][[All,2]]
Out[]=
{1I,2I,2I,3I,3I,3L,3L}
Out[]=
{2I,3I,3L,4I,4L,4S,4T,4Q}
Out[]=
{2I,3I,3L,4I,4L,4S,4T,4Q}
Out[]=
{1I,2I,2I,2I,3I,3I,3L,3L,4I,4L,4S,4T,4Q}
Out[]=
{2I,2I,3I,3I,3L,3L,4I,4L,4S,4T,4Q}
So the 4-pointers give all types of piece rewards between sizes 1-3.
The 3-, 2-, and 0-pointers give all types of piece rewards between 2-4.
And finally, for each polyomino, there is at least a 1-pointer that gives it as a reward.
The 3-, 2-, and 0-pointers give all types of piece rewards between 2-4.
And finally, for each polyomino, there is at least a 1-pointer that gives it as a reward.
We can look at the relationship between our key variables more directly.
In[]:=
size[s_String]:=ToExpression[StringTake[s,1]];puzzleAnalysisRaw=Tablex[[1]],25-Total[Flatten[x[[3]]]],size[x[[2]]],CeilingFractionalPart,{x,puzzle};b1=BubbleChart[Flatten/@List@@@Normal[Counts[puzzleAnalysisRaw[[All,{2,1}]]]],Frame->False,AxesTrue,AxesLabel->{"puzzle size","point reward"}];b2=BubbleChart[Flatten/@List@@@Normal[Counts[puzzleAnalysisRaw[[All,{2,3}]]]],Frame->False,AxesTrue,AxesLabel->{"puzzle size","reward piece size"}];b3=BubbleChart[Flatten/@List@@@Normal[Counts[puzzleAnalysisRaw[[All,{1,3}]]]],Frame->False,AxesTrue,AxesLabel->{"point reward","reward piece size"}];Show[GraphicsRow[{b1,b2,b3},ImageSize->900]]
25-Total[Flatten[x[[3]]]]
4
Out[]=
and, yes, why not in 3D?
In[]:=
BubbleChart3D[Flatten/@List@@@Normal[Counts[puzzleAnalysisRaw[[All,{2,1,3}]]]],PlotRange->All,AxesTrue,AxesLabel->{"puzzle size","point reward","reward piece size"},Ticks->{Range[1,16,3],Range[0,5],Range[1,4]},LabelingFunction->Above,ViewPoint{1.8,-2.3,1.25}]
Out[]=
There seems to be a pretty pattern here.
Let’s try to explain the point value using the size of the puzzle and the puzzle piece reward as dummies.
Let’s try to explain the point value using the size of the puzzle and the puzzle piece reward as dummies.
puzzleAnalysisLinModel=puzzleAnalysisRaw[[All,{2,3,1}]];lm1=LinearModelFit[puzzleAnalysisLinModel,{puzzleSize,rewardSize},{puzzleSize,rewardSize}];lm1["AdjustedRSquared"]lm1["BestFitParameters"]lm1["ParameterPValues"]
Out[]=
0.956478
Out[]=
{0.0534421,0.35019,-0.254614}
Out[]=
{0.787102,5.03797×,2.62918×}
-33
10
-6
10
R-squared of 95.6%!
We can even improve this slightly by adding a dummy for “does it need a piece smaller than a tetromino?”
We can even improve this slightly by adding a dummy for “does it need a piece smaller than a tetromino?”
In[]:=
puzzleAnalysisLinModelSlightlyBetter=puzzleAnalysisRaw[[All,{2,3,4,1}]];lm2=LinearModelFit[puzzleAnalysisLinModelSlightlyBetter,{puzzleSize,rewardSize,needsSmaller},{puzzleSize,rewardSize,needsSmaller}];lm2["AdjustedRSquared"]lm2["BestFitParameters"]lm2["ParameterPValues"]
Out[]=
0.959421
Out[]=
{-0.088206,0.356308,-0.26919,0.215509}
Out[]=
{0.663199,5.21176×,5.93915×,0.0379839}
-33
10
-7
10
And even our dummy is significant.
From this, it appears to me like reward pieces were deemed to be equally worthwhile by the designer. But I doubt they are really so in an actual game of Project L - for example, I often find the 4-I piece to be quite useless, whereas my sense is that the 4-L (and also the 3-L) are often extremely good. 4-T is also typically more useful than the 4-S.
From this, it appears to me like reward pieces were deemed to be equally worthwhile by the designer. But I doubt they are really so in an actual game of Project L - for example, I often find the 4-I piece to be quite useless, whereas my sense is that the 4-L (and also the 3-L) are often extremely good. 4-T is also typically more useful than the 4-S.