Archive for the ‘general math’ Category

January 3rd, 2009

I’ve not done one of these for a while. Calculate the following indefinite integral.

 \light \int W \left(\frac{1}{x} \right) \, dx

Where the W stands for the Lambert W function.

Full disclosure: I know the result and have verified it by differentiating but I don’t know how to obtain it.

Update: The solution has been posted here.

December 30th, 2008

Welcome to this – the last Carnival of Mathematics in 2008.  Sadly, submissions were on the low side this time around – probably due to the fact that many people were away from the internet over the festive season (and so they should be).  Rather than let this adversely affect the size of this carnival, I broke every rule in the carnival book and went searching for some submissions of my own.  I hope you enjoy the results…

Carnival tradition dictates that before I start the show I should entertain you all with some mathematical facts about the number 46 (since this is the 46th edition of the carnival – for those of you who have imbibed too much festive cheer) and I have managed to come up with:

With tradition satisfied lets look at this edition’s submissions.

Rod Carvalho of Reasonable Deviations shows how to construct polynomials from their roots using a graphical approach.  This is a nice way of viewing the process of constructing polynomials, as all the cumbersome algebraic manipulation boils down to assigning values to the nodes of a graph.

Maria Andersen of TCMTB shows how to create an answer key to your calculus test (or any other test for that matter) using Windows Journal.  I have to confess that I have not used Windows Journal because it is part of Windows Vista – something I only ever use under duress.  Maria makes it look rather compelling though so maybe I need to convince a friend of mine to lend me their laptop!

John D. Cook of The Endeavour gives us a Constructive proof of the Chinese Remainder Theorem.  This comes at a good time for me because as part of my ‘fill in the huge gaps in my maths knowledge’ project, I have been learning about congruences from an Open University booklet I found in the library.  John also submitted his most popular post of 2008 – Jenga Mathematics which is more than worthy of your attention.

If I stuck to tradition then that would be it for this edition of the carnival since they were the only submissions I received.  It seems that the festive period really isn’t a good time for getting responses from math bloggers!   So, I threw tradition out of the window and went looking for some of my favourite maths blog posts from the last 12 months.  The only rules I tried to stick to were ‘one post per blog and one post per month’.

1 year, 12 months, 12 posts, 12 blogs – Happy new year to you all.

January:  Mathematics is logical, elegant and refined.  The real world isn’t! Just like a street fight, the real world is dirty, surprising and uncompromising and solving real-world mathematical problems in physics and engineering can often take phenomenal amounts of computational power. Enter street-fighting mathematics, an MIT course that teaches you some of the tricks and techniques you’ll need in order to get approximate answers to many real-world problems in just a few lines of mathematics.  I first learned of this course from a blog post by Michael Lugo of God Plays Dice back in January and yet I still haven’t found time to work through it.  With luck, I’ll manage it in 2009.

February: I like mathematics that’s pretty and so does Vlad Alexeev – author of both Mathpaint and Impossible World.  Back in February he highlighted a sculpture of a three dimensional Hilbert curve by Carlo H. Séquin.  This post also includes an image rendered by a piece of software called Maxwell Renderer which looks intruging – can anyone suggest the closest open source equivalent?

March: Thanks to Easter, a lot of people went egg-crazy back in March and Kathryn Cramer of Wolfram Research was one of them.  In response to her initial post a lot of us attempted to create Mathematical easter eggs using Mathematica.

April: I have never taken a course in graph theory and so I don’t know much about it but I have attended talks on the subject and so have seen an old map of Königsberg several times.  Using googlemaps, the guys over at 360 showed that if we pose the Königsberg problem today then the result is completely different.

May:  If you read this blog for more than a couple of weeks then you will quickly realise that I like computer algebra systems and yet the free, open source pacakge Axiom is one that I haven’t played with much.  Alasdair of Alasdair’s Musings has though and he has also written a great 6-part introduction to the system which started in May.

June: No Carnival is complete without a puzzle to solve and Tanya Khovanova gave us a great one back in June.

July: Back in July, Eric Roland gave us details of his prime generating formula

August: Google isn’t just a search engine – it’s a calculator too but, like all calculators, it doesn’t always give the correct results.  Stephen Shankland gave us the details back in August.

September: Brian Hayes of bit-player invited us all to just shut up and program.  All too often I read articles from old-timers (such as myself – recently hitting 31) who lament about the loss of a supposedly golden age of computing.  You see, back in the 80s and early 90s we used computers such as the Sinclair Spectrum, Commodore 64, Acorn Archimedes and Amiga and all of them came with a programming language built in – usually some form of BASIC.  These old-timers argue that young-uns find it difficult to get into programming these days since computers no longer come with programming languages built in – or if they do then they are hidden from view in some way.

Of course this is a load of rubbish.  Hand me a computer with an internet connection and 60 seconds later I will hand it back to you with one or more programming environments installed that would be suitable for mathematical exploration (or mucking around as I prefer to think of it).  Brian’s article gives some ideas, both free and commercial, that might get you started.

October: Loren Shure of the Art of MATLAB explains how to create the Olympic rings using MATLAB.

November: What are p-adic numbers?  I have no idea – yet another subject that is on my list of subjects to study.  Dave Richeson of ‘Divison by Zero’ knows what they are though and gave a basic introduction to them back in November.  Thanks Dave – that post now represents the sum total of my knowledge on the subject.

December: Finally we reach December and a post from squareCircleZ who explains how Archimedes was doing calculus 2000 years before Newton and Leibniz.

So, that’s it.  The final carnival of mathematics for 2008.  I hope that no one minds the breaks from tradition and I hope you will join me in supporting the carnival throughout 2009.  Happy new year to you all

December 28th, 2008

This time last year I asked the question ‘What is interesting about the number 2008?‘ and it turned out to be rather popular so I thought I would do the same with 2009. Of course definitions of ‘interesting’ vary but for what what it is worth here are a few things that fit my definition of the term.

  • Both 2009 and its reversal 9002 are multiples of 7.
  • The 2009th prime (17471) is palindromic.
  • You can express 2009 as the sum of 4 positive cubes in exactly 3 ways. (Kudos to anyone who can come up with these 3 ways)

Non Mathematical fact about 2009: 2009 is a blue moon year.

Quiz: 2009 is (probably) the 44th term of a sequence that begins 1789, 1797, 1801, 1809. What is this sequence?

If you know of any mathematical reasons why 2009 might be considered as interesting then please let me know in the comments.

Update 31st Dec 2009: Thanks to the great site Number Gossip, I have discovered that

Oh dear, I fear that numerology cranks are going to have a field day.

December 23rd, 2008

The next Carnival of Mathematics will be hosted here on Sunday 28th Decemeber and so I am in need of submissions.  The usual carnival submission form has not been set up yet so you can either email me or post your submission(s) in the comments.  I will be supressing the publication of all comments to this post so it won’t spoil the show.

Since this carnival will be the last one in 2008 I thought I would change the format slightly and ask for not only your most recent mathematical posts but also your favourite posts from the previous 12 months.  Also, feel free to nominate other people’s articles that you particularly enjoyed over the past year (but please make it clear to me that this is what you are doing).

Let’s try and make this one the Carnival of the year!

December 12th, 2008

David Joyner of the SAGE development team has come up with a couple of very nice mathematical Christmas greetings using a combination of SAGE (For the mathematics used to generate the images) and GIMP and Inkscape (for the text).  The first one is based on a Barnsley Fractal and the sage source code is available here.

small fern

David’s other creation is a Sierpinski gasket that has been coloured such that it resembles a Christmas tree.  The SAGE source code is given below.

gasket


