## Getting your feet wet numerically

Simulate the following stochastic differential equations:

• $dX(t) = – \lambda X(t) dt + dW(t)$
• $dX(t) = – \lambda X(t) dt + dW(t)$

by using the following Euler type numerical approximation

• $X_{n+1} = X_n + \lambda X_n h + \sqrt{h} \eta_n$
• $X_{n+1} = X_n + \lambda X_n h + \sqrt{h} X_n\eta_n$

where $$n=0,1,2,\dots$$ and $$h >0$$ is a small number which give the numerical step side.  That is to say that we consider $$X_n$$ as an approximation of $$X( t)$$ with $$t=h n$$.  Here $$\eta_n$$ are a collection of mutually independent random variables each with a Gaussian distribution with mean zero and variance one. (That is $$N(0,1)$$.)

Write code to simulate the two equations using the numerically methods suggested.  Plot some trajectories. Describe how the behavior changes for different choices of $$\lambda$$. Can you conjecture where it changes ? Compare and contrast the behavior of the two equations.

## Match play golf problem

This problem is motivated by the new format for the PGA match play tournament. The 64 golfers are divided into 16 pools of four players. On the first three days each golfer plays one 18 hole match against the other three in his pool. After 18 holes the game continues until there is a winner. At the end of these three days the possible records of the golfers in a pool could be: (a) 3-0, 2-1, 1-2, 0-3; (b) 3-0, 1-2, 1-2, 1-2; (c) 2-1, 2-1, 1-2, 1-2; (d) 2-1, 2-1, 2-1, 0-3. What are the probabilities for each of these four possibilities?

## Handing back tests

A professor randomly hands back test in a class of $$n$$ people paying no attention to the names on the paper. Let $$N$$ denote the number of people who got the right test. Let $$D$$ denote the pairs of people who got each others tests. Let $$T$$ denote the number of groups of three who none got the right test but yet among the three of them that have each others tests. Find:

1. $$\mathbf{E} (N)$$
2. $$\mathbf{E} (D)$$
3. $$\mathbf{E} (T)$$

## Up by two

Suppose two teams play a series of  games, each producing a winner and a loser, until one time has won two more games than the other. Let $$G$$ be the number of games played until this happens. Assuming your favorite team wins each game with probability $$p$$, independently of the results of all previous games, find:

1. $$P(G=n)$$ for $$n=2,3,\dots$$
2. $$\mathbf{E}(G)$$
3. $$\mathrm{Var}(G)$$

[Pittman p220, #18]

## Population

A population contains $$X_n$$ individuals  at time $$n=0,1,2,\dots$$ . Suppose that $$X_0$$ is distributed as $$\mathrm{Poisson}(\mu)$$. Between time $$n$$ and $$n+1$$ each of the $$X_n$$ individuals dies with probability $$p$$ independent of the others. The population at time $$n+1$$ is comprised of the survivors together with a random number of new immigrants who arrive independently in numbers distributed according to $$\mathrm{Poisson}(\mu)$$.

1. What is the distribution of $$X_n$$ ?
2. What happens to this distribution as $$n \rightarrow \infty$$ ? Your answer should depended on $$p$$ and $$\mu$$. In particular, what is $$\mathbf{E} X_n$$ as $$n \rightarrow \infty$$ ?

[Pittman [236, #18]

## Weights of Pennies

The distribution of weights of US pennies is approximately normal with a mean of 2.5 grams and a standard deviation of 0.03 grams.

(a) What is the probability that a randomly chosen penny weighs less than 2.4 grams?

(b) Describe the sampling distribution of the mean weight of 10 randomly chosen pennies.

(c) What is the probability that the mean weight of 10 pennies is less than 2.4 grams

(d) Sketch the two distributions (population and sampling) on the same scale.

[From OpenIntro Statistics, Second Edition, Problem 4.39]

## Benford’s Law

Assume that the population in a city grows exponentially at rate $$r$$. In other words, the number of people in the city, $$N(t)$$, grows as $$N(t)=C e^{rt}$$, where $$C<10^6$$ is a constant.

1. Determine the time interval $$\Delta t_1$$ during which $$N(t)$$  will be between 1 and 2 million people.

2. For $$k=1,…,9$$, determine the time interval $$\Delta t_k$$ during which $$N(t)$$  will be between k and k+1 million people.

3. Calculate the total time $$T$$ it takes for $$N(t)$$ to grow from 1 to 10 million people.

4. Now pick a time $$\hat t \in [0,T]$$ uniformly at random, and use the above results to derive the following formula (also known as Benford’s law) $$p_k=\mathbb P(N(\hat t) \in [k, k+1] \,million)=\log_{10}(k+1)-\log_{10}(k).$$

## A modified Wright-Fisher Model

Consider the ODE

$\dot x_t = x_t(1-x_t)$

and the SDE

$dX_t = X_t(1-X_t) dt + \sqrt{X_t(1-X_t)} dW_t$

1. Argue that $$x_t$$ can not leave the interval $$[0,1]$$ if $$x_0 \in (0,1)$$.
2. What is the behavior of $$x_t$$ as $$t \rightarrow\infty$$ if if $$x _0\in (0,1)$$ ?
3. Can the diffusion $$X_t$$ exit the interval $$(0,1)$$ ? Prove your claims.

## No Explosions from Diffusion

Consider the following ODE and SDE:

$\dot x_t = x^2_t \qquad x_0 >0$

$d X_t = X^2_t dt + \sigma |X_t|^\alpha dW_t\qquad X_0 >0$

where $$\alpha >0$$ and $$\sigma >0$$.

1. Show that $$x_t$$ blows up in finite time.
2. Find the values of  $$\sigma$$ and $$\alpha$$ so that $$X_t$$ does not explode (off to infinity).

[ From Klebaner, ex 6.12]

## Cox–Ingersoll–Ross model

The following model has SDE has been suggested as a model for interest rates:

$dr_t = a(b-r_t)dt + \sigma \sqrt{r_t} dW_t$

for $$r_t \in \mathbf R$$, $$r_0 >0$$ and constants $$a$$,$$b$$, and $$\sigma$$.

1. Find a closed form expression for $$\mathbf E( r_t)$$.
2. Find a closed form expression  for $$\mathrm{Var}(r_t)$$.
3. Characterize the values of parameters of $$a$$, $$b$$, and $$\sigma$$ such that $$r=0$$ is an absorbing point.
4. What is the nature of the boundary at $$0$$ for other values of the parameter ?