**Finding focus with Archimedes**

Hard as it is to imagine now, for most of the history of mathematics there was no coordinate geometry system and therefore graphs were not drawn using algebraic equations but instead were constructed. The ancient Greeks such as Archimedes made detailed studies of conic sections (parabolas, ellipses and hyperbola) using ideas of relationships in constructions. The nice approach to this method is that it makes clear the link between conic sections and their properties in reflecting light – a property which can then be utilized when making lenses. A parabolic telescope for example uses the property that all light collected through the scope will pass through a single focus point.

Let’s see how we can construct a parabola without any algebra – simply using the constructions of the Greeks. We start with a line and a focus point F not on the line. This now defines a **unique parabola**.

This unique parabola is defined as all the points A such that the distance from A to F is equal as the perpendicular distance from A to the line.

We can see above that point A must be on our parabola because the distance AB is the same as the distance AF.

We can also see that point C must be on our parabola because the length CD is the same as CF. Following this same method we could eventually construct every point on our parabola. This would finally create the following parabola:

**Focus point of a parabolic **mirror

We can now see how this parabola construction gives us an intrinsic understanding of reflective properties. If we have a light source entering parallel to the perpendicular though the focus then we can use the fact that this light will pass through the focus to find the path the light traces before it is reflected out.

Newton made use of this property when designing his parabolic telescope. It’s interesting to note how a different method leads to a completely different appreciation of the properties of a curve.

**Finding the area under a quadratic curve without calculus**

Amazingly a method for finding the area under a quadratic curve was also discovered by the Greek scientist and mathematician Archimedes around 2200 years ago – and nearly 2000 years before calculus. Archimedes’ method was as follows.

Choose 2 points on the curve, join them to make 2 sides of a triangle. Choose the 3rd point of the triangle as the point on the quadratic with the same gradient as the chord. This is best illustrated as below. Here I generated a parabola with focus at (0,1) and line with the x axis.

Here I chose points B and C, joined these with a line and then looked for the point on the triangle with the same gradient. This then gives a triangle with area 4. Archimedes then discovered that the area of the parabolic segment (i.e the total area enclosed by the line BC and the parabola) is 4/3 the area of the triangle. This gives 4/3 of 4 which is 5 1/3. Once we have this we can find the area under the curve (i.e the integral) using simple areas of geometric shapes.

**Using calculus**

We can check that Archimedes’ method does indeed work. We want to find the area enclosed by the 2 following equations:

This is given by:

It works! Now we can try a slightly more difficult example. This time I won’t choose 2 points parallel to the x-axis.

This time I find the gradient of the line joining B and C and then find the point on the parabola with the same gradient. This forms my 3rd point of the triangle. The area of this triangle is approximately 1.68. Therefore Archimedes’ method tells us the area enclosed between the line and the curve will be approximately 4/3 (1.68) = 2.24. Let’s check this with calculus:

Again we can see that this method works – our only error was in calculating an approximate area for the triangle rather than a more precise answer.

So, nearly 2000 years before the invention of calculus the ancient Greeks were already able to find areas bounded by line and parabolic curves – and indeed Archimedes was already exploring the ideas of the limit of sums of areas upon which calculus in based.

]]>

**Finding the average distance between 2 points on a hypercube**

This is the natural extension from this previous post which looked at the average distance of 2 randomly chosen points in a square – this time let’s explore the average distance in n dimensions. I’m going to investigate what dimensional hypercube is required to have an average distance of more than one, and then also what happens to the average distance as n approaches infinity.

**Monte Carlo method**

The Monte Carlo method is a very powerful technique which utilizes computational power. Basically we use the fact that the average of a very large number of trials will serve as an approximation to an exact result. In this case I will run a Python program 10 million times – each time it will select 2 coordinate points and then work out the distance between them. It will then find the average of these 10 million trials. The code above generates 2 coordinates in 3 dimensional space inside a unit cube. We can modify this for n-dimensional space by remembering that Pythagoras still works in higher dimensions.

**Results**

Running this code helps to generate the above results. This answers our first question – we need a 7 dimensional unit hypercube until the average distance between two randomly chosen points is greater than 1. We can also see that the difference between the average distances is reducing – but it’s not clear if this will approach a limit or if it will continue growing to infinity. So let’s do some more trials.

