Hammersley Point Set

Author

Eric W. Weisstein
April 16, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/ComputerScience/HammersleyPointSet.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/HammersleyPointSet.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Graphics`Colors`

Code

Net0[m_Integer?Positive,t_Integer?NonNegative]:=Module[ 
{
l=IntegerDigits[#,2,m]&/@ Range[0,2^m-1],
vec = Table[1/2^i, {i,m-t}]
},
 {Take[Reverse[#],m-t].vec,Take[#,m-t].vec}&/@l 
]

Net[n_,t_:0]:=Map[FromDigits[{#,0},2]&,{Reverse[Drop[#,t]],Drop[#,-t]}&/@Flatten[Outer[List,Sequence@@Table[{0,1},{n}]],n-1],
{2}]

NetSlow[n_,t_:0]:=Map[FromDigits[{Drop[#,-t],0},2]&,{Reverse[#],#}&/@Flatten[Outer[List,Sequence@@Table[{0,1},{n}]],n-1],
{2}]

©2005 Wolfram Research, Inc. except for portions noted otherwise

Construction of the Sequence

Net[2,0]/.x_Rational:>BaseForm[x//N,2]

IntegerDigits[#,2,2]&/@Range[0,3]

Equality Comparisons

Net[8,0]==NetSlow[8,0]==Net0[8,0]

Net[8,2]==NetSlow[8,2]==Net0[8,2]

Net[8,6]==NetSlow[8,6]==Net0[8,6]

Timing Comparisons

Net[16,0];//Timing

Net2[16,0];//Timing

Net0[16,0];//Timing

Net[16,3];//Timing

Net2[16,3];//Timing

Net0[16,3];//Timing

Examples

Table[Net[n,0],{n,3}]//ColumnForm

Table[Net[n,1],{n,3}]//ColumnForm

Graphic

MakeBoxes[Net[t_,m_,n_],TraditionalForm]:=RowBox[{
RowBox[{"(",
RowBox[{MakeBoxes[t,TraditionalForm],",",MakeBoxes[m,TraditionalForm],",",MakeBoxes[n,TraditionalForm]}],")"}],"-","net"}]

MakeBoxes[net[m_,t_],TraditionalForm]:=RowBox[{"t","=",MakeBoxes[t,TraditionalForm]}]

Show[GraphicsArray[
Partition[Table[Graphics[{
PointSize[.05],Red,
Point/@Net[6,t]},
AspectRatio->Automatic,
PlotLabel->TraditionalForm[net[6,t]],
PlotRange->{{0,1},{0,1}},
Frame->True],{t,0,5}],3]
]]