About Hailstone 1.0 Language: Visual C++ Version: 1.0 Size: 396 Kb (Statically linked) Introduction Features Bug Report Download ScreenShots Screen 1 Screen 2 Screen 3 Screen 4 Screen 5 |
Hailstone Numbers
Hailstone 1.0 is a Windows application that generates Hailstone Numbers sequences. A Hailstone Sequence is generated by a simple algorithm, understandable even by non-mathematicians: Start with an integer N. If N is even, the next number in the sequence is N / 2. If N is odd, the next number in the sequence is (3 * N) + 1. Starting with 12 leads to the following sequence:
After several iterations, both sequences finally end down to 1 and enter in the endless loop 4, 2, 1. These sequences of numbers are called Hailstone Sequences and the number of these sequences the Hailstone Numbers. In 1937, L. Collatz conjectured that all sequences finally fall back to 1. This problem, called the Collatz Problem, is still, to the best of my knowledge, unresolved. Features Hailtone 1.0 could help you in search of the mysteries of the Hailstone Numbers. 1. Sequence Data Select the menu 'File | View Single Sequence'. Click on the 'Compute' Button, enter the Sequence Start Number and watch the results ... The maximum value reached in the sequence and the sequence length are shown on the left of the window. The listbox is populated with the sequence number and the highest value is highlighted. Selecting the tab 'Sequence Graph' shows the graphical representation of the Hailstone sequence. 2. Multiple Sequences Select the menu 'File | View Multiple Sequences'. Click on the button 'Compute', enter the Starting Number of the first sequence and the Starting Number of the last sequence. After computation ( that could take a while if a large range is selected), the maximum value of the maximum reached in all the sequences as well as the maximum length found are showed on the left of the window. The listbox is populated with the sequence attributes:
Clicking the button 'Length Frequency' shows the frequency of the different sequence lengthes. Here again, the sorting order can be toggled using the column header. To illustrate this point, here are the length frequencies of the sequences starting with 1 to 50.
The frequence length that appear most is 16. Four sequences have this length of 16 numbers. Amongst the sequences, no one have a sequence length of 22 numbers. Interestingly enough, four numbers generates a sequence length greater than 100. Also, the distribution is highly asymmetric: one group, almost complete, up to 34 and, after a big gap, a second one between 104 and 111. Clicking the button 'Max. Frequency' shows the frequency of appearance of the maximum value of the different sequences. Here again, the sorting order can be toggled using the column header. To illustrate this point, here are the maximum frequencies of the sequences starting with 1 to 50.
The highest value in sequences that have the higher frequency is 16. Distribution is spread from 1 to 304 followed by the much more higher value of 9232. Furthermore, this amazingly high value ( compared to the sequence starting value) is obtained four times for the sequences starting with 1 to 50. Selecting the tab 'Paths Graph' shows the graphical representation of the maximum value and length of the selected sequences. 3. Sequences Maxima Select the menu 'File | View Sequences Maxima'. Click on the button 'Start', enter the Starting Number of the first sequence and the Starting Number of the last sequence and let the application compute higher and higher maximum values and sequence lengthes. Depending on the start and end starting number, the computation could take seconds, minutes, hours or even days ... Be cool, this part of the application uses the multi-thread feature of Windows and it can be stopped at any time by clickin the 'Stop' button. Here is what it actually does: the application compute the sequences according to the selected range and stores the maximum value and sequence length as they appear in the scan. For example, the sequence starting with 27 has a maximum value of 9232. The next sequence start number in the list is 255, as it is the first number since 27 that have a maximum higher than 9232. The following number added to the listbox is 447, as its maximum value (actually 39364) is the first to overcome the preceeding maximum reached (13120 with sequence starting with 255). Here are the first ones:
For this part of the application, the sequence starting numbers can be extremely high, up to 10 ^{18}. Of course, for such high values, computing time can be very, very, very long .... To give an idead, computing a million sequences takes about 15 seconds on a 900 Mhz machine. This could seems fast but to compute one billion, it takes about 4 hours... Note that this part of the application is not optimized to perform lengthy calculations. The User Interface is updated whith computation progress and the algorithm have not been optimized specifically for speed. However, it can compute sequence with huge starting number such as the path record I found on the Web. Try the following range: (do not type in the spaces added for clarity) - Start Number: 10709 980568 908000 - End Number: 10709 980568 909000 You will obtain the amazing maximum value of: 350 589187 937078 188831 873920 282244 for the stating number 10709 980568 908647Bug Report Please report any bug to Thierry.Marneffe@skynet.be Have Fun !!! |