Header tag

Thursday, 13 February 2025

Calculator Fun and Games 4: Sums of Digits and Multiples of 9

This post isn't taken directly from Calculator Fun and Games, but it is definitely a puzzle of the sort that Ben Hamilton could have included in his book.  It's very straightforward, and can be demonstrated easily with some examples.



One (or more) players each write down a six- (or seven-, or eight-) digit number on a piece of paper.  Using the calculator, they sum the digits and write down the total.  They then sum those digits (using the calculator), and repeat until they have a single-digit answer.  Largest number wins.

Let's try an example: I'll start with 987654 (regular readers will recognise this from my previous blog post on Calculator Fun and Games, called Over and Out).

987654

9 + 8 + 7 + 6 + 5 + 4 = 39
3 + 9 = 12
1 + 2 = 3

My opponent tries a different approach:

123456

1 + 2 + 3 + 4 + 5 + 6 = 21
2 + 1 = 3

So it's a tie.

Time for a tie-breaker:  I go completely random and punch six digits into my calculator:

946305

9 + 4 + 6 + 3 + 0 + 5 = 27
2 + 7 = 9

My opponent needs to find something special just to draw this round:

813524

8 + 1 + 3 + 5 + 2 + 4 = 23
2 + 3 = 5 

So I win, because 9 is greater than 5.

Analysis

The result for any random number is largely random.  You can't identify the final sum-of-digits just by looking at a number, especially for numbers where the first sum of digits is going to be more than 9.

However, there is a definite pattern in the sums of digits of sequences of numbers which is probably not surprising if you think about it (or use a spreadsheet, as I did to analyse some long sequences of numbers).


The second sum - i.e. the final iteration of the summing - follows a very simple pattern: 1-9, then 1-9 over and over again.  This extends across hundreds (from 899 to 900) and by the same process, extends across thousands (1999 - 2000) and so on.  This means that each digit from 1 to 9 is represented equally as the final sum.  The probability of ending up with a 1 or a 7 or an 8 is equal - each digit has a probability of 1/9 of being the final sum.

And providing you don't memorise a number (or a collection of numbers) which sum to a final answer of 9, this makes it an interesting and fun game for young calculator users.

Not that there are many of them around these days! :-)

Note on the spreadsheet:

To break down a three-digit number to its individual digits (which can then be summed), I used these formula.  Place the three-digit number in cell A1.

Hundreds:  
B1 = INT((A1 - MOD(A1, 100)) / 100)
Takes the remainder of dividing A1 by 100 and subtracts this from A1, then divides this by 100 to provide a digit.

Tens:
C1 = INT((A1 - MOD(A1, 10)) / 10) - 10 * INT(A1 / 100)
Divides A1 by 10 to give a two-digit integer, then subtracts 10 times the hundred digit.  The trickiest of the calculations.

Units:
D1 = MOD(A1, 10)
yields the remainder when A1 is divided by 10 - i.e. the units

Further extension:  asking an AI bot for a series of maths puzzles that can be solved with a calculator, it replied with this:

Magic Number Game:

  • Choose a number, multiply it by 9, and then add the digits together until you get a single digit. This digit will always be 9. Try it with different numbers and see if it works.

So:  is it true that all multiples of 9 eventually sum to 9?

I have known for a long time that the first sum of multiples of 9 is always 9, and can explain why intuitively, but not comprehensively.

1 * 9 = 9
2 * 9 = 9 + (10 - 1) which means that the tens column is incremented by 1, and the units column is reduce by 1.  Therefore the sum of the tens and units will remain unchanged at 9.

9
18
27
36

and so on.

However, this breaks down after reaching 90
9 * 11 = 99
--> 9 + 9 = 18
--> 1 + 8 = 9

...and further iterations of the sums of digits are needed.  I've known this as a useful way of determining if a number is a multiple of 9, but I can't prove why it's always the case except by demonstrating it.  And my A-level mathematics teacher told me that demonstrating for some cases is hardly a proof for all. 

More mathematically advanced brains than mine have already shown why the sums of digits of multiples of nine are always nine - I won't pretend to understand it, but it has been done. 