**Further trials**

This takes us up to a 22-dimensional hypercube. At this point it’s probably useful to plot a graph to see the trend.

**Reciprocal model**

This reciprocal model is of the form:

We can see that this is a pretty good fit (R squared 0.9994). If this model is accurate then this would suggest that the average distance approaches a limit as n approaches infinity.

**Polynomial model**

This polynomial model is of the form:

We can see that this is also a very good fit (R squared 0.9997). If this model is accurate then as b is greater than 0, this would suggest that the average distance approaches infinity as n approaches infinity.

**Reflection**

Quite annoyingly we have 2 model which both fit the data very accurately – but predict completely different results! Logically we could probably say that we would expect the average distance to approach infinity as n approaches infinity – and also we could possibly justify this by the fact that the polynomial model is a slightly better fit. Given the similarity between the 2 models it probably time to find out the actual results for this.

**Average n-dimensional distance bounds**

Not surprisingly the mathematics required to work this out is exceptionally difficult – and ends up with non-solvable integrals which require analytic solutions. The Monte Carlo method with very large numbers of trials is a reasonably good approach to approximating this answer. There is however a very useful lower and upper bound for the average distance in n dimensional space given by:

This shows immediately that the average distance will approach infinity as n grows large – as the lower bound will grow to infinity. Quite pleasingly we can see that the polynomial model we derived is similar to the lower bound. We can plot both upper and lower bound along with our polynomial model to see how these all compare. We have lower bound (green), polynomial model (black) and upper bound (green):

We can see that our polynomial model very closely follows the upper bound in our domain. As we extend the domain this polynomial approximation remains above the lower and tracks the upper bounds before gradually growing less accurate. When n is 50 our model predicts a distance of 2.94, whereas the upper bound is 2.88. This is quite a nice result – we have used the Monte Carlo method to derive a polynomial approximation to the average distance in n-dimensional hypercubes and it both closely follows the upper bound over a reasonable domain and also is of a very similar form to the lower bound. We can use this lower bound to see that a 36 dimensional hypercube (and higher) would be guaranteed to have an average distance of more than 2.

**Conclusion**

This was a nice example of the power of the Monte Carlo method in these kind of problems – we were able to use it quite successfully to get a polynomial approximation which turned out to be reasonably accurate. We could have significantly improved this accuracy by running 100 million (or 1 billion etc) trials each time – though this would have probably required a more powerful computer!

]]>**Find the average distance between 2 points on a square**

This is another excellent mathematical puzzle from the MindYourDecisions youtube channel. I like to try these without looking at the answer – and then to see how far I get. This one is pretty difficult (and the actual solution exceptionally difficult!) The problem is to take a square and randomly choose 2 points somewhere inside. If you calculate the distance between the 2 points, then do this trial approaching an infinite number of times what will the average distance be? Here is what I did.

**Simplify the situation: 1×1 square**

This is one of the most important strategies in tackling difficult maths problems. You simplify in order to gain an understanding of the underlying problem and possibly either develop strategies or notice patterns. So, I started with a unit square and only considered the vertices. We can then list all the possible lengths:

We can then find the average length by simply doing:

**2×2 square**

We can then follow the same method for a 2×2 square. This gives:

Which gives an average of:

**Back to a 1×1 square**

Now, we can imagine that we have a 1 x 1 square with dots at every 0.5. This is simply a scaled version of the 2×2 square, so we can divide our answer by 2 to give:

**3×3 square**

Following the same method we have:

This gives an average of:

and if we imagine a 1×1 square with dots at every 1/3. This is simply a scaled version of the 3×3 square, so we can divide our answer by 3 to give:

We can then investigate what happens as we consider more and more dots inside our 1×1 square. When we have considered an infinite number then we will have our average distance – so we are looking the limit to infinity. This suggests using a graph. First I calculated a few more terms in the sequence:

Then I plotted this on Desmos. The points looked like they fit either an exponential or a reciprocal function – both which have asymptotes, so I tried both. The reciprocal function fit with an R squared value of 1. This is a perfect fit so I will use that.

This was plotted using the regression line:

