Sunday, May 29, 2011

Speaking of the "End of the World"...

I just finished reading Benson's The Dawn of All, which is the second of his two "apocalyptic" novels. The other is Lord of the World Note carefully: they are NOT related as part 1 and part 2, but rather as left-hand versus right-hand!

I highly recommend both of them. "Dawn" has some marvellous surprises, especially touching on science and faith - so much so that I had to comment on it on The Duhem Society.

Friday, May 27, 2011

Light at the end of the baktun

Someone said the world ended last Saturday. Oh well, I was away. Apparently there are still some Mayans around who do that sort of thing - they were so into fortune-telling that they needed to have some built-in pre-scheduled catastrophe. Yes, this would be End-of-the-World Number Five for them. Doom, doom. It's sort of like Invader Zim and GIR singing the Doom song, or like those drums that the Fellowship heard still beating in Moria after - uh - afterwards.

Well, during my research for my Saga I decided to look briefly into the Maya Long Count - it's funny - and I found that one of the interpretations comes out to have the end of the baktun on December 23, 2015, which fits in very well with something in my adventure. Of course, as you may expect, the world doesn't end for our heroes... but I must not spoil it for you.

And so, this episode of my Saga is called "13.0.0.0.0" from the Maya Long Count when the current baktun ends. A baktun is 20*20*18*20 = 144000 days or about 400 years - no, not exactly, of course, since they didn't believe in intercalation. For the Mayans the "end-of-the-world" thing comes around every so often - the only wheel they had were imaginary ones like this, and I think this one will be end-of-the-world number five, but who's counting! That sort of periodic Doom is sort of like good old Y2K, the famous computer-disabling comet that hit back around the start of 2000, or 2001 if you don't believe in zero. Of course I had a Whole Bulb of Garlic on my computer, so by the magic of the internet, we were safe. Yeah, that makes two or three end-of-the-worlds for me already! Wow. But let us get back to my story.

This episode "13.0.0.0.0" is Part X in From Darkness Into Light, the volume in my Saga covering the years from the fall of 2013 until Christmas of 2016 - that is when Something Happens. No; not the end of the world. (hee hee) It's rather the start of something - something exciting.

And speaking of exciting stuff, here is the latest prime palindrome found by my busy little computer...

11064077077046011

But that's not the end of the world either; we know there are always more primes, though I don't know whether or not there will be more prime palindromes. I'll leave that for you to work out.

And if you decide you can't wait for my book to come out locally, you can always drive down to Quayment and ask at any bookstore. They'll have it.

Monday, May 23, 2011

On light and darkness - and complex numbers and other joys

It is one of those strange things - truths - that the names of two of the darkest and most hateful men who ever existed are now associated with something grand, silly, happy, light, and laughable. No, not Darwin and Marx. Not even Nietzsche and Kant. I mean Calvin and Hobbes.

