CPT 01: Modeling

Author: John J Weber III, PhD Corresponding Textbook Sections:

• 3.1 – Mathematical Modeling

Expected Educational Results

• Objective 1–1: I can model population decay using a difference equation.
• Objective 1–2: I can model population decay using a differential equation.
• Objective 1–3: I can use technology to solve models of population decay.

Differential Equations

Modeling Population Decay

We will conduct a simulation to construct model of a population. This population will consist of $N$ six-sided dice. In the activity, you will either gently roll all dice at the same time or simulate rolling N six-sided dice with Python.

Here is the code to simulate the rolling of 100 six-sided die. The comments explain the code.

xxxxxxxxxx9101# Import needed packages2import random, collections, numpy3#4# Initialize the pseudo-random number generator5random.seed()6#7# Simulate 100 rolls of fair six-sided dice8# Create an array of 100 integers on [1,7) and store into x9x=numpy.random.randint(1,7,100)10#11# Print the array and print the counts of the rolls12print(x, collections.Counter(x), sep="\\n\\n")

Simulation

The simulation of population decay will consist of the following steps:

2. Roll or simulate the roll of 100 dice;

• Any die that shows an odd number, then this individual has passed from the population and is removed from the population.
• Record the number of individuals remaining in the population.
3. Repeat Step 2 with the remaining die.

Pre-Experiment Discussion Questions

Prior to performing the experiment:

1. Make a prediction, i.e., describe what you think will happen.
2. Provide assumptions (simple, non-compound assumptions) that will support your prediction.
3. Share your predictions and assumptions to the class.
4. Critique the predictions and assumptions.

Conduct the Experimental Procedure

Record data in a two-column table similar to the table below:

1. When should you stop the Experimental Procedure? Explain.

2. Make a conclusion about the experiment. Explain.

• Explain how you know your conclusion is plausible.
• Indicate which assumptions actually played a role in the experiment.
3. Present your data and conclusions to the class.

4. Critique each group's data and conclusions.

5. Create a mathematical model:

• Let $n$ be the number of iterations.
• Let $p(n)$ be the number of dice, [individuals], remaining after each iteration.
• Create the mathematical model.
• Describe the reasonableness of your mathematical model for $p(n)$. Explain.
• How would you measure how successful your mathematical model describes $p(n)$. Explain.
6. Critique each group's model.

Run Python Code for Simulation

Make sure that you change Language to Python below the bottom-right portion of the code window.

The code will count the number of each outcome. For example,

Counter({3: 22, 1: 22, 4: 18, 2: 14, 6: 13, 5: 11})

states that there where 22 threes, 22 ones, 18 fours, 14 twos, 13 sixes, and 11 fives.

Difference Equations

Modeling Population Decay with Immigration

We will conduct a simulation to construct model of a population. This population will consist of $N$ six-sided dice. In the activity, you will either gently roll all dice at the same time or simulate rolling N six-sided dice with Python.

You will use the Python code to simulate the rolling of 100 six-sided die.

Simulation

The simulation of population decay will consist of the following steps:

2. Roll or simulate the roll of 100 dice;

• Any die that shows an odd number, then this individual has passed from the population and is removed from the population.
• Record the number of individuals remaining in the population.
3. Repeat Step 2 with the remaining die.

Pre-Experiment Discussion Questions

Prior to performing the experiment:

1. Make a prediction, i.e., describe what you think will happen.
2. Provide assumptions (simple, non-compound assumptions) that will support your prediction.
3. Share your predictions and assumptions to the class.
4. Critique the predictions and assumptions.

Conduct the Experimental Procedure

Record data in a two-column table similar to the table below:

1. When should you stop the Experimental Procedure? Explain.

2. Make a conclusion about the experiment. Explain.

• Explain how you know your conclusion is plausible.
• Indicate which assumptions actually played a role in the experiment.
3. Present your data and conclusions to the class.

4. Critique each group's data and conclusions.

5. Create a mathematical model:

• Let $n$ be the number of iterations.
• Let $p(n+1)$ be the number of dice, [individuals], remaining after each iteration.
• Create the mathematical model, i.e., $p(n+1) = \text{mathematical expression}$.
• Describe the reasonableness of your mathematical model for $p(n+1)$. Explain.
• How would you measure how successful your mathematical model describes $p(n+1)$. Explain.
6. Critique each group's model.

Run Python Code for Simulation

Make sure that you change Language to Python below the bottom-right portion of the code window.

The code will count the number of each outcome. For example,

Counter({3: 22, 1: 22, 4: 18, 2: 14, 6: 13, 5: 11})

states that there where 22 threes, 22 ones, 18 fours, 14 twos, 13 sixes, and 11 fives.

Models for Population Decay

Definition:

Exponential Growth and Decay: An exponential model is used when the rate of change of the population is proportional to the population size.

Compartmental Model: A compartmental model is used when there is an inflow and outflow to a system.

Mathematical Models

Definition:

Difference Equation: A difference equation is in the form: $\displaystyle p(n+1)-p(n)=\text{some expression}$ and is useful for compartmental models.

Differential Equation (DE): A model (i.e., equation) that contains derivatives (e.g., rate of change, acceleration, etc.) of an unknown function.