Learning Computer Science

This is an update from to my earlier  Self Taught Computer Science post.

I’ve started working on the SICP Exercises and so far so good. I’m finding Scheme, the variation I’m using, frustrating but thats to be expected. It’s frustrating because there appears to be no actual standard implementation of Scheme. It’s also perverse that, because it appears so simple, and there’s no standard implementation, people try and create a compliant version of Scheme. Perhaps this is testament to how hard it is to follow a standard as opposed to blazing your own trail the way a lot of popular languages do. There’s another blog post in here somewhere comparing languages that follow standards and languages that …. evolve!

I’m using the DrScheme IDE and I love it for its simplicity. Even though Scheme is frustrating I’m finding it easy to work with. I know Functional languages are based on Lambda Calculus but until I started working in Scheme I hadn’t realised how easy it is to think in functions. This can probably be attributed to the SICP exercises being heavily slanted towards computation and interesting mathematical functions like the Wallis Product or the Fibonacci Sequence. Regardless, I’m finding it easier to think mathematically in Scheme than Perl or Java.

I’ve done one exercise in Haskell so far and its been painful. This is not because Haskell is painful it’s just that almost every tutorial on Haskell I find first wants to teach me how to use the Haskell calculator (my derogatory term for the interpreter), as opposed to telling me how to get the thing to compile a standalone executable. That last sentence is a rant, as I’m digging into Haskell I’m finding more material. I really don’t know what it is about this language that I find so appealing. I’ve seen some really negative reviews of Haskell online but I cannot bring myself to hate it even though it’s driving me a bit mad learning it. Only time will tell if Haskell and me are meant to get on.

So far I’m finding SICP time consuming but digestible. I’m noticing a marked increase in complexity, I’m just hoping I can get through enough during my holidays to learn something.

Self Taught Computer Science

Over the last year I’ve felt as if I’ve reached a plateau. I cannot put my finger on why this is or why I feel like this but regardless of what programming language I use C/Perl/Java I feel like I’m just moving boxes. This is not the first time I’ve felt like this either.

I don’t think this is a problem with the languages I’m using I think its more of a problem with me and the applications I tend to be working on.

After a while (not a very long while) developing CRUD applications loses its appeal. Developing network apps, GUI’s etc… they all start to look dull when you’ve done them a few times. My experience with GUI’s is very limited so the above statement is an assumption in that regard.

I’ve no idea why this is but I’m sure more experienced programmers could probably shed some light on this. I personally think that unless something stretches your ability it will eventually lose it’s novelty.

Though, surely as a programmer who loves to program I should be able to entertain myself in almost any application I write but for me this does not seem to be the case. I’ve never been one for mental wanking and I would prefer not to start. Over complicating an application just to keep it interesting doesn’t appeal to me in the slightest. I watch programmers fall into this trap all the time and its sad to see them commit this cardinal sin. The worst thing is having to watch them explain their contraption as if it’s a simple solution when it’s obviously a complicated  mess of a thing. Don’t get me wrong I’ve been guilty of this sin and in quite a few cases been oblivious of it. Its almost as bad as the Not Invented Here syndrome so prevalent in our trade.

I personally think my main problem is that I don’t feel as if I am getting any better. I look at old applications and where I would normally see a dozen ways to improve it I see two or none and it’s not because it’s perfect or anywhere close, only a fool would believe so. I know I’ve not learned a fraction of what I need to know in my field so why have I hit this wall. Have I reached the limits of my ability or is this a normal phenomenon that programmers go through?

My opinion is that I’m seeing things through the wrong goggles. Most of my education has been self taught so its been led mostly by interest as opposed to formally taught. I’ve been studying with the Open University for several years now in order to get some background mathematics etc but I still think there are areas that I need to improve on in particular around Computer Science.

Unfortunately the Open University computing courses are geared towards popular topics, Java etc in order to attract more students. Having done a few of their computing courses I wish I hadn’t bothered because I gained more from my own work than I did from the taught courses. I cannot say the same thing about the mathematics though. I decided to start mathematics because I knew that whatever I learnt would be applicable regardless of the current fashion or trends in industry and it won’t be out of date in a couple of decades.

Having looked around this for some time I have decided that what I need to do is to start my own computer science program to build on the mathematics I’m doing with the Open University. The areas I’m really interested in is how to go about writing my own computer language, compiler, virtual machine etc so I’ve been looking around to see what other universities are doing and what books they are using in this area.

Having done a fair bit of looking I spotted a definite trend towards functional languages and the further I looked into this the more I noticed that All Roads Lead To Lisp. Or to scheme or to some variant thereof. Abstracting a bit further I am being steered towards learning a functional language. The two languages that interest me the most in this area are Scheme and Haskell. Now all I need to do is decide what books and resources I need to start a course in this area. Most resources online point towards Structure and Interpretation of Computer Programs (SICP) in order to get started so I am looking at this now. I am not sure if I’ll try and tackle Haskell until I get a bit more familiar with scheme although having looked at Haskell the language is appealing to me.

Watch this space for more installments on my self taught Comp Sci education!

Lockhart’s Lament

spiral.jpgI have to thank Philip Wadler for spotting the Lockharts Lament article!

If you are worried about how mathematics is being taught today then read the following article Lockharts Lament. The first few pages describe the problem perfectly. Our education system is being designed by people who have little or no understanding of the task at hand.

Perhaps mathematicians are being arrogant and calling what they do an art. I personally think it’s as much an art as painting, sculpture or poetry. Its quite sad that Wikipedia doesn’t have mathematics listed as an art. Surely there is nothing more expressive than mathematics. Have a look at some of the images here. Anyone with a little mathematics and a lot of people with no mathematics will find these images beautiful.

If art has anything to do with expression then for some there can be nothing more expressive than an equation. Mathematics is fundamentally about describing the world around us and more besides. Physicists use mathematics to as a tool to understand the world around us. This practical applications does not mean that it’s not an art. Ask a physicists if they consider mathematics to be an art and I would bet that most think it is. The E=mc2.jpgmost famous equation today is E=MC^2. The beauty in this is astonishing but its not the most beautiful equations to some, F=MA may be more beautiful depending on your point of view. The fact that these equations are of huge practical importance seems to make some think that mathematics is not an art but merely a tool. Mr Lockhart’s article puts it well

“Music can lead armies into battle, but that’s not why people     write symphonies.”

The sooner we start treating mathematics more like an art and making it interesting the better, until that day almost every student being churned through our education system will hate the watered down shadow of a system our educators deem to call mathematics.


I’m doing a Mathematics degree with the Open University and I am in my first two of the 4 required level 3 subjects.
I have not really had as much time as I would like to devote to Maths, so, for the most part, I have been reading the material and finishing the course work with as little paper and pen as possible. This system of doing things was working fine up until a few weeks ago when I started to run into trouble with M381 (Number Theory and Mathematical Logic).
The questions in this course have demanded a rigour that has not really been set out in previous courses. When asked “Prove the Following” I was completely baffled and had no idea where to start. This might sound odd for those people who are up to speed with their Math but for me it was an eye opener. For those maths teachers out there you may recognise that I have become a calculator and not a thinker (my own fault) which is fine for doing sums but pretty useless for real Mathematics.
Anyway. Not to be outdone I decided that the only way to get up to speed was to subject myself to more Maths, specifically, more thinking about Maths. I went looking for a text that would have the rigour I was looking for and having searched high and low one text that seemed to appeal was A Course of Pure Mathematics by G. H Hardy
I have been trying to get to grips with this book over the last few weeks and so far I have made the following observations.
The book states in the preface:

This book has been designed primarily for the use of first year students at the Universities whose abilities reach or approach something like what is usually described as “Scholarship Standard”

I am “meant” to be covering 3rd year level material in my degree and a lot of the material in this book appears new to me. This begs the question[s].

  • Have I forgot what I learned previously?
  • Have I not understood the material in previous courses?
  • Has the standard slipped since Hardy’s time?

There are more questions I could ask but these questions alone scared me into checking Google groups for more information and I found the following article on Littlewood which made me think that perhaps the required standard was higher in those days.
Having thought about this for a while I decided that “standards being higher” was a weak excuse at best, and that I should really not be casting historical aspersions when I’m hardly capable of judging a decent book from a bad one due to my lack of mathematical maturity. This left me in a bit of a dilemma.

  • I want to get better at Maths.
  • I have only so many hours in the day (I have bills to pay).
  • I need to teach myself.

The criteria above mean I need to pick an area of mathematics in which I will continually find myself in, regardless of what maths I am doing. From what I could gather there are a few areas that seem to crop up all over the place. Two of these subjects are Calculus and Analysis (I know they are similar subjects), they seem to find their way into everything to some degree or another.
To this end I have decide to spend some of my spare time doing problems from calculus and analysis books. I have also bought Polya’s “How to solve it and am about half way through it” and so far it has been an interesting read.
I have ordered Spivaks Calculus book. I would also like a few other books to read around the area a bit. Again the source I went to for information on this was sci.math. The books I intend to investigate are as follows.

  • Calculus: T. M. Apostol
  • Calculus: Spivak (on order)
  • Calculus Answer book: Spivak (Answer book) (on order)
  • Introduction to Calculus: Courant, John
  • Mathematical Analysis: T. M. Apostol
  • Real Anlysis: Royden
  • Principles of Mathematical Analysis: Rudin (Baby)

I don’t intend to purchase all of the above books although it would be nice to have them. The above list seems to be the most popular recommendations on sci.math (particularly Spivak, it has an answer book so I ordered it). I intend to have a look at each of them and decide which ones would be best suited for me.
I have also heard good things about:
What is Mathematics: Courant Robbins Stewart
which I have been meaning to buy for a long time. Current books I own are:

  • A Course of Pure Mathematics: Hardy
  • Differential and Integral Calculus: Courant Vol 1 (Old Blackie edition).
  • Calculus Made Easy: Silvanus P Thompson and Martin Gardner
  • An Introduction To the Theory of Numbers: Niven and Zuckerman
  • An Introduction To the Theory of Numbers: Hardy and Wright
  • Fundamentals of Number Theory: William J. LeVeque
  • Advanced Mathematics (A pure Course): Perkins and Perkins
  • Engineering Mathematics: K. A. Stroud 4th Ed
  • How to solve it: Polya
  • Fermats Lat Theorem: Simon Singh
  • A concise History of Mathematics: Dirk J. Struik
  • Introductory Logic and Sets for Computer Scientists: Nimal Nissanke
  • A History of Mthematics: Victor J. Katz

Open University M203 Pure Mathematics Course

Is driving me nuts. The last block ie
Analysis B
is trying to cover so much ground so fast I have hardly got time to catch my breath. This is in part due to my preparation ie
These courses are meant to be adequate preparation for M203 but having just started reading.
Hardy G. H: A Course of Pure Mathematics.
Courant R: Differential and Integral Calculus Vol. 1
they seem to spend a lot more time on the fundamentals of calculus ie limits and functions than I ever did previously. Hardy’s book is very explanatory but hard to follow and deserves some concentration but so far I have found the first few pages a treat to read. I like the way “he preaches to the cannibals” which is just what I need.
I am not sure if MST121 and MS221 are enough preparation for M203. I have done very well in all of my coursework but my algebra is just not up to scratch. I can tell this when I am reading some of the material and they appear to make leaps from one bit to another. If you are thinking about doing M203 or the next course M208 then make sure that you have a good grounding in algebra. The best arena for brushing up on your algebra or at least for me is “real analysis” particularly sequences limits and series.
I have decided I won’t be attempting Complex Analysis M337 next year because my algebra is just not hot enough yet. I will do it in 2 years time when the course runs again. Its a shame because I really wanted to do M337 next year.

A Mathematician’s Apology

I started reading
A Mathematician’s Apology
Author: G. H. Hardy (Foreward by C. P. Snow)
ISBN: 052142706
this one as soon as it arrived through the post. It is quite a small book and even smaller when you open the cover, at least in this edition it is since they have left over an inch of margin around the text.
I really enjoyed it. I have to say that I enjoyed the forward by Mr Snow as much as the content by Hardy. I think this was because he was writing about the Author of whom I would like to know more whereas Hardy was writing about his subject rather than himself. You can get a feel for Hardy’s character from the text, particularly near the end but I thought that it dealt mainly about his take on mathematics.
The book is definitely some sort of apology, I thinks its open for debate whether he needed to apologize for anything but he obviously felt the need to justify himself in some way.
Personally I don’t think Hardy had any more need to justify himself than Da Vinci, Matisse or Michelangelo, Hardy was an artist its just that his art was mathematics which like some forms of art is not appreciated by the masses. However, this does not mean that what he created wasn’t beautiful or worthwhile. In fact years later it was found that a lot of what Hardy had created was of immense use.

More bloody Books

