callumneily

90 Reputation

2 Badges

0 years, 336 days

MaplePrimes Activity


These are Posts that have been published by callumneily

Mathematics often feels precise and deterministic. We solve equations, follow logical steps, and do our best to arrive at exact answers. But sometimes, surprisingly, randomness can also lead us to deep mathematical truths. One of the most famous examples of this idea is a problem from the 18th century known as Buffon’s Needle.

Imagine you have a floor made of long wooden planks placed side by side. The seams between the planks form a set of equally spaced parallel lines across the floor. Now, suppose you take a needle and randomly drop it onto the floor. Sometimes the needle lands entirely on one plank. Other times, it crosses one of the seams between planks, as shown below.

Now here is the curious question posed by the French mathematician Georges-Louis Leclerc, Comte de Buffon in the 1700s:

If we repeatedly drop the needle at random, what is the probability that it crosses one of the lines on the floor?

At first glance, this sounds like a simple probability puzzle. But the answer turns out to involve one of the most famous numbers in mathematics: π.

To keep things simple, assume the distance between the parallel lines on the floor is the same as the length of the needle. We can also imagine that all of our needles are thrown onto the same plank, potentially crossing onto the plank above or below. This configuration is equivalent to throwing the needle onto any plank as long as the planks are equally wide; this modification makes the analysis much simpler.

Every time the needle lands, two things determine whether it crosses a line:

  • The distance x from the center of the needle to the nearest line
  • The angle θ at which the needle lands with respect to the parallel lines

See a depiction of this below.

To determine the probability of a needle crossing one of these lines, we need to describe what a "random drop" of the needle means mathematically. If the lines are the same length apart as the length of the needle L, then the center of the needle can never be farther than L/2 from the nearest line. Therefore, 0 ≤ x ≤ L/2. Next, we can simplify our domain for θ. The problem is symmetric, so we only need to consider angles between 0 and π/2. Any given half of the needle then has a vertical reach of (L/2)sin(θ).

We will say a needle "crosses" a line precisely when the center lands close enough to a line that one end of the needle can reach across the line. This occurs when x ≤ (L/2)sin(θ).

An important assumption to make is that every pair (x,θ) in the rectangle 0 ≤ x ≤L/2, 0 ≤ θ ≤ π/2 is equally likely. We’re assuming the needle lands with uniform randomness over all vertical positions x and angles θ. This means that the probability of crossing a line is the fraction of this region where the inequalities above hold. That is, 

Probability = (area of favourable region) / (area of total region)

The "rectangle" formed by inequalities has a total area of (L/2) * (π/2) = π*L/4. The needle crosses a line exactly when x ≤ (L/2)sin(θ), so for a fixed angle θ, the allowable x values are 0 ≤ x ≤ (L/2)sin(θ). The favourable area is then:

The probability of a needle crossing a line is therefore:

This result leads to a fascinating idea. If the probability of crossing a line is 2/π, we can rearrange the formula to estimate π itself:

π ≈ 2N / C

where:

  • N = the total number of needle drops
  • C = the number of times the needle crosses a line

In other words, by performing a simple random experiment and counting how often the needle crosses a line, we can approximate π.

For example, suppose you drop the needle 10,000 times and it crosses a line 6,366 times. Plugging these values into the formula gives

π ≈ (2 × 10,000) / 6,366 ≈ 3.14

With enough trials, the estimate tends to get closer and closer to the true value of π. At the bottom of this post, I attached a Maple worksheet that simulates this phenomenon. Below are results from simulating this result using N = 10, 100 & 1000, respectively. Notice as N increases, our approximation for π tends to become more and more accurate.

Below is a more dynamic simulation from the Maple worksheet to show how the approximation stabilizes as N increases.

What makes Buffon’s Needle so fascinating is the unexpected connection between geometry, probability, and one of mathematics’ most important constants.

π usually appears when dealing with circles (circumference, area, rotation, etc). But in Buffon’s experiment, there are no circles at all. Instead, π emerges from the geometry of all the possible ways a needle can land on a set of parallel lines.

This was one of the earliest examples of what we now call a Monte Carlo method, which is essentially using random experiments to estimate numerical values. Today, similar techniques are used in physics, finance, computer graphics, and machine learning.

One of the best parts of Buffon’s Needle is that you can try it yourself. All you need is:

  • A toothpick or needle
  • A piece of paper with a sequence of parallel lines, each a distance of the needle's length apart
  • A lot of patience

Drop the needle repeatedly (N times), record how many times it crosses a line (C), and compute 2N/C. The more times you repeat the experiment, the closer your estimate will get to π.

After reading about this experiment, I was convinced that mathematics is not only about abstract symbols and formulas. Sometimes, even something as simple as dropping a needle onto the floor can reveal the hidden structure of elements of the universe that we would've otherwise never known were there.

 

Buffons_Needle_Simulation.mw

