Home » Posts

# How to solve a Sudoku using Set Theory

In this entry I am going to look at ow to solve a Sudoku puzzle using Sets and Venn diagrams

### What is a Sudoku Puzzle

Sudoku puzzles have now been around for over half my life, and sometimes I’ll have a go at one. They are not my favourite sort of puzzle but they divert the mind for a while.

If you do Sudoku, you may not realise it, but you are doing a problem in 3 dimensions. Each number has to be unique in three directions – in each column, in each row, in each box.

So that is one I did a few days ago – and yes, I did finish it!

### Venn Diagrams

But before I describe how I went about that, lets track back and look about something I learnt in about Year 7 (or ‘First year seniors’ as we called it in my day!)

Actually I did ask my A-level student from 2 years ago about sets and Venn Diagrams – and he said he hadn’t learnt about them. But there are definitely questions about them on GCSE exams now.

Venn Diagrams were the invention of English Mathematician John Venn who was working about 100 years ago. They are the clearest way to show sets and how they relate to each other.

Let’s just step back one step first though. What is a set?

A set is just a collection of things. Of letters, of people, of cats… even of sets!  Let’s say set A is the ‘the set of all the vowels in the alphabet’,   B is the set of all the letters in the word FACE

This is a Venn Diagram showing set A and set B. The place to look is where the two circles overlap. In that space I have written the letters A and E because  they belong to both sets.

I said that the ‘things’ in the sets could themselves be sets themselves. That might sound like a strange thing to say.  But lets say C is the set of all the elephants in the world and set D which is ‘the set of all sets of animals!’.   Then set C would be in set D!

### How to solve a Sudoku puzzle – using Sets!

Let’s get back to Sudoku. How can set theory help?

When I look on what number I can put into an empty square – let’s say the square in the middle of the second row

In this Venn Diagram, I’m defining the set ‘Row’ to be ‘all numbers that don’t yet appear in row 2. Likewise, the sets ‘Column’ and ‘Square’ are all the numbers that don’t yet appear in the 5th column and the top-middle square.

NOTE: I’ve said numbers are members if they DON’T already appear on the Row, column and square. That is because that is what qualifies them as the right number for the square.

The number 1 is already in the row, column and square.  But we can put the number 2 on the diagram. Its not in the column yet.

If I consider number 3 to 9 in turn and add them to my Venn Diagram, I get this

The right number to put in the box needs to qualify in all three ways. It needs to be in all three sets.   The middle of the Venn Diagram, where all three sets (i.e. the circles) intersect.   We actually have two numbers in that space. 6 and 8.  Actually that means we don’t yet know what number to put in this square. More of the puzzle needs to be solved before this box is.

Do I draw Venn Diagrams  for every blank square? Well, Ok, I draw them in my head, but my thinking follows the same line

I am solving a Sudoku puzzle using ‘Set Theory’

# The next number in a sequence

You probably saw questions ‘What is the next number in the sequence?’   quite early in studying numbers.

### Next number in a sequence example

2  4   6   8   10  ..  what is the next number?

Let’s just ignore the people who can see the answer straight off,  and look for a method.

Look for the GAPS between each number. That is always the best start. In this example, the gap between each number is 2 – To put it another way, the numbers are going UP by 2 each time.

Once we have spotted that, we can move on through the sequence, adding two onto the last number each time.

… 12  14  16

Where we can get clever though is trying to find a general term in this sequence.  This is a step up in effort, for sure.

What we do here is give all the numbers in a sequence a ‘place in the  sequence’   which we do, in true algebra fashion, by using a letter. Its normal to use n in sequences.  Questions will usually ask ‘find the nth’ term?’

We say we the first term in the sequence is n=1,  then n=2 for the second, and so on.  The general term then uses n in a formula. Let’s see how its done

### Finding the nth term

The first thing is to see the gap, as we saw before. In the first example, the gap was 2

1  4  7 10 13

In this sequence the gap is 3

So we start our nth term formula by putting this gap number in front of the n.   2n for the first example,  3n for this example.

So – does ‘3n’ give the sequence we’ve been asked to investigate?

No, because that sequence is

3  6  9  12 15 ..

But we can compare the two sequences – something we do a lot when looking for nth term formulas – and see our sequence is 2 less for eeach term than 3n: 3 6 9 …

so we have our formula   3n – 2

We can check, say, the 5th term  –   5 x 3 – 2 = 15 – 2 = 13. That matches what we were given. We can now confidently predict the 100th term

100 x 3 – 2 = 200 – 2 = 298

### Is the number in the sequence?

