The Battle of Trafalgar: A Stochastic Approach Introduction Recall

advertisement

The Battle of Trafalgar: A Stochastic Approach

Introduction

Recall that the Battle of Trafalgar model says that when fleet A has ships and fleet B has ships, then the rates of change of and may be modeled by these differential equations: where and are constants reflecting, respectively, the relative firepower of a ship in fleet A and a ship in fleet B.

Solving this system of differential equations may involve analytical or numerical approaches, but all solutions treat and as continuous variables, and the progression of the Battle of Trafalgar is taken to be deterministic—i.e., as time passes, these differential equations model how and must necessarily diminish, until one of them has dwindled to zero.

It is not obvious that treating and as continuous variables is realistic. What does it mean for a fleet to have 8.23 ships? Furthermore, the deterministic model doesn’t allow for chance to play any role.

Might a smaller and weaker fleet of ships possibly win the battle through luck? If so, what are its chances?

In this unit, a stochastic approach to solving some differential equation models will be developed, and you will be invited to apply it to a combat models problem. (“Stochastic” means “subject to

randomness”.)

A stochastic approach to a different problem

The Battle of Trafalgar problem presents a number of difficulties, one of which is that it involves a pair of coupled differential equations, and there are two variables evolving over time. We’ll put that problem aside for a little while to consider a different problem that only involves one variable and one differential equation. We’ll develop the stochastic approach using this simpler problem, and will leave it largely to the reader to expand the techniques so as to solve the Battle of Trafalgar problem.

The problem we will consider here is how a disease spreads through a population. Let us suppose that there is a certain troop of 10 monkeys. At time , one of them somehow contracts a disease that is contagious among monkeys. We will suppose that the average daily rate of disease transmission is 5% for every possible monkey pair that exists in which one is infected and one is not.

Thus, if we let be the number of infected monkeys among the ten, and if we let be the number of days since the disease was introduced to the troop, then a differential equation modeling the spread of the disease is: page 1



 time

Interested students may want to solve this differential equation, given the initial condition at

. We will not solve it here, but a slope field of this differential equation along with its solution is shown below. sick monkeys

 time (days)





                   

That solution is continuous and deterministic: it says that at any moment in time, we can predict exactly how many monkeys will be infected. There is a good chance that the number will be a non-integer. Let us now consider a stochastic approach to the problem.

We will say that there are 10 distinct states that the monkey troop can be in at any point in time, each one indicating how many monkeys are infected—anywhere from one to all ten. We’ll identify these states as .

Our model says that the average daily rate at which (the number of sick monkeys) changes is equal to

. That is equivalent to saying that over a very short time period , the probability that a new monkey is infected is approximately equal to .

1

Note that our model does not allow for monkey recovery. Thus if we are presently in state , then after a short period of time , there are only two possible states we can be in: we may still be in state

, if no infections were transmitted; or we may be in state , if the disease was indeed transmitted.

Our new question of interest is: at a particular time state , ?

, what is the probability that we are in each

1 By considering only very short time periods, we reduce to effectively zero the probability that two different transmissions will occur during the same time period. This simplifies our solution considerably. page 2

Let us consider just the state (chosen arbitrarily). To be in that state at time , we must have previously been either in state and “gone nowhere,” or else we must have been in state and seen an infection occur. Thus, the probability of being in state at time is equal to: where time .

, are functions indicating the probabilities of being in the various states

We may expand the right-hand side of the equation...

at

… and subtract from both sides…

… and divide both sides by …

… and take the limit of both sides …

..and the result is a differential equation.

2

We may find it notationally convenient to hide the argument from these functions; but we must remember that is a function of for all .

It may be helpful to think of probability as “flowing” from one state to another. The probability that is flowing “out” of state and into state . The

is the

is the probability that is flowing

“into” state from state .

2 Recall that we assumed that because was very small, the probability of two new infections occurring in the same time period was negligible. More rigorously, we could have included possible transitions from one state to another that involved new infections occurring. The probability of such a transition occurring would have included as a factor, and even after dividing both sides of our equation by , we would have been left with a factor of at least . In the limit, all terms like this would have gone to zero. page 3