Further reading


Other Calculator Fun and Games articles:

Snakes and Ladders (Collatz Conjecture)
Crafty Calculator Calculations (numerical anagrams, five digits)
More Multiplications (numerical anagrams, four digits)
Over and Out (reduce large numbers to zero in as few steps as possible)


Sunday, 9 February 2025

Calculator Fun and Games 3: Over and Out

Calculator Fun and Games 3:  Over and Out

This visit to Calculator Fun and Games is one of my favourites, and features a game that I’ve played more than any of the others in the book (even the ‘spell words with your calculator’ game).  It’s called Over and Out, and has a loose cricket theme.  

The rules are simple:  you start with a six-digit number (no zeroes allowed, no duplicated digits), and the aim is to get it down to zero in as few steps as possible, and the target is six (the number of balls in an over in a game of cricket).  The steps are addition, subtraction, multiplication and division, and you can add, subtract, multiply or divide by any one-digit or two-digit numbers.


The example in the book goes like this:

583621

1)       583621 + 19 = 583640

2)       583640 / 40 = 14591

3)       14591 – 11 = 14580

4)       14580 / 45 = 324

5)       324 / 12 = 27

6)       27-27 = 0

Mission accomplished, game over!  583621 is reduced to zero in six steps.

The hints in the book include generally working on subtracting and dividing, but adding or multiplying where necessary to give you a change to divide by a larger number – as we saw in the example here, the first step of adding 19 enables us to divide by 40 in the second step.

The largest six-digit number that has no zeroes or duplicates is 987654 and it presents a challenge!  Here’s how I would have approached it as a young child – the ‘adult’ mathematician will appear later.

987654

1)       It’s even, so I can divide by 2.  And why not?
987654 / 2 = 493827 which is odd, so I can’t divide by 2 again.

2)       493827 – 27 = 493800 which I can divide by 50, or even 80.  I’ll go with 50 for now (because I’m thinking as a child, and I'm not sure how old I would have been when I realized I could divide by 80).

3)       493800 / 50 = 9876  Now we’re talking!  Getting our number down to four digits so quickly puts us in a really good place.  I can see that we can divide this number by four, so that’s my next step.

4)       493800 / 4 = 2469  isn’t divisible by 2, 3 or 5, so I’m struggling to find an easy way down.  I’ll subtract the 69 and it should be easier from there.

5)       2469 – 69 = 2400.  Still quite high, but divisible by 80.

6)       2400 / 80 = 30

7)       30-30 = 0

So it took me seven steps, although I was starting from the highest six-digit number allowed in the game.

Over the years, I’ve played this game quite often when I have a spare minute and a calculator.  In fact, I got so advanced with it, that I started using a spreadsheet to keep track of my results (although I’ve since lost it).  Then, just for good measure, I wrote a macro that would work out the optimal route down from any digit to zero.  It works on one simple principle:  the fastest way down is to divide.  Find the largest factor for any number, and divide by it.  If it’s prime (or its lowest factor is higher than 99) then calculate the highest multiple of 99 below it, and subtract down to it.


Let’s take 987654 as our example, and go through how the macro worked:

1)       987654 – highest factor below 99 is 97.  Divide by 97.
(to determine this, the macro divides 987654 by every number between 2 and 99 and checks if there is a remainder after the division.  If there’s no remainder, then store the number in a variable.  The largest value for that variable after checking all the numbers is the one to use.  In other words, check if (987654/x) = INT( 987654/x).
987654 / 97 = 10182

2)       10182 – highest factor is 6.  Divide by 6.
10182 / 6 = 1697

3)       1697 is prime.  Highest multiple of 99 below 1697 is 17 * 99 = 1683, so we will subtract 14.
(to calculate this: round down the value of (1697/99) to the nearest integer).
1697 – 14 = 1683

4)       1683 is divisible by 99, we set it up that way.
1683 / 99 = 17

5)       17 – 17 = 0

The macro is brutally strong, and took the highest possible value for the game (987654) to zero in five steps.

