Thursday 18 October 2012

A fine cipher!

As part of the National Cipher Challenge one of the student Codebreakers, Megan, independently cracked the new codes by realising that it was enciphered as an 'Affine Cipher'

Megan looked up how Affine Ciphers worked so that she could crack it.
She wrote up a great guide to what an Affine cipher is and how to use one...



Affine Ciphers

The Affine Shift Cipher is a special type of substitution cipher, similar to that of the Caesar Shift Cipher. However, instead of just ‘shifting’ all the letters by a certain amount, we must first convert each letter into a number, as shown below:

A
B
C
D
E
F
G
H
I
J
K
L
M
0
1
2
3
4
5
6
7
8
9
10
11
12
 
 
 
 
 
 
 
 
 
 
 
 
 
N
O
P
Q
R
S
T
U
V
W
Z
Y
Z
13
14
15
16
17
18
19
20
21
22
23
24
25


We then apply a function to the letter which you had converted into a number, in the form ax + b, where x is the number of the letter and a and b are constant amounts which we apply to every number.


For example, lets try coding the word BEACH, by using the function 3x +2. (i.e. a = 3 and b = 2, where x is the number of each letter).
So lets start with B, which we can convert into the number 1. 
We then input this into the equation 3x + 2.
3(1) + 2 = 5
We then convert this number back into a letter, using the same key as above.
5 = F
So the letter B has transformed into the letter F.
We then do the same thing for each of the other letters.
E = 4 à  3(4) + 2 = 14 à 14 = O
A = 0 à  3(0) + 2 = 2  à  2 = C
C = 2 à 3(2) + 2 = 8   à  8 = I
H = 7 à 3(7) + 2 = 23 à 23 = Z.

So the coded message of BEACH when applying the function 3x + 2 is FOCIZ"

After Megan worked out what Affine ciphers were she then cracked the new code. Read Megan's account of how she cracked it...


In the code, only 2 letters were ever on their own - L and Z. So i assumed they were a and i.
L = 11
Z = 25
a = 0
i = 8

