My son and I have been playing with infinite series, using imaginary cookies in a cut-it-in-half and share-it-out exercise. So if, say, you have two cookies and share them with three people, you cut the two cookies in half, give one half to each person, and have a half left over. Then you cut the half-cookie in half and have two half-half-cookies, which isn't
enough to share, so you cut the half-halfs in half, and so on ad infinitum. It makes a pattern, and the pattern varies according to the number of cookies you start off with and how many people want a share. Of
course, your cookies end up kinda disintegrated. Or is that differentiated...
The page we were working on had a basic program to illustrate the pattern formation. It looked like this...
10 c=0
20 INPUT T
30 INPUT B
40 PRINT INT(T/B);
50 n = T - B*INT(T/B)
60 n = n*2
70 c = c + 1
80 IF c>10 THEN STOP
90 IF n>B THEN GOTO 110
100 n<=B THEN GOTO 150
110 x = 1
120 PRINT x;
130 n = n - B
140 GOTO 60
150 x = 0
160 PRINT x;
170 GOTO 60
180 end
I'm a bit allergic to code, so I got him to talk me through it.
"What does that T and B stand for?" I asked, innocently.
"Total Biscuit!" He answered, without a moment's hesitation.
Bloody smart-arse...