And we can find the equation of the horizontal asymptote by seeing what happens when x approaches infinity. This will give a/c. Using the values provided by Desmos’ regression I got 0.515004887. Because I have been using approximate answers throughout I’ll take this as 0.52 (2sf). **Therefore I predict that the average distance between 2 points in a 1×1 square will be approximately 0.52**. And more generally, the average distance in an n x n square will be 0.52(n). This is somewhat surprising as a result – it’s not obvious why it would be a little over half the distance from 0 to 1.

**Brute forcing using Python**

We can also write a quick code to approximate this answer using Python (This is a Monte Carlo method). I generate 4 random numbers to represent the 2 x-coordinates and 2-y coordinates of 2 random points. I then work out the distance between them and repeat this 10 million times, then calculate the average distance. This gives:

**Checking with the actual answer**

Now for the moment of truth – and we watch the video to find out how accurate this is. The correct answer is indeed 0.52 (2sf) – which is great – our method worked! The exact answer is given by:

Our graphical answer is not quite accurate enough to 3 sf – probably because we relied on rounded values to plot our regression line. Our Python method with 10 million trials was accurate to 4 sf. Just to keep my computer on its toes I also calculated this with 100 million trials. This gave 0.5214126210834646 (now accurate to 5 sf).

We can also find the percentage error when using our graphical method. This is only:

Overall this is a decent result! If you are feeling *extremely* brave you might want to look at the video to see how to do this using calculus.

**Extension: The average distance between 2 points in a unit circle**

I modified the Python code slightly to now calculate the average distance between 2 points in a unit circle. This code is:

which returns an answer of 0.9054134561871364. I then looked up what the exact answer is. For the unit circle it is 128/(45 pi). This is approximately 0.9054147874. We can see that our computer method was accurate to 5 sf here. Again, the actual mathematical proof is extremely difficult.

**Reflection**

This is a nice example of important skills and techniques useful in mathematics – simplification of a problem, noticing patterns, graphical methods, computational power and perseverance!

]]>**Generating e through probability and hypercubes**

This is a really beautiful solution to an interesting probability problem posed by fellow IB teacher Daniel Hwang, for which I’ve outlined a method for solving suggested by Ferenc Beleznay. The problem is as follows:

*On average, how many random real numbers from 0 to 1 (inclusive) are required for the sum to exceed 1?*

**1 number**

Clearly if we choose only 1 number then we can’t exceed 1.

**2 numbers**

Here we imagine the 2 numbers we pick as x and y and therefore we can represent them as a coordinate pair. The smallest pair (0,0) and the largest pair (1,1). This means that the possible coordinates fit inside the unit square shown above. We want to know for what coordinate pairs we have the inequality x + y > 1. This can be rearrange to give y > 1-x. The line y = 1-x is plotted and we can see that any coordinate points in the triangle BCD satisfy this inequality. Therefore the probability of a random coordinate pair being in this triangle is 1/2.

**3 numbers**

This time we want to find the probability that we exceed 1 with our third number. We can consider the numbers as x, y, z and therefore as 3D coordinates (x,y,z). From the fact that we are choosing a third number we must already have x +y <1. We draw the line x+y = 1, which in 3D gives us a plane. The volume in which our coordinate point must lie is the prism ABDEFG.

We now also add the constraint x+y+z >1. This creates the plane as shown. If our coordinate lies inside the pyramid ABDE then our coordinates will add to less than 1, outside this they will add to more than 1.

The volume of the pyramid ABDE = 1/3 (base area)(perpendicular height).

The volume of the prism ABDEFG = (base area)(perpendicular height).

Given that they share the same perpendicular height and base area then precisely 1/3 of the available volume would give a coordinate point that adds to less than 1, and 2/3 of the available volume would give a coordinate point that adds to more than 1.

Therefore we have the following tree diagram:

Exceeds 1 with 2 numbers = 1/2

Does not exceed 1 with 2 numbers, exceeds 1 with 3 numbers = 1/2 x 2/3 = 1/3.

Does not exceed 1 with 2 numbers, does not exceed 1 with 3 numbers = 1/2 x 1/3 = 1/6.

**4 numbers**

If you been following so far this is where things get interesting! We can now imagine a 4 dimensional unit cube (image above from Wikipedia) and a 4D coordinate point (x,y,z,a).

