\documentclass[12pt]{article}
\usepackage{fancyhdr,fancybox,amssymb,epsfig,amsmath,latexsym,bm}
\usepackage{enumerate}
\usepackage{tikz}
\usepackage[all]{xy}
\usepackage{stackrel}
\usepackage[]{hyperref}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.markings}

\tikzset{big arrow/.style={decoration={markings,mark=at position 0.6
      with {\arrow[scale=2]{>}}}, postaction={decorate}, shorten >=1pt}}

% Code to make an augmented matrix (Usage: \begin{bmatrix}[ccc|c])
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
  \hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{#1}}
\makeatother

\topmargin=-.5in
\headsep=0.2in
\oddsidemargin=0in
\textwidth=6.7in
\textheight=9.2in
\footskip=.5in

% Change this line to \def\bold{\mathbf} for ``upright boldface.''
\def\bold{\bm}

\newcommand{\F}{\mathbb{F}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\def\0{\bold{0}}
\def\A{\bold{A}}
\def\B{\bold{B}}
\def\C{\bold{C}}
\def\I{\bold{I}}
\def\M{\bold{M}}
\def\P{\bold{P}}
\def\Q{\bold{Q}}
\def\a{\bold{a}}
\def\b{\bold{b}}
\def\c{\bold{c}}
\def\e{\bold{e}}
\def\p{\bold{p}}
\def\q{\bold{q}}
\def\t{\bold{t}}
\def\u{\bold{u}}
\def\v{\bold{v}}
\def\x{\bold{x}}
\def\<{\langle}
\def\>{\rangle}
\def\hat{\widehat}

\DeclareMathOperator{\Span}{Span}
\DeclareMathOperator{\rank}{rank}
\newcommand{\vv}[2]{\begin{bmatrix} #1 \\ #2 \end{bmatrix}}
\newcommand{\vvv}[3]{\begin{bmatrix} #1 \\ #2 \\ #3 \end{bmatrix}}

\newcommand{\ds}{\displaystyle}

\renewcommand{\footrulewidth}{1pt}
\newenvironment{proof}[1][Proof.]{\smallskip\begin{trivlist}
    \item[\hskip \labelsep {\sffamily #1}]}{\qed\end{trivlist}\bigskip}
\newenvironment{sol}[1][Solution.]{\smallskip\begin{trivlist}
    \item[\hskip \labelsep {\sffamily #1}]}{\qed\end{trivlist}\bigskip}
\newenvironment{fminipage}
{\setlength{\fboxsep}{15pt}\begin{Sbox}\begin{minipage}}
{\end{minipage}\end{Sbox}\fbox{\TheSbox}}
\newcommand{\qed}{\hfill \ensuremath{\Box}}
\newcommand{\disp}{\displaystyle}


\pagestyle{fancy} \lhead{{\sf Homework 6 $|$ Due September 21 (Wednesday)
}} \rhead{\thepage} \cfoot{{\sf Math 4500 $|$ Mathematical Modeling
    $|$ Fall 2016 $|$ M.~Macauley}}


\begin{document}

%$\;$

\noindent \emph{Read}:
\begin{itemize}
\item Chapter 4.1: Global dynamics emerging from local interactions:
  agent-based modeling for the life sciences. By D.~Gammack,
  Elsa.~Schaefer, and H.~Gaff, pages 105--113.
\item Chapter 5.1--5.4: Agent-based models and optimal control in
  biology: a discrete approach. By R.~Laubenbacher, F.~Hinkelmann, and
  M.~Oremland, pages 143--152. \smallskip
\end{itemize}


\begin{enumerate}

\item Download \emph{Cellular Automaton Explorer} from David Bahr's
  homepage. Under the ``Rule'' tab, select ``Wolfram 1-d
  rules''. Under the ``Lattice and Properties'' tab, configure the
  settings to have 150 rows and columns. Now, do the following for
  ECA Rules 54, 73, 137, and one more ``interesting'' rule of your choice.
  \begin{enumerate}
    \item Explore the dynamics of the elementary cellular automaton
      (ECA) rule using both a single black square as a starting state,
      and using a random state. Print a screenshot of your findings.
    \item Which of the four Wolfram classes do you think this rule
      belongs to, and why?
  \end{enumerate}



  \item Consider the ECA rule defined by the following \emph{truth
    table}:
    \[
    \begin{tikzpicture}[scale=.5]
      \begin{scope}[shift={(0,0)}]
        \draw [fill=black] (.07,.07) rectangle (.93,.93); 
        \draw [fill=black] (1.07,.07) rectangle (1.93,.93); 
        \draw [fill=black] (2.07,.07) rectangle (2.93,.93); 
        \draw (1.07,-.07) rectangle (1.93,-.93); 
      \end{scope}
      \begin{scope}[shift={(4,0)}]
        \draw [fill=black] (.07,.07) rectangle (.93,.93); 
        \draw [fill=black] (1.07,.07) rectangle (1.93,.93); 
        \draw (2.07,.07) rectangle (2.93,.93); 
        \draw [fill=black] (1.07,-.07) rectangle (1.93,-.93); 
      \end{scope}
      \begin{scope}[shift={(8,0)}]
        \draw [fill=black] (.07,.07) rectangle (.93,.93); 
        \draw (1.07,.07) rectangle (1.93,.93); 
        \draw [fill=black] (2.07,.07) rectangle (2.93,.93); 
        \draw [fill=black] (1.07,-.07) rectangle (1.93,-.93); 
      \end{scope}
      \begin{scope}[shift={(12,0)}]
        \draw [fill=black] (.07,.07) rectangle (.93,.93); 
        \draw (1.07,.07) rectangle (1.93,.93); 
        \draw (2.07,.07) rectangle (2.93,.93); 
        \draw [fill=black] (1.07,-.07) rectangle (1.93,-.93); 
      \end{scope}
      \begin{scope}[shift={(16,0)}]
        \draw (.07,.07) rectangle (.93,.93); 
        \draw [fill=black] (1.07,.07) rectangle (1.93,.93); 
        \draw [fill=black] (2.07,.07) rectangle (2.93,.93); 
        \draw [fill=black] (1.07,-.07) rectangle (1.93,-.93); 
      \end{scope}
      \begin{scope}[shift={(20,0)}]
        \draw (.07,.07) rectangle (.93,.93); 
        \draw [fill=black] (1.07,.07) rectangle (1.93,.93); 
        \draw (2.07,.07) rectangle (2.93,.93); 
        \draw [fill=black] (1.07,-.07) rectangle (1.93,-.93); 
      \end{scope}
      \begin{scope}[shift={(24,0)}]
        \draw (.07,.07) rectangle (.93,.93); 
        \draw (1.07,.07) rectangle (1.93,.93); 
        \draw [fill=black] (2.07,.07) rectangle (2.93,.93); 
        \draw [fill=black] (1.07,-.07) rectangle (1.93,-.93); 
      \end{scope}
      \begin{scope}[shift={(28,0)}]
        \draw (.07,.07) rectangle (.93,.93); 
        \draw (1.07,.07) rectangle (1.93,.93); 
        \draw (2.07,.07) rectangle (2.93,.93); 
        \draw [fill=black] (1.07,-.07) rectangle (1.93,-.93); 
      \end{scope}
    \end{tikzpicture}
    \]
    Here, white $=0$, black $=1$, and each 4-box diagram represents a
    three-bit input vector $(x_{i-1}(t),x_i(t),x_{i+1}(t))$ and the
    corresponding output $x_i(t+1)=f(x_{i-1}(t),x_i(t),x_{i+1}(t))$.
    \begin{enumerate}
      \item Find the decimal form of this rule. It should be a number
        between $0$ and $255$.
      \item Write the local function $f(x_{i-1},x_i,x_{i+1})$ as a
        polynomial over $\Z_2=\{0,1\}$.
      \item Write the local function $f(x_{i-1},x_i,x_{i+1})$ as a
        Boolean logical expression (that is, using $\vee$, $\wedge$,
        and $\neg$).
    \end{enumerate}



  \item Consider the \emph{parity function}
    $f(x_{i-1},x_i,x_{i+1})=x_{i-1}+x_i+x_{i+1}$, where addition is
    assumed to be done modulo $2$.
    \begin{enumerate}
      \item Write out the truth table of this function.
      \item Find this rule's decimal representation.
      \item Write this rule using Boolean logic.
    \end{enumerate}


  \item Find a 1-dimension ECA rule that always translates its initial
    state one position to the right. Express it four different ways:
    by its truth table, in decimal form, using Boolean logic, and as a
    polynomial over $\Z_2$.



  \item Download NetLogo from
    \url{https://ccl.northwestern.edu/netlogo/}. Find an agent-based
    model that we did not try out in class. Adjust one of the
    parameters until you find a ``threshold'' between two distinct
    types of behavior. Describe your findings in a paragraphs,
    including the approximate value of the threshold, and print out a
    screen shot (in color, if possible).


\end{enumerate}


\end{document}


