On Subtlety and Complexity

What’s the difference between explaining something in a more complex way as opposed to a more subtle way? After all, both explanations will inevitably be longer, and more complicated. Isn’t subtlety therefore just as complex as complexity?


The example I’m going to use is that of of faith, hope and charity. At first, they all seem fairly similar. Having faith in someone can also be seen as having a strong hope in them; In this wikipedia article, faith is seen as being aligned with goodness (which is otherwise thought of as charity); what’s worse: a modern rendition of charity is the word “love” (which sounds more like trust/hope).

I think perhaps a way of disentangling this confusion is with three very fundamental concepts: Truth, beauty and goodness. Now if you think about it, these are actually really fundamental concepts. They run through everything we know, and anything can be described in terms of them, like a cup:

For example, in front of me, I have truly have a green cup, that because of it’s elegant (beautiful) design is good for holding water (or coffee, in the case of the picture). Something is truly described as what it really is; Something is beautiful when its form follows its function; And something is good when that function is fulfilled.

Now if we back up a bit and look at these two trios side-by side, things start to get interesting. Faith clearly maps with truth, independently of either hope or charity (something simply to be known). The next obvious connection is that of Charity and goodness (“it is in giving that we receive”). And last, but not least, we can see that Hope is left with beauty. This is the analogy that I find most fascinating. Does beauty make one hopeful? Is one who has not hope blind to beauty? I think perhaps simply pondering those questions will do the comparison more justice.

The point is, the ideas of faith hope and charity are clearly different, but they can be quite hard to clearly wrap one’s head round. However, one doesn’t need to break them down (complicate them) in order to understand them more, but instead try to squash and stretch them a bit, until the “shape” of the idea is just right.


The definition of complex is consisting of multiple parts. Subtlety, in contrast is any distinction made that does not break a thing down. As you can see, the distinction between Faith, Hope and Charity is therefore subtle (extremely so), but ironically, trying to explain how it is has proved to be somewhat complex!

Euler Project: Challenge #3

Ok, so a while back (I don’t remember exactly when). I tried to get into the Euler Project. What it is is a series of difficult mathematical (programming) challenges. When I first tried it, I solved the first two challenges, and couldn’t progress much further.

Anyway, I was recently on a bit of a programming spree, and gave challenge #3 another shot. Instead of coding my solution in Javascript, I have now switched to Python (a newer, lower level, yet more elegant, programming language). This post is an explanation of how I solved it, so if you don’t want the solution spoiled, go and figure it out yourself (then please come back here to tell me how inefficient mine is).

The exact problem, as stated on the website, is:

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

As you can see, it is quite a nicely stated problem since it gives you a number you can test out before trying to compute the highest prime of the monster 12-digit number. Initially, I went about coding my solution in a fairly obvious way (pseudo code)

loop bigNumber:

  if number%bigNumber == 0 (i.e. if there is no remainder, then it’s a factor) then
   loop through factor to check if it has factors. if it has none, then it’s prime!

Now, this logic worked fine for the relatively small 13195 (in 0.011 seconds, I might add) but when I threw the huge number at it, the program just hung (sat there, showing no result). After examining it in more detail, I found that it was simply going to take too many life times to check all the factors.

However, I knew there must be a solution that didn’t involve a supercomputer, since I know a guy who solved this problem. Back to the drawing board…

My basic problem was one of efficiency. So in my second version of the program, I changed the program in two different ways. I manually multiplied the number (also known as chunking, a mistake in hindsight, since the computational equivalent of long-division is, in fact, faster). The second change I made was a bit more complicated, but I personally found it fascinating. So, please humour me for a moment with this explanation:


Let’s find out if 13 is a prime number.
So we’ll check the potential factors one by one:

  1. 2 times 2 is 4
  2. 2 times 3 is 6
  3. 2 times 4 is 8
  4. 2 times 5 is 10
  5. 2 times 6 is 12
  6. 2 times 7 is 14 (greater than 13, so we’ll jump to the next number)
  7. 3 times 2 is 6
  8. 3 times 3 is 9
  9. 3 times 4 is 12
  10. 3 times 5 is 14 (greater than 13, so we’ll jump to the next number)
  11. 4 times 2 is 8
  12. 4 times 3 is 12
  13. 4 times 4 is 16 (greater than 13, so we’ll jump to the next number)
  14. 5 times 2 is 10
  15. 5 times 3 is 15 (greater than 13, so we’ll jump to the next number)
  16. 6 times 2 is 12
  17. 6 times 3 is 16 (greater than 13, so we’ll jump to the next number)
  18. 7 times 2 is 14 (greater than 13, so we’ll jump to the next number)
  19. 8 times 2 is 16 (greater than 13, so we’ll jump to the next number)
  20. 9 times 2 is 18 (greater than 13, so we’ll jump to the next number)
  21. 10 times 2 is 20 (greater than 13, so we’ll jump to the next number)
  22. 11 times 2 is 22 (greater than 13, so we’ll jump to the next number)
  23. 12 times 2 is 24 (greater than 13, so we’ll jump to the next number)

Now, since none of the numbers we’ve checked multiplied neatly into 13, we can conclude that 13 is a prime number. However, did you notice that after 4, every single potential factor we checked had already been checked in reverse?

For example, 5 times two (line 14) had already been checked (as 2×5) on line 4!

By simply ending the sequence when we start to see the same number again, we half the number of steps needed. If we do this for a bigger number, like 23, we cut it down by 6 sevenths! So as you can imagine,

There were a few other efficiencies I implemented (like not chunking, for example) and there might even be more still (like looking into how the program does long division, and trying to make it easier relative to the problem). But as it turns out, this simple change knocked the program run time from multiple lifetimes to about 3 seconds! So yes, I did find the highest prime number that factors into 600851475143 and I hope that you can too!


I really enjoyed this challenge, and can see myself attempting more in the future (even reattempting the ones I’ve done in order to do them better). I also see myself switching to a lower level language (like C), so that I can program an even faster and more efficient solution (even though it will make doing so more complex). Perhaps this project can be my doorway into really understanding the truly complex mathematics which has hitherto evaded me.

More Toki Pona

One day I’ll get sick of this constructed language once and for all, but for the moment, there still seem to be some things that bring me back to Toki Pona. I had a more thorough read of the book today, and frustratingly read through the “Toki Pona Proverbs section”, which managed to concentrate all the things that I didn’t like about the language…

And don’t get me wrong, the sound of the words doesn’t bother me that much. My current solution (though technically breaking the phonetic rules) are simply to change the stress patterns of the language. So instead of saying TOki POna LI TOki POna, one says toKI poNA li toKI poNA, which personally I find sounds a lot better.

No what bothers me is the shallow philosophy that seems to sit in the background of The Toki Pona Book: Truth is Relative, Simplicity is Goodness, non-essentials are bad (literally “Ike). So instead of rehashing all these frustrations, i decided to write a Toki Pona “sequence” (it doesn’t display enough structure to be called a poem, but it might just resemble one):

pona li pona ala nanpa ali
 
 wan ijo li pona ala e ali
 wan li pona e oko
 mute ijo li ike e ala ali
 oko li oko e mute pona
 
 mute ali li ike ala
 mute li pona
 wan wan li ike ala
 wan li pona
 
 pona li pona ala
 ike li ike ala

And no, don’t worry. This time, I wont be daft enough to leave you without a translation, even though it is rough, and won’t carry the same tone as the (extremely ambiguous) original:

simple is not good always
 
 one thing does not make good all
 one does good to the eye
 many things do not bad to all
 the eye sees a lot good
 
 not many is all bad
 many is good
 one one is all bad
 one is good
 
 simple is not good
 non-essential is not bad

If you concluded that that made very little sense, don’t worry. You’re probably right!