# College Math Teaching

## February 26, 2011

### Ants and the Calculus of Variations

Filed under: applied mathematics, calculus of variations, optimization, popular mathematics, science — collegemathteaching @ 10:38 pm

Yes, ants appear to solve a calculus of variations problem despite having little brains. Here is the “why and how”:

embedded in the ants’ tiny brains is not an evolutionary algorithm for solving the Steiner problem, but a simple rule combined with a fact of chemistry: ants follow their own pheromone trails, and those pheromones are volatile. As Wild explains, ants start out making circuitous paths, but more pheromone evaporates from the longer ones because ants take longer to traverse them while laying down their own scent. The result is that the shortest paths wind up marked with the most pheromone, and ants follow the strongest scents.

Wild shows a nice simulation video on his site, demonstrating how, given these simple assumptions, ants wind up taking the shortest trails.

Before we say that evolution can’t explain a behavior, it behooves us to learn as much as we can about that behavior.

Ants find the shortest route because of three simple facts:

2. Pheromone trails degrade over time
3. Short paths take less time to traverse

When two points (say, two nests, or a nest and a food source) need to be connected, ants may start out tracing several winding pheromone paths among them. As ants zing back and forth down trails, pheromone levels build up. Long trails take more time to travel, so long-trail ants makes fewer overall circuits, more pheromone dissipates between passes, and the trails end up poorly marked. Short trails enable ants to make more trips, less time elapses between passes, so these trails end up marked more strongly. The shortest trail emerges.

Here’s a simulation showing digital ants selecting the shortest of 4 possible routes. Note how and where pheromone concentration builds:

They solved the geodesic problem and haven’t even had my numerical analysis class! 🙂

## February 24, 2011

### Calculus Problem: the hanging rope problem: two models.

Filed under: calculus, class room experiment, integrals, physics, student learning — collegemathteaching @ 10:21 pm

This will be a diversion from the Lebesgue measure/integration posts.

During today’s question and answer period, a student asked the following question: if one has a 50 foot long rope hanging off of a long cliff and one pulls up 25 feet of rope to the top, how much work does one do? Assume the rope weighs .5 pounds per linear foot.

My “instinct” told me to break this into two parts:
Work done on the first 25 feet: $\int^{25}_{0} .5xdx = 625/4$
Work done on the bottom 25 feet of rope: $(25)(25)(.5) = 625/2$
So the total work done is $625/4 + 625 /2 =(3/4)625 ft-lb.$ which is correct.

But a student suggested the integral $\int^{50}_{25} .5xdx$ which also works. The question is: why?

To discover why, let us remind ourselves of the model that we are using: to compute the work done by pulling up a rope, one divides the rope into small segments, each of equal weight. Each segment gets lifted a different amount so the integrand becomes $\rho xdx$

Now let’s make our problem a bit more general: we have a rope of length $L$ and we are going to lift $a$ feet of it where, of course, $a \leq L$
So the total work is $\int^{a}_{0}\rho xdx + \rho a(L-a)$ which, written in terms of integrals, becomes: $\int^{a}_{0}\rho xdx + \int^{L}_{a} \rho adx$
We can write this as a single integral if we do a change of variable in the second integral:
Let $(a/(L-a))(x-a) = u$ which means $(a/(L-a))dx= du$ so the second integral gets changed to: $\int^{a}_{0} \rho (L-a) du$ so the work becomes: $\int^{a}_{0}\rho xdx + \int^{a}_{0} \rho (L-a) du$. But the variable is dummy so we can switch back to $x$ in the second integral to obtain: $\int^{a}_{0}\rho (x + L-a) dx$.
Now to get to the student’s suggestion, do yet another change of variable:
Let $w = x + (L - a)$
Then the integral becomes $\int^{L}_{L-a} \rho wdw$

However, this integral makes no sense with the model that uses $\rho dx$ as a segment of rope that gets lifted $x$ units.
But there is another model that actually conforms more to what we actually feel if we pull up a rope ourselves.
First, set our variable $x$ running from top to bottom with $x = 0$ representing the top of the cliff. Then think of the $dx$ denoting the amount that the rope is moved and $\rho (L-x)$ the weight of the rope that is being pulled when there is $x$ length of rope remaining to be pulled.