Another common question is – is 100 in the sequence 1 4 7 10….

This question has not asked you to find the nth term – but that is the route to finding the answer.

We have already found the nth term for this sequence. This means we need to find n where

3n – 2 = 100.

We start to solve this like an equation, by taking 2 from both sides

3n = 98.

Now we hit a hitch.  n is not going to be a whole number because 3 is not a factor of 98.  In sequences we are only interested in cases where n IS a whole number.

from this we can say that 100 is NOT in the sequence because there is no n where 3n – 2 = 100

### More Practice

For more practice, see this website

# How do we combine powers

In today’s post I will be looking at how to Combine Powers. By a ‘Power’ I mean that little number you sometimes see at the top right of a number.

So – What does it mean?

32  is another way of writing 3 x 3.  ‘Squares’ are quite familiar. But we can extend this idea

56  =  5 x 5 x 5 x 5 x 5 x 5 –  count the 5s – there are 6 of them!

And with that, you can probably how to see how any other ‘power’ calculation can be worked out, like 23150 or 31245 – though you’ll understand if I don’t write those out in full!

Answers to ‘power’ sums can get very big!

By the way, sometimes you will see the word ‘index’ and that means the same thing. And sometimes its called ‘order’, which explains why it is an O in the acronym BODMAS.  If you are not sure what I mean by BODMAS, check here

### How to Combine Powers

Once we understand how something is written in maths, the next step is to see how we can combine powers. How does this idea with things we already know?

For example – what does it mean if we write  63  x 64

The easiest way to see how to make sense of that is the first write this out in full

6 x 6 x 6    x   6 x 6 x 6 x 6  –    and now we have 7 6s  – all times together –  So we can write this as 67

63  x 64 =  67

Now, we don’t want to write things out in full every time, so lets look at what we have really done. Then we can see a short cut.

3 + 4 = 7!  So we can see a rule that might come from this. If you want to multiply power, just add the powers together.

Note that we can only do this if the bigger number is the same. We can’t add the powers and get any sensible answer if we try

54 x  73 – where the 5 and 7 are different. There is a way I would simplify that but I won’t look into that now.

### Some special cases

One last thing for today,  I’d like to consider what 21, 20 and 2-1 all mean.

What does it mean to say ‘Multiply 2 and 2 and 2… -1 times! Doesn’t seem to make much sense, does it? But we can see how these things can mean something if we look again at our rule to combine powers.

So that’s not what we do, but we do want our rule of Index Adding to mean multiplying to still work.

So lets look at

22 x 21 = 23

and 22 x 20 = 22

and 21 x 2-1 =20

The answers I’ve shown here have been worked out by the ‘adding powers’ rule – e.g. 2 + 1 = 3

The first one is the easiest to explain –
2 x 2    – how do we get that to 2 x 2 x 2 ?  By multiplying by 2 again!

so 21 = 2. That makes sense if you can get the sentence  2 multiplied together 1 time!

But what does it mean to say ‘2 Multiplied together 0 times’?

22 x 20 = 22 – But what number doesn’t change others in multiply sums?

The only number that does that is 1…  so it can only make sense that 20 -1

In fact, this is the rule for all numbers 50 = 1 430 = 1 – and so on.

This takes me to my special case, which complete the picture on how to use powers.

21 x 2-1 =20

Using the other two cases we can rewrite this as

2 x 2-1 = 1

from that we can see 2-1 = 1/2 – because thats the only number that completes this sum

We can extend that idea to say any ‘-‘ power  – just put the number on the bottom of a fraction with 1 on the top

So 14-12 = 1/1412

# An algebra problem to end the week : simultaneous equations

I thought I’d finish the week with a problem from my friends at ‘Quora’.. but then I found most of this weeks problems were difficult questions requiring University Maths! Yes I could follow (most) of it but it was all a little ‘off-piste’ for this diary, So here is a problem with can solve using Simultaneous equations

### A word problem

So I have picked out a wordy problem that might look complicated at first sight, but we really just need to turn it into a couple of equations…  Let’s see

Lets call our numbers a and b – That’s always a good start with Algebra.

### Let’s get some simultaneous equations

The first equation gives us the sum. So

a + b = 26.

With the second equation, we need to decide which is the larger number. It doesn’t matter which be choose. Let’s say a is larger.

a =  5 + 2b  (a has a value 5 more than twice b)

This is where we can solve the simultaneous equations. I’ll make a video on all the ways to do this soon, but for now I am going to solve these ‘by substitution’

I am going to substitute into the first equation the expression for a in the second. In the () you will see I have replaced ‘a’ with what a = in the second

