You are currently browsing the tag archive for the ‘cannonballs’ tag.

**Stacking cannonballs – solving maths with code**

Numberphile have recently done a video looking at the maths behind stacking cannonballs – so in this post I’ll look at the code needed to solve this problem.

**Triangular based pyramid.**

A triangular based pyramid would have:

1 ball on the top layer

1 + 3 balls on the second layer

1 + 3 + 6 balls on the third layer

1 + 3 + 6 + 10 balls on the fourth layer.

Therefore a triangular based pyramid is based on the sum of the first n triangular numbers.

The formula for the triangular numbers is:

and the formula for the sum of the first n triangular numbers is:

We can simplify this by using the identity for the sum of the first n square numbers and also the identity for the sum of the first n natural numbers:

Therefore:

and the question we want to find out is whether there is triangular based pyramid with a certain number of cannonballs which can be rearranged into a triangular number i.e.:

here n and m can be any natural number. For example if we choose n = 3 and m = 4 we see that we have the following:

Therefore we can have a triangular pyramid of height 3, which has 10 cannonballs. There 10 cannonballs can then be rearranged into a triangular number.

**Square based pyramids and above.**

For a square based pyramid we would have:

1 ball on the top layer

1 + 4 balls on the second layer

1 + 4 + 9 balls on the third layer

1 + 4 + 9 + 16 balls on the fourth layer.

This is the sum of the first n square numbers. So the formula for the square numbers is:

and the sum of the first n square numbers is:

**For a pentagonal based pyramid we have:**

1 ball on the top layer

1 + 5 balls on the second layer

1 + 5 + 12 balls on the third layer

1 + 5 + 12 + 22 balls on the fourth layer.

This is the sum of the first n pentagonal numbers. So the formula for the pentagonal numbers is:

and the formula for the first n pentagonal numbers is:

**For a hexagonal based pyramid we have:**

The formula for the first n hexagonal numbers:

and the formula for the sum of the first n hexagonal numbers:

For a **k-agon based pyramid we have**

and the formula for the sum of the first n k-agon numbers:

Therefore the general case is to ask if a k-agonal pyramid can be rearranged into a k-agon number i.e:

**Computers to the rescue**

We can then use some coding to brute force some solutions by running through large numbers of integers and seeing if any values give a solution. Here is the Python code. Type it (taking care with the spacing) into a Python editor and you can run it yourself.

You can then change the k range to check larger k-agons and also change the range for a and b. Running this we can find the following. (The first number is the value of k, the second the height of a k-agonal pyramid, the third number the k-agon number and the last number the number of cannonballs used).

**Solutions:**

3 , 3 , 4 , 10

3 , 8 , 15 , 120

3 , 20 , 55 , 1540

3 , 34 , 119 , 7140

4 , 24 , 70 , 4900

6 , 11 , 22 , 946

8 , 10 , 19 , 1045

8 , 18 , 45 , 5985

10 , 5 , 7 , 175

11 , 25 , 73 , 23725

14 , 6 , 9 , 441

14 , 46 , 181 , 195661

17 , 73 , 361 , 975061

20 , 106 , 631 , 3578401

23 , 145 , 1009 , 10680265

26 , 190 , 1513 , 27453385

29 , 241 , 2161 , 63016921

30 , 17 , 41 , 23001

32 , 298 , 2971 , 132361021

35 , 361 , 3961 , 258815701

38 , 430 , 5149 , 477132085

41 , 204 , 1683 , 55202400

41 , 505 , 6553 , 837244045

43 , 33 , 110 , 245905

44 , 586 , 8191 , 1408778281

50 , 34 , 115 , 314755

88 , 15 , 34 , 48280

145, 162, 1191, 101337426

276, 26, 77, 801801)

322, 28, 86, 1169686

823, 113, 694, 197427385

2378, 103, 604, 432684460

31265, 259, 2407, 90525801730

For example we can see a graphical representation of this. When k is 6, we have a hexagonal pyramid with height 11 or the 22nd hexagonal number – both of which give a solution of 946. These are all the solutions I can find – can you find any others? Leave a comment below if you do find any others and I’ll add them to the list!

**Galileo: Throwing cannonballs off The Leaning Tower of Pisa **

This post is inspired by the excellent book by Robert Banks – Towing Icebergs. This book would make a great investment if you want some novel ideas for a maths investigation.

Galileo Galilei was an Italian mathematician and astronomer who (reputedly) conducted experiments from the top of the Tower of Pisa. He dropped various objects from in order to measure how long it took for them to reach the bottom, coming to the remarkable conclusion that the objects’ weight did not affect the speed at which it fell. But does that really mean that a feather and a cannonball would fall at the same speed? Well, yes – as long as they were dropped in a vacuum. Let’s have a look at how we can prove that.

**Newton’s Laws:**

For an object falling through the air we have:

p_{s}gV – p_{a}gV – F_{D} = p_{s}Va

p_{s} = The density of the falling object

p_{a} = The density of the air it’s falling in

F_{D} = The drag force

g = The gravitational force

V = The volume of the falling object

a = The acceleration of the falling object

To understand where this equation comes from we note that Newton second law (Force = mass x acceleration) is

F = ma

The LHS of our equation (p_{s}gV – p_{a}gV – F_{D}) represents the forces acting on the object and the RHS (p_{s}Va) represents mass x acceleration.

**Time to simplify things**

Things look a little complicated at the moment – luckily we can make our lives easier through a little simplification. p_{a} will be many magnitudes smaller than than p_{s} – as the density of air is much smaller than the density of objects like cannonballs. Therefore we ignore this part of the equation, giving an approximate equation:

p_{s}gV – F_{D} ≈ p_{s}Va

Next, we can note that in a vacuum F_{D} (the drag force) will be 0 – as there is no air resistance. Therefore this can also be ignored to get:

p_{s}gV ≈ p_{s}Va

g ≈ a

But we have a = dU/dt where U = velocity, therefore,

g ≈ a

g ≈ dU/dt

g dt ≈ dU

and integrating both sides will give:

gt ≈ U

Therefore the velocity (U) of the falling object in a vacuum is only dependent on time and the gravitational force. In other words it is independent of the object’s mass. Amazing!

This might be difficult to believe – as it is quite unintuitive. So if you’re not convinced you can watch the video below in which Brian Cox tests this out in the world’s largest vacuum chamber.

If you liked this post you might also like:

War maths – how modeling projectiles plays an essential part in waging wars.

**IB Revision**

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

The Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial. Really useful!

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions. This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.