Luckily all we care about is the ratio of the 4-D pyramid and the 4-D prim formed by our constraints x+y+z <1 and x+y+z+a >1.

We have the following formula to help:

The n-D volume of a n-D pyramid = 1/n (base)(perpendicular height).

Therefore:

The 4-D volume of a 4-D pyramid = 1/4 (base 3D volume)(perpendicular height).

The 4-D volume of the prism ABDEFG = (base 3D volume)(perpendicular height).

Given that the 2 shapes share the same base and perpendicular height, the hyper-pyramid occupies exactly 1/4 of the 4-D space of the hyper-prism. So the probability of being in this space is 1/4 and 3/4 of being outside this space.

We can now extend our tree diagram:

Does not exceed 1 with 2 numbers, does not exceed 1 with 3 numbers, exceeds with 4 numbers = 1/2 x 1/3 x 3/4 = 1/8

Does not exceed 1 with 2 numbers, does not exceed 1 with 3 numbers, does not exceed with 4 numbers = 1/2 x 1/3 x 1/4 = 1/24.

In general a hyper-pyramid in n dimensional space occupies exactly 1/n of the space of the hyper-prism – so we can now continue this tree diagram.

Expected value

We can make a table of probabilities to find how many numbers we expect to use in order to exceed one.

Which gives us the following expected value calculation:

Which we can rewrite as:

But we have:

Therefore this gives:

So on average we would need to pick *e *numbers for the sum to exceed one! This is quite a remarkable result – *e, *one of the fundamental mathematical constants has appeared as if by magic on a probability question utilizing hyper-dimensional shapes.

**Demonstrating this with Python**

Running the Python code shown above will simulate doing this experiment. The computer generates a “random” number, then another and carries on until the sum is greater than 1. It then records how many numbers were required. It then does this again 1 million times and finds the average from all the trials.

1 million simulations gives 2.7177797177797176. When we compare this with the real answer for e, 2.7182818284590452353602874713527, we can see it has taken 1 million simulations to only be correct to 4sf.

Even 5 million simulations only gives 2.7182589436517888, so whilst we can clearly see that we will eventually get e, it’s converging very slowly. This may be because we are reliant on a random number generator which is not truly random (and only chooses numbers to a maximum number of decimal places rather than choosing from all values between 0 and 1).

I think this is a beautiful example of the unexpected nature of mathematics – we started out with a probability problem and ended up with *e, *via a detour into higher dimensional space! We can also see the power of computers in doing these kinds of brute force calculations.

**Have you got a Super Brain?**

Adapting and exploring maths challenge problems is an excellent way of finding ideas for IB maths explorations and extended essays. This problem is taken from the book: The first 25 years of the Superbrain challenges. I’m going to see how many different ways I can solve it.

The problem is to find all the integer solutions to the equation above. Finding only integer solutions is a fundamental part of number theory – a branch of mathematics that only deals with integers.

**Method number 1: Brute force**

This is a problem that computers can make short work of. Above I wrote a very simple Python program which checked all values of x and y between -99 and 99. This returned the only solution pairs as:

Clearly we have not proved these are the only solutions – but even by modifying the code to check more numbers, no more pairs were found.

**Method number 2: Solving a linear equation**

We can notice that the equation is linear in terms of y, and so rearrange to make y the subject.

We can then use either polynomial long division or the method of partial fractions to rewrite this. I’ll use partial fractions. The general form for this fraction can be written as follows:

Next I multiply by the denominator and the compare coefficients of terms.

This therefore gives:

I can now see that there will only be an integer solution for y when the denominator of the fraction is a factor of 6. This then gives (ignoring non integer solutions):

I can then substitute these back to find my y values, which give me the same 4 coordinate pairs as before:

**Method number 3: Solving a quadratic equation**

I start by making a quadratic in x:

I can then use the quadratic formula to find solutions:

Which I can simplify to give:

Next I can note that x will only be an integer solution if the expression inside the square root is a square number. Therefore I have:

Next I can solve a new quadratic as follows:

As before I notice that the expression inside my square root must be a square number. Now I can see that I need to find m and n such that I have 2 square numbers with a difference of 24. I can look at the first 13 square numbers to see that from the 12th and 13th square numbers onwards there will also be a difference of more than 24. Checking this list I can find that m = 1 and m = 5 will satisfy this equation.