So i thought, if L = a, then b would have to equal 11. (ax0(because a = 0)+11 = 11 (which = L)
So then if Z = i, the equation would be 8a + 11 = 25 (mod 26)
So then I tried inputting numbers 1,2,3,4 etc up to 25... it was annoying because I kept making mistakes... then (after 13 was kinda working but not properly) remembered that when i had first looked up the affine shift cypher it said it could only be 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25 (which i realised obviously made sense cuz else you wouldn't be able to get all the letters because the others are factors of 26). So then i started again from 3, and then i did 5 and it worked (I'd obviously made a mistake last time). 8 x 5 + 11 = 25! So then i thought 'oh hey, a (in the equation) must equal 5!'
(^ ^ if this hadn't worked I would have tried L = i and Z = a, but thankfully it did)



So then i found this website where you could put in the code and what a and b equal and it would decode it for you. It showed me i was right (thankfully! I'd already tried a few combos and they had failed) however, it didn't leave spaces between words... so...
Then I went on the Simon Singh website and found this 'black chamber' thing. I put in L = a and Z = i, and then worked out the other letters by matching them up using the website I used before or subbed the numbers of the letters into 5x+11. I also used the frequency thing which was cool (useful for the most common letters like e)


Megan's method of cracking this code mirrors exactly how modern codebreakers try to crack codes...using some intuition, reading up on how some codes work and a fair bit of work!

Saturday 13 October 2012

A great mathematician you'd be lost without!



Leonhard Euler

1707 - 1783

Euler (pronounced 'oiler') was a Swiss mathematician who has contributed a huge amount to much of the maths that is used today. In fact we probably wouldn't have Sat Nav if it wasn't for Euler!

Although it may seem he was around a long time ago, compared to Pythagoras (570 BC!) it's pretty recent...

He made a real difference in lots of areas of maths from algebra to number theory and to geometry, where he effectively 'invented' a whole new area of maths that's called 'Graph Theory' and which has led on to 'Topology' which is a way of looking at shapes, where shapes are considered the same if they can be squished or stretched to be the same as long as no holes are filled in and no new holes are made. So in topology a teacup is considered to be the same topology as a doughnut! (because they both have 1 hole in them)







In Year 12 Further Maths we're looking at Euler's Graph Theory, we'll be looking to see how it can be used for very practical purposes. Car Sat Navs rely on the theories that were first started by Euler and if you have ever used Google Maps to find your way, you have Euler (and a few others) to thank!

View Larger Map

It all started with a problem about bridges in the Prussian town of Konigsberg (what is now Kaliningrad in Russia). On a Sunday afternoon people would go for a walk over the 7 Bridges of Konigsberg going through the different areas of town. The challenge was... is it possible to visit all the areas of town by crossing over each bridge once and only once?
Have a go...!


It was Euler who first proved that it was in fact impossible... Read more about it here... and it was his new way of thinking about the problem which created the mathematics of Graph Theory and then Topology...

Have you ever tried to draw the house with the cross without taking your pen off the paper and without retracing any lines? what about the one on the right? These are examples of graphs
It's thanks to Euler that we know when it is and when's it's not possible to do this. Can you make a 'graph' that you can draw without retracing and one that you can't?



Saturday 6 October 2012

Elephants, snowflakes, fractals and infinity...

...one of the most recent areas of discovery and interest in maths is Fractals...

Fractals are amazing geometric shapes that have some pretty interesting properties... they're basically shapes that look the same or contain the same level of detail no matter how far you zoom in... if you imagine zooming in on the circumference of a circle it starts to look straighter and straighter, it's not a fractal...

There's a famous fractal called the Koch snowflake which is made up of equilateral triangles using the simple rule that half way along every side of the triangle there's another triangle a third of the size... 



Some surprisingly complex shapes can be made by fairly simple rules, like one of my favourites the "Mandelbrot Set"...




It's this idea that simple rules can create complex structure that lead us to believe that fractals are behind how much of nature works, and by understanding the behaviour of fractals and what's called 'Choatic maths' we may be able to understand how nature works. 

Can you find some examples of nature behaving a bit like a fractal...? find some and comment on this post... there are gold forms and maths stickers available!

In fact Fractals are used in lots of computer games to make things look as natural as possible.



There's this great woman called Vi Hart who as well as being a great mathematician is an amazing doodler! Check out her fractal influenced doodling...




Thursday 4 October 2012

Secrecy, codes and hacking...


The National Cipher Challenge has just started!

Join the Kingsbridge Codebreakers to help try and crack the codes to help us win £3,000 as well as learning how codes are made and to help out with your maths as we go...






Codes have been used for thousands of years from very basic ones such as the Caeser Shift Cipher, used during Roman times to pass secret messages by Roman Emporers to more sophisticated ones such as RSA codes that the whole of internet security relies on. RSA codes use the fact that it's pretty hard, even for computers to break up numbers into its prime factors... especially pretty big numbers... for example try and find the 2 prime numbers that multiply to give 4757 (comment your answer at the bottom of the post...1st correct wins a gold form). A computer can obviously work this out in under a second but even a computer takes a little while to work out the 2 prime factors of a number like: 16152174667064029642647365822885998430666314431815268152405470907824573659036629
72483772980826569393306732864932303362619914669385966910731129686267107921489042
39628873374506302653492009810626437582587089465395941375496004739918498276676334
238241465498030036586063929902368192004233172032080188726965600617167

And it's because it takes soooooooooooo long, in fact, one of the ones that has been cracked took 9 years!!!!.... that we can use this code to encrypt data and websites...
A Caeser Shift cipher (shift 2)

Without understanding the maths behind such codes the world wouldn't be able to function in the way it does.

Check out lots of different codes here.

Better still join Kingsbridge Codebreakers  and learn how to make and crack them!



Monday 1 October 2012

It's all about nothing...powers of nothing...

In Year 8 we've recently been looking at powers and some equations and graphs involving powers.




What are powers???
Remember you can think of raising to the power as how many times you multiply a number by itself, for example 2 to the power of 3 is 2^3 = 2x2x2 = 8

We had recently used the laws of indices to discover that any number (except 0) raised to the power of 0 is actually 1...click here for more info

Jordan in Year 8 went away and looked at what 0 to the power of 0 is...

Have a look through what Jordan found out and the piece of research he produced ...








Thursday 27 September 2012

Measuring angles - why 360 degrees?

Most of the time at school we use 'degrees' to measure an angle... first of all what is an angle???
I think of an angle as the amount you have to turn one line so it meets the other.




There are lots of ways of measuring this but a very popular one is using degrees, where we say that there are 360 degrees in a full turn. But why do we use 360? Why not 100? or 400?


It seems to go back to the ancient Babylonians (in an area which is now within Iraq), who were extremely influential on a lot of maths we still use today, as have been many other cultures such as the Greeks, Chinese and Indians.
The Babylonians counted using 60s rather than tens and considered the number 6 to be of strong importance and therefore 6 x 6 = 36 to be particularly significant. This was supposedly backed up by observing there are approximately 360 days in a year, so a full circle being made up of 360 parts or degrees seems to make sense.
360, by a bit of luck(?) turns out to be fairly useful because it has a lot of factors 

However there is another useful way of measuring angles using 'radians' instead of degrees.
Radians are particularly useful for higher level maths and are based on the idea of how many lots of the diameter of a circle, with radius of 1, will wrap around the circumference.
1 radian is equal to about 57.2958 degrees. Radians use the value π 

Friday 21 September 2012

x.... why do we use x in Maths?

In Maths when we want to use a letter to stand for a number that we don't necessarily know yet or that we want to use different values for... we often use the letter x ... for example... the cooking time for a chicken is 40 minutes for every kilo, so the time it takes depends on how heavy the chicken is... 
We could turn this into a formula where  x  is the weight (in kg) of the chicken  Time = 40x
This is what we often mean by algebra

So...
when x = 1 the cooking time is 40 x 1 = 40 minutes
when x = 2 the cooking time is 40 x 2 = 80 minutes
when x = 3 the cooking time is 40 x 3 = 120 minutes
when x = 4 the cooking time is 40 x 4 = 160 minutes
when x = 5 the cooking time is 40 x 5 = 200 minutes
....

The formula Time = 40x   saves us from having to keep writing this out lots of times!

But why x?

There are a few theories however a popular one is that back in the 17th Century in France a famous philosopher and mathematician René Descartes was sending a lot of maths to get get printed. In order to print a book the printers had to use individual blocks of wood with each letter. In René's maths he used lots of different letters to stand for the 'missing numbers' and the printers suggested that in the French language they didn't use many x's so they had plenty of them they could use.... so as a result, all of René's 'missing numbers' are shown using x.

René Descartes also introduced the idea of using (x,y) coordinates and graphs

Click here to read more about the history of algebra and here