So let’s change the rules of the game, and look at seven-digit numbers.  Can the macro crunch a seven-digit number down to zero in six steps?  I’ll go first, as an adult mathematician, using every trick I can think of (without using a spreadsheet!).

9876543

1)       9876543 + 57 = 9876600
I prefer this instead of subtracting 43, because I know I can divide the answer by 60, whereas dividing 987500 will only divide by 50.  I’ll do a quick check on my calculator to see if I can divide by 80 (I can’t, fractions aren’t allowed), and hence divide by 60 for my next step.

2)       9876600 / 60 = 164610
So I have a six-digit number, but at least it’s low and it’s divisible by 10.  Easy next step (for the human, anyway)

3)       164610 / 10 = 16461
Now what? I can add 39 and then divide by 50, or subtract the 61 and divide by 80.  I’ll take the second option.

4)       16461 – 61 = 16400

5)       16400 / 80 = 205

6)       205 is visibly divisible by 5, so I’ll do that, get down to less than 100 and subtract what’s left.
205 / 5 = 41

7)       41 – 41 = 0

Seven steps for a seven-digit number seems good to me!  Let’s see what the macro would do:

9876543

1)       Largest factor below 100 is 3.
9876543 / 3 = 3292181 which is prime.

2)       Since 3292181 is prime, find the multiple of 99 which is below it:  33254 * 99 = 3292146.  Second step is to subtract down to this number:
3292181 – 35 = 3292146

3)       This is now divisible by 99:
3292146 / 99 = 33254 (at this stage, the macro is at around twice the value I was at; I had 16461 after my third step).

4)       33254 is divisible by 26:
33254 / 26 = 1279

5)       1279 is prime, so find a multiple of 99 nearby. 12 * 99 = 1188, so I need to subtract down to 1188.
1279 – 91 = 1188

6)       1188 / 99 = 12

7)       12 – 12 = 0

So even my macro needs to take seven steps with this seven-digit number.

Looking further, and with some assistance, I can see that I could improve the human answer.  I reached 164610 after two steps, and some mathematical assistance shows that this is actually divisible by 90 and by 93.  Dividing by 90 gives me 1829, while dividing by 93 gives me 1770.  Let’s follow this path – I’ll recap first:

1)       9876543 + 57 = 9876600

2)       9876600 / 60 = 164610

3)       164610 / 93 = 1770

4)       I can see by eye that 1770 is divisible by 10, but it’s also divisible by 59. 
1770 / 59 = 30

5)       30 – 30 = 0

So my brute-force macro (which I programmed, I’ll take the blame/credit for it) took seven steps by trying to divide by 99 each time, whereas another path can reach the end in five steps.  The macro has a short-sighted strategy – what’s the best ‘next step’ - compared to trying to find a number like 9876600 which can be divided by 60, 93 and 59 to get down to less than 100 in three further steps (in fact 9876600 has 192 factors and 30 of them are below 100, including 1). I will hold my hands up and confess that this was a fluke, I didn’t plan to find such a ‘good’ number with so many factors. 

A follow-up to the macro coding (which I have not pursued) is to take the initial number and work out how to operate on it to get the most factors below 100.  9876600 has 192 factors; 9876500 has only 24, the best next step would be to divide by 50:

1)       9876543 – 43 = 9876500

2)       9876500 / 50 = 197530

3)       197530 / 10 = 19753 which is prime.  Need to find another number within +- 99 of 19753 which has the best sequence of factors (and I need a new algorithm to do that).  For now, let’s use the ‘divide by 99’ even though we know it’s sub-optimal.
19753 / 99 = 199.5 so let’s find 200 * 99 = 19800.  Let’s add up to 19800

4)       197530 + 79 = 19800

5)       19800 / 99 = 200

6)       200 / 50 = 4

7)       4 – 4 = 0

Still stuck on seven steps!

And so you can see why I have whiled away many hours on this particular problem.  It just takes one person and a calculator (and I was playing this when calculators were a feature on watches, not portable phones) and like all good maths puzzles, can be expanded indefinitely.  I could get a spreadsheet and a macro to throw nine-digit or ten-digit numbers around, getting down to zero in minimal steps; or I could use my calculator and take the human approach, and then compare the difference!

