The following email exchange recently took place between my brother Chip
and me. His stuff is in black and my stuff is in red. The book we're talking
about is "The Recursive Universe" by William Poundstone. I'm including
it on the tiny-c Programming Group Facebook site because it includes examples of
the "immediate mode" of tiny-c. This mode is briefly mentioned in the tiny-c 
documentation. It's an extremely useful mode, especially when you are debugging.

Just the facts, no fibbing!



The quote on the back cover of the book you are reading asked a pretty
amazing question -- about the nature of life itself -- and if the
creation of it is "integrally related" to the game of Life's rules.

I was also impressed by the last sentence in the quote on the back cover
of the book: [about the book's being] ... "one of the most compelling
books about science ever written."

This whole subject of mathematical patterns showing up consistently in
nature really make me think about God and what graduate mathematics
courses he must have taken in heaven. The darn stuff works out every
time! It makes one wonder about the nature of math itself, But THIS last
sentence makes me take a second look at another WAY looking at a phrase
involving the four words "the nature of math!" I mean aren't we also
talking about the "the math of nature?" My observation of my own
paragraph's questions must seem elementary, since "men of science" have
no doubt pondered the mutual connection of the two (math and nature).
When I was a kid growing up, I thought math was just something you
learned in school -- that had laws of "its own." But now I think I see
that ITS Laws may well be the laws of all of life -- which I suppose
includes, music, philosopy, and religion, (and thought?) too. Right?

Before I go, I have a math question. Actually three questions. One is
this: If 4! = 4*3*2*1 or 24, then how can 0! = 1? Wouldn't it be written
0*-1 or 0?

First, 4*3*2*1 = 4! doesn't quite translate to 0*-1 for 0! because the rule 
for factorial says "start with your number and multiply it by all its 
predecessors down to 1." This rule can only have meaning if you
insist your start number is greater than or equal to 1. 

But ...

if we *define* 0! to be 1, we can then retain (extend) the definition (law?)
that

n! = n * (n-1)!  for n >=1

(because 1! = 1 * (1-1)! = 1 * 0! = 1 * 1 = 1)

It's kind of like fractional exponents. You drop the idea that powers mean
how many times you multiply a base by itself and arrange things so that the
law of exponents still holds.

21/2

is given the meaning square root of 2 because we want

21/2 * 21/2 = 21/2 + 1/2 = 21 = 2

My second question has to do to with Fibonacci numbers. Would I be right
in saying F(3)=2? Would I also be right in saying F(4)=3?

Yes. F(n)=F(n-1)+F(n-2) with F(1)=F(2)=1. So, F(3)=F(2)+F(1)=1+1=2

My last question has to do with your program. Did you say the Golden
Ratio is computed by dividing one very high Fibonacci number by the
Fibonacci number immediately following it in the sequence? As in:
F(n-1)/F(n)? Let's see if I can figure this out on my own: Here is a
list of the first 20 Fibonacci numbers. I am calculating them with my
head on a piece of paper now:

1,1,2,3,5,8,13,21,34,55,89,144,233,377,710,1087,1797,2884,4681 and 7565.

By the way, I did not cheat and / or use a calculator! There may be
errors since this came out my head!

Hmm. Too hard for my weary brain. Lemme check.

C:\Users\Lee\My Stuff\tc>tinyc

tiny-c/PC Interpreter  Version PC-01-07
Copyright (c) 1984 by Scott B. Guthery
Implemented 5/16/09 by Lee Bradley / Ed Davis

tiny-c Shell - 2/9/9

tc>.r fib.tc
 456
 0 30 456 24044

tc>.[int i;for (i=0;i<30;++i)[pn fibf(i)]]

 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711
28657 -19168 9489 -9679 -190 -9869 ...

Note: the negative numbers are due to using the DOS tiny-c interpreter which
can handle numbers only up to 32767.

Notice the use of tiny-c's "immediate mode." Remind you of BASIC? Anyway,
looks like you messed up at summing 233 and 377. Not bad. But using, say, the 
tiny-c interpreter and the fib.tc program is more reliable.

OK, so now I need to see if The Golden Ratio of .6 shows up (or comes
close to it) if I divide the last number in the sequence by the one
preceding it. Here goes: 4681 / 7565 = unbelievable! It worked! I
got .618770654329.

Even when you make a mistake, if you continue to sum the two previous numbers
to get the next, you should (and do) come close the the Golden Ratio when
you divide. Using my values

4181 / 6765 = 0.61803399852180339985218033998522

The Golden Ratio is about 1.61803398874989484820. Note: The Golden Ratio, usually called phi,
has the interesting property that 1 / phi = phi - 1. So the above ratio is actually an approx.
to the reciprocal of the Golden Ratio.

And it really is rather cool that this eventually works to be
(sqrt(5)-1)/2 -- which I guess is irrational, right? Is an irrational
number one that goes on forever (in a manner of speaking)?

Enjoy your book! Interesting stuff!

Irrational numbers are numbers that can't be expressed as ratios. And yes, such numbers
have infinitely many numbers in their decimal expansions and these numbers don't repeat.
Unlike rational numbers (aka fractions) which do.

sqrt(2) = approx

1.
4142135623 7309504880 1688724209 6980785696 7187537694 8073176679
7379907324 7846210703 8850387534 3276415727 3501384623 0912297024
9248360558 5073721264 4121497099 9358314132 2266592750 5592755799
9505011527 8206057147 0109559971 6059702745 3459686201 4728517418
6408891986 0955232923 0484308714 3214508397 6260362799 5251407989
6872533965 4633180882 9640620615 2583523950 5474575028 7759961729
8355752203 3753185701 1354374603 4084988471 6038689997 0699004815
0305440277 9031645424 7823068492 9369186215 8057846311 1596668713
0130156185 6898723723 5288509264 8612494977 1542183342 0428568606
0146824720 7714358548 7415565706 9677653720 2264854470 1585880162
0758474922 6572260020 8558446652 1458398893 9443709265 9180031138
8246468157 0826301005 9485870400 3186480342 1948972782 9064104507
2636881313 7398552561 1732204024 5091227700 2269411275 7362728049

whereas

27/37 = (hold on ...)

tc>.r fib.tc
 456
 0 30 456 24044

tc>.[ps ".";dpf(27,37,10)]

.7297297297