Re: collatz proof algorithm reveals e



You make a mistake in line 1. z(1) = 3.
I'll show you the full proof dump for n = 10.
Maybe this will help you understand.
To create such a dump do (prove c3 10 50 'prove)
The proof starts with n = 0 and finds the cycles for n=0 and n=1,
it was designed to handle more than one function and not
for collatz exclusively.

((0 0) (0 0 0 0 0 0 0) 0 () 0 () 0 ())
((1 4) (1 0 1 0 0 0 0) 1 (0) 0 () 0 ())
((1 2) (2 0 1 0 0 0 1) 1 (0) 0 () 1 (4))
((1 1) (3 0 1 0 0 0 2) 1 (0) 0 () 2 (2 4))
((2 1) (4 0 2 0 0 0 2) 2 (0 1) 2 (2 4) 0 ())
((3 10) (5 1 2 0 0 0 2) 2 (0 1) 1 (4) 0 ())
((3 5) (6 1 2 0 0 0 3) 2 (0 1) 1 (4) 1 (10))
((3 16) (7 1 2 0 0 0 4) 2 (0 1) 1 (4) 2 (5 10))
((3 8) (8 1 2 0 0 0 5) 2 (0 1) 1 (4) 3 (5 10 16))
((3 4) (9 1 2 0 0 0 6) 2 (0 1) 1 (4) 4 (5 8 10 16))
((4 2) (10 1 2 0 0 1 6) 2 (0 1) 5 (4 5 8 10 16) 0 ())
((5 16) (11 2 2 0 0 1 6) 2 (0 1) 4 (5 8 10 16) 0 ())
((6 3) (12 3 2 0 0 1 6) 2 (0 1) 3 (8 10 16) 0 ())
((7 22) (13 3 2 1 0 1 6) 2 (0 1) 3 (8 10 16) 0 ())
((7 11) (14 3 2 1 0 1 7) 2 (0 1) 3 (8 10 16) 1 (22))
((7 34) (15 3 2 1 0 1 8) 2 (0 1) 3 (8 10 16) 2 (11 22))
((7 17) (16 3 2 1 0 1 9) 2 (0 1) 3 (8 10 16) 3 (11 22 34))
((7 52) (17 3 2 1 0 1 10) 2 (0 1) 3 (8 10 16) 4 (11 17 22 34))
((7 26) (18 3 2 1 0 1 11) 2 (0 1) 3 (8 10 16) 5 (11 17 22 34 52))
((7 13) (19 3 2 1 0 1 12) 2 (0 1) 3 (8 10 16) 6 (11 17 22 26 34 52))
((7 40) (20 3 2 1 0 1 13) 2 (0 1) 3 (8 10 16) 7 (11 13 17 22 26 34 52))
((7 20) (21 3 2 1 0 1 14) 2 (0 1) 3 (8 10 16) 8 (11 13 17 22 26 34 40
52))
((7 10) (22 3 2 1 0 1 15) 2 (0 1) 3 (8 10 16) 9 (11 13 17 20 22 26 34
40 52))
((8 4) (23 3 2 1 0 2 15) 2 (0 1) 12 (8 10 11 13 16 17 20 22 26 34 40
52) 0 ())
((9 28) (24 4 2 1 0 2 15) 2 (0 1) 11 (10 11 13 16 17 20 22 26 34 40 52)
0 ())
((9 14) (25 4 2 1 0 2 16) 2 (0 1) 11 (10 11 13 16 17 20 22 26 34 40 52)
1 (28))
((9 7) (26 4 2 1 0 2 17) 2 (0 1) 11 (10 11 13 16 17 20 22 26 34 40 52)
2 (14 28))
((10 5) (27 4 2 2 0 2 17) 2 (0 1) 13 (10 11 13 14 16 17 20 22 26 28 34
40 52) 0 ())
((11 34) (28 5 2 2 0 2 17) 2 (0 1) 12 (11 13 14 16 17 20 22 26 28 34 40
52) 0 ())

e.g.
z(0..10) = 28 is the third number on the last line.
z(7) = 23 - 13 = 10.
z(1) = 4 - 1 = 3.

This dump shows tour "flash of insight" is correct. But note that when
proceeding from n to n+1 the prover is called with arguments
(among others) n+1 and collatz(n+1). I do this to maintain the loop
invariants of the algorithm so although this call to collatz may seem
superfluous I count this as 1 not 0.

.



Relevant Pages

  • Re: Reset a foreach loop.
    ... This algorithm is Oas opposed to the others which were O. ... You only loop through the collection once so you can do other processing as well. ... It would be nice to have something like remove_iffrom the C++ STL. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Finding the execution time
    ... Hi Nicolas, yes my algorithm depends to multiple calculations separated ... end loop; ... Prev by Date: ...
    (comp.lang.vhdl)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... and Richard made it clear that he understands the order ... >> of evaluation of a for loop. ... > using strlen but using an Oalgorithm when there is a trivial O ... >> In most other languages the terminating ...
    (comp.programming)
  • Re: Efficiency questions: combined ifs and looping 4 times
    ... Choice of algorithm always has a far bigger impact in performance than ... Use sizeof before the loop, store the result in a var and use ... speaks well of PHP. ... your order of complexity analysis is off. ...
    (comp.lang.php)
  • Re: count of each word occurred
    ... > take each word in order and compare it with the rest of the list ... Another version of this algorithm takes advantage of the fact that it does ... loop over all words in the list ... a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq ...
    (alt.comp.lang.learn.c-cpp)