Project Euler

Michael Jacobsen
To solve problem #23 I apply simple brute force and we get to play a little with F# sets. Find all abundant numbers below the given upper limit. Create a set of all sums of these numbers (with a small optimization where avoid computing both a+b and b+a). Then we make a set difference and sums the remaining elements. #light let n = seq { 1 .. 28123 } let abundant number = (List.

Average Distance on a Line

Michael Jacobsen
As warm-up to the question of average distance between two points on a circle I’ll start out finding the average distance between two points on a line. For one particular point x we have an average distance to n other points as $$ \sum_{i=1}^n | x - y_i | \frac{1}{n} $$ where we sum each distance times its probability (1/n). If take ``all points’’ on line of unit length we get a Rieman Integral, that is

Heat - Remote Sensing of Temperature

Michael Jacobsen
The problem is to deduce how the temperature changes (we will call this a temperature profile) at one place from measurements at another place. We restrict ourselves to a 1-D problem. Assume that we can apply a temperature profile (f(t)) to the end of a rod (at the position x = 0). We now define the forward problem that gives the temperature profile at any point by means of a Partial Differential Equation (PDE):