Art is about humanistic sensibilities

We spend a lot of time trying to create ways of replicating the way humans behave. But why?

Have we ever critically analyzed why we need things done for us? Sure, some devices and machines actually do things better than humans, others save time.  Others make our lives easier, but at what cost? Do we loose part of what it means to be human when we do this? Imagine what our lives would be like if we ate pills as meal replacements? (Not theoretically possible, because although pills can provide minerals and vitamins, they can’t provide calories). Our lives would become infinitely less fulfilled because we all but elude the taste, or feel of food.

Our perception of things is also different to machines. Humans see beyond the two-dimensional realm that a machine sees. We see depth in paintings, and the appreciation of the craft. Consider the painting below, Fugevilt (Wild Birds) painted circa 1660 by Dutch artist Jan Vonck (1631-1664). This is the partial description from the gallery in Bergen:

“This still life follows a Baroque formula for presenting dead animals, flowers and objects. The birds are on a table and seen against a dark background. They appear decorative yet are depicted with a large degree of realism. The artist’s skill is related to the richness of detail.”

The painting is a marvel with exceptional detail. Could a machine create a similar painting?  From the “object” perspective of being able to replicate the painting, likely yes. From the intellectual perspective, no, because a machine cannot infuse the same aesthetic qualities an artist can. There are a load of articles on how AI can reproduce art, but it’s just not the same. Who cares if a machine can paint something? We have a planet full of talented people that can do that – *why* do we need a machine?

To me it’s the difference between reading a physical book and an electronic book. Both have the same content, but the physical book portrays the content in a more humanistic manner. It’s not just about reading the words, it’s about picking up the book, feeling its physicality, or triggering a memory of some sort. Electronic books just don’t have the same feeling, or character. Or maybe hand carving a spoon – sure I could likely program a CNC machine to machine a wooden spoon out of just about any material, but the hand-carved spoon has intrinsic value – it reminds us of our link to the earth (something far too many humans seem to have forgotten). It is an object which has both humanistic and tactile sensibilities, unlike the sterility of the machine-made aesthetic.

Machines and progress are all good and well, but if we loose what it means to be human, what does any of it really matter?

P.S. People would be better off spending their time designing machines that can autonomously clean up all the crappy plastic (that science helped create), that is now polluting the worlds oceans.

 

Weird recursive algorithms

Here are some weirder recursive algorithms.

TAK

The Tak function, also known as Takeuchi’s triple recursion, was invented by Ikuo Takeuchi of the Electrical Communication Laboratory of Nippon Telephone and Telegraph Co., for the purpose of comparing the speeds of LISP systems [1]. Here is a version in Lisp [2]:

