Homework 7: Physical Modelling ============================== +------------------------------------------------------------------------------+ | **Due Date**: 11:59pm March 2, 2025 | | | | Homework should be submitted as a single Jupyter notebook to Dropbox | +------------------------------------------------------------------------------+ To do **in advance of this homework**: * Make sure you have run the code in Allen Downey's Chapter 7 notebook. Exercises --------- Complete the exercises corresponding to Exercise 7.1 and 7.2 in Chapter 7 of Think Complexity (version 2): 1. In Section 7.6, Downey showed that the Rule 18 CA produces a fractal. Can you find other 1-D CAs that produce fractals? Note: the ``Cell1D`` object in ``Cell1D.py`` does not wrap around from the left edge to the right, which creates artifacts at the boundaries for some rules. You might want to use ``Wrap1D``, which is a child class of ``Cell1D`` that wraps around. It is also defined in ``Cell1D.py``. 2. In 1990 Bak, Chen and Tang proposed a cellular automaton that is an abstract model of a forest fire. Each cell is in one of three states: empty, occupied by a tree, or on fire. The rules of the CA are: a. An empty cell becomes occupied with probability *p*. b. A cell with a tree burns if any of its neighbors is on fire. c. A cell with a tree spontaneously burns, with probability *f*, even if none of its neighbors is on fire. d. A cell with a burning tree becomes an empty cell in the next time step. Write a program that implements this model. You might want to inherit from ``Cell2D``. Typical values for the parameters are *p=0.01* and *f=0.001*, but you might want to experiment with other values. Starting from a random initial condition, run the CA until it reaches a steady state where the number of trees no longer increases or decreases consistently. In steady state, is the geometry of the forest fractal? What is its fractal dimension? Submission ---------- Please submit a single Jupyter notebook which completes the above exercises, filling in Allen Downey's Chapter 7 notebook. There are already placeholders in the notebook for your work.