Group Abstract Group Abstract

Message Boards Message Boards

[JAM] CellularAutomaton Code Jam Wolfram Summer School 2015

Posted 11 years ago
POSTED BY: Vitaliy Kaurov
46 Replies
POSTED BY: EDITORIAL BOARD
Posted 10 years ago
Attachments:
POSTED BY: Richard Gaylord
POSTED BY: Udo Krause
POSTED BY: Todd Rowland
Posted 10 years ago

it bothers me a great deal that stephen uses terms like "simple program" without defining what simple means. its similar to his statement of the Principle of Computational Equivalence which states "Almost all processes that are not obviously simple can be viewed as computations of equivalent sophistication". i have no idea what it means to say computations have "sophistication". Wiki defines the word as follows "Sophistication is the quality of refinement — displaying good taste, wisdom and subtlety rather than crudeness, stupidity and vulgarity." (i told my wife that based on this definition, i'm sophisticated and she replied... well, i'm not sure what she replied becuase she was laughing too much for me to understand what she said). many people have said that they don't understand what PCE means but no one, to my knowledge, has questioned what it means for a computation to be sophisticated? i am quite familiar with theoretical physics models being elegant (which i use to describe a model in contrast to it being a kludge) but not with them being sophisticated. is the use of terms like 'simple' and 'sophisticated' like the characterization of pornography by Supreme Court Justice Potter Stewart who famously said: “I know it when I see it” (don't misunderstand me. i do NOT intend to compare PCE or NKS to pornography - except that both are based on imagery. i think stephen uses NKS rather than NS to emphasize it's use of visualization rather than equations). I raise these questions becuase i have spent a lot of time (much too much of my time) discussing both WL and NKS with other theoretical physicists and it's hard to do when i don't understand the descriptions as given by stephen himself.

POSTED BY: Richard Gaylord

Todds answer was so clear and professional, nevertheless you dig in again

it bothers me a great deal that stephen uses terms like "simple program" without defining what simple means.


Question: Is the following a simple program?