(defun tak' (x y z)
  (cond ((not (< y x)) z)
        (t (tak' (tak' (1- x) y z)
                 (tak' (1- y) z x)
                 (tak' (1- z) x y)))))

This is one of those non-sensical algorithms that can be used to profile efficiency, either of a system or language, similar to Ackermann. It was used as a means of testing stack instructions, data moving, and arithmetic. The amount of recursion performed by this algorithm is significant, in fact it was described in one books as “a recursive algorithm with cubic explosion” [3]. Here is the algorithm:

tak(x,y,z) = y, if x<=y, otherwise
tak(x,y,z) = tak(tarai(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y))

Call this with tak(10,2,9) returns a calue of 9, calling the function 4145 times. Here is the C version of the function:

int tak(int x, int y, int z) {
   if (x > y)
      return tak(tak(x-1,y,z),tak(y-1,z,x),tak(z-1,x,y));
   else
      return y;
}

Zibonacci

This is a weird rendition of Fibonacci which tends to calculate results which appear to zig and zag.

zib(0) = 1
zib(1) = 1
zib(2) = 2
zib(2n+1) = zib(n) + zib(n-1) + 1, if n>0 (odd values 3 and higher)
zib(2n) = zib(n) + zib(n+1) + 1, if n>1 (even values 4 and higher)

The C program to calculate this looks like:

int zib(int n) {
   if (n == 0)
      return 1;
   else if (n == 1)
      return 1;
   else if (n == 2)
      return 2;
   else if (n%2 == 1 && n >= 3) // odd
      return zib((n-1)/2) + zib((n-1)/2-1) + 1;
   else if (n%2 == 0 && n >= 4) // even
      return zib(n/2) + zib(n/2+1) + 1;
}

Here is the output for 1 to 20:

1  2  3  6  4  10  6  11  10  15  11  17  15  18  17  22  18  26  22  27

Tribonacci

This algorithm mimics Fibonacci, but adds the previous three values instead of two [4]. The first three Tribonacci numbers are 0, 0, 1.

trib(0) = 0
trib(1) = 0
trib(2) = 1
trib(n) = trib(n-1) + trib(n-2) + trib(n-3)

Here are the values 0 to 10: 0, 0, 1, 1, 2, 4, 7, 13, 24, 44, 81

Here is the algorithm written in C:

int trib(int n) {
   if (n == 0 || n == 1)
      return 0;
   else if (n == 2)
      return 1;
   else
      return trib(n-1) + trib(n-2) + trib(n-3);
}
  1. McCarthy, J., “An interesting LISP function”, ACM Lisp Bulletin, 3, pp.6-8 (1979)
  2. Gabriel, R.P., Performance and Evaluation of Lisp Systems (1985)
  3. Robertson, I.B., “Hope+ on Flagship”, in Proc. Functional Programming, pp.296-307 (1989)
  4. Feinberg, M., “Fibonacci-Tribonacci”, The Fibonacci Quarterly, 1(3), pp.71-74 (1963)

What is Quickselect?

Quickselect [1] is the lesser known algorithmic child of Tony Hoare. It is essentially a selection method based on Quicksort. It finds the k-smallest number in a list that is not sorted.

The problem is defined as a function quickSelect(), which takes as input the array, lower and upper indices defining a sublist within it, and a positive number k. The algorithm then searches for the k-th smallest number in the specified sublist. The algorithm applies Hoare’s partition scheme which arranges the list into three parts: those less than or equal to the “pivot” element, a second list that only contains the pivot, and a third that contains the elements greater than the pivot.

The reason I delved into this algorithm was that someone mentioned that it would be faster to implement a median filter than using C’s built-in Quicksort. In a previous post I compared various languages for median image filtering. The C programs used either (i) built-in qsort() function, or (ii) quickSelect(). In all cases the quickSelect() function was faster, partially because it did not have to sort the entire array.

Here are the three C functions that comprise the QuickSelect algorithm. First the function partitionHoareREC() that performs the partitioning:

int partitionHoareREC(int a[25], int left, int right, int pivot) {
   int aux;
   if (left > right)
      return right;
   else if (a[left] > pivot && a[right] <= pivot) {
      aux = a[left];
      a[left] = a[right];
      a[right] = aux;
      return partitionHoareREC(a,left+1,right-1,pivot);
   }
   else {
      if (a[left] <= pivot)
         left = left + 1;
      if (a[right] > pivot)
         right = right - 1;
      return partitionHoareREC(a,left,right,pivot);
   }
}

Next a wrapper function, partitionHoareWrapper(), for the partition function:

int partitionHoareWrapper(int a[25], int lower, int upper) {
   int middle, pivot, right;
   if (upper >= 0) {
      middle = (lower + upper) / 2;
      pivot = a[middle];
      a[middle] = a[lower];
      a[lower] = pivot;
      right = partitionHoareREC(a,lower+1,upper,pivot);
      a[lower] = a[right];
      a[right] = pivot;
      return right;
   }
}

And finally the quickSelect() algorithm:

int quickSelect(int a[25], int lower, int upper, int k) {
   int pivotI;

   if (lower == upper)
      return a[lower];
   else {
      pivotI = partitionHoareWrapper(a, lower, upper);
   if (pivotI == k-1)
      return a[pivotI];
   else if (pivotI < k-1)
      return quickSelect(a,pivotI+1,upper,k);
   else
      return quickSelect(a,lower,pivotI-1,k);
   }
}

Here is how the function can be used to find the median of an array with 25 elements:

int m;
int arr[25];
...
m = quickSelect(arr,0,24,12);

[1] Hoare, C.A.R., “Algorithm 65: Find”, CACM, 4(7), pp.321-322 (1961)

 

My axe never needs an upgrade

It’s easy to become disheartened by the world as it is today. Technology seems to play a large role in the dysfunctional society we have created. Technology that was once interesting, is now not so. We live in a world where people are becoming addicted to computer games, banks and companies are being hacked, and now drones are being used as aerial IEDs. The solutions, if they even exist,  likely involve even more technology. When I started out in this field, I thought it might have a positive impact on society, however what some of us have come to realize is that the negatives may outweigh the positives. Most of us now spend most of the day sitting in front of an inanimate machine, typing away. Yes, there are positive things. I think digital photography is great. Digital TVs are nice. Special effects can be awesome (if done properly), and a case in point is the difference between Star Wars E1, and E7 – notwithstanding that E1 supposedly had CGI in 90% of the scenes. Online shopping is obviously convenient, and means I can buy stuff from almost anyplace in the world.

But now I have to worry about buying appliances that aren’t too smart, because I don’t want them wirelessly connected to the internet. Do they need to be that smart? They don’t do anything inherently smart – like does a smart washer detect an errant red sock in my white laundry? I have to worry about buying a car that is too wired, because likely it has been poorly programmed, and is riddled with security issues. I have to worry about people scanning my chip-enabled cards, so I need a RFID blocking wallet. Lot’s of worries I could do without. I also have to worry about poorly written software.

Life was simpler once. They said technology would make life simpler. Remember the paperless office? It hasn’t and likely never will (and if we think androids will make our lives easier, think again). There is inherently a price to pay for most technology. Strangely enough the only technologies that don’t need to be upgraded are those things created before the tech era. The axe was one of the first implements developed by humans, and although it evolved, and many different types exist, they don’t need to be upgraded. You can cut down a tree, or sculpt wood with them, in almost any environment, they don’t have complex moving parts, or circuit boards, and they are green products that can last hundreds of years.

We may need to look into the past to extract elements of the simpler lifestyle  that once existed, when we were more attune to nature – creating a world that is more sustainable, and maybe less reliant on technology.

The new Loblaws self-checkouts – usability

Recently Loblaws upgraded the interface on their self-checkout. It seems people weren’t happy. About as happy as they were with the Shoppers Drugmart self-checkout  a while back. In fact even BlogTo posted an article on it. The biggest issue seems to be the lack of text, the poor use of symbols, and the over-use of whitespace. The first screen shows a green shopping cart, which you are suppose to touch, or scan your first item.

To be honest, using just symbols is okay, but these symbols and their layout look like they were done by someone clueless about HCI. Let’s look at the screen below:

The first thing I don’t particularly like is the fact that the three buttons on the middle-right are two sizes (well orientations really), surrounded by a *LOT* of whitespace. Obviously the first symbol implies bread and vegetables, and the second implies a discount, but they look like someone in kindergarden drew them. The red $ implies pay (so why not just use the word “Pay”?). Why not have proper symbols? With all that real-estate, they could provide an icon for (i) loose bread products; and (ii) self-bagged fruit and vegetables.. Have those three in a line, make them square buttons, and its a start. Put the cash-out button below them, and don’t make it red. Amazon have a “Proceed to Checkout” button, it’s yellow and it seems to work. Go with what works.

The other four buttons are innocuous.

  • PC Optimum card – fine
  • Use your own bag? The words “Own bag” would likely work better than in icon of a recyclable bag.
  • Change language to French? Maybe how about just the word “French”.
  • ????? Help? Why not just put “Help”? Or a ? with Help underneath?

Overall the interface is just blah. Now it does allow you to do things in no strict order, i.e. you can scan your points card any time during the transaction as opposed to at the beginning. If I don’t have a points card it doesn’t annoy me by asking me.

A weird usability experience.