Follow-ups are to work out the best way to treat prime numbers.  Anything else can be divided down to something smaller, but the main challenge is what to do when there’s no more dividing available.  At the moment, it follows the “divide by 99 next time”, but it might be worthwhile finding larger factors so that a series of divisions is possible instead of just 99.  That’s a challenge for another day – I’m still happy playing with my calculator and my macro!

Further Reading

An algorithm which determines odd or even to reduce a number to zero, although it only divides by two... instead of looking for the largest factor

Other Calculator Fun and Games articles:

Snakes and Ladders (Collatz Conjecture)
Crafty Calculator Calculations (numerical anagrams, five digits)
More Multiplications (numerical anagrams, four digits)

Wednesday, 5 February 2025

Calculator Fun and Games 2: More Multiplications

My continued mining of the paperback Calculator Fun and Games by Ben Hamilton continues.  My previous post looked at multiplication calculations where the product of a multiplication contained the same digits as the two numbers being multiplied; for example: 2 * 8741 = 17482  leading to numerical anagrams.  In this post, I move forwards a few pages through the book to a similar set of questions, along with the question, "What do you notice?"

Calculators at the ready: here are some more multiplications:


Here goes:

8 * 473 = 3784
9 * 351 = 3159
15 * 93 = 1395
21 * 87 = 1827
27 * 81 = 2187
35 * 41 = 1435

In this case, they're all four-digit numerical anagrams.  I mentioned in previous post that my conversations with AI led me to find a four-digit numerical anagram of this kind - mine was the 27 * 81 = 2187.  So, are there any more?

Yes:  Copilot has found a few (possibly through brute force?)

21*60 = 1260
30*51 = 1530
80*86 = 6880

These are the two-digit * two digit pairs.

There are some single-digit * three-digit pairs that can be added to the list:

3* 501 = 1503
3* 510 = 1530
5* 251 = 1255
6* 201 = 1206
6* 210 = 1260
8 * 860 = 6880

Copilot has indicated that these are ALL the pairs; and it can also suggest a Python or BASIC loop that tries all the combinations of digits in turn (brute force).  It doesn't, however, provide much output on identifying patterns in the numbers.  It helpfully points out that a is a single-digit number, and the other number, b, is a three-digit number.  Their product, a *b is a four-digit number.

I'd call out 6880, which features twice (8*860 and  80*86).  However, that's only because it's possible to move the zero between either a or b.  The same applies to 3*510 (30*51) and 6*210 (60*21).

Otherwise, there's no obvious pattern - these numbers only produce numerical anagrams because of a certain coincidence that occurs in base 10.





Saturday, 1 February 2025

Calculator Fun and Games: Crafty Calculator Calculations

I have written on a number of occasions about the book 'Calculator Fun and Games' by Ben Hamilton, which my parents gave to me as a Christmas present in the mid 1980s.  I'd always found maths interesting, but this book (and a calculator) opened up a world of puzzles and fun in maths.  I have revisited this book periodically, mining it for blog articles, and here I am again, going through it page by page looking at the underlying maths behind some of the games and puzzles it contains.  One such example is Snakes and Ladders (the Collatz Conjecture) which I covered in an article back in 2012.

Another of the puzzles is known simply as 'Crafty Calculator Calculations', and is a series of multiplications, with the question, "What do you notice about these numbers?"

Here are the multiplications.  I shall resist the temptation to throw them all into a spreadsheet, and in the spirit of the book will be using my calculator (a Casio fx-85MS which is about 20 years old).  After all, that's what they idea is - and the book does specify, "Try them on your calculator," so that's what I'm doing.

Section 1: The answers as written

