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.

Screen Shot 2019-05-19 at 3.36.23 PM

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:

Screen Shot 2019-05-19 at 3.40.12 PM

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

Screen Shot 2019-05-19 at 3.40.16 PM

Screen Shot 2019-05-19 at 3.54.28 PM

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:

Screen Shot 2019-05-19 at 3.54.39 PM

Screen Shot 2019-05-19 at 3.54.35 PM

Therefore:

Screen Shot 2019-05-19 at 3.54.44 PM

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.:

Screen Shot 2019-05-19 at 3.54.49 PM

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:

Screen Shot 2019-05-19 at 3.54.52 PM

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.

Screen Shot 2019-05-19 at 3.36.06 PM

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:

Screen Shot 2019-05-19 at 4.07.43 PM

and the sum of the first n square numbers is:

Screen Shot 2019-05-19 at 4.07.45 PM

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:

Screen Shot 2019-05-19 at 4.07.48 PM

and the formula for the first n pentagonal numbers is:

Screen Shot 2019-05-19 at 4.07.51 PM

For a hexagonal based pyramid we have:

The formula for the first n hexagonal numbers:

Screen Shot 2019-05-19 at 4.07.55 PM

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

Screen Shot 2019-05-19 at 4.07.58 PM

For a k-agon based pyramid we have

Screen Shot 2019-05-19 at 4.08.01 PM

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

Screen Shot 2019-05-19 at 4.20.16 PM

Screen Shot 2019-05-19 at 4.20.22 PM

Screen Shot 2019-05-19 at 4.20.25 PM

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

Screen Shot 2019-05-19 at 4.20.29 PM

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.

Screen Shot 2019-05-19 at 4.28.45 PM

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

Screen Shot 2019-05-19 at 8.58.44 PM

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.

Screen Shot 2015-10-27 at 5.32.24 PM

Newton’s Laws:

For an object falling through the air we have:

psgV – pagV – FD = psVa

ps = The density of the falling object
pa = The density of the air it’s falling in
FD = 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 (psgV – pagV – FD) represents the forces acting on the object and the RHS (psVa) 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. pa will be many magnitudes smaller than than ps – 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:

psgV – FD ≈ psVa

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

psgV ≈ psVa

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.

Website Stats

  • 9,478,200 views

About

All content on this site has been written by Andrew Chambers (MSc. Mathematics, IB Mathematics Examiner).

New website for International teachers

I’ve just launched a brand new maths site for international schools – over 2000 pdf pages of resources to support IB teachers.  If you are an IB teacher this could save you 200+ hours of preparation time.

Explore here!

Free HL Paper 3 Questions

P3 investigation questions and fully typed mark scheme.  Packs for both Applications students and Analysis students.

Available to download here

IB Maths Super Exploration Guide

A Super Exploration Guide with 168 pages of essential advice from a current IB examiner to ensure you get great marks on your coursework.

Available to download here.

Recent Posts

Follow IB Maths Resources from Intermathematics on WordPress.com