This then gives:

which when I solve for integer solutions and then sub back into find x gives the same four solutions:

**Method number 4: Graphical understanding**

Without rearranging I could imagine this as a 3D problem by plotting the 2 equations:

This gives the following graph:

We can see that the plane intersects the curve in infinite places. I’ve marked A, B on the graph to illustrate 2 of the coordinate pairs which we have found. This is a nice visualization but doesn’t help find our coordinates, so lets switch to 2D.

In 2D we can use our rearranged equation:

This gives the following graph:

Here I have marked on the solution pairs that we found. The oblique asymptote (red) is y = 2x-1 because as x gets large the fraction gets very small and so the graph gets closer and closer to y = 2x -1.

All points on this curve are solutions to the equation – but we can see that the only integer solution pairs will be when x is small. When x is a large integer then the curve will be close to the asymptote and hence will return a number slightly bigger than an integer.

So, using this approach we would check all possible integer solutions when x is small, and again should be able to arrive at our coordinate pairs.

So, 4 different approaches that would be able to solve this problem. Can you find any others?

]]>

**You can download all 17 of the Paper 3 questions for free here:** [**PDF**].

**The full typed mark scheme is available to download at the bottom of the page.**

**Seventeen IB Higher Level Paper 3 Practice Questions**

With the new syllabus just started for IB Mathematics we currently don’t have many practice papers to properly prepare for the Paper 3 Higher Level exam. As a result I’ve put together 17 full investigation questions – each one designed to last around 1 hour, and totaling around 40 pages of questions and **600 marks** worth of content. This has been specifically written for the Analysis and Approaches syllabus – though some parts would also be suitable for Applications.

Below I have split the questions into individual pdfs, with more detail about each one. For each investigation question I have combined several areas of the syllabus in order to create some level of discovery – and in many cases I have introduced some new mathematics (as will be the case on the real Paper 3).

**Topics explored:**

**Paper 1: Rotating curves: **[Individual question download** here**. Mark-scheme download** here.**]

Students explore the use of parametric and Cartesian equations to rotate a curve around the origin. You can see a tutorial video on this above. The mathematics used here is trigonometry (identities and triangles), functions and transformations.

**Paper 12: Circumscribed and inscribed polygons **[Individual question download **here**].

Students explore different methods for achieving an upper and lower bound for pi using circumscribed and inscribed polygons. You can see a video solution to this investigation above. The mathematics used here is trigonometry and calculus (differentiation and L’Hopital’s rule).

**Paper 2: Who killed Mr. Potato? **[Individual question download **here****.**]

Students explore Newton’s Law of Cooling to predict when a potato was removed from an oven. The mathematics used here is logs laws, linear regression and solving differential equations.

**Paper 3: Graphically understanding complex roots **[Individual question download **here.**]

Students explore graphical methods for finding complex roots of quadratics and cubics. The mathematics used here is complex numbers (finding roots), the sum and product of roots, factor and remainder theorems, equations of tangents.

**Paper 4: Avoiding a magical barrier **[Individual question download **here**.]

Students explore a scenario that requires them to solve increasingly difficult optimization problems to find the best way of avoiding a barrier. The mathematics used here is creating equations, optimization and probability.

**Paper 5 : Circle packing density** [Individual question download **here**.]

** **Students explore different methods of filling a space with circles to find different circle packing densities. The mathematics used here is trigonometry and using equations of tangents to find intersection points.

**Paper 6: A sliding ladder investigation **[Individual question download **here**.]

Students find the general equation of the midpoint of a slipping ladder and calculate the length of the astroid formed. The mathematics used here is trigonometry and differentiation (including implicit differentiation). Students are introduced to the ideas of parametric equations.

Paper** 7: Exploring the Si(x) function **[Individual question download **here**.]

** **Students explore methods for approximating non-integrable functions and conclude by approximating pi squared. The mathematics used here is Maclaurin series, integration, summation notation, sketching graphs.

**Paper 8: Volume optimization of a cuboid **[Individual question download **here.**]