(5 + 2b) + b = 26

We can together together terms

5 + 3b = 26

Take 5 from both sides

3b = 21

And from this see that b = 7. And so a = 19 (Twice b plus 5).

As a final check 7 + 19 = 26

So there we have it the two numbers are 19 and 7

For more information on solving simultaneous equations, take a look at this More Help on simultaneous equations

My second post on avoiding and correcting errors seems a bit obvious! Its very important to actually read the question. But it doesn’t stop many people, including myself from forgetting this ‘tip’ from time to time!

### It’s time to read the question!

I’ll show this by an example from the exam paper I’ve just completed.

The first part I answered correctly – see if you can!

### Spot the difference!

Its the second part I am writing about here.  Now I know why I made the mistake. I’d tutored students many times before on questions like this – or so I thought – and I wanted to show off!

I read the question as ‘What was the difference in Monthly average expenditure’ between the two years. I have seen students answer this question before – when it was the question asked – by reading off all the data, adding all the numbers together and comparing.

And I usually tipped the more able students that they don’t have to do this. Its quicker to find the difference in each column and add these up. So that is what I did now….

### Have you seen this question before? Are you Sure?

Thinking you have seen the question before, like this, is a common reason for misreading – And its an error that is going to effect more able students, or at least ones with a good memory!

But this won’t help when the marks are added up.  Its the questions where you think ‘Oh, I know what to do with this one’ that you need to be most careful with, because they are the ones you are more likely to rush into without proper reading

OH, and have you spotted the important detail I missed in the question?

You will see I did too much work, and would have got no credit for it.

If you’d like to see my other post on very basic errors, then follow this link

# When the answer just doesn’t seem right : Correcting Maths Mistakes

I’ve completed  a couple of Foundation exam papers this week, as a bit of forward planning for one of my students – and when I came too compare my answers with the official ones,When I looked at my answers I saw I’d made some mistakes, so this is an entry about correcting maths mistakes.

In this post, though, I’d like to share with you a question that I did get wrong initially, but where I spotted my own mistake.

The thing is – My answer just didn’t seem right.  And that’s what I’d like to share with you in this posts – It’s a very important skill with number questions; To be able to feel when your answer feels right.

This is the question

To make this comparison, you need to work out how much one biscuit cost.

For the 20 Biscuit tin the sum is  £1.50/20. Although this is from a calculator paper, I did this ‘long hand’ and got the answer 7.5p each.

Next I did the calculation for the second tin, again ‘long hand/in my head’  and got the answer 5p per biscuit.

I don’t know how I did this – I made a mistake, and I never pretend I never make mistakes. I just wasn’t taking care.

But what I can do is think ‘Um, that doesn’t seem right. The second box costs a bit more than the first, and has slightly more biscuits.’

The answer just had to be about the same, not as different a 5p and 7.5p. That might seem like a big difference, but 7.5p is 50% more.

So I did the answer again, and found the cost per biscuit was also 7.5p each. The answer was that Nada was wrong, box 2 offers the same value, not better.

This might not work every time – If my wrong answer had been 7.4p per biscuit I may not have spotted my mistake.

But you would be surprised how often just thinking as you write your answer ‘does this make sense’, you can spot some basic errors. Correcting Maths mistakes is essential if you are to get the grade you deserve : Don’t let it effect your grade.

Here is some more useful advise on avoiding errors

It may be a statement of the obvious, but in exam questions the words can give a big clue about how to tackle the question. One of the big ‘Clue’ words in ‘Hence’.

The two sentences above, if you see either in an exam question, they mean the same thing – The next part can be solved by using the work you have just done…   and you’d be a fool not to!  Unless you are flying through an exam time is going to not going spare.

Lets look at one of the question where this applies.

### It starts by asking us to solve

y2 – 7y + 12 = 0

Which we can do by factorising the equation to get

(y – 3)(y – 4) = 0

If you are not sure what we did there, maybe you want to read up on how to factorise quadratics  (Link)

So we find y = 3 and y = 4 are the solutions

So far, so good, and my student had no problem with this

the question continues

Hence solve the equation x4 – 7x2 + 12 = 0 –

which is another way of saying ‘ Hence find the answer ‘

There is one big clue here in exam-speak – the word ‘Hence’

This means you will have done some of the work already. No need to start from the beginning… and maybe starting from the beginning won’t work anyway.

In this case, just compare the second occasion with the first.  There is definitely something similar between – 7y and – 7x2

If we use the substitution y = x

Then we can make that middle part the same – and the first part also is true

y2 = (x2)2 = x4

So with this substitution, the equations are the same!

We solved the first equation to find y = 3 or 4.  Since y = x

x2 = 3 or 4

so x =  +- Root 3 or +- 2

# A little more on Higher Dimensions

Continuing yesterday’s theme of higher dimensions, in this post I look at a couple more 4 Dimension shapes and how they can be represented on a screen.

Thinking about how to show 4 dimensions its helpful to think of ways to show 3 dimensions on a 2D screen. One such way is to take ‘cross sections’.  For example, one way to show a cylinder is a series of circles.  Stack these together and you get a cylinder.

A cross section of a 4 Dimension shape will be a 3 Dimension shape,

Another way of thinking of this is to consider time as the forth dimension*.  Imagine seeing a sphere appearing as a dot, then growing to ‘full size’, then disappearing again at the same rate.  The diagram here would show stages of the process.

I’ve seen other representations of a ‘hypersphere’ but this is the one clearest to me.

How would a ‘Hypercube’ look like, using the same ‘cartoon technique?

(*Some people think this to be the case, through the 4-Dimension space-time physicists work with isn’t that simple, but it will do for this thought experiment).

Before we move off 4-Dimension shapes, I’d like share one of my favourite shapes. This can only exist if we have 4-Dimensions (The closest 3 dimension idea is a mobius strip)

In the picture, it looks like the bottle goes ‘through itself’. In the ‘4 dimensions’ this would not be the case.  Rather like if we want to get past a wall we step over it, using the third  dimension that a creature who knew only two dimensions could not

# Living on a higher dimension

Living on a higher dimension is something I am sure we’d all like to do; Well, if I meant a level of unbound wisdom; This is a Maths Diary, though, so I probably mean Dimension, as in shapes!

Maths students study shapes that have 2 or 3 dimensions.  The underlying maths regarding shape can be extended to more dimensions.

For example, we all know the area of a square is  L2 where L is the length of one of its sides   The volume of a cube is L3, again where L is the length of one of the sides.

### A ‘Cube’ in higher dimensions

So what does L4 represent? Its definitely something we can write down, but does it have a meaning.  Its fair to say that, by extension this  would be the ‘amount of space’ occupied by an equal-lengthed shape in 4 Dimensions!

The difficulty lies in trying to relate that to what we know, as we don’t know 4 dimensions. A 4-dimension cube is often called a hypercube. Another name for it is a Tesseract – and that is a word I’ve only just learnt!

Below is representation of one, but there is a problem with trying to show 4 dimensions, using just a 2-dimension screen.  I’ve seen various ways of doing this, and the way I’m showing here is the clearest to me… Think of the ‘cube inside’ as being smaller only because its further away. Its really the same size.

To an extent we also had this problem in drawing the cube, as shown above. There we were trying to show three dimensions on a two dimension screen.  That was only a ‘gap’ of one extra dimension though, and we are familiar with what a cube looks like.

In my next post I will continue with this theme, and consider how we can show other 4 dimension shapes in two dimensions.

For more on Higher Dimensions, see my next diary entry

# Is BODMAS for Life (Or just for Christmas)?

The question is –  Does the rule for order of calculation, BODMAS  always apply?

(OK so it’s a bit eccentric having a post about Christmas at the start of August, but I liked the title so I am sticking to it)

For a reminder of what the BODMAS rule is,  check here

### Can we ever bend the BODMAS Rule?

Well the real answer is ‘yes’ – but should the rules should be bent sometimes?

This idea started with a post I saw on Facebook. I gave my initial answer yesterday. This morning I had to admit I got it wrong, if we follow BODMAS to the letter.

### A BODMAS Example

The question is, simply, what is the value of

Add 2 + 2 to get 4; multiply by the 2 outside the bracket and get 8;  then 8 divided by 8…  we get the answer 1.

Actually, by BODMAS rules the divide should come before the multiply (D before M)   so it should be 8 divided by 2 (Giving 4)….  4 x 4 = 16

That is probably the ‘Correct’ answer and I had to accept I was wrong  – and there is nothing bad about accepting one is wrong sometimes

### Why I might disagree?

But I still feel somewhat attached to my original answer!  To me,  2(2+2)  LOOKS like a single unit for calculation. If the x sign had been there between the first 2 and the ( , as below, I don’t think I’d have made the same mistake

For me, the () is such a powerful sign,  I see any digit next to it as ‘belonging’ to it, and hence how I did that calculation in the way I did. I can’t claim that is the official rule; just the way I read it.

So my recommendation is, BODMAS rules as they are, if you want to communicate a calculation, if there is any doubt on what you mean, include extra brackets to avoid confusion