Some of the Plots of "Designer" Paths are "Works of Art"

The desire to visualize any Collatz trajectory,  especially very long ones or ones designed to get at some particular feature,  led to development of a program npathtrk which traverses the Collatz trajectory beginning from any arbitrary integer and prepares a plot of the path traversed.  A previous attempt to represent a Collatz trajectory in a polar coordinate system produced much too crowded and cluttered a graph to be useful. 

This new presentation was chosen as a means of incorporating the features of the Collatz iteration as immediately as possible in a large available space to minimize resulting clutter.  In this new attempt,  a Cartesian coordinate system was employed with trunc(log[2](n))  used as the y-value and frac(log[2](n))  used as the x-value.  Each value of n thus acquires a unique position in the plot.  Each division by 2  (or series thereof)  results in a vertical line from an even valued n downward to the resulting odd value, n/2^i.  Each 3n+1 operation results in an increase of 1 or 2 in the y-dimension and a shift to the right by about 0.58 or to the left by about 0.42 on the x-axis.  (log[2](3) is 1.584962501 and 2-log[2](3) is 0.415037499.)  The connections between the points are then plotted using facilities of Maple 10. 

In some illustrative graphs details are given,  i.e.  a list of the values of n and the resulting values of log[2](n) is displayed beside the plot in one... , two..., three.. examples.


>        npathtrk := proc(n,shutdown)   local
> alphabet,ostring,lineno,logn,mod3,mod8,count,nloc,linelist,mylogn,myintn,myfracn;
>        alphabet:=`123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;
>        ostring := ``;
>        lineno := 1;
>        nloc := n;
>        mylogn := evalf(log[2](nloc));
>        fprintf(`terminal`,`%8d %15d %14.8f\n`,lineno,nloc,mylogn);
>        linelist:=[[frac(mylogn),trunc(mylogn)]];
>           while nloc<>1 do;
>              if lineno=shutdown then break; end if;
>           nloc := 3*nloc+1;
>           count := 0;
>           mylogn := evalf(log[2](nloc));
>           myintn := trunc(mylogn);
>           myfracn := frac(mylogn);
>           linelist:=[op(linelist),[myfracn,myintn]];
>              while type(nloc,even) do;
>              count := count+1;
>              myintn = myintn-1;
>              nloc := nloc/2;
>              end do;
>           lineno := lineno + 1;
>           fprintf(`terminal`,`%8d %15d %14.8f\n`,lineno,nloc,mylogn-count);
>           ostring := cat(substring(alphabet,count..count),ostring);
>           linelist:=[op(linelist),[myfracn,myintn-count]];
>           end do;
>        fprintf(`terminal`,`%s\n`,ostring);
>        plot(linelist);
>        end proc;


> n :=  661;
> shutdown := 18;
> npathtrk(n,shutdown);

Most complete itineraries give extremely confused patterns when treated in this way.   There is an example of a simple fragment of a longer itinerary which,  while understandable with the aid of annotation of the odd points,  illustrates how quickly the representation gets confusing.  To maintain clarity at all,  one must present only portions of a trajectory in order to prevent the confusion of deeply overlaid line segments.   The values of n and shutdown for the example are those given in the above source listing,  and the printed output by the side of the plot gives the data actually plotted.

The pair of programs makepath and npathtrk developed to make a pictorial presentation of properties of the Collatz trajectories proved to have minor value in that context.  However,  the great facility which they provided for making such graphs led to some experimentation to see what kind of limits they could be pushed to.  Perhaps the only useful result was showing that very long paths could be designed to fit within a relatively narrow range of magnitude.  To my great surprise the result of some of these attempts seemed artistic,  so I experimented a bit to explore some of the parameters which could be modified to alter the appearance of the resulting graphs.

Keep firmly in mind that these plots are those for "designer" paths,  which are very far removed from the usual paths in the general tree.  In particular I've concentrated on paths which have repetitious segments of various lengths and compositions.  It is the repetition of identical segments which results in the multiplication of some particular pattern in the resulting plots.  Garden variety paths have no such repetitious patterns,  so their plots appear as severely unattractive scribbles.

To keep the integers reached within some narrow range of orders of magnitude one must balance the number of s-steps against the number of  b-steps.  To this end,  path fragments with 7 s-steps and 10 b-steps   (implying a magnitude change of about (2/3)^7*(4/3)^10 or 2^27/3^17 or about 0.962 in that 17 step fragment)  were employed.  Different paths arise from use of differing orders of these steps,  and would result in a huge family of different graphs if fully explored.  Only two are shown here,  one with s7b10 and the other with the s's and b's more intermingled.

Another variant for any plot is the scale of the x-axis.  Changing the log[2](n) throughout the npathtrk program to log[4](n) will change the appearance of the plot for an identical trajectory segment.  Compare the log[2](n) plot with the log[4](n) plot.  The pattern of diagonal lines is much changed because the widened scale on the x-axis results in fewer instances where the edges of the (now base 4) orders of magnitude occur in a transition.   This log[4](n) plot is the only one among these samples which is plotted with this variant.

We have noted before that l.d.a.s appear infinitely often at intervals of their d values   (with reference to their characterization as dn+c or {c[d]}).   The first instantiation of such an l.d.a.  occurs at n=0,  and the subsequent instantiations appear at n=1,  2,  3, ..... Something like that   (though the details escape me)   occurs when different values of d are provided to makepath with the same path pattern specified.   In witness to that consider the graphs for four runs of 40 reps of 'ssb' with d values of 24,   48,   96,   and 192.  If you think there isn't any difference among these,  look at the position of the little tail pointing to the x-axis at the bottom.

Attention was also given to producing varying amounts of verticality to the plots by employing steps in the repeated path segments with values greater than "2".

In the graph from repeated segments "s6s" the tiny height of the divisions by 2 after each element is so overshadowed by the very large heights of the "6"'s and "s"'s that the picture is just a series of offset cantilevers. Note how huge the order of magnitude reached is here.

In the graph from repeated segments "62127" results in a similarly cantilevered construct, but this time with a bit of thickness to the individual floors. The vertical scale is large enough to virtually make the contribution of the "212" segments negligible.

In the graph from repeated segments "22222222224" the separation between layers is just enough to keep them separate and the vertical scale is compressed enough that the series of b-steps (compare bsteps on a more expanded vertical scale) contains nearly overlapping path segments.

In the graph from repeated segments "11111111116" the separation between layers due to the "1111111111" portion of the paths is quite insufficient to separate them, so a heavily overlaid pattern connected by and interlaced with the vertical segments due to the "6" results.

And finally, there is a plot of a number of repetitions of the name "Lori".

Clearly the interplay of results from changes in all these various parameters has the possibility of creating hundreds of plots of varying artistic interest.


My Collatz Home Page       Index of Terms Used