def sierpinski_seasons_greetings():
"""
Code by Marshall Hampton.
Colors by David Joyner.
General depth by Rob Beezer.
Copyright Marshall Hampton 2008, licensed
creative commons, attribution share-alike.
"""
depth = 7
nsq = RR(3^(1/2))/2.0
tlist_old = [[[-1/2.0,0.0],[1/2.0,0.0],[0.0,nsq]]]
tlist_new = [x for x in tlist_old]
for ind in range(depth):
for tri in tlist_old:
for p in tri:
new_tri = [[(p[0]+x[0])/2.0, (p[1]+x[1])/2.0] for x in tri]
tlist_new.append(new_tri)
tlist_old = [x for x in tlist_new]
T = tlist_old
N = 4^depth
N1 = N - 3^depth
q1 = sum([line(T[i]+[T[i][0]], rgbcolor = (0,1,0)) for i in range(N1)])
q2 = sum([line(T[i]+[T[i][0]], rgbcolor = (1,0,0)) for i in range(N1,N)])
show(q2+q1, figsize = [6,6*nsq], axes = False)

It just goes to show that advanced mathematical software such as SAGE doesn’t just have to be used for teaching and research – it can be used for making mathematical Christmas cards too! SAGE is completely free and is available from the SAGE math website. Thanks to David for his work on this one.

December 7th, 2008

Since setting the Walking Randomly Christmas Challenge, I have been looking around the web for Christmasy things that other people have written using mathematical software. If you have been thinking of submitting something to the challenge then maybe these will give you inspiration.

First up, we have several Wolfram Demonstrations based on themes that could be used to design Christmas greeting cards.  For example there is a great one by Michael Trott and Jeff Bryant called Decorative Holiday Stars.

Holiday Christmas Stars

If you prefer your greetings less ‘designer’ and more purely Mathematical then how about creating a card from Eisenstein Snowflakes?

Eisenstein Snowflake

Other Wolfram Demonstrations that might give you inspiration for the Christmas challenge include

I next turned my attention to MATLAB and their File Exchange and immediately hit upon a MATLAB file by Marc Lätzel that draws a Christmas tree.

Matlab Christmas Tree

Something a bit more mathematical is the .m file by Per Sundqvist which generates a FEMLAB geometry for the Koch snowflake.  This can then be used in FEMLAB to solve eigenvalue problems over the Koch domain.   I don’t have a copy of FEMLAB (called COMSOL these days) so I can’t test it but the result looks nice and a quick google search has resulted in some references that might be useful in implementing calculations like this. ‘Computing eigenfunctions on the Koch Snowflake: a new grid and symmetry‘ by John M Neuberger might be a good place to start.

Eigenfunctions on a koch snowflake

Next up is Maple.  A quick search of their Application Centre resulted in the Maple 5 code for a swinging snowman – very nice!  This is another one I can’t test because, unfortunately, I don’t have a copy of Maple but if you are one of those who do then the source code is available if you’d like to try it out.  Maple is at version 12 these days so it will be interesting to see if this old Maple 5 code still runs (let me know if you are able to test it).

MAPLE snowman

These above examples are just highlights of the sort of thing I discovered while looking around for ‘Christmas maths.’  Why not try your hand at designing something yourself in the Walking Randomly Christmas Challenge?  Submissions can be in pretty much any language you care to mention although, of the commercial maths packages, I can only test scripts written in Mathematica, Mupad, MATLAB and MathCAD.  Of course any open-source package (such as SAGE or Octave) is fair game.

If you prefer your submission to be anonymous then either don’t let me know who you are (post your code in the comments section for example) or just tell me that you would prefer it if your name were not attached.  Of course if you want full recognition for your talents then I can do that too :)  My email address is relatively easy to find.  Have fun!

November 30th, 2008

Now that December has arrived you may well be thinking of sending your loved ones a Christmas card so why not send them one based on some sort of Mathematics? Even better – why not design it yourself? Software packages such as Mathematica, SAGE and MATLAB are absolutely perfect for this sort of thing since they combine a large amount of mathematical functionality with top quality plotting routines. To see what I mean – let’s take a look at a Christmas greeting designed by the developers of the open source mathematical system, SAGE.

Seasons greetings from SAGE

I have to confess that I do not have a clue about the mathematics behind the above greeting (something to do with a p-adic plot function apparently) but maybe by the time Christmas comes around I will understand how it was created. The SAGE source code you need to generate it is


sage: P1 = Zp(3).plot(rgbcolor=(0,1,0))
sage: P2 = Zp(7).plot(rgbcolor=(1,0,0))
sage: P3 = text("$Seasons$ $Greetings$ ",(0.0,1.8))
sage: P4 = text("$from$ $everyone$ $at$ sagemath.org!",(0.1,-1.6))
sage: (P1+P2+P3+P4).show(axes=False)

I thought I would have at doing one and came up with the design below by re-using some Mathematica code from a Wolfram Demonstration. The design is based on a fractal called the Koch Snowflake.


Koch[0] = {{0, 0}, {1, 0}, {1/2, -(Sqrt[3]/2)}, {0, 0}} // N;
Koch[n_] := Koch[n] =
Module[{s},
Partition[Koch[n - Sign[n]], 2, 1] /. {a_, b_} :> (s = b - a;
{a, a + s/3, a + s/3 + RotationTransform[Sign[n] 60 °][s/3],a + 2 s/3})] //
Append[Flatten[#, 1], Last[Koch[n - Sign[n]]]] &;
Graphics[Line@Koch[5],
Epilog -> Inset[Style["Merry Christmas", 20], {Center, Center}, {Center,Center}]]

Merry Christmas Koch Curve

OK, so it’s clear that I am no designer but how often do you get a Christmas card that comes complete with Source code? This got me thinking, there must be people out there with better design skills than me – a great many of them in fact and so onto the challenge.

Your task is to design a Christmas message with a mathematical theme using any mathematical system or programming language of your choice. Your design must be generated algorithmically (so you can’t design it in Photoshop and import it into Mathematica for example) and it must include source code. Ideally, you should include a quick explanation of the mathematics you featured in your design.

There will be no prizes I’m afraid other than kudos and praise from me but hopefully you’ll have fun doing it just the same. You can get your designs to me in a number of ways: email me, post source code in the comments section or post your design on your own website and send me the link – whatever you feel is best.

If you do not have access to a commercial maths package such as Mathematica, MAPLE or MATLAB then I suggest that you take a look at SAGE which is completely free (in fact you should take a look at SAGE even if you DO have one of the commercial systems).

Assuming some people actually respond to this post, I will post some of my favourites over the run up to Christmas.

Have fun!

November 21st, 2008

It’s that time of year again – a time when your thoughts naturally turn to what Christmas presents you might buy for the geek in your life.  If you are a geek yourself then this is an easy exercise – just think what you might want yourself and buy that.  Geeks know what other geeks like you see!

What if you are not a geek though?  How do you work out what your nerdy friend would like most for Christmas?  What you need, dear reader, is a geek guide – someone of the nerdy persuasion who can help you separate the geek wheat from the nerd chaff.

Now if you have read much of my blog you will have probably come to the conclusion that I am a geek (or possibly a nerd – the difference is subtle) and so maybe you are thinking that I can help you.  Well, maybe I can – but only for a certain type of geek.

You see, there are many varieties of geek and each one has different needs and wants, thus making it impossible to write a post entitled “Christmas gifts for geeks” which will please everyone.  So, I am going to concentrate on gifts for the mathematically inclined which includes (but is not limited to) mathematicians, scientists, engineers and, most importantly…..me!  Many of my friends read this blog and so this post is mainly a shameless hint dropping exercise but it is possible that it will be of use to other people as well.

In addition, if you actually buy any of these books using the links in this post then I will earn some commission from Amazon without it costing you a penny extra.  Doing this helps support Walking Randomly and is greatly appreciated but I really won’t mind if you choose not to.

Books

For the mathematician in your life you almost certainly cannot go wrong by buying them a book – just make sure that they haven’t already got it!  Another tip is ‘don’t try to be too specialised’ – advanced textbooks may well be useful but they are not (often) much fun and Christmas presents are supposed to be fun!

With these thoughts in mind I will separate this section into two parts – books I own and books I wish I owned.  In addition, I will only consider the lighter side of the mathematical spectrum (for a given value of ‘lighter’) so these books should be of interest to mathematicians of any level – from high school students to research scientists.  The large number of equations that some of them contain may make them look like text books in some cases, but let me assure you that they are (mostly) easy reading.

Books I own – and highly recommend

  • “e”, The Story of a Number by Eli Maor.  Some numbers are so important that they get whole books written about them and e (sometimes known as Euler’s number) is one of them.  It’s a constant that certainly gets around as it appears in all manner of places from compound interest to calculus with detours through subjects such as complex analysis and trigonometry. This book is easy to read and contains a mixture of mathematics, history and biography.
  • An Imaginary Tale: The Story of “i” by Paul Nahin. I’ll never forget the look on my dad’s face when he asked what I was learning at University and I told him ‘they are teaching us about imaginary numbers.’ It didn’t exactly strengthen his faith in further education I can tell you!  It turns out that  the term ‘imaginary’ is an unfortunate byproduct of history and if you delve into the mathematics then you’ll soon learn that not only do imaginary numbers exist but that they form the basis of one of the most beautiful and powerful areas of mathematics there is.
  • Gamma: Exploring Euler’s Constant by Julian Havil. Everyone has heard of Pi, quite a few people know about e but you’ll be hard pressed to find a non-mathematician who knows about Gamma. Impress the mathmo in your life by giving them a book about a mathematical constant that has been seriously undersold by its PR team. It contains some heavier mathematics than the books mentioned above but it is still accessible to good high school students and undergraduates.  I’m still working my way through it to be honest and loving every minute.
  • Flatland: A Romance of Many Dimensions by Edwin Abbott.  We live in a three dimensional world world (some say 4, some say 11 but for the sake of this note I am saying 3) but what would it be like if we inhabited a world of only 2 dimensions.  Imagine how life would be in such a world and how we would react to a mysterious visitor from the 3rd dimension.  Edwin Abbott did exactly this and in the process wrote a satire on Victorian England (the book was written in 1884, making this a very early example of science fiction).  This is a very charming (and very cheap) book that was first recommended to me by a fellow physicist.
  • The Music of the Primes by Marcus du Sautoy.  Prime numbers fascinate us, there can be no denying that, and in this book Marcus takes us to meet some of the people and mathematics behind them.  Some reviewers complain about the fact that the mathematics isn’t detailed enough but then others may well say that it is too mathematical – writing popular maths books is a difficult game.  Personally I think he had it just right and told a great story with just enough maths to keep it from being a book on history rather than a book on maths .  Whenever I wanted more detail I looked to other sources and this got me reading more books on number theory.  This is precisely what popular maths books should do in my opinion – invite the reader in….show them enough to whet their appetite but not so much that it scares them off,  point them in the direction of further study and leave them wanting more….
  • The Man Who Loved Only Numbers by Paul Hoffman.  This is a book about the life of an extremely eccentric mathematician called Paul Erdős – one of the most prolific writers in mathematics apparently. Erdős was a strange character but an extremely well respected mathematician.  This book is serious easy reading and contains a lot less actual math than most of the other books I mention here. I have a copy in my office and many people have borrowed and enjoyed it – only one of them was a mathematician by training. This is a great book.  In fact I am going to read it again on the train home this evening.
  • Inside Your Calculator: From Simple Programs to Significant Insights by Gerald Rising. “Sir, how does the calculator know the sine of a number?” I innocently asked my teacher at the end of a maths lesson back when I was far too young to have a scientific calculator.  He blustered for a bit before answering ‘It stores them in memory – it’s just a big look up table’.  I was deeply suspicious.  That would take a lot of memory I thought!  A lot more than my cheapo calculator had that’s for sure.  So how do calculators do this stuff?  This book makes a good job of explaining the detail (hint…CORDIC).
  • Surely You’re Joking, Mr.Feynman! by Leighton, Feynman and Hutchings.  Richard Feynman is an all time hero of mine and this book is a collection of anecdotes about his life.  If memory serves me there is not a single equation in this book but I would be surprised to meet a mathememtican who doesn’t enjoy it.  Wanna see the human side of a genius?  Buy this book then.

Books I wish I owned (feel free to buy one for me if your mood takes you that way.)

  • The Princeton Companion to Mathematics Edited by Timothy Gowers (click here for his blog) – This beautiful looking book is for the more serious mathematician but it is the sort of thing that will remain on their bookshelf for years to come.  Essentially it is a guide to as much pure mathematics as you can fit into a single volume and would be a perfect addition to any mathematicians library.  It’s a bit expensive but looks like it’s worth every penny.
  • Hexaflexagons, Probability Paradoxes, and the Tower of Hanoi by Martin Gardner. Martin is something of a legend among recreational mathematicians and has many books and articles to his name. He wrote the ‘mathematical games’ column for Scientific American for many years where he picked up a large following among mathematicians at all levels. This book is a collection of some of the best of his Scientific American articles that have been expanded with updates and new material.  Even if you only have a passing interest in mathematics – this looks like a good book to get.
  • Bad Science I feel like I know Ben Goldacre well and yet I have never met him but his blog and column in the Guardian have kept me entertained and informed for years.  An expert in refuting dodgy statistics and sham science, Ben takes no prisoners.  I find his writing extremely entertaining as well as providing much food for thought so naturally I would like his book.  Where is the maths connection?  Well, maths is often abused by the media and it’s often statistics that gets abused.  Ben tends to have a lot to say about that.
  • An Adventurer’s Guide to Number Theory by Richard Friedberg.  I have no idea what this book might be like but I enjoy number theory, I like the title, it gets good reviews and it’s reasonably priced.  Sounds good to me.
  • Digital Dice Computational Solutions to Practical Probability Problems by Paul Nahin.  I have a couple of Nahin’s books and they are both great so I am guessing this one will be just as good.  From what I have seen, he includes lots of simulations in MATLAB.  Randomness?  MATLAB? Nahin?  Of course I want this book.
  • Nonplussed: Mathematical Proof of Implausible Ideas by Julian Havil.  There are a lot of true facts in Mathematics that make you say ‘no way – that can’t be true’ when you first hear them.  I have said this to myself several times over the years and it usually takes a good, solid proof (along with several concrete examples) before I concede the point.  By the sound of it this book is choc full of this sort of thing.
  • Euler’s Gem: The Polyhedron Formula and the Birth of Topology by David Richeson.  Euler’s name seems to be everywhere in mathematics – you only need to look at this list from Wikipedia to get an idea of just how pervasive his ideas have become.  I have never seen this book and I don’t know much about his polyhedron formula but I do intend to find out.
  • The Drunkard’s Walk: How Randomness Rules Our Lives by Leonard Mlodinow.  When you write a blog called ‘Walking Randomly’ you really should have some books about randomness on your shelf.  That’s partly why this one is here.  The good reviews don’t do any harm either.
November 10th, 2008

The latest edition of the Carnival of Mathematics has been published over at Number Warrior. There is some superb stuff in this one with articles on the stability of eigenvalues, the probability of probabilities, the use of computers in mathematics, the arc lengths of Lissajous curves, how Fourier Transforms were used to analyse a song by the Beatles and much more.

The level of mathematics needed to follow all of the articles varies considerably which is great because it means that there should be something for everyone – from high school to research.

October 24th, 2008

I haven’t done a ‘problem of the week’ for a while so I thought I would throw a fun one out there to see what happens. Prove (or otherwise) that 0.9 recurring (that is 0.999999999999…… etc) is equal to one.

Update: Several solutions have been posted in the comments section