2 * 8714 = 17428
2 * 8741 = 17482
3 * 4128 = 12384
3 * 4281 = 12843
3 * 7125 = 21375
3 * 7251 = 21753
6 * 7251 = 43506 (?)
8 * 4973 = 39784
8 * 6521 = 52168
9 * 7461 = 67149
14 * 926 = 12964
24 * 651 = 15624
42 * 678 = 28476
51 * 246 = 12546
78 * 624 = 48672
87 * 435 = 37845
75 * 231 = 17325
65 * 281 = 18265
65 * 983 = 63895
72 * 936 = 67392

What do I notice?  With the exception of a probable typo that I've highlighted, each of the answers is a numerical anagram of the two numbers being multiplied together.

Extension work 1: Fixing the typo

Firstly, 6 * 7251 = 43506, which is not a numerical anagram.  

Hypothesis:  the 7251 is a typo, having appeared in the previous line.  The six is probably correct, since it comes between a series of threes and before a pair of eights.

I've tried multiplying 7251 by 4, 5, 6 and 7, and none of them produce numerical anagrams, so the 7251 is definitely the typo.

Hypothesis: Fixing the typo is going to be difficult, unless I can find some patterns in the larger of the two numbers which are being multiplied.  Is there a pattern?

What do these numbers have in common?
8741   - prime
8714 - not prime
7461 - not prime
926 - not prime

So the answer is - not much.  It's more like a random distribution, although 1 and 7 appear quite frequently (because any number y multiplied by another number that ends in 1 will have the digit y at the end).

I can find (with relative ease) examples where I can get an anagram of four of the five digits:

5 * 6321 = 31605 (containing a zero instead of a two)
6 * 5321 = 31926 (containing a nine instead of a five)

But I haven't yet found one that will replace the error in the original question.

So the question is:  Is the initial set a complete set with no further triplets of numbers?

It's unlikely that this is a complete set - they're such an arbitrary bunch that it's highly possible there are many more.  But is there a way of making this a systematic search instead of just random guessing?

- the units of the larger number are either 1, 3, 4, 5, 6 or 8

- the smaller number and larger number have to multiply together to form a five-digit number.  3 * 2894 will only produce another four-digit number, for example.

The answer (through only trial and improvement) is that this is NOT a complete set of triplets.  For example:

5 * 2519 = 12595 is an example not included in the original list.