In[17[:= N[I^I, 18]
Out[17]= 0.207879576350761909 + 0.*10^-19 I

with $Mathematica$, yes. Otherwise you have some trouble relying on Leonhard Eulers clarification what the logarithm is. If I understand Stephen Wolfram a little bit he follows the idea of Richard P Feynman, that quantum electrodynamics is in a way far to complicated (or elaborated (or elegant)) because a photon or electron do for sure not do such calculations during scattering: Feynman proposed to search for another way to understand that unbelievable efficiency, correctness and parallelism that particles show. Feynman was also one of the first to discuss physics and computation. And Mr Wolfram pushed simple programs as a candidate.


If you look into the garden you see effortless growing plants, Erwin Schrödinger asked about cleavage, Albert Einstein detected that there is no such thing as central time, but instead of that something propagates, evolves, steps, does the right thing to keep things running ... that step is hoped to be simple, because every entity does it, only we do not see: what and how.

POSTED BY: Udo Krause
Posted 10 years ago

i take umbrage at you first sentence which seems to be a personal attack.. of course todd's response is professional - did i say otherwise? and his explanation is quite clear. he says "what is meant by "simple" is elusive and cannot be meaningfully defined in a rigorous way, so it is a matter of opinion.". as for your example, i don't consider it to be a simple program (or even a program) . but then, that's my opinion.

POSTED BY: Richard Gaylord
POSTED BY: Udo Krause
Posted 10 years ago
POSTED BY: Richard Gaylord
Posted 10 years ago
Attachments:
POSTED BY: Richard Gaylord
POSTED BY: Udo Krause

Just for the logs

ArrayPlot[
 CellularAutomaton[{Count[Last[Last[TuringMachine[2361, {1, Mod[#1, 2]}, #2]]], 1] &, {}, 
   1}, {{1}, 0}, 100]]

turing1

Similar

ArrayPlot[
 CellularAutomaton[{Count[Last[Last[TuringMachine[2361, {1, Mod[#1, 2]}, #2]]], 1] &, {}, 
   1}, RandomInteger[{0, 1}, 100], 20]]

enter image description here

Loosing black

ArrayPlot[
 CellularAutomaton[{Count[Last[Last[TuringMachine[401, {1, Mod[#1, 2]}, #2]]], 1] &, {}, 
   1}, RandomInteger[{0, 1}, 100], 100]]

enter image description here

a year of birth

ArrayPlot[
 CellularAutomaton[{Count[
     Last[Last[
       TuringMachine[1959 (* more interesting than 2015 *), {1, Mod[#1, 2]}, #2]]], 
     1] &, {}, 1}, RandomInteger[{0, 1}, 100], 100]]

turing4

the last one for tonight

ArrayPlot[
 CellularAutomaton[{Count[Last[Last[TuringMachine[2016, {1, Mod[#1, 2]}, #2]]], 1] &, {}, 
   1}, {{1}, 0}, 100]]

turing5


Could possibly also insert a CellularAutomaton into a CellularAutomaton or let a TuringMachine decide which CellularAutomaton to insert ... but, will that be cool looking?

POSTED BY: Udo Krause
POSTED BY: Udo Krause

This does not use Total

ArrayPlot[CellularAutomaton[{Fold[BesselJ, #] &, {}, 1}, {{1.}, 0}, 100]]

but looks conventional

foldBessel

This turns back to the Total

ArrayPlot[CellularAutomaton[{Total[
     CoefficientList[Cyclotomic[Total[#], x], x]] &, {}, 1}, {{1}, 0},
   200], ColorFunction -> Hue]

but has not found a convincing color function (yet)

cyclotomicCA

because a ListPlot3D of it shows peaks around 2400

cyclotomicCA3D

POSTED BY: Udo Krause

Nice. One thing apparent from the first picture is that it fades out on the top left diagonal. I like how you found the singularity-like behavior. Encouraging for the digital physics people who try to find CAs for the universe.

POSTED BY: Todd Rowland

I like how you found the singularity-like behavior.

This one fades out more impressive.

ArrayPlot[CellularAutomaton[{Fold[BesselJ, #] &, {}, 1}, {{1.}, 1./(\[Pi] E)}, 100]]

A background 0 is too dry and this observation was shadowing in here by the Planck ground state idea (as an element of a functional space with eigenvalue != 0 ( $\frac{1}{2} \hbar \omega$ in a relevant case)); so one feels oneself seeing $\frac{1}{\pi e}$ as an eigenvalue of a not formulated quantum problem .... oh oh oh, today is Sunday ...

BesselBackground

By the way, Todd, did somebody at the Summer School jam into quantum cellular automata?

POSTED BY: Udo Krause

Not in this codejam. Everything from that is here in this discussion.

Funny you should mention "quantum" because this year we had several people doing related projects. ne person simulated a D-Wave device and another was researching the type of CA with quantum mechanics described by t'Hooft.

POSTED BY: Todd Rowland

These are all really great. Everyone can keep posting.

I enjoy the expressions like

f[{x_, y_}] := Table[x, {Max[y]}]
Grid[CellularAutomaton[{f[#] &, {}, 1/2}, Range[4], 3]]

which gives

enter image description here

POSTED BY: Todd Rowland

Slicing the evolution of 2D Totallistic 3-Color Rule 344373765 across the y-axis and animating the slices resembles a Kraken rising from the sea.

enter image description here

POSTED BY: Sibesh Kar

You can upload GIFs - I fixed it for you. Very nice. But the point of this Code Jam is to use not integer rule specification --- we are using functions as rules --- see some code above. Some folks also misunderstood this and there area a few posts with integer rule specification. It is OK - they all look great. But it would be nice to find some cool looking CAs with functions as rules. You should also post code not only the output.

POSTED BY: Vitaliy Kaurov
Posted 11 years ago
POSTED BY: Jesse Dohmann
Posted 11 years ago

Here are a few I looked at.

ArrayPlot[CellularAutomaton[{Mod[Total[#]^2, 10] &, {}, 1}, {{1}, 0}, 100]]

enter image description here

ArrayPlot@
 CellularAutomaton[{Mod[Total[#] + RandomInteger[{0, 1}],4] /. {0 -> 0, 1 -> 0, 2 -> 1, 3 -> 1} &, {}, 1}, 
                   {{1, 1, 1}, 0}, 200]

enter image description here

ArrayPlot@
 CellularAutomaton[{Sqrt@StandardDeviation[#] &, {}, 1}, {{1.}, 0}, 200]

enter image description here

ImageAdjust@Image[
 CellularAutomaton[{Mod[Tr[#] + Tr[Reverse[#]], 7] &, {},
                   {1, 1}}, {{{1}}, 0}, {{{20}}}]]

enter image description here

POSTED BY: K. James
POSTED BY: Todd Rowland
Posted 10 years ago

because a program using CellularAutomaton runs extremely fast, i'd like to follow up on the use of CellularAutomaton for rules that are anonymous functions. i have tried the 1D forest fire CA using a rule involving pattern matching and i get error messages that i can't even understand. i realze that pattern matching is not especially fast (http://blog.wolfram.com/2011/12/07/10-tips-for-writing-fast-mathematica-code/) but being able to use pattern-matching based update rules (inclusing those that involve , __ and __) within CellularAutomaton would allow us to use it with a great many CA models. what are the restrictions and limitations on using these sorts of rules in CellularAutomaton?

POSTED BY: Richard Gaylord

i have tried the 1D forest fire CA using a rule involving pattern matching and i get error messages that i can't even understand.

Where is your code?

POSTED BY: Udo Krause
Posted 10 years ago

Here it is:

pyro =
          (treeGrowIgnite = #/. {0 :> Floor[1 + p - Random[]], 1 :> Floor[2 + f - Random[]]};
           forestIgnite = TreeGrowIgnite //. 
                                  {{2, c___, 1} -> {2, c, 2},
                                   {1, c___, 2} -> {2, c, 2},
                                   {a___, 2, 1, b___} -> {a, 2, 2, b},
                                   {a___, 1, 2, b___} -> {a, 2, 2, b}};
             forestNew = forestIgnite /. 2 -> 0)&

the first 2 pattern matching replacement rules are apparently not needed becuase they represent wrap around b.c. which are used by default in CellularAutomaton.

note: sorry that this code appears so badly. i write it in one way but in the preview window, what i write is changed into something which is unreadable and sometimes terms are even dropped or changed. i don't know why.

POSTED BY: Richard Gaylord
POSTED BY: Udo Krause
Posted 10 years ago
Attachments:
POSTED BY: Richard Gaylord
Posted 10 years ago
POSTED BY: Richard Gaylord
Posted 11 years ago
ArrayPlot[CellularAutomaton[{Sin[Total[N@#]] &, {}, 1}, {{1}, 0}, 50],
  ColorFunction -> "Rainbow"]

<code>enter image description here

POSTED BY: Tingting Huang

Compare this to the version where the total is renormalized so the argument to Sin ranges from 0 to 2Pi

ArrayPlot[
 CellularAutomaton[{Sin[Total[N@#] 2 Pi/3] &, {}, 1}, {{1}, 0}, 250]]

That gives something random looking whereas renormalizing to make it range from 0 to Pi instead gives similar behavior. I wonder what the uniform regions are like.

POSTED BY: Todd Rowland
Posted 11 years ago
ArrayPlot[
 CellularAutomaton[{Mod[
     Total[FactorInteger[FromDigits[#, 3]][[All, 1]]], 4] &, {}, 
   1}, {{4}, 1}, 400], ColorRules -> {1 -> White}, ImageSize -> Full]

enter image description here

POSTED BY: Victor Phan

Very cool. Reminds me of shifted 225 combined with ordinary rule 225 (see e.g. p.58 ).

POSTED BY: Todd Rowland
NearestNeighborGraph[
 Position[CellularAutomaton[{604419492, {3, 1}, {1, 1}}, {{{1}}, 
    0}, {10, All, All}], 1]]

enter image description here

POSTED BY: Wenzhen Zhu
POSTED BY: Wenzhen Zhu

This one starts off as nested and then becomes complex, after step 25 it is all complex. Not sure if it has localized structures or not.

POSTED BY: Todd Rowland

Simple function involving the sum of two cosines whose frequencies ratio is the golden ratio.

g[x_] := Abs[Cos[x] + Cos[N[GoldenRatio] x]];
ArrayPlot[CellularAutomaton[{g[Total[#]] &, {}, 1}, {{1}, 0}, 200],ColorFunction -> GrayLevel]

enter image description here

POSTED BY: Carlo Giacometti
POSTED BY: Vitaliy Kaurov

If anyone wants more quasiperiodic awesomeness, here's a superposition of five cosines whose wave vectors form a pentagon (this gives a ten fold symmetry, but if you take any direction you will find no repeating pattern):

PlaneWave[x_List, k_List] := Cos[k.x];
c1 = 1/4*(Sqrt[5] - 1);
c2 = 1/4*(Sqrt[5] + 1);
s1 = 1/4*(Sqrt[10 + 2*Sqrt[5]]);
s2 = 1/4*(Sqrt[10 - 2*Sqrt[5]]);
kvectors = {{0, 1}, {s1, c1}, {s2, -c2}, {-s2, -c2}, {-s1, c1}};
DensityPlot[
 Abs[Total@Map[PlaneWave[{x, y}, #] &, kvectors]], {x, -40, 40}, {y, -40, 40}, 
ColorFunction -> GrayLevel, PlotPoints -> 50]

enter image description here

POSTED BY: Carlo Giacometti
POSTED BY: Vitaliy Kaurov

By the way the author of the video above, Richard Hennigan, also made a Demonstration: Quasicrystals

enter image description here

POSTED BY: Vitaliy Kaurov

These numerical rules are interesting because they depend on the precision. It appears that the general effect is valid, of having a detailed inner structure. However the exact details are difficult to compute numerically.

Compare with increased precision

g2[x_] := Abs[Cos[x] + Cos[SetPrecision[GoldenRatio, 100]* x]];
ArrayPlot[CellularAutomaton[{g[Total[#]] &, {}, 1}, {{1}, 0}, 200], 
 ColorFunction -> GrayLevel]

enter image description here

POSTED BY: Todd Rowland
POSTED BY: Ashkan Akbariyeh

If you take a very slowly growing continuous value CA but look very far in its future evolution you can find something interesting

ArrayPlot[
 CellularAutomaton[{Mod[Total[#]/2.96, 1] &, {}, 1}, {{1}, 0}, 
{{1000, 1300}, {-90, 90}}], PixelConstrained -> 2]

enter image description here

POSTED BY: Vitaliy Kaurov
POSTED BY: Todd Rowland
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard