Thursday, 26 June 2014

What are vampire/perfect/happy/palindromic numbers? - Part 1

There are many different types of numbers and classifications of numbers, some of which you will have heard of such as the obvious integers, negatives, evens and the like. However, there are also some rarer, more interesting types a few examples of which I will give now.
Vampire Numbers
Vampire Numbers are whole numbers which can be factorised into two numbers which together have the same digits as the original number. The two factors must have half the number of digits of the original number, and the number itself must therefore have an even number of digits (the factors must also not both have trailing zeroes). It is easier to explain these with an example, so I will give one. 1395 is a vampire number because it is 15 multiplied by 93 and 1395 has the same digits as 15 and 93.Similarly 1260 is a vampire number as it is 21 times 60 and 1435 is 35 multiplied by 41.
There are also different subsets of vampire numbers such as numbers which have two or more possible pairs of ‘fangs’ (as the factors are known). The first one of these is 125460 which is 204 × 615 and 246 × 510, the first number with three possible pairs of factors is 13078260, which equals 1620 × 8073, 1863 × 7020 and 2070 × 6318. I could go on. Also there are Pseudovampire numbers whose fangs are not equal to half the number of digits of the original number. There are lots of these, well infinitely many, such as 126 which equals 6×21. Finally, there are Prime vampire numbers whose fangs are its (only) prime factors as in 117067 which is 167*701.

Perfect Numbers
Perfect numbers are numbers whose divisors (not including itself) sum to the original number. The first example of this is the number 6, whose factors are 1, 2 and 3, which clearly add up to six, and the second perfect number is 28, which is 1 + 2 + 4 + 7 + 14. What is interesting about Perfect Numbers is that they are indefinitely linked with Mersenne Primes, which are primes which are 1 less than a power of 2 such as 3 which is 1 less than 4, 7 (1 less than 8) and 31 (1 less than 32). For every Mersenne Prime, m, m(m+1)/2 is a Perfect Number. For example, the first Mersenne Prime is 3 and 3(3+1)/2 = 12/2 = 6, the first Perfect Number. Leonhard Euler, one of my favourite mathematicians, proved that all perfect numbers are like this. As a concept, they are very old. The Greeks knew the first four (6, 28, 496, 8128), and the fifth was first recorded in the mid 15th century.

Amicable and Sociable Numbers
Perfect numbers are linked with Amicable and Sociable numbers, which both involving adding up the factors. Amicable numbers come in pairs, such as 220 and 284, where the sum of the factors of the first number is the second number and vice versa. Other pairs include 1184 and 1210 as well as 2620 and 2924. Sociable numbers are groups of numbers that form a chains so that the sum of the factors of A equals B, the sum of B equals C and the sum of C equals A. One such group is of four numbers; 1,264,460 -> 1,547,860 -> 1,727,636 -> 1,305,184 which goes back to 1,264,460. One delightful use of amicable numbers is as a nerdy, romantic gesture as shown by the people at Maths Gear -

Wednesday, 25 June 2014

Why does 5 round up? – The maths of rounding and approximating

I was taught from a young age, as I’m sure you were too, that 5 and numbers greater than 5 round up, whilst numbers smaller than 5 round down. But why?

The essence of rounding numbers is to get an accurate, long value such as 6.72 and make it an easy, simple value like 7. In order for the final number to be as close as possible to the original, whilst still being simple, you must find the nearest ‘nice’ (which depends on the context) number. The important word here is nearest.

This means that if you were rounding 6.72 you would chose 7 as that is closer to 6.72 than 6. In the same way, 6.42 would round down to 6, as 6.42 is close to 6 than it is to 7. It follows that 6.49 would round down while 6.51 would round up, 6.499 down and 6.501 up, 6.4999 down and 6.5001 up. The division is clearly going to be at 6.5, but that is equidistant from both 6 and 7 so which way does 6.5 go?

The answer lies purely in convention, from a purely mathematical perspective it should do neither, but then again rounding isn’t a purely mathematical concept. There are many different methods of sorting this, from the odd/even rule to the 5 always rounds up to the view that nothing in real life would give a value of exactly five. It also depends on context, however, for example if the maximum voltage for a circuit is 4.5V you should round that down to 4V rather than face the danger of going above the exact value. On the other hand, if you need a minimum fuse of 3.5A you should round that up to 4A in order for it not to fuse when a normal current goes through it (I admit my knowledge of electronics is limited). All in all, the general convention is that 5 rounds up, albeit with little mathematical basis.

Rounding also leads to other interesting fallacies and mistakes. Recently someone asked me whether 4.46 would round up or down. Immediately I said 4, with my opinion that 4.46 is closer to 4 than 5. However, their argument was that 4.46 would round up to one decimal place to give 4.5 and that would then round up (as we have decided that convention dictates 5 rounds up) to 5. This shows the issue with rounding a rounded number, which can cause numerous differences such as in this case the large difference between 4 (a lovely, even, perfect square) and 5 (a nasty, odd, prime number). In these situations, it is important to go back to the trick of, is it closer to 4 or 5?
Another fallacy caused by rounding is the practice of performing calculations on a rounded number which is perfectly shown in this classic joke:
Museum goer: How old is this dinosaur?
Tour guide: 70 million years and 2 weeks
Museum goer (shocked): How do you know?
Tour guide: When I first started working here the manager told me the dinosaur was 70 million years old. And I’ve been working here for 2 weeks.

This shows the issues with false precision, which in other words is taking a rounded number literally.

In conclusion, although rounding is essential in the real world, it is easy to make mistakes and important to question the essence behind the mathematics of rounding.

Why do I love maths? – A maths student’s apology

To start off my entry into the ‘blogosphere’, I am going to explain, in the style of G.H Hardy’s A Mathematician’s Apology, why I love maths and why you should too.

Firstly, I love maths because it ranges from the simplest ideas, such as 1+1=2, to such incredibly complex thoughts as Graham’s Number and the Riemann Hypothesis. This means that anyone can do maths; it is not limited to a select few as neurobiology is, and you don’t need to be in the top 100 people to understand it as is the case with quantum physics. Also, all of the complex, difficult and high-level pieces of mathematics are all dependant on the simplest of axioms and can be most proven from them. This amazes me, how so many proofs, conjectures, theorems, theories and hypotheses can all stem from the numbers 1, 2, 3 etc.
“Mathematics allows for no hypocrisy and no vagueness.” Stendhal

Maths is also useful yet remains self-rewarding. Although maths nowadays is used for so much of our modern life, from binary in technology to cyphers for internet banking, the thrill of maths often comes from the doing of the maths. Maths for the sake of maths. This gives maths an artistic quality, and both areas are similar in many ways. In the same way some may find a Mondrian painting beautiful, I find Pascal’s triangle beautiful and in the same way multiple artists can see one painting in many different ways, many different results can come from one mathematical concept.
“A mathematician, like a painter or a poet, is a maker of patterns” G.H Hardy

In addition, maths is permanent; it was as true one thousand years ago as it is today and will be in one thousand years time. As Hardy wrote in A Mathematician’s Apology:
“Archimedes will be remembered when Aeschylus is forgotten, because languages die and mathematical ideas do not. ‘Immortality’ may be a silly word, but probably a mathematician has the best chance of whatever it may mean.”

In the same way, maths can be generalised meaning there will never be a right-angled triangle that Pythagoras’s Theorem does not apply to and there will never be another even prime after two. As well as this, the answer to a maths problem is the answer, there are no different interpretations or other possible viewpoints. If you have the mark scheme to a maths exam, you will be able to get full marks unlike an English or History exam in which it is about your opinion, your interpretation or the way you put forward your ideas. This, to me, gives mathematics a sense of permanence, which is becoming more and more rare in this ever-changing world.

Maths is also fundamental to many subjects and real life. As Galileo wrote:
“Mathematics is the language with which God has written the universe.”
Every science requires mathematics for the calculations and ideas it holds, all engineers require mathematics, artists and architects use mathematics perhaps without knowing it, all computers and computer scientists rely on mathematics… Almost everything needs mathematics and in that way maths is fundamental to our society and everyday life. But I don’t think that means we should do maths, as I said before maths is self-rewarding not done for its results but for the process of finding them.
“All science requires mathematics.” Roger Bacon
All-in-all, mathematics is beautiful, aesthetically pleasing, simple yet complex, accessible, fun, permanent, artistic, useful yet self-rewarding, fundamental and interesting. That is why I love it.
“Pure mathematics is, in its way, the poetry of logical ideas.” Albert Einstein

I would love to hear your opinions on why you do or don’t love maths so please leave a comment below.



About me

Hello! I’m Nathan James and this is my blog about the fun and interesting side of mathematics. I’m a student from Surrey, I love maths and my aim is to make others love it to0. I also love music (playing and listening to), technology and photography.

About the blog

Because of this, I have decided to set up this blog with the aim of exposing the hidden wonders of mathematics and I hope you will enjoy it. I will also create a series of guides to various aspects of mathematics, A walk through… As the name suggests, I intend to have a drunkard’s walk through mathematics, with no particular aim just exploring the more interesting side of mathematics.
Although the predominant topic of this blog will be mathematics I also intend to write, from time to time, about my other interests such as photography (you can see my photos on my website and my flickr account) and technology.

About the name

The name refers to a mathematical concept of The Drunkard’s Walk, which is a random walk over two dimensions. As Wikipedia explains it:
“Imagine now a drunkard walking randomly in an idealized city. The city is effectively infinite and arranged in a square grid, and at every intersection, the drunkard chooses one of the four possible routes (including the one he came from) with equal probability. Will the drunkard ever get back to his home from the bar?”
By the way, yes he will.

I hope you enjoy it!