Four digits:  27 * 81 = 2187 (that's what you get for asking AI for help, and not specifying that you want a five-digit number).

Conclusions:

AI says this is an interesting exercise in combinatorics, but didn't actually add anything to the search (it would have taken longer to explain the question to it than it would to have found more myself). 

"There is a specific quantity of numbers that satisfy the requirement a *b = c where c is a numerical anagram of a and b, containing each of the digits of a and b once each, and where c is a five-digit number."

But can I fix the typo in the original series of questions?  No, and I have tried! 

Other articles in the Calculator Fun and Games series:

More Multiplications (numerical anagrams, four digits) - the sequel to this article!
Over and Out (reduce large numbers to zero as rapidly as possible)
Calculator Games: Front to Back
Snakes and Ladders (Collatz Conjecture)
Calculator Fun and Games: The Kaprekar Constant




Thursday, 2 January 2025

Solving PEMDAS Problems

PEMDAS Problems

PEMDAS problems are a common challenge for anyone using math – especially when you're learning PEMDAS in school for the first time, and without much real-life context. PEDMAS stands for Parentheses, Exponents, Multiplication, Division, Addition, and Subtraction. It's a set of rules that tell you the order to follow when solving a math problem to get the right answer, and an answer which mathematicians can agree on internationally.  PEDMAS is the term in the US; BODMAS is the term used pretty much everywhere else.  I can't help wondering if this is going to end badly.

  • Parentheses always come first. You must calculate everything inside the parentheses before moving on.
  • Exponents (like squares, cubes, or square roots) are next.
  • After that, it's the arithmetic functions: Divide, Multiply, Add, Subtract.  In BODMAS, Division always comes first.  For some strange reason I have not been able to fathom, in PEMDAS, you just do everything from left to right.  It's sure to cause confusion, and a quick look at social media will tell you that.  How can it not, if 3 *4 /3+2 is PEMDAS does 3*4 and then divide by three, and then add two?  If it's BODMAS then you do the division first, even though it's not on the left.  Let's leave that for a whole other discussion.

Why is PEMDAS Important?

Imagine you have this expression: 3 * 4 - 2

  • Without PEMDAS, it's unclear whether you should multiply 3 by 4 first, or subtract 2 from 4.
  • PEMDAS helps avoid confusion and makes sure everyone gets the same answer.  It's worth pointing out at this point that real mathematicians, who want to communicate unambiguously, always want to avoid confusion.  And by real mathematicians, I mean anybody except the fools who put stupid questions on social media just for the conflict.

Let's Look at Some Examples:

  1. (3 * 4) - 2

    • Parentheses first: 3 * 4 = 12
    • Subtraction: 12 - 2 = 10
  2. 3 * (4 - 2)

    • Parentheses first: 4 - 2 = 2
    • Multiplication: 3 * 2 = 6
  3. 4 * (6 - 2²)

    • Parentheses first:
      • Exponents: 2² = 4
      • Subtraction: 6 - 4 = 2
    • Multiplication: 4 * 2 = 8

Why Does PEMDAS Sometimes Cause Trouble?

  • Tricky Online Problems: Some people intentionally write confusing problems (like 1 + 7 * 3) to see if others can solve them correctly.  There is a correct answer, but the ambiguity is a bigger problem than the math.
  • Everyday Math: Even simple situations can involve PEDMAS. For example:
    • If each car has 4 wheels and is towing a caravan with 2 wheels, how many wheels are there in total for 4 cars?
      • Correct: 4 * (4 + 2) = 24 wheels 
      • Incorrect: (4 * 4) + 2 = 18 wheels.  Four wheels on four cars, and two for a caravan is not enough.

PEMDAS helps us avoid these kinds of mistakes and ensures we get the correct answer every time!

Other online reading

The Math Equation Solver (will handle PEMDAS problems)


Other Calculator Fun and Games articles:

Snakes and Ladders (Collatz Conjecture)
Crafty Calculator Calculations (numerical anagrams with five digits)
More Multiplications (numerical anagrams, four digits)
Over and Out (reduce large numbers to zero as rapidly as possible)
Calculator Games: Front to Back
Calculator Games: Up, up and away with Ulam sequences
Calculator Games: The Kaprekar Constant


Sunday, 29 December 2024

First times of 2024

You may think that as you get older, you do fewer and fewer things for the first time.  But actually, no, that's not the case.  And here's the list of things I can remember doing for the first time in 2024 - in no particular order.


First time keeping a close eye on how much chocolate I eat, and cutting beetroot out of my diet completely.  In 2023, I was diagnosed with kidney stones - not serious, but potentially painful.  They had been the cause of some discomfort for me in the second half of 2023, and I had various medical checks; the recommended treatment for them is to manage them through my diet.  Anything high in oxalates is out; anything with medium levels has to be taken in moderation.  So, I've not had any beetroot for the whole year, for the first time ever (this was a sad loss for me, I love pickled beetroot) and I've watched my chocolate intake.  I don't think I had any chocolate in January or February, then I lightened up a little.  It's not all bad news, so don't sell your shares in Cadbury's just yet!

First time seeing the Northern Lights.  Twice.  The first time I didn't actually think I'd seen them - they looked more like light pollution on the north horizon.  The second time, there was no mistaking them, even if they were still quite faint.

First time leaving the kids overnight with a babysitter, while spending a night with Naomi at a friend's wedding.  That was during the summer, and was a Friday night/Saturday morning.  We didn't go far, which made it an ideal first time for us to leave them altogether for most of Friday and most of Saturday morning.  They went to the cinema together on the Friday; we went to a wedding, meal and disco.  I think we had the best of it.

First time going to an airshow and giving somebody else my camera to take photos.  It worked out well - I got some mediocre video (a combination of the viewfinder on my camera, and the dreadful weather) while Liz took some amazing photos with the stormy skies.




First time using generative AI to produce a picture... and then produced dozens more.  I've also used generative AI (Chat GPT) to write BASIC programs for me.  I have marvelled at the ability of AI to turn text into images, and then got on and started using it without thinking too much about it!

First time laying loft boarding (successfully too).  Our loft is in two sections - the main part and a smaller section.  For some unknown reason, the smaller section (which has its own separate access) was never boarded over, but was very well stocked with fibreglass insulation.  In November, I boarded over most of the smaller section - enough to house our Christmas decorations when Christmas is finished.  That frees up more space in our main loft... for my train set! :-D

First time going on board a warship - the HMS Belfast in London.  We went on a family trip during October half term and spent three days in London; I took the boys round the interesting sights, while Lizzie and Naomi did the art galleries and Shakespeare's Globe.  We saw some locations we hadn't seen before, including HMS Belfast, which is highly recommended and free if you have Blue Peter badges (the boys do).  I went on a tour of a submarine when I was about six, but considering a submarine is all 'inside' with no windows, I can safely say the warship was far more interesting, with a strange alternating feeling of vertigo (on deck) and claustrophobia (inside).  

First time buying a car online, after the previous one started producing more smoke than one of the Red Arrows during their display.  We drove about four miles back home one Saturday afternoon, billowing huge clouds of bluish-white smoke, and deterring all other motorists within 300 yards.  Within 10 days we'd needed to order a replacement - online.  Same model, newer interior.  It's better than the old one too, with more gadgets inside.

First time playing a massive multiplayer online game - Fortnite - and subsequently the first time I bought my own gaming controller.  I've been a keyboard warrior since the mid 80s (almost before the internet was created) and then migrated to a mouse when I started playing real-time strategy games in the early 90s.  I had been borrowing my son's controller throughout January and most of February, and bought myself my own controller with my birthday money in mid February.  It's taken some minor damage to the cables (in early December) and still works perfectly, even if I'm not as good as my sons at playing!

First time learning, and coding in Python.  My programs are not complicated, and they all work on a local PC without any network access, but it's been very interesting and challenging.  I have considerable experience writing in BASIC and Visual Basic, and this was just the next step - learning a new syntax.  I wrote a program which will calculate how long people will have to wait in a queue at a supermarket, and then calculated the time savings from opening two (or more) checkouts at a supermarket compared to just one.  The results were very surprising, and I actually enjoyed analysing the output of the program.  More to follow next year.

In 2022, I became a Trustee for my church - overseeing the running of the administration of the church (legal compliance, health and safety and so on).  In 2024, I was asked and then was nominated to become the Treasurer of my local Scout group.  No, I don't know exactly what I'm doing, but I can operate a spreadsheet with ease, and I'm getting there.

First time going to a gym.  If you've met me, you can tell from my physique that I'm not a regular gym-goer.  Or ever been to a gym, even.  I was described during my teenage years as a bean-pole, and I've not put on much weight or muscle since then (except when I was at university, cycling six miles a day and becoming very trim indeed).  However, December at my local gym was 'bring a friend to the gym' month, so Lizzie brought me.  I've been three times this month, and I've still got the moves to cover 13 miles in an hour on an exercise bike.  It's not quite as scenic as being on a real bike (took Lizzie on a bike ride for the first time ever this year too) but there's less traffic and the weather is more amenable.

First time running on a treadmill - Isaac decided last December that he wanted one (he's a miniature runner), and so last New Year's Eve we bought him a cheap second-hand one.  I used it more than he did, but even so, it wasn't worth the space it took up.  It was fun while it lasted!

The Lists of Firsts

A first time for everything: 2018
2019 in reflection
First times in 2021 list
First times of 2022
First times in 2023
Things I did for the first time in 2024


Thursday, 5 December 2024

BODMAS Problems

 BODMAS problems are a recurring challenge throughout the life of a mathematician - especially at school or college.  

If you use PEMDAS instead of BODMAS, you might find my article on PEMDAS Problems helpful instead.

BODMAS stands for Brackets, Operators, Division, Multiplication, Addition and Subtraction, and sets out the order in which you must work through a maths problem to get to the correct answer.  Brackets (called Parentheses in the US) always come first, and you have to calculate what's inside them before you do anything else.  Operators are 'powers' or 'indices' and include squares, cubes, square roots and cube roots.  The rest are the normal arithmetic calculations.

For example (3*4)-2 is not the same as 3*(4-2).  And without the brackets, you'd be looking at just 3*4-2 which is ambiguous.  It's not clear which way round you're supposed to do the calculations.  What do you do first?


Mathematicians don't make these rules up to be awkward or difficult.  Mathematicians hate confusion, ambiguity and uncertainty, and therefore they use BODMAS and brackets and all these rules so that when they talk to other mathematicians anywhere in the world, they are entirely clear what they're talking about.  They are even more specific and precise than scientists (in my experience) and will take great care to make sure that they are crystal clear about their calculations.

In my experience, mathematicians who understand BODMAS problems don't get involved in the BODMAS questions that go around on social media, where there are no brackets and a whole flame war kicks off between people who defend their answer to 1+5*3.  These are badly-written problems, written that way on purpose.

Let's take a look at some simple examples of BODMAS problems, and identify some of the possible pitfalls along the way:

a) Let's start with (3*4)-2

The brackets here clearly indicate that we should calculate 3*4 first.  3*4 = 12.  12 -2 = 10.

In fact, the brackets aren't required here - Multiplication always comes before Subtraction.

Let's change the position of the brackets:

3* (4-2)

Without the brackets, we'd do 3*4 first, but with the brackets, we must calculate 4-2 first.

4-2 = 2

3* 2 = 6

So there's a clear distinction between 10 and 6.  We must be careful with our BODMAS problems.


Another one:

b)  4 * (6-22)

