Professional Documents
Culture Documents
Fall, 2015
Assignment 2: The Collatz Problem
Due Date
Assignment 2 is due on Thursday, October 8th, at 11:59. The cutoff is
automated and is exactly at this time. Assignments submitted within
the next hour will be considered late. After that time they will not be
accepted at all.
These assignments are to be done individually. You can collaborate on
understanding the problem but you must write the solution
individually. Your submission might be subject to plagiarism
detection software.
Introduction
Given any positive integer, n, we can generate a sequence of integers
as follows. If n is odd and not equal to 1, the next value in the
sequence is 3n+1. If n is even, the next value in the sequence is n/2.
If n is 1, the sequence terminates.
There is a conjecture that for any value of n, the sequence eventually
terminates with the value 1. Proving this conjecture is known as the
Collatz problem. The problem has a long history and is also known as
the Syracuse problem, Kakutanis problem, Hasses algorithm and
Ulams problem or just the 3x+1 problem.
To date the conjecture has not been proven and remains an open
problem. See http://www.cecm.sfu.ca/organics/papers/lagarias/ for an
extensive discussion of this problem.
Assignment
You are to write and submit two programs to study the Collatz problem
Part 1 (40 marks)