Jonisalonen - jonisalonen.com - The Mindful Programmer

Latest News:

What is O(0) 20 Aug 2013 | 11:21 am

If you have ever taken a course in algorithms or data structures you’ll have seen big-O notation. For example you’ll know that a bubble sort runs in O(n²) time and merge sort in O(n log n) time. Maybe...

Where Java system properties come from 14 Aug 2013 | 11:43 am

The reference implementation of Java, OpenJDK, has been open source since a long time now, which means we can look under the covers and see the minute implementation details of anything we find intere...

Almost always, almost everywhere 8 Aug 2013 | 01:59 am

There are two precise mathematical terms with names that sound delightfully imprecise: almost always, and almost everywhere. Almost always means with probability 1. An event with probability 1 does n...

When 0.3 is not 3/10 28 Jul 2013 | 03:47 pm

If you’ve taken a course in numerical computing you’ll be familiar with the various sources of numerical error. First you have representation error that arises when you have to represent a number with...

Simple, Efficient, and Wrong. 30 Jun 2013 | 01:07 am

I’m finally giving this thing a name of its own, paraphrasing a quote by H.L. Menken: For every problem there is a solution that is simple, efficient, and wrong. Reality has a nasty habit of getting...

Sorting a linked list 22 May 2013 | 04:31 am

For God’s sake, don’t try sorting a linked list. – Steve Yegge Why would it be a bad idea to sort a linked list? A few things come to mind: To locate the kth item you have to traverse the k-1 items th...

Calculating combinations 21 Mar 2013 | 03:24 am

The number of ways to pick k items from a total of n is pretty simple to calculate. The first can be chosen in n ways, the second in n-1 ways, and so on, until the k’th can be chosen in (n-k+1) ways: ...

Infinite integers 2 Mar 2013 | 12:00 am

Lately we’ve discussed how integers work in computers when their size is limited to a fixed number of bits. What if there is no such limitation and we can use as many bits as we want? As computers get...

Why We Use 2′s Complement 16 Feb 2013 | 04:07 am

Previously we discussed the mathematical foundations of computer integers and found that, as far as arithmetic is concerned, we can choose to use any range of N = 2m numbers. Why is it then that in mo...

Mathematical foundations of computer integers 13 Feb 2013 | 04:47 am

Integers have typically a fixed size in computers, for example 32 or 64 bits. Since in mathematics there are no such limits on the size of integers, the question arises: how do computer integers work,...

Recently parsed news:

Recent searches: