Basic Examples (2)
Basic Examples
(2)
Marks for a sparse ruler of length 57:
In[2]:=
Out[2]=
{0,1,3,6,13,20,27,34,41,48,52,56,57}
Check that all differences are covered:
In[3]:=
ComplementRange[57],#[[2]]-#[[1]]&/@Subsets[57,"Full"],{2}
Out[3]=
{}
———
Show spaces between marks in a the full form of a length-396 ruler:
In[9]:=
Differences[396,"Full"]
Out[9]=
{1,1,1,1,1,6,11,11,11,11,11,23,23,23,23,23,23,23,23,23,23,23,12,12,12,12,12,12,1,1,1,1,1}
Split the Difference:
In[10]:=
Split[%]
Out[10]=
{{1,1,1,1,1},{6},{11,11,11,11,11},{23,23,23,23,23,23,23,23,23,23,23},{12,12,12,12,12,12},{1,1,1,1,1}}
Make a series of lists from the compact form of a length-396 ruler:
In[8]:=
Table[#[[1]],{#[[2]]}]&/@Transpose[396]
Out[8]=
{{1,1,1,1,1},{6},{11,11,11,11,11},{23,23,23,23,23,23,23,23,23,23,23},{12,12,12,12,12,12},{1,1,1,1,1}}
Show the compact form:
In[11]:=
Out[11]=
{{1,6,11,23,12,1},{5,1,5,11,6,5}}
Verify the above shortened form has length 396:
In[12]:=
Dot@@%
Out[12]=
396
Show the full form for a length-396 ruler:
In[13]:=
Out[13]=
{0,1,2,3,4,5,11,22,33,44,55,66,89,112,135,158,181,204,227,250,273,296,319,331,343,355,367,379,391,392,393,394,395,396}
Scope (4)
Scope
(4)
Options (2)
Options
(2)
Possible Issues (2)
Possible Issues
(2)
Neat Examples (3)
Neat Examples
(3)