The online racing simulator
Anyone a mathematician? Can you do mah homew3r plz :D
Hiya. So here's a question:

I've got a pseudocode algorithm


MODULE stupidmodule(INTEGER x)
WHILE x>1 DO
IF even(x) THEN (* x is even*)
x:= x/2
ELSE
x:= 3*x+1 (* x is odd *)
ENDIF
ENDWHILE
ENDMODULE

How do I prove that with all x values the algorithm terminates, a.k.a regardless of the value of x in the beginning the algorithm will produce a number from the initial x that is of form (x = x*2n)?
#2 - amp88
You can't solve the Collatz problem.
What a cunning bastard the lecturer...
#4 - amp88
For a given range of numbers (in this case from 1 to the maximum value the integer can store in the specific environment) you can prove it with experimentation. However, there's no mathematical proof that all positive integers will terminate (and there never can be, as far as I'm aware).

FGED GREDG RDFGDR GSFDG