0

I am wondering if there is an easy way to draw Wolfram's elementary cellular automaton (and some steps of its evolution) in LaTeX, for example, rule 30 as can be seen here:

http://mathworld.wolfram.com/CellularAutomaton.html

Of course one could try to draw it with TikZ but that would be rather complicated.

How can I draw the rule itself, i.e. enter image description here

2

A possible solution with TikZ matrices

enter image description here

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{matrix, positioning}

\begin{document}
\begin{tikzpicture}[b/.style={draw, minimum size=3mm,   
       fill=black},w/.style={draw, minimum size=3mm},
       m/.style={matrix of nodes, column sep=1pt, row sep=1pt, draw, label=below:#1}, node distance=1pt]

\matrix (A) [m=0]{
|[b]|&|[b]|&|[b]|\\
&|[w]|\\
};
\matrix (B) [m=0, right=of A]{
|[b]|&|[b]|&|[w]|\\
&|[w]|\\
};
\matrix (C) [m=0, right=of B]{
|[b]|&|[w]|&|[b]|\\
&|[w]|\\
};
\matrix (D) [m=1, right=of C]{
|[b]|&|[w]|&|[w]|\\
&|[b]|\\
};
\matrix (E) [m=1, right=of D]{
|[w]|&|[b]|&|[b]|\\
&|[b]|\\
};
\matrix (F) [m=1, right=of E]{
|[w]|&|[b]|&|[w]|\\
&|[b]|\\
};
\matrix (G) [m=1, right=of F]{
|[w]|&|[w]|&|[b]|\\
&|[b]|\\
};
\matrix (H) [m=0, right=of G]{
|[w]|&|[w]|&|[w]|\\
&|[w]|\\
};

\end{tikzpicture}
\end{document}
0

An alternative solution:

\usepackage{amsmath}

\[ \LARGE
\substack{\blacksquare \blacksquare \blacksquare \\ \square} \enspace
\substack{\blacksquare \blacksquare \square \\ \square} \enspace
\substack{\blacksquare \square \blacksquare \\ \square} \enspace
\substack{\blacksquare \square \square \\ \blacksquare} \enspace
\substack{\square \blacksquare \blacksquare \\ \blacksquare} \enspace
\substack{\square \blacksquare \square \\ \blacksquare} \enspace
\substack{\square \square \blacksquare \\ \blacksquare} \enspace
\substack{\square \square \square \\ \square}
\]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.