First is Brackets.  We must calculate the contents of the brackets, which is 6-22.
Within these brackets, we must do the Operator first.  Operators are squares, square roots, and any other powers.  In this question, the operator is the 2 squared.

22 = 4
6-4 = 2

So the contents of the Brackets comes to 2.

4*2 = 8

Let's compare this with the same calculation without the brackets, and use BODMAS to find out the value of 4 * 6-22

BODMAS says that we do the Operators first (there are no Brackets in this question), and we know that 22 = 4

This gives us:  4 * 6 - 4 

Next, we do the multiplication, so 4 *6 = 24
And finally, the subtraction, 24 -4 = 20

So now we have a difference between
 4 * (6-22) = 8
4 * 6 - 4 = 20 

Clearly we're going to have to be careful!

c) This time, let's do a calculation with algebra:

x2  + (2x * 6x) + (x -z)

Remembering to do our brackets first, we get:

x2  + 12x2 + x - z

Operators: we can't do anything further with these at this stage; all that remains now are Addition and Subtraction.  Addition comes first:

x2  + 12x2 + x - z = 13x2  + x - z

And we can't simplify this any further.

Why does BODMAS cause problems?

BODMAS expressions, like 3* (3+5+6) can occur even in simple everyday maths situations.

For example, how many wheels are there in total with on four four-wheeled cars if each car is carrying a caravan which has two wheels?

A car has four wheels; a caravan has two wheels.  That's six wheels.  And there are four cars and caravans, so that's 4 * 6 = 24 wheels altogether.

However, if you misunderstood or miscalculated, you might work like this:

There are four cars, each with four wheels.  That's sixteen wheels.  And two wheels for the caravan makes 18 wheels.

4 * (4+2) is very different from (4*4) + 2.  And that's why we have BODMAS - to help us avoid problems and misunderstandings, in cases from cars and caravans to planets and stars!

If you enjoyed this article, you may also be interested in some of the other articles I've written about mathematical subjects:

BODMAS on Social Media - What's The Fuss?
BODMAS and Badly Written Maths Questions
Snakes and Ladders (the Collatz Conjecture)
Crafty Calculator Calculations (numerical anagrams with five digits)

More Multiplications (numerical anagrams, four digits)
Over and Out (reduce large numbers to zero in as few steps as you can)
Calculator Games: Front to Back
Calculator Games: Up, up and away with Ulam sequences
Calcualtor Games: The Kaprekar Constant