Archive for Game of Life

The strange case of Zhong Guo in Conway’s Game of Life

Posted in Uncategorized with tags , , , on August 1, 2009 by spinoza1111

Zhong Guo

When at Princeton, I met, in addition to John Nash, the UK mathematician John Horton Conway, who’d been lured from Cambridge University to New Jersey: they made him an offer he could not refuse. Conway, who resembled a mad Russian monk, was rooting about the magazines in the local WaWa, a 7-11 convenience store.

I greeted him, saying I’d read of his Game of Life in a 1970 Scientific American and had programmed it on my university’s mainframe. He was delighted to hear of its fame, of course. But in these Meetings With Remarkable Men, I do not speak of their mathematics: like Wayne and Garth when they meet Alice Cooper, non sum dignus.

The game of Life generates truly and provably unpredictable patterns using a few simple rules (http://en.wikipedia.org/wiki/Conway’s_Game_of_Life) that can be simulated with patience and graph paper, or on a computer. For any friends in China who are barred from Wikipedia, the game board consists of cells that are either live or dead. If a cell has less than two or more than three neighbors tangent to it (including the four neighbors touching its corners, eight in all) it dies of loneliness or overcrowding. If a dead or if you prefer, unborn, cell has precisely three neighbors it is born, which gives a whole new meaning to “menage a trois”.

The rules are special in that it’s provable (see Stephen Wolfram, A New Kind of Science) that there is no way of predicting the way a starter pattern will evolve, whether it will grow, die out, cycle over a certain number of patterns and so on, without evaluating the rules. This is deep, because the Game shares with the Turing machine the property that it’s “halting problem” is unteintscheidbar, unsolvable, or in Scots, uncanny.

In this example, a digitisation of the Chinese characters for the Middle Kingdom, Zhong Guo, becomes the pattern shown IN JUST ONE STEP: in just one step, we get The Curse of the Golden Flower and The Dragon Palace, that is, images that look Chinese. Which may, or may not, mean that writing wires our brains in a deep way, and that Chinese art is neurologically related to Chinese writing.

It might be said that a minute alteration, such as would naturally occur in Chinese calligraphy or everyday writing, would produce completely different images, and for this reason, the Golden Flower and the Dragon Palace are fool’s gold, mirages and Ignuus Fatii.

But this is not the case. A symettrical figure like Zhong drawn perfectly always produces “pleasing” symettrical patterns. A slightly off-center figure such as Guo produces figures that only slowly depart from symettry to randomness.

If the lines in the Zhong are thicker than one pseudo-pixel, say an even number, they disappear because pixel n, not at the end, has five neighbors. But in death is there transfiguration, for each triplet has a child. The character stays itself but is hollowed out.

When my students write Chinese characters they sometimes feel their bones, for the practical reason that they are learned in the hand: it’s impossible to copy them, apparently, using sight alone. They summon up ancestors.

Writing is deeper than speech. Speech is the gibbering ape but writing is what we do when silenced and in prison.

Straight lines are doomed but fecund in Life.

If the line is of width 1, each pixel must die of loneliness: if the line is of width n>1 both the edge and interior pixels are doomed to die of overcrowding.

But each straight line produces (all surrounding pixels being clear) a hollow line of length L-2.

Furthermore, if the line is of thickness > 2 it produces a seal at either end. This seal is joined by cells filling the interior.

The ability of straight lines to produce curves astonished the early experimenters with Life.

This was simultaneous with the more well-known discovery of fractals by an IBM researcher who found a class of functions that likewise refuse entropy.

If a physical analogue is discovered (molecules obeying Conway) then this could be something for nothing, perhaps a source of free energy.

A new Microsoft .Net tool for executing source code at run time

Posted in Uncategorized with tags , , , , , , , , on April 12, 2009 by spinoza1111

screen1

In developing a “laboratory” for messing around with Conway’s Game of Life and other cellular automata (as described elsewhere in this blog), I need to compile rules specified or changed by the user into .Net object code for reasonable efficiency. This involves using “reflection”: access to code as an object in an OO language.

In industry, one is expected to be silent about these distinct and well-defined needs, and quietly hack or copy some clown’s code, and deal with the inchoate results and the self-hatred that comes from doing a bad job. I wake up every morning singing loud Hosannahs that I am no longer in industry for this reason (I am a teacher of English after thirty years in a software industry which produced the credit crisis owing to its deliberate lack of craft and embedded anti-intellectualism).

I therefore have spent some time developing a distinct object for this purpose, codeDoer, the doer of code.

Microsoft .Net supports “reflection” in the form of access to compilers at run time: but actually using it messes up your code.

A “fully interpretive” language such as Rexx, used on IBM mainframes, is fully interpretive because “code” is a thing accessible to code. In Rexx, “code” is a Rexx string, and strings are part of Rexx’s fundamental ontology: everything is a string.

However, in many languages, vendors have long been reluctant to give the programmer access to reflection, since full reflection allows the programmer to essentially steal the vendor’s thunder by providing compilers to third parties.

In my book, “Build Your Own .Net Language and Compiler” (Apress, May 2004), I discuss how to implement a non-object-oriented reflection (in the sense of executing source code represented in strings at run time) in the interpreter.

But in .Net, accessing Reflection out of the box seemed to me to involve a lot of time-consuming and difficult to maintain clap trap, generating code using pathological practices (such as Invoke() in place of simple calls when Invoke() is not needed).

I just wanted to be able to code

CodeDoer objCodeDoer = new CodeDoer(“1 + 1″);
objCodeDoer.compile();
MessageBox.Show(objCodeDoer.run());

where a pre-edit would check the code for one of two forms:

* Expression: no terminating semicolon, no return
* Code: terminating semicolon and/or a final return

so I did.

The compiled object code is available for continual reuse after the first compile.

The codeDoer class executes simple or fancy code and returns its value, having whatever side effects are planned for in the code. Here’s a screen shot of it executing a recursive N Factorial program, which accesses a params array of objects to get the value of N: because C Sharp is strict with conversions, the code includes a characterwise conversion of an object to a string to a Long integer.

screen2

The codeDoerTester form and class tests the codeDoer class, allowing you to try C Sharp expressions and statements out.

The class uses a methodology for reliable and maintainable object oriented design which I discuss in “Build Your Own .Net Language and Compiler”, including self-inspection and the use of XML to dump its state. It also “cooks” C Sharp expressions (adding return and semicolon) and then as needed “bakes” them (adding namespace, class and method wrappers) prior to compiling them using a provider.

I believe Open Source to be a form of virtualized slavery, in which the code worker is enslaved by the theft of his intellectual property by men like Jimmy Wales…who get rich based on free labor. Therefore it is against my religion to give this code away. I ain’t gonna be altruistic to rich people, which creeps like Wales expect.

Instead, if you’re interested in it, contact me at spinoza1111@yahoo.COM to discuss a deal for the DLL and/or the source code. I’m not free but I am cheap. Hell, if you need the code for charity and social work, I’ll probably give you the whole kit and kaboodle for free after all.

The Prime Number “Happy Face”: not a discovery

Posted in Uncategorized with tags , , , , , , , , , on March 15, 2009 by spinoza1111

corrected

An earlier post made reference to a display that was produced erroneously, which contained a “happy face” that was an artifact, not only of the aspect ratio but also of the bug; the orignal post cautioned the reader that the “happy face” meant nothing compared to the truth and beauty of the primes. This is the corrected visual map of the primes from 3 to 11483. A later blog post will describe further discoveries and the availability of this software.