Opening
This guy says that it is really important to get off to a good start in this class. He says that if we are attentive, and work very hard to keep up right from the start ... we are likely to do learn alot and do well.
I wonder why he is telling us this? I wonder if something in his experience prompted him to ``open'' with these words.
Intro to Programming
Definition
A PROGRAM is a sequence of instructions which performs some action or computes some value.
The following is a program written in an informal ``code'' to generate a sequence of numbers for any value of A that you choose in step 1.
Choose an arbitrary positive integer, A.
Write down A.
if A = 1, then stop.
if A is even, then replace A by A / 2 and go to step 2.
if A is odd, then replace A by 3 * A + 1 and go to step 2.
|
It is conjectured that the computation, as well as its specification, is finite. Evidently, this has yet to be proven. This ``program'' is the original specification of the set of sequences provided by Lothar Collatz. This ``program'' is the original specification of the set of sequences provided by Lothar Collatz.
In passing, and knowing that you are not in a position to fully appreciate it, you might enjoy observing a Java program which describes this computation.
public void collatz (int a)
{
IO.println (a);
if (a == 1) {return; }
if (Predicates.even (a))
{
collatz (a / 2);
}
else
{
collatz (3 * a + 1);
}
}
|