** **Students start with a simple volume optimization problem but extend this to a general case of an m by n rectangular paper folded to make an open box. The mathematics used here is optimization, graph sketching, extended binomial series, limits to infinity.

**Paper 9: Exploring Riemann sums **[Individual question download **here**.]

Students explore the use of Riemann sums to find upper and lower bounds of functions – finding both an approximation for pi and also for ln(1.1). The mathematics used here is integration, logs, differentiation and functions

**Paper 10 : Optimisation of area **[Individual question download **here**.]

Students start with a simple optimisation problem for a farmer’s field then generalise to regular shapes. The mathematics used here is trigonometry and calculus (differentiation and L’Hopital’s rule)

**Paper 11: Quadruple Proof **[Individual question download **here.**]

Students explore 4 different ways of proving the same geometrical relationship. The mathematics used here is trigonometry (identities) and complex numbers.

**Paper 13: Using the binomial expansion for bounds of accuracy **[Individual question download **here**.]

Students explore methods of achieving lower and upper bounds for and non-calculator methods for calculating logs. The mathematics used here is the extended binomial expansion for fractional and negative powers and integration.

**Paper 14: Radioactive Decay **[Individual question download **here**.]

Students explore discrete decay models, using probability density functions to investigate the decay of Carbon-14 and then explore the use of Euler’s method to approximate more complex decay chains. The mathematics used here is integration, probability density functions and Euler’s method of approximation

** Paper 15: Probability generating functions [**Individual question download **here**.**]**

Students explore the use of probability generating functions to find probabilities, expected values and variance for the binomial distribution and Poisson distribution for predicting the eruption of a volcano.

**Paper 16: Finding the Steiner inellipse using complex numbers [**Individual question download **here]**

Students use a beautiful relationship between complex numbers and an ellipse tangent to the midpoints of a triangle. This relationship allows you to find the equation of an ellipse from coordinate points of a triangle.

**Paper 17: Elliptical curves** [Individual question download **here**]

Students explore a method for adding points on an elliptical curve. This has links with elliptical curve cryptography.

**Mark-scheme download**

[If you don’t have a PayPal account you can just click on the relevant credit card icon]

IB HL Paper 3 Practice Questions and markscheme.

100 pages of preparatory questions with answers for the IB HL Analysis P3 exam. Please note this is not an automatic download and will be sent the same day.

$9.00

IB HL Paper 3 Practice Questions and markscheme AND Exploration Guide

All the Paper 3 questions and mark scheme AND the 63 page Exploration Guide. The Exploration Guide includes: Investigation essentials, Marking criteria guidance, 70 hand picked interesting topics, Useful websites for use in the exploration, A student checklist for top marks, Avoiding common student mistakes, A selection of detailed exploration ideas, Advice on using Geogebra, Desmos and Tracker. And more! Please note this is not an automatic download and will be sent the same day.

$14.00

**3D Printing with Desmos: Stewie Griffin**

Using Desmos or Geogebra to design a picture or pattern is quite a nice exploration topic – but here’s an idea to make your investigation stand out from the crowd – how about converting your image to a 3D printed design?

**Step 1**

Create an image on Desmos or Geogebra. Remove the axes and grid pattern. This image is a pre-drawn image already on Desmos available here.

**Step 2**

Take a screen capture image of your picture (jpeg, gif, png). We need to convert this to a SVG file. You can convert these for free at sites like picsvg.

**Step 3**

Lastly we need to use a 3D editing site . You can join up with a site like Tinkercad for free.

**Step 4**

Making our 3D model. We import our SVG file and we get the image above. We can then resize this to whatever dimensions we wish – and also add 3D depth.

Lastly I would then save this file and send it to a 3D printer. You can see the finished file below:

So, if we printed this we’d get something like this:

**3D printing the Eiffel Tower**

Let’s use another Desmos art work. The Eiffel Tower above was a finalist in their annual art competition drawn by Jerry Yang from the USA.

This is then converted to the SVG file above.

And this is the result on Tinkercad when I add some depth and change the colour scheme. Let’s see what that would look like printed:

Pretty good- we’ve created a cheap tourist souvenir in about 5 minutes!

**Mathematical art**

I thought I’d have a go at making my own mathematical art. I started with using some polar coordinates to create this nice pattern:

Which then creates the following 3D shape:

This topic has a lot of scope for exploration and links with art, design technology and engineering. Thanks to our ever resourceful ICT wizz at school Jon for assistance, and also thanks for this excellent method which was posted by Ryan on Thingiverse. You can also explore huge numbers of ready made 3D templates on the site.

]]>**Complex Numbers as Matrices – Euler’s Identity**

Euler’s Identity below is regarded as one of the most beautiful equations in mathematics as it combines five of the most important constants in mathematics:

I’m going to explore whether we can still see this relationship hold when we represent complex numbers as matrices.

**Complex Numbers as Matrices**

First I’m I’m going to define the following equivalences between the imaginary unit and the real unit and matrices:

The equivalence for 1 as the identity matrix should make sense insofar as in real numbers, 1 is the multiplicative identity. This means that 1 multiplied by any real number gives that number. In matrices, a matrix multiplied by the identity matrix also remains unchanged. The equivalence for the imaginary unit is not as intuitive, but let’s just check that operations with complex numbers still work with this new representation.

In complex numbers we have the following fundamental definition:

Does this still work with our new matrix equivalences?

Yes, we can see that the square of the imaginary unit gives us the negative of the multiplicative identity as required.

More generally we can note that as an extension of our definitions above we have:

**Complex number ****multiplication**

Let’s now test whether complex multiplication still works with matrices. I’ll choose to multiply the following 2 complex numbers:

Now let’s see what happens when we do the equivalent matrix multiplication:

We can see we get the same result. We can obviously prove this equivalence more generally (and check that other properties still hold) but for the purposes of this post I want to check whether the equivalence to Euler’s Identity still holds with matrices.

**Euler’s Identity with matrices**

If we define the imaginary unit and the real unit as the matrices above then the question is whether Euler’s Identity still holds, i.e:

Next I can note that the Maclaurin expansion for e^(x) is:

Putting these ideas together I get:

This means that:

Next I can use the matrix multiplication to give the following:

Next, I look for a pattern in each of the matrix entries and see that:

Now, to begin with here I simply checked these on Wolfram Alpha – (these sums are closely related to the Macluarin series for cosine and sine).

Therefore we have:

So, this means I can write:

And so this finally gives:

Which is the result I wanted! Therefore we can see that Euler’s Identity still holds when we define complex numbers in terms of matrices. Complex numbers are an incredibly rich area to explore – and some of the most interesting aspects of complex numbers is there ability to “bridge” between different areas of mathematics.

]]>**Sierpinski Triangle: A picture of infinity**

This pattern of a Sierpinski triangle pictured above was generated by a simple iterative program. I made it by modifying the code previously used to plot the Barnsley Fern. You can run the code I used on repl.it. What we are seeing is the result of 30,000 iterations of a simple algorithm. The algorithm is as follows:

**Transformation 1:**

x_{i+1} = 0.5x_{i}

y_{i+1}= 0.5y_{i}

**Transformation 2:**

x_{i+1} = 0.5x_{i} + 0.5

y_{i+1}= 0.5y_{i}+0.5

**Transformation 3:**

x_{i+1} = 0.5x_{i} +1

y_{i+1}= 0.5y_{i}

So, I start with (0,0) and then use a random number generator to decide which transformation to use. I can run a generator from 1-3 and assign 1 for transformation 1, 2 for transformation 2, and 3 for transformation 3. Say I generate the number 2 – therefore I will apply transformation 2.

x_{i+1} = 0.5(0) + 0.5

y_{i+1}= 0.5(0)+0.5

and my new coordinate is (0.5,0.5). I mark this on my graph.

I then repeat this process – say this time I generate the number 3. This tells me to do transformation 3. So:

x_{i+1} = 0.5(0.5) +1

y_{i+1}= 0.5(0.5)

and my new coordinate is (1.25, 0.25). I mark this on my graph and carry on again. The graph above was generated with 30,000 iterations.

**Altering the algorithm**

We can alter the algorithm so that we replace all the 0.5 coefficients of x and y with another number, *a*.

a = 0.3 has disconnected triangles:

When a = 0.7 we still have a triangle:

By a = 0.9 the triangle is starting to degenerate

By a = 0.99 we start to see the emergence of a line “tail”