Gabriel’s Horn is one of the most famous examples in calculus of how infinity can behave in ways that completely defy our intuition.

The horn-shaped object is created from a very simple curve: y = 1/x for x ≥ 1 (pictured below).

Now imagine rotating this curve around the x-axis. The resulting surface stretches infinitely far to the right while becoming thinner and thinner. Visually, it resembles a long trumpet or horn that continuously narrows to a thickness of zero.

At first glance, nothing about this shape seems particularly mysterious. As x grows larger, the radius 1/x becomes smaller and smaller. It seems reasonable that both the volume contained inside the horn and the area of its surface would remain finite (or at least if the volume was finite, then the surface area would also be finite). After all, the horn gets extremely thin very quickly.

Calculus allows us to test that intuition.

To compute the volume of the horn, we use the disk method. Each slice perpendicular to the x-axis forms a circular disk of radius r = 1/x, each with an area of π*r2 = π*(1/x2).



The total volume is the sum of an infinite number of these disc areas with thickness dx. As an integral,

V = π ∫₁^∞ (1/x²) dx.

This is a simple integral that converges to a value of 1. We could use the power or rule or our favourite computing software (I used Maple below).



Hence, V = π ∫₁^∞ 1/x² dx = π*1 = π. This means the horn contains only π cubic units of space, even though it extends infinitely far. 

Now let’s compute the surface area of the horn. For a surface of revolution, the surface area is

A = 2π ∫₁^∞ y √(1 + (y′)²) dx.

Since y = 1/x, we have y′ = −1/x². Substituting into the formula gives

A = 2π ∫₁^∞ (1/x) √(1 + 1/x⁴) dx.

Software like Maple can easily handle this integral. It tells us the integral diverges to infinity.