(Note: I have only a vague idea what the real C&H taught - I recall something about going to hell, and not as Dante, who apparently had a "just visiting" card - just as I very quickly forget an error in software once I have corrected it. Of course there are philosophers specializing in pathology who have to know such errors, just as there are pathologists for medicine or for engineering. But the study of Error Writ Large is a special sort of subject, not usually suitable for blogging, at least not today. And I did want to start a discussion on error, but I didn't have time. Maybe some other year. But let us proceed.)

There are many useful insights for a computer scientist in C&H - or even for a Chestertonian. People moan about "complex numbers" - but Hobbes easily disposes of this to Calvin by explaining they are things like "eleventeen" and "thirty-twelve". These sound complex to me, and I regret to state that few mathematicians have risen to the heights which could enable them to even speak these words, much less state theorems about them. More's the pity. We need more such advances.

Another one of the deep insights into methodology - indeed, a classic in proof-techniques - occurs in the famous lesson of the Opposite Pole, one of the important concepts found in what is likely Calvin's greatest single contribution to humanity: that is, the game of Calvinball, which is on a par with Chesterton's "Gype". [See his autobiography, CW16:211]

I do not have the time to dig out the precise bibliographic reference to the item, but the insight is simple to state. It occurs when Hobbes accuses Calvin of "not declaring" that he touched the Opposite Pole. Calvin states "Obviously I declared it oppositely: by not declaring it."

Genius... pure genius.

Well. It was just this insight I was seeking recently when I was trying to decide how to handle a... er... a certain situation in my Saga. It was one of those situations involving Enemy Powers, obviously calling for the charism which in Holy Orders is classed under the Minor Order called "Exorcist".

Now, as I have noted previously I have a copy of the Roman Ritual, so there was no difficulty regarding the formal method. However, for a number of reasons - some dramatic, some artistic, some a kind of paternal concern - I didn't want to let Certain Matters come into direct view.

So I decided to wield Calvin's "Opposite Pole Technique", and declare it by not declaring it. There's some theatric term which might be used... ah yes: "it [the gory part] happens off-stage."

Strange to say, this made the whole effect a good deal more creepy than I expected.

On contemplating this, two different GKC quotes come to mind:
After a pause the priest spoke again in his mild manner. "Admiral," he said, "will you do me a favour? Let me, and my friends if they like, stop in that tower of yours just for tonight? Do you know that in my business you're an exorcist almost before anything else?"
[GKC "The Perishing of the Pendragons" in The Wisdom of Father Brown]

This inverted imagination produces things of which it is better not to speak. Some of them indeed might almost be named without being known; for they are of that extreme evil which seems innocent to the innocent. They are too inhuman even to be indecent.
[GKC The Everlasting Man CW2:253]
I don't delve into this to shock or annoy, but just the OPPOSITE: to suggest that there are good artistic ways of handling such matters so that they do NOT shock. No one needs that sort of detail... and yet the effect will be Calvinistic and Hobbesian in the extreme.

Hee hee!

Thursday, May 19, 2011

GKC, the mathematician's delight

I have mentioned previously - at least I think I have - that I intensely dislike the idea of my computer running around loose. I do not want it spending its time as it chooses: I am its absolute master, and I wish it to be working at doing MY bidding, not at what the designers of its operating system have chosen to assign it for its idle time.

Of course, as a Chestertonian and a fortiori a Catholic Christian, there is NO SUCH THING as "idle time" - all times and events are sacred, and we can be holy and busy with the praise of God as we stroll vaguely down the street (in the public's view). But I am not speaking about the Chestertonian view of having "nothing to do" - a line from his Autobiography which was so striking it even got stuck into a "Calvin and Hobbes" comic:
For my own part, I never can get enough Nothing to do.
[GKC Autobiography CW16:202]
Sorry, I cannot find the citation for the C&H comic; I will hunt that later.

Now (ahem!) I was saying something about my computer. I want it to keep busy, and at useful work. So I have recently chosen to have it work on finding the prime palindromes which have 17 digits... yes, a lovely little task for a healthy young machine with nothing better to do. Recently it found that
10704969896940701
is prime... what a good little machine. I would give it a treat, but my cookies won't fit in that little slot. Besides, I think it has enough cookies, even if Goggle sometimes says they are disabled. Hee hee.

I took a quick glance to see if Chesterton ever talked about primes. He mentions the Prime Minister a lot, but I know very little about England, and didn't know they have public servants to treat of number-theoretic matters. How advanced. I've seen GKC mention binomials and triangles and several other tech math things, but... well. I guess not.

However I found the word "prime" in an interesting context, which is quite relevant to the matter:
There are some things of which the world does not like to be reminded, for they are the dead loves of the world. One of these is that great enthusiasm for the Arcadian life which, however much it may now lie open to the sneers of realism, did, beyond all question, hold sway for an enormous period of the world's history, from the times that we describe as ancient down to times that may fairly be called recent. The conception of the innocent and hilarious life of shepherds and shepherdesses certainly covered and absorbed the time of Theocritus, of Virgil, of Catullus, of Dante, of Cervantes, of Ariosto, of Shakespeare, and of Pope. We are told that the gods of the heathen were stone and brass, but stone and brass have never endured with the long endurance of the China Shepherdess. The Catholic Church and the Ideal Shepherd are indeed almost the only things that have bridged the abyss between the ancient world and the modern. Yet, as we say, the world does not like to be reminded of this boyish enthusiasm.

But imagination, the function of the historian, cannot let 60 great an element alone. By the cheap revolutionary it is commonly supposed that imagination is a merely rebellious thing, that it has its chief function in devising new and fantastic republics. But imagination has its highest use in a retrospective realization. The trumpet of imagination, like the trumpet of the Resurrection, calls the dead out of their graves. Imagination sees Delphi with the eyes of a Greek, Jerusalem with the eyes of a Crusader, Paris with the eyes of a Jacobin, and Arcadia with the eyes of a Euphuist. The prime function of imagination is to see our whole orderly system of life as a pile of stratified revolutions. In spite of all revolutionaries it must be said that the function of imagination is not to make strange things settled, so much as to make settled things strange; not so much to make wonders facts as to make facts wonders. To the imaginative the truisms are all paradoxes, since they were paradoxes in the Stone Age; to them the ordinary copy-book blazes with blasphemy.
[GKC "A Defence of China Shepherdesses" in The Defendant]
Huh? you ask. What does that have to do with integers that have no integer divisor other than themselves and one?

READ IT AGAIN.

"...the function of imagination is not to make strange things settled, so much as to make settled things strange; not so much to make wonders facts as to make facts wonders."

Even if you are not a mathematician, there ought to be a wonder about primes (which are perhaps very dull facts), even little ones... But this is nothing more than the song of the old Psalmist, as orchestrated through the classical trivium and quadrivium: "The heavens declare the glory of God..." For it was the arrangement of the quadrivium (by at least some medievals) to begin to organize the idea of number and its application: hence:

number in itself is arithmetic
number in time is music
number in space is geometry
number in space and time is astronomy

We'll talk about this arrangement another time. Right now it's lunchtime and then I have to go see if my computer deserves another "Good Boy!"

Wednesday, May 11, 2011

Stunned

Normally, I don't do this - post in the middle of my other business. But I was looking for something and (as usual) found something else.

In this case, I found a very STUNNING passage in what I think is a very important essay of GKC. It's not the usual GKC - or perhaps I ought to say it is the essential GKC. It is mysterious, and yet fully natural, quite practical and gloriously theoretic... in the old Greek sense which derives from a root which means "to see"...

It is the sort of thing which underlies so much of his fiction - but also his non-fiction, and the sort of thing that one might expect to find used as a plot device... alas, it is too Catholic, or something... it will take a LOT of meditation to grasp this one. But I think I ought to let you read it, and ponder it for yourself...

Often when riding with three or four strangers on the top of an omnibus I have felt a wild impulse to throw the driver off his seat, to seize his whip, to drive the omnibus far out into the country, and tip them all out into a field, and say, "We may never meet again in this world; come, let us understand each other." I do not affirm that the experiment would succeed, but I think the impulse to do it is at the root of all the tradition of the poetry of wrecks and islands.
[GKC ILN Oct 24 1908 CW28:205]
Here is revealed the "man behind the curtain" - the backstage mechanisms, the "source code" (as we techs call it) which underlies GKC's Manalive and other works. For example:
The best way that a man could test his readiness to encounter the common variety of mankind would be to climb down a chimney into any house at random, and get on as well as possible with the people inside. And that is essentially what each one of us did on the day that he was born.
[GKC Heretics CW1:142]
Now, let us go and do likewise.... I do not mean (I beg you!) to go abusing bus drivers or airline pilots, or to go invade a random home in the style of Santa Claus - but by understanding this scheme, and THEN by synthesizing this device into new fiction. It suggests so many fertile fields for our work.

And speaking of work... see you later.

Tuesday, May 10, 2011

On errors, or on being wrong (a brief introduction)

Among the many fun things one can do when one reads is to find cool quotes that would make good slogans to hang in your lab or office or classroom. Like this famous one from a well-known physicist:
One of the severest tests of a scientific mind is to discern the limits of the legitimate application of scientific methods.
[James Clerk Maxwell, "Paradoxical Philosophy" (1878), in The Scientific Papers of James Clerk Maxwell, edited by W. D. Niven, II (Cambridge, 1890), p. 759. Quoted by S. L. Jaki in The Relevance of Physics and elsewhere]
It would spare us much nonsense, of many forms - but I am afraid people would not know who Maxwell was, or why he said that, or what he meant.

It's funny to think about science as having "limits" - but it is wrong to think there aren't any such things. Yes, WRONG - as in being in error. Perhaps it is because we don't like to think about being wrong... yet that links in to subjects like chivalry - or what we might call personal integrity and such matters.

There is no better test of a man's ultimate chivalry and integrity than how he behaves when he is wrong...
{GKC "The Real Dr. Johnson" in The Common Man 120-1]
Ahem...

Er...I am sorry. I was going to write more on this, but found I cannot take the time - so for now I will leave this brief introduction as a starting point. Eventually we must come back to this: it is a matter of pedagogy: of knowing how (and what) we must teach... and one thing we ought to teach is this idea of limits and boundaries - and of errors. It is a good thing to know how we've gone wrong, as it might help us to avoid the same mistake.

PS A friend of mine at grad school once said "it's hard to avoid making the same mistake once" - but actually it is possible. That's why we have education in the first place. We try to keep our students from making most of the mistakes of the past, and point out ways of recognizing such things. It's funny to think of the pathology of epistemology - which we might call the history of heresies - but then it is a useful device. Physicians learn to recognize diseases of the body - we ought to learn to recognize at least some of the diseases of thought:

"Well, that's all I can tell you about the new religion," went on Flambeau carelessly. "It claims, of course, that it can cure all physical diseases."
"Can it cure the one spiritual disease?" asked Father Brown, with a serious curiosity.
"And what is the one spiritual disease?" asked Flambeau, smiling.
"Oh, thinking one is quite well," said his friend.
[GKC "The Eye of Apollo" in The Innocence of Father Brown]
In brief:
Christianity spoke again: "... If you were a philosopher you would call it, as I do, the doctrine of original sin. You may call it the cosmic advance as much as you like; I call it what it is - the Fall."
[GKC Orthodoxy CW1:321]
More on this later.

Thursday, May 05, 2011

On a Priest and Boys' Books (and a prayer)

This morning I was in a place I was also in on this very day, 48 years ago.
While I was there I did the exact same thing... though on that day, there was but One Species, today there were Two... this was a profound moment, and deserves meditation - and while I can write many things here on this blogg, there are some things which would take more space than the world contains... and I don't mean as in world = earth, I mean the Greek sense, where world = cosmos.

Afterwards I spoke briefly to the priest, and he said how sad it is that people only think of the few (very few) bad priests, and not of the large number of good priests. He wondered why there are not many stories about good priests...

It is a challenge. Of course in my Saga I have some good priests and even a pair of good bishops. (I must not mention the Pope just now; you will learn why eventually. Oh will you be surprised!) Some of these face severe difficulties, of course, but I have no writing time to waste on bad priests.

Why, you ask?

The answer happens to belong to my own discipline, as well as to my own interests. It is also in Chesterton:
It is always simple to fall; there are an infinity of angles at which one falls, only one at which one stands.
[GKC Orthodoxy CW1:306]
It is far harder to write a computer program without errors than to write one that contains errors. It is far harder to paint a picture, or compose (or play) a musical work, that contains no blemish than to achieve one without blemish... The same is true for stories. It is easy enough to write a story, but a real story must possess certain attributes... it must share somehow in the One True Story...

Our great guide in writing, indeed in Catholic writing (which is also simultaneously catholic), that is G. K. Chesterton, pointed out this important and very dramatic link - a link which suggests something:
that other great essential of the schoolboy protagonist; which is accidental and even improbable presence on a tremendous historical occasion. All who love boys' books as they should be loved know that Harry Harkaway, as well as crossing cutlasses with an individual smuggler or slaver, must also manage to be present at the Battle of Trafalgar. The young musketeer from Gascony, however engrossed by duels with masked bravos or loveletters to Marguerite de Valois, must not forget to put in an appearance at the Massacre of St. Bartholomew.
[GKC "The True Romance" taken from Daily News 1911 and quoted in A Handful of Authors]
Huh? you ask. What link is there?

Obviously, the link is that one's hero ought to be present at a tremendous historical occasion.

Well? What historical occasion was more tremendous than the crucifixion on Calvary?

Is not the priest there, like the hero in the boys' book? Is he not in persona Christi, and hence on Calvary? Is he not at once the priest, the altar, and the Lamb of sacrifice? "Yes, my son, God will provide the lamb for the sacrifice..." Was it not this that Moses (the archpriest of the Israelites) discussed with Christ when he appeared with Elijah at the Transfiguration? (As to why Elijah was there, we shall consider that at length another time.)

So now we have our formula, direct from Chesterton, and properly founded upon scripture and tradition, as well as upon common sense. (The Church, we know, is wedded to common sense; see GKC on that too.) As in the cases of software, or music, or painting, it now only requires the time and resources to synthesize it, to bring it to its completion. But it takes that initial ignition... that spark of the creation which for us is subcreation.

Let, therefore, the Spirit come, and direct His chosen writer (whoever it may be; I am not clamoring for another assignment here!) and may He inflame that one to write a modern priestly adventure according to the great tradition... good stories about a good priest. Amen.

Prime Fun

Just a little thing for you today... a HUGE little thing.

Often when I am here doing my work - that is, my OTHER work, my writing on the Saga - I am distressed to see that my computer is sitting idle while I am busy.

I find this very disturbing. Why should it sit there and twiddle its digital thumbs (oy, what a redundancy!) while ***I*** am busy struggling to organize my thoughts? So I thought to myself, what little chore might I set it to working on while I am busy?

I debated this; there are too many things where I would mistrust my machine if left to its own devices. (hee hee) So I decided upon prime numbers. These are safe, lots of good healthy fun for a young speedy and carefree machine.... Very well, I said: I will have it find me some prime numbers. Big prime numbers. (The little ones I can find for myself.)

Alas. I wroght my code too well. It soon found all the primes up to its 32-bit limit - that is, the last "number" which it "knows" how to deal with easily: 4294967295. There are over 230 million such primes, and the largest is 4294967291. The smallest is 2, but I found that one all by myself. In fact I had to explain all that to it when I started, since it didn't understand me when I typed in "Find me some primes." Hee hee. What a stupid machine. Fast but stupid.

So now I have a nice little file, some 800 megabytes long, full of all of them. It is a wonder to behold. After that rather fun little project I let the computer relax while I debated the next project. Then I had it begin the exploration of the next bunch of numbers which it still knows how to handle, though not as readily: the 64-bit integers which go up to 18 followed by eighteen zeros. (That's larger than the largest known whale.) Now of course there is not enough disk space on the planet - such things remind me of that line at the end of St. John's gospel (Jn 21:25) ... hee hee - so I stopped that after a while.

Then I decided on another something: prime palindromes. That would be fun too! Let's see: 11, 101, 131, 151, 181... Wow. So I dashed off another little demand, that is, instructions for my computer to keep it busy and off the streets. And so, over the weekend, it finished examining all those primes with 15 places in base ten which are palindromes: that is, from

100 000 323 000 001
up to
999 999 787 999 999

In the meantime, I found out why there can only be one prime palindrome with an even number of places... but - uh - this blogg-box is too small to contain my proof. Hee hee hee. (How's that, Mr. Fermat?)

Yes. I could have it do the 17-place ones next, but I am not sure what I choose to assign it. There are so many fun questions... But whatever I select will be fun for me, and entirely safe for this little machine.

Unless (shh!) unless there are still some spies around.

You know as well as I do that old saying we herd back in grad school:

"SPIES LIKE BIG PRIME NUMBERS."

So perhaps I ought to encrypt this posting.

Nah. But you can if you want to. And if you need some large primes, I know where you can get some. Heh heh. (Hey buddy. Want a prime?)

Now, back to work.

Tuesday, May 03, 2011

Annoyed! or, time for some fun

Well, not quite. But once in a while I get tired of hearing yet another elementary lesson in computer programming which demonstrates recursion by the famous happy function, the factorial:

Given a non-negative integer x:
if x<2 then x!=1
else x*(x-1)!

So people write


int fact(int x)
{
if(x<2)return 1;
else return x*fact(x-1);
}


Of course, real programmers never write that. They have a healthy respect for recursion. Also, they know that one can give an explicit form of the recursive definition:

x! = PI i (as i varies from 1 up to x)

However, as I wrote some time ago on the old ACS blogg, we know that computers are not very good at mathematics, especially simple mathematics like addition or multiplication. Though as we know, they are exceedingly fast, if you do not expect too much of them! They are machines, not brains. But we must appreciate such things - our cars or our computers or even our food - as they are, not as what we wish they might be. Fantasy is only possible for realists.

And so, in order to help you stay grounded in the real world, and keep from taxing your machinery, I hereby provide you with all the factorials you will need, at least until some future generation of machines come out with larger integers. (Yes, I am well aware that one can write code to handle arbitrarily large numbers, but that's not relevant here.)

As much as I despise "C" (which I always felt was a grade), I use it often, and there are many dialects which have been degraded from it. So I present my offering to you in "C"...



/*
We assume BIGINTEGERTYPE is a sixty-four bit integer type.

This array contains all the factorials from 0! to 20!, which is the largest that can be stored in a 64-bit variable.

Also note that 12! = 479001600 is the last that fits in 32 bits.
*/

BIGINTEGERTYPE fact64[]=
{1,1,2,6,24,
120,720,5040,40320,
362880,3628800,39916800,479001600,
/* these are larger than 4294967295 which is 2-to-the-32 minus one...*/
6227020800,87178291200,1307674368000,
20922789888000,355687428096000,6402373705728000,
121645100408832000,2432902008176640000};


There you are! Have fun, and please don't hurt yourself playing with those huge numbers. Observe lab safety techniques, and be nice to your lab mates.

Yes, just in case you were wondering:
1. the biggest factorial that fits into a 32-bit integer is 12!
2. the biggest factorial that fits into a 64-bit integer is 20!

Some other fun things, especially if you have bothered to pay attention in other classes:

1. 220 is 1048576, just over a million. So, when you play Twenty Questions, you are able to "sort" among over million items (assuming certain binary properties, etc).

2. Since (264) is 18 446 744 073 709 551 616,
a handy way to remember an approximation is "three coulombs".
That is, since a coulomb is 6*1018, 264 is three times that, or 18*1018

3. 20! is a third of a coulomb, that is 2*1018.

4. 24! is just over a mole (that is 6*1023)

5. pi seconds is (approximately) a nano-century.

6. the ratio of
(inch to mile)
is approximately the same as
(astronomical unit to light-year)