By a = 0.999 we see the line dominate.

And when a = 1 we then get a straight line:

When a is greater than 1 the coordinates quickly become extremely large and so the scale required to plot points means the disconnected points are not visible.

If I alternatively alter transformations 2 and 3 so that I add b for transformation 2 and 2b for transformation 3 (rather than 0.5 and 1 respectively) then we can see we simply change the scale of the triangle.

When b = 10 we can see the triangle width is now 40 (we changed b from 0.5 to 10 and so made the triangle 20 times bigger in length):

**Fractal mathematics**

This triangle is an example of a self-similar pattern – i.e one which will look the same at different scales. You could zoom into a detailed picture and see the same patterns repeating. Amazingly fractal patterns don’t fit into our usual understanding of 1 dimensional, 2 dimensional, 3 dimensional space. Fractals can instead be thought of as having fractional dimensions.

The Hausdorff dimension is a measure of the “roughness” or “crinkley-ness” of a fractal. It’s given by the formula:

D = log(N)/log(S)

For the Sierpinski triangle, doubling the size (i.e S = 2), creates 3 copies of itself (i.e N =3)

This gives:

D = log(3)/log(2)

Which gives a fractal dimension of about 1.59. This means it has a higher dimension than a line, but a lower dimension than a 2 dimensional shape.

]]>

**Sphere packing problem: Pyramid design**

Sphere packing problems are a maths problems which have been considered over many centuries – they concern the optimal way of packing spheres so that the wasted space is minimised. You can achieve an average packing density of around 74% when you stack many spheres together, but today I want to explore the packing density of 4 spheres (pictured above) enclosed in a pyramid.

**Considering 2 dimensions**

First I’m going to consider the 2D cross section of the base 3 spheres. Each sphere will have a radius of 1. I will choose A so that it is at the origin. Using some basic Pythagoras this will give the following coordinates:

**Finding the centre**

Next I will stack my single sphere on top of these 3, with the centre of this sphere directly in the middle. Therefore I need to find the coordinate of D. I can use the fact that ABC is an equilateral triangle and so:

**3D coordinates**

Next I can convert my 2D coordinates into 3D coordinates. I define the centre of the 3 base circles to have 0 height, therefore I can add z coordinates of 0. E will be the coordinate point with the same x and y coordinates as D, but with a height, *a*, which I don’t yet know:

In order to find *a *I do a quick sketch, seen below:

Here I can see that I can find the length AD using trig, and then the height DE (which is my *a* value) using Pythagoras:

**Drawing spheres**

The general equation for spheres with centre coordinate (a,b,c) and radius 1 is:

Therefore the equation of my spheres are:

Plotting these on Geogebra gives:

**Drawing a pyramid**

Next I want to try to draw a pyramid such that it encloses the spheres. This is quite difficult to do algebraically – so I’ll use some technology and a bit of trial and error.

First I look at creating a base for my pyramid. I’ll try and construct an equilateral triangle which is a tangent to the spheres:

This gives me an equilateral triangle with lengths 5.54. I can then find the coordinate points of F,G,H and plot them in 3D. I’ll choose point E so that it remains in the middle of the shape, and also has a height of 5.54 from the base. This gives the following:

As we can see, this pyramid does not enclose the spheres fully. So, let’s try again, this time making the base a little bit larger than the 3 spheres:

This gives me an equilateral triangle with lengths 6.6. Taking the height of the pyramid to also be 6.6 gives the following shape:

This time we can see that it fully encloses the spheres. So, let’s find the density of this packing. We have:

Therefore this gives:

and we also have:

Therefore the density of our packaging is:

Given our diagram this looks about right – we are only filling less than half of the available volume with our spheres.

**Comparison with real data**

[Source: Minimizing the object dimensions in circle and sphere packing problems]

We can see that this task has been attempted before using computational power – the table above shows the average density for a variety of 2D and 3D shapes. The pyramid here was found to have a density of 46% – so our result of 44% looks pretty close to what we should be able to achieve. We could tweak our measurements to see if we could improve this density.

So, a nice mixture of geometry, graphical software, and trial and error gives us a nice result. You could explore the densities for other 2D and 3D shapes and see how close you get to the results in the table.