However, this is difficult to solve analytically. To understand what happens to this integral, notice that for large x, the square root term is very close to 1, since 1/x4 can be approximated as 0 as x grows large. This means the integrand behaves roughly like 1/x (it's actually slightly larger than 1/x). But

∫₁^∞ 1/x dx diverges, and ∫₁^∞ (1/x) √(1 + 1/x⁴) dx > ∫₁^∞ 1/x dx, so ∫₁^∞ (1/x) √(1 + 1/x⁴) dx must also diverge. As a result, the surface area of Gabriel’s Horn is infinite.

This leads to the famous, surprising conclusion:

  • The horn has finite volume.
  • The horn has infinite surface area.

In other words, it could be filled with a finite amount of paint, but it would require an infinite amount of paint to coat its inside surface.

Of course, real paint has thickness, so the paradox disappears in the physical world. Eventually, the horn would become thinner than the paint layer itself. But mathematically, the result is perfectly consistent.

The key idea lies in how quickly the function 1/x shrinks. The cross-sectional area of the disks scales like (1/x)² = 1/x², and the integral of 1/x² converges.

But the circumference of each slice scales like 1/x, and the integral of 1/x diverges.

So as the horn extends outward, the added volume decreases quickly enough to sum to a finite value, while the added surface area decreases too slowly and accumulates forever.

Gabriel’s Horn beautifully illustrates one of the central themes of calculus: infinite processes can produce results that feel deeply counterintuitive.

Volume and surface area seem closely related, but can behave in completely different ways when infinite limits are involved. A shape can stretch endlessly yet still contain a finite amount of space.

This strange object reminds me that mathematics isn’t just about calculating numbers, but is also about exploring the strange and fascinating consequences of simple ideas pushed to their limits.

 

In mathematics, us humans love to rely on intuition. It helps us make physical sense of phenomena and guide our thinking before formal reasoning is developed.

For example, approximating the derivative of a function at a point can be thought of intuitively as dividing the function’s rise by its run. As we shorten the distance we run, this ratio approaches the value of the function’s derivative at that point. See this in the demonstration from Maple Learn below.

 

It is impossible to fully grasp the idea of moving an infinitesimal distance, so we make it easier by asking: “If we move an extremely small distance to the right, how much do we move up?”.

Intuition is typically a beautiful tool for approximating limits, but limits tend to limit (pun intended) the utility of our intuition. A perfect example of this? The Staircase Paradox.

Consider any rectangle you’d like. In the following example, we'll use a rectangle of width 3 and length 4 for convenience, but this paradox extends to any rectangle.

The name of the game is to ask yourself: how far must we walk along the edge of the rectangle to get from the top left corner to the bottom right. Here, the distance is of course 7 units (3 units right and 4 units down). This looks like a bit of a scary fall, so let’s add some stairs.

Even with the stairs, we’re still travelling a total distance of 7 units (1.5 + 1.5 units right, 2 + 2 units down). To shorten the fall even more, we can keep adding more and more stairs.

The important thing to notice is that no matter how many stairs we add, the distance travelled is always 7.

Now you may be wondering, where exactly is the paradox? Well, imagine now we have an infinite number of stairs. Our intuition tells us that our path to the bottom becomes more like a slide instead of a staircase. The steps we take are infinitely small, so it seems like we’re just travelling in a straight line down to the bottom right corner. However, if this were the case, we would have a right triangle! Using the Pythagorean Theorem, the length of our travelled path would be sqrt(32+42) = 5.

In other words, our calculations from before were wrong! But... they can’t be wrong, because we saw that the total distance of 7 units travelled was independent of the number of stairs we added.

This is a consequence of something called the “Manhattan distance”, which is the distance you travel if you can only move horizontally and vertically, like navigating the grid of streets in Manhattan. No matter how small we make the steps in our staircase, we are still only moving right and down. We never actually move diagonally. So even though the staircase looks more and more like a straight line, its length is always computed using horizontal distance + vertical distance. The limit of the shapes is a diagonal line, but the limit of the lengths is not the length of that diagonal. And that’s where our intuition stumbles.

The key lesson of the Staircase Paradox is that a sequence of curves can converge to a straight line, while their lengths converge to something completely different.

This is one of the quiet but profound messages of higher mathematics: limits preserve some properties, but not all. Smoothness, shape, and position may converge nicely, while quantities like length, area, or curvature behave in more subtle ways. Mathematics has a gentle way of reminding us that how we measure something can matter just as much as what we’re measuring.

Some mathematical theorems don't just prove a statement to be true, but they reveal something beautiful that itches our intuition. Viviani's Theorem is one of those rare gems. The theorem says something profound but geometrically elegant:

For any point inside an equilateral triangle, the sum of the perpendicular distances from that point to the triangle's three sides is always equal to the height of the triangle.

Take the equilateral triangle below as an example:

By picking any point P, we can draw lines perpendicular to each edge of the triangle that touch point P. The length of these lines always add to 6, which we will discover is the height of this triangle.

To explore this more, former Maplesoft co-op student Michael Barnett made a Maple Learn document on Viviani's Theorem where this is seen in action, as shown below.


No matter where the point P moves, the sum of perpendicular distances from that point to the edges of the triangle always add to the same value: the height of the triangle.

To see why this is the case mathematically, consider the example from before:


More generally, if we let x, y, and z be the shortest distances from the point P inside the triangle to the sides AB, AC and BC, respectively, one can conclude that:

 


In words, the sum of these distances x+y+z is simply the height of the triangle, h, no matter where the point P lies inside the triangle.

Even after reading this proof, it may be tempting to think of cases where this would not be true. I like to think of Maple Learn as a playground for geometry, algebra and visualization to interact. It helps to convince us that even for many different cases (in fact, all cases!), this theorem holds true.

Viviani's Theorem is a reminder that mathematics isn't always about answers. Instead, it's about finding hidden harmonies that our intuition begs us to question and search for. With tools like Maple Learn, those harmonies buried in symbols and complicated definitions can be uncovered and explored.

If geometry ever felt too distant or abstract, this is your invitation to see it come alive!

Many problems in mathematics are easy to define and conceptualize, but take a bit of deeper thinking to actually solve. Check out the Olympiad-style question (from this link) below:

 

Former Maplesoft co-op student Callum Laverance decided to make a document in Maple Learn to de-bunk this innocent-looking problem and used the powerful tools within Maple Learn to show step-by-step how to think of this problem. The first step, I recommend, would be to play around with possible values of a and b for inspiration. See how I did this below:


Based on the snippet above, we might guess that a = 0.5 and b = 1.9. The next step is to think of some equations that may be useful to help us actually solve for these values. Since the square has a side length of 4, we know its area must be 42 = 16. Therefore, the Yellow, Green and Red areas must add exactly to 16. That is,


With a bit of calculus and Maple Learn's context panel, we can integrate the function f(x) = ax2 from x = -2 to x = 2 and set it equal to this value of 8/3. This allows us to solve for the value of a.


We see that a = 1/2. Since the area of the Red section must be three times that of the Yellow (which we determined above to be 8/3), we get Red = (8/3)*3 = 8.

The last step is to find the value of b. In the figure below, we know that the line y = 4 and the curve y = bx2 intersect when bx2 = 4 (i.e. when x = ± 2/sqrt(b)).

 

Since we know the area of the red section is 8 square units, that must be the difference between the entire area underneath the horiztonal line at y = 4 and the curve y = bx2 on the interval [-2/sqrt(b), 2/sqrt(b)]. We can then write the area of the Red section as an integral in terms of b, then solve for the value of b, since we know the Red area is equal to 8.

Voila! Setting a = 1/2 and b = 16/9 ≈ 1.8 guarantees that the ratio of Yellow to Green to Red area within the square is 1:2:3, respectively. Note this is quite close to our original guess of a = 0.5 and b = 1.9. With a bit of algebra and solving a couple of integrals, we were able to solve a mathematics Olympiad problem!

1 2 Page 1 of 2