I am never going to finish “From Here to Infinity”. I was about half way through Mr Stewarts book when I got an urge to browse Amazon, big mistake.
I spotted the following books all of which I ordered
A concise History of Mathematics.
Author: Dirk J. Struik
A Mathematician’s Apology
Author: G. H. Hardy (Forward by C. P. Snow)
The Man Who Loved Only Numbers
Author: Paul Hoffman
A History Of Mathematics (An Introduction)
Author: Victor J. Katz

Fermats Last Theorem.

I have just finished reading:
Fermats Last Theorem
ISBN: 1841157910
Author: Simon Singh
I actually bought this book and had started reading it when I found
“Surely You’re Joking, Mr.Feynman!:”
but I am afraid that Mr Feynman took the lead and this book never got touched again until I had finished the Feynman book.
On the whole I enjoyed it but its a bit dry in places and meanders about the
place, or at least that was my impression. I had trouble seeing the
relevance of some of the writing to Fermats problem and this is where I got the
feeling of the book going off on tangents just to be brought back quite
I was also a bit surprised to hear the Authors description of “divide by 0” in
one of the Appendix’s. He says that you cannot divide by zero because zero will
go into something infinitely many times.
I know this is a religious issue for some people but I would have described it
as follows.
2 x 0 = 0 : True
this looks correct and is correct. Its basic algebra. Now when transposing formula we could take the left 0 over to the right side by dividing through by
0 as follows
2 = 0/0
We can see that 2 cannot = 0/0 so division by zero is undefined. Some people
might see it better as follows.
(2 x 0)/0 = 0/0
If the left zeros cancel which they would if 0 was a normal number then we are
left we are left with the absurdity.
2 = 0/0 : Absurd
So 0 cannot be a number or at least not in any normal sense. So to say that 0
divides something infinitely many times seemed wrong to me.
If we look at it another way it might be clearer. If we look at the following
infinite sequence
1/(1/2), 1/(1/3), 1/(1/4), 1/(1/5) ………. 1/(1/n)
the we can see that as
n |–> infinty that 1/n |–> zero
so we have 1/0 which if we could say gives us infinity because 0 divides 1
infinitely many time. That sounds plausible enough but, if we look at the following
infinite sequence
1/(1/-2), 1/(1/-3), 1/(1/-4), 1/(1/-5) ………. 1/(1/-n)
then we can see that as
-n |–> negative infinty then 1/-n |–> zero
but zero is the only number that is neither negative or positive so which
infinity do we pick. Do we say that because the sequence is approaching
negative infinity that it 1/0 is -ve infinity or +ve infinity. This is another
of those absurdities that we ran into earlier when dealing with divide by zero.
Dividing by zero is indeterminable which is why no one says that it divides
something infinitely many times when in fact we have no idea what its doing.
I am sure some clever cloggs will come along after a course in complex
analysis and blow the above out of the water but this is the way I have always
thought of this question.

Does Mathematics ever get any easier

I don’t think so. Just when I think I am getting to grips with something I get a good slap around the face from out of the blue. Is it this that has kept people all through the ages fighting for some insight in the hope that they might deliver a good slap back.
It all seems so much like an enormous quagmire were an unwary step might have you screaming for help before being swallowed up in muddy oblivion. On the other hand when you hear Ian Stewart describing Mathematics in his books he seems to alternate from quagmire to utopia. I have yet to find this utopia (but I’m still looking) and as far as I am aware there are no maps for sale down the local camping store.
I just wish I had a torch or even a compass, so even though I have no idea what direction is the best to take I have an idea what direction I am heading in and can be psychologically comforted.
Mathematics is the most frustrating yet fascinating subject I have come across. I just hope I find a compass soon and I imagine I am not alone.

M203 Group Theory

Is over and thank the lord. My tutor had told me that the Group theory was much easier than the linear algebra, unfortunately for me this was not the case. It was only when I handed him the Tutor Marked Assignment ( TMA ) that I found out he had specialized in Group theory so I think he might be a bit biased 😉
I think it was because I was unable to see an immediate use for it. I loved its elegance and I enjoyed the course more than the linear algebra but I found it much tougher going. I have been using linear algebra during the process of building a vector space search engine so it is nothing new to me and I could see a use for it which I lacked with Groups.
Still haven’t decided what I am going to study next year but I would like to do a a bit more work on group theory. I have a summer school coming up soon and I am hoping to get some idea of what might be suitable for my level 3 courses next year.
I managed to get 92% for the TMA so I must have done something right.