In other words, start with $L$ amount of rope hanging off of the cliff. Then pull up on the rope with a “jerk” that moves the rope $\Delta x$ units upward. This movement moved (approximately) the whole rope upward which means that one applied a force of $\rho L$ over $\Delta x$ distance. Now pull up again and now one moves $\rho (L - \Delta x)$ amount of rope $\Delta x$ units upward. Then repeat; this yields the integral $\int^{L}_{0} \rho (L-x) dx = \int^{L}_{0} \rho xdx$ with the equality following from a simple change of variable.

This conforms to how the rope gets easier to pull as we pull the rope up; there is less weight to pull when the amount of hanging rope is less. So here we minimum amount of rope left to be pulled will be $L - a$ and the maximum is $L$ hence the integral is $\int^{L}_{L-a} \rho xdx$.

## February 3, 2011

### Why A Bounded Condition is Necessary for Intergral Convergence Theorems

Filed under: advanced mathematics, analysis, calculus, integrable function, integrals, Lebesgue Integration — collegemathteaching @ 1:07 am

One of the reasons that the Lebesgue theory is an improvement on the Riemann theory is that we have better convergence properties for integrals. For example, we could define the following sequence of functions: $f _{k}(x)=\left\{ \begin{array}{c}1,x\notin {1/2, 1/4, 3/4. ...1/2^k, 3/2^k,...(2^{k-1} -1)/2^k} \\ 0,x\in {1/2, 1/4, 3/4. ...1/2^k, 3/2^k,...(2^{k-1} -1)/2^k} \end{array}\right.$ Then for each $k$, $\int_{0}^{1} f_{k}(x)dx =1$ for all $k$ and $f_{k}(x) \to f(x)$ point wise and $f$ does not have a Riemann integral. It does have a Lebesgue integral which is 1.

In fact, there are many convergence theorems, one of which is the Bounded Convergence Theorem:
If $f_{k}$ is a sequence of measurable functions on a finite measure set $S$ and the functions $f_{k}$ are uniformly bounded on $S$ and $f_{n} \to f$ pointwise on $S$ then $lim \int_{S} f_{k} = \int_{S} lim f_{k} = \int_{S} f$.

We’ll take on this convergence theorem a little later (in another post). But why do we need a condition of the “uniformly bounded” type?
We’ll present an elementary but fun counter example to the theorem if the “uniformly bounded” condition is dropped.

Well start our construction by considering the sequence ${1/2, 1/3, ....1/k,...}$. We then note that $1/n$ and $1/n+1$ are $1/(n)(n+1)$ units apart hence we can form disjoint segments $( 1/n - 1/(3(n)(n+1)), 1/n + 1/(3(n)(n+1)))$ which can be used as the base for disjoint isosceles triangles whose upper vertex is at coordinate $(1/n, (3n)(n+1))$. Each of these triangles enclose an area of 1.
Now we can define a sequence of functions $f_{k}$ by letting $f_{k} = 0$ off the base of the triangle centered at $1/k$ and letting the graph of $f_{k}$ follow the upper two edges of the triangle. Then for all $k$ we have $\int_{0}^{1} f_{k}(x)dx = 1$. Hence $lim \int_{0}^{1} f_{k} (x)dx = 1$. Also note that $f_{k} \to f$ where $f(x) = 0$ for all $x \in [0,1]$. This isn’t hard to see; first note that $f_{k}(0) = 0$ for all $k$ and for $t > 0$ $f_{m} (t) = 0$ for all $m$ where $(3m + 4)/(3m^2 +3m) < t$. Of course, $\int_{0}^{1} f(x)dx = 0$. Each $f_{k}$ is bounded but the sequence is NOT uniformly bounded as the peaks of the triangles get higher and higher.

Note: I made a mistake when I first posted this; of course we don’t NEED “uniform boundedness” but we need either a boundedness condition or some condition that ensures that the measure of the unbounded parts is zero.

Example: order the rationals between 0 and 1 by $q_{i}$ and let each rational be written as $p_{i}/d_{i}$ in lowest terms.
Then define $f_{k}(x)$ to be $d_{i}$ for $x \in {q_{1},...,q_{k}}$ and 1 otherwise. Then the $f_{k}$ are NOT uniformly bounded as sequence but $\int_{0}^{1}f_{k} = 1$ for all $k$ and $\int_{0}^{1}f =1$ (where $f_{k}\to f$ ).
But this is ok as $f$ differs from the constant function $y = 1$ on a set of measure zero.