||| And now for something completely different :
( Image : Courtesy of Weisstein, Eric W. , “Fibonacci Numbers” – From MathWorld - A Wolfram Web Resource )
![]()
in|ad|ae|qu|at happily accepted Olivier’s challenge from one of his comments on our blog and hired an external consultant/ghostwriter/expert on the topic of Wolframs “A New Kind of Science” . Incidently , the author of this contribution explored the world of Stephen Wolfram’s Theory just recently in the context of algorithmic music generation , as described on the excellent webpage “Wolfram Tones” and the theoretical background page “How Wolfram Tones Work” which – and there we are at the CENTER OF THE TOPIC – , nicely explains the basics of those patterns , and “Rule 30″ in particular . Although Olivier’s Challenge was solved by other contributors much faster , we still want to entertain you with our musings from a dark , cold sunday afternooon . |||
Stephen Wolfram discovered that very complex cell evolution patterns can be derived from rather simple mathematical equations . This can be nicely demonstrated if one accepts three important constraints :
- quantize time in discrete steps ( this gives abrupt transitions from one state of a cell to the next )
- a cell has only two possible states ( White/Black , or One/Zero , or Foo/Bar , or Apple/Orange )
- the next state is dependant on the present state of a cell and it’s immediate neighbours to the left and right in an imaginary horizontal “line” of cells . |||
Wolfram found evidence that “m to the mth to the nth power” of possible results sets exist in a given configuration , for only 2 states and a Sequence of only 3 cells this gives the realistic number 256 . Most of those results are regular , but ” RULE 110 ” and ” RULE 30 ” have become so popular that a special interest was aroused .
Olivier Schmidt-Chevalier was a teacher for the LOGO programming language in a “previous life” , so it was natural for him to ask interested readers for SOLUTIONS TO THE “RULE 30″- pattern in this programming language . |||
Therefore , in|ad|ae|qu|at’s consultant polished up some deeply burried knowledge about PROGRAMMING AND BOOLEAN ALEGBRA , downloaded the FSM LOGO Installer , grabbed a pack of blank paper and a sharp pencil , and started up . ( It is also noteworthy at this point that the programming language CHUCK is very useful for such experiments in the alogrithmic music domain . )
OK , WHAT HAVE WE GOT ? – We know the TRUTH TABLE for the behaviour of individual cells within RULE 30 : The digit in the middle is our target cell , left and right to it there are its neighbours , the combination of those three should give us a SPECIFIC RESULT after the CALCULATION :
000=>0 , 001=>1 , 010=>1 , 011=>1 , 100=>1 , 101=>0 , 110=>0 , 111=>0
The VERBAL DESCRIPTION of THIS LOGIC is :
The next middle cell takes the state of its left neighbour only if the cell itself and its right neighbour are both 0 , otherwise its takes the opposite value of its left neighbour . |||
![]()
NOW COMES THE TRICKY PART : Which BOOLEAN LOGIC can we use to COMBINE those three digits to give the result ? – You might still remember from high school that there are functions like AND , OR and XOR available .
To make it eazy , we NAME the three cells A , B and C , and SPLIT UP THE LOGIC TABLE in TWO parts , first combining B with C , and the result of this calculation is thrown on A . After some trial-and-error and by just staring at the truth tables for 30 minutes we found the SOLUTION :
( B OR C ) XOR A = D ( where D is the new cell ) |||
GREAT ! – HOW do we implement this in LOGO ? – HOW are the variables assigned , functions defined , loops nested … ? – We have never used LOGO before , so it was time for some research , which gave us the following SYNTAX ( sorry : the html format does not give proper TABs for indention and no , &bsp does not work in the Wordpress code editor ) :
to wolf30 :a :b :c
make “d1 bitor :b :c
make “d bitxor :a :d1
end
- The KEYWORD “to” starts the DEFINITION of a PROCEDURE which we named “wolf30″ .
- The VARIABLES a , b , c , have to be handed over to this procedure for it to actually work
- d1 is only used as a TEMPORARY storage for the result of the FIRTST TRUTH TABLE ( the OR between B and C ) ,
- D is the final result which we can use in our main loop . |||
![]()
NOW WE KNOW HOW TO CALCULATE the NEW STATE of a SINGLE cell , but we STILL NEED a LOOP to calculate one LINE of cells ( – we choose 50 cells as a good value – ) . And we need this loop nested in another loop which gives us 25 rows of actual output !
The tool of the trade was using ARRAYS as storage containers for the cell lines .
- We need an INPUT array for the variables A , B , C which we send to the procedure , and
- an OUTPUT array to store the results and actually display those .
Do not forget to write back the OUTPUT array to the INPUT array after the calculation , REMEMBER : This is all about self-growing , CIRCULAR , geeky-looking algorithmic BEHAVIOUR ! |||
FIRST , we create the procedure “result” where we define the two arrays and fill them with ZERO , THEN we seed one active cell to the algorithm by setting the middle cell of the input array to ONE . ( Please note we had to create arrays of 52 elements and shift all the calculations around by +1 and -1 , otherwise the leftmost and rightmost cells would not have two neighbours … )
to result
make “input (ARRAY 52)
make “output (ARRAY 52)
repeat 52 [setitem repcount :input 0]
repeat 52 [setitem repcount :output 0]
setitem 26 :input 1
show :input
end
GREAT , we can show off our FIRST ARRAY , the input , just one lonely ONE in all those ZEROs ( click for full size ) :
NOW we go for the INNER LOOP , which has to grab three adjacent cells , hand those over to the “wolf30″- PROCEDURE , and store the result value D in the cells of the output array . This loop has to RUN 50 TIMES .
“repcount” is a LOGO- built- in variable which carries the value of the very loop cycle we are in , we have to SHIFT this by +1 and -1 to get the vaules for the adjacent cells , N1 relating to left , N2 to middle , N3 to right . In the NEXT FOUR CODE- LINES we RETRIEVE the cell values from the input array and HAND them OVER to the “wolf30″ procedure via A , B and C :
repeat 50
[make "n repcount+1
make "n1 :n - 1
make "n2 :n
make "n3 :n + 1
make "a item :n1 :input
make "b item :n2 :input
make "c item :n3 :input
wolf30 :a :b :c
setitem :n :output :d
]
The NEXT and FINAL step is to EMBED this per-cell loop for one line INTO an OUTER LOOP which REPEATS this for 25 lines , shows us the RESULT after every calculation , as well as storing it back to the INPUT array for the next line :
repeat 25 [repeat 50 [ make....see above....]
show :output
repeat 52 [make "m item repcount :output
setitem repcount :input :m]
]
NOW we TYPE IN the MAGIC word “RESULT” to start the procedure , and – VOILÀ – we have SOLVED THE CHALLENGE ( click ) :
For your pleasure , HERE is the COMPLETE CODE right out of the FMSLogo Editor Window .
We humbly apologize that it is not the most elegant and optimized code on earth , but we are quite happy that we produced SOME WORKING CODE AT ALL :
||| If you ARE STILL WITH US , THANK you for reading .
This ENDS our little adventure into the worlds of LOGO , Stephen and Olivier for tonight .
PLEASE drive home safely and do not hesitate to ask Olivier some deep questions about LOGO … |||
Nach diesem HARD CORE wird es höchte Zeit für LETZTE LOCK ( er ) UNGEN : czz meldet sich wieder zu Wort und fordert Sie hiermit höflich auf , sich von Ihren KONSOLEN zu erheben , das Fenster zu öffnen und nach durchknobelter Nacht die frische Brise des Frühmorgens in Ihre erschöpften
Bronchien strömen zu lassen .
Dazu OHREN AUF für musikalischen RELIEF . Aus Bogotà strömen die sachten Klangsachen des Keyborders / Producers Fredy Alvarez ( aka Smetenan aka FUNGITONIC & THE LOBERS auf uns her : Und für einmal ist das Schlagwort ALZHEIMER zu begrüssen . Für EIN MAL , für DIESES Mal . Denn die das scheibar Zart- Versponnene dieser Sounds trügt in zweierlei Weise : Zunächst ist im Verlauf der so zuckersüss Glasharmonisch anhebenden Suite eine allmähliche Aufrauhung zu bemerken . Da schabt und kratzt und rempelt es nicht eben wenig unter dem glatten Firnis der Oberfläche . Zum Andern besitzen Sounddesign und psychoakustische “HARMONIE”- Wirkungen eine – vom Titel indizierte – geradezu unheimliche Schattenseite . Der Eindruck des eigenartig Gedämpften , Wattierten mag durchaus auf jene ABSENT- MINDEDNESS verweisen , wie sie ein korrodierende Gedächtnis hervorbringt . Oder die Einwirkung starker Sedativa . – NICHTS DA also mit Romantik und einsamen Spaziergängen im Nebel : Was das kolumbianische Label SERIES in seiner CREATIVE- COMMONS- NET- ABTEILUNG ( SERIES N – Release 023 ) serviert , mag zwar freundlich klingen , wäre allerdings MITNICHTEN der geeignete MUZAK für Wellness- Tempel oder Artpraxenwartezimmer . THIS IS PSYCHO , pure and simple . Hören Sie zu , atmen Sie die Brise , und begrüssen sie eine weitere , vom Nahgedächtnis ZU VERSCHLINGENDE Woche . CLICK TRACKS TO LISTEN . 01. Sin toldo | 02. 5/4 | 03. Funcional ( reversión ) | 04. Mina Silvia | 05. Ser eso | 06. Despertar ( feat. Lupito ) | 07. Paisaje oriundo |||










How do you said that in French : oh la la ! ;) :)
Wonderfull ! I did not know this version of langage Logo (FMS).
Epoustouflant ! Bravo !!!
Anyway, now you are the third (because “calendar) solution linked in this “Challenge” ! And you’ll find it by looking the link on my name up there ;)
Désolé, j’oubliais … Comment tu dis ça en autrichien : oh la la ! ?
Formidable ! Je ne connaissais pas la version de FSM du langage Logo.
Maintenant, tu es – dans le temps – la 3ème solution liée dans cette page “Sous les pavés, la plage” ! Tu peux suivre le chemin à partir du lien sur ma signature de ce commentaire :)
Man weiss wirklich kaum mehr , wo dieser virtuelle Oliver sicher gerade befindet – on ne sait vraiment pas , où il se trouve , cet Olivier virtuel – nobody knows where to search and to find this Virtual Presence :
sometimes he’s HERE ,
sometimes he’s THERE
and sometimes he’s EVERYWHERE :
it really takes some logical skills to follow -
by the way : the brilliant feat of RULE 30- solution was done by kap.
“Küss’ die Hand” as they would say in France .