You can draw a “flow diagram” of this system and it might look something like this:

The only flow rates that have been included on this diagram are those into and out of state , but the others are not difficult to derive. Notice that states and are a little bit different from the others.

They are called “boundary states” because they either do not have probability flowing in, or do not have probability flowing out.

The full system of differential equations for this problem is shown below, following a table in which the flow rates for monkeys are computed based on the differential equation .

7

8

9

10

1

2

3

4

5

6

0.80

1.05

1.2

1.25

1.2

1.05

0.80

0.45

0 page 4

It is worth noting that all these derivatives add up to zero, meaning that the “flow” of probability must be entirely contained within this set of ten possible states.

A numerical solution to the monkey problem

This system of differential equations may appear difficult to solve. But Euler’s method—or any of several possible numerical approaches—may be employed to solve the system numerically. Note that the initial conditions are and for ; i.e., there is a 100% chance that there is exactly one sick monkey at time monkey at time .

, and there is a 0% chance that there is more than one sick

, Using Euler’s method to solve the system of differential equations yields the following plots for

, …, .

1

0.8

0.6

0.4

0.2

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

time (days)

Because the curves run together a bit in the middle, it may be helpful to look at just a subset of the functions . Below is a plot showing just , , and . page 5

1

0.8

0.6

0.4

0.2

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

time (days)

P1

P5

P10

In this plot we can see that by the time 4 days have passed, there is only about a 20% chance that there will still be only one sick monkey. indeed, by day 8 there is at least a 25% chance that all the monkeys will be sick.

Another graph that might be instructive is the “expected” or “average” number of monkeys sick at any given time, which is given by the function:

That function is shown below.

10

8

6

4

2 page 6

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

time (days)

Notice how similar this looks to the deterministic solution.

It is also possible to solve this system of equations analytically, although the technique is beyond the AP

Calculus syllabus. It is not beyond AP Calculus students, however, and if you want to try it, you are encouraged to do so. Notice that the first differential equation in the collection, , may be solved easily. The second solution depends upon the first; the third upon the second; and so on.

A useful technique for solving the system is called “integrating factors” and you can research it easily online. Your teacher may also be able to help you with integrating factors.

A stochastic approach to the Battle of Trafalgar Problem

Now that you have seen a stochastic approach used to solve a problem similar to the Battle of Trafalgar problem, you are ready to try the Battle of Trafalgar problem itself. Recall that the system of differential equations is: where and are constants reflecting, respectively, the relative firepower of a ship in fleet A and a ship in fleet B.

In the actual Battle of Trafalgar, the French and Spanish fleets each numbered well over 10, but that creates a problem that is very difficult to solve initially. You may wish to try solving this system supposing that at time there were ships in fleet A and ships in fleet .

That state in which and at time might be denoted

might be denoted state . The probability of being in that state

or, for convenience, simply . (But always remember that is a function of time.) The initial conditions of our system are therefore , and for all other ; i.e., there is a 100% chance that at time in fleet B, and a 0% chance that at time

there are ships in fleet A and ships

there are any other numbers of ships in the two fleets.

As time progresses, the probability of remaining in the initial state diminishes, and the probability of being in any of several other states increases. Eventually, however, the probability must eventually be distributed only among the possible “terminal states”—states in which or , indicating that the battle is over.

Here are some suggestions for solving this problem. List all possible states. Draw a flow diagram illustrating how probability “flows” dynamically among the states, similar to that on the top of page 4 of this document. Use technology to solve the system of equations numerically, or solve the system analytically. You may at first want to use particular values for the constants and , and then generalize them later on if you wish. page 7

With your solution, you can now address important questions, such as: What is the probability that fleet

B will win the battle? Or: Under what circumstances will fleet B have at least a 50% chance of winning the battle? Or: What is the probability that the battle will last longer than 24 hours? page 8

Download