Away… for a bit.

No posts for a few weeks… on vacation, and trying to work on my other blogs, and writing other things. back in early August.

Advertisements

Human-machine interaction and the usability conundrum

In this day-and-age usability shouldn’t be the issue it is. There are usability experts out there and frankly how hard is it to make this usable? Hard it seems. Makers of physical tools seem to get it right most of the time, in fact some designs work so well, they haven’t changed in eons. So why is it so difficult for people to get tactile usability right in devices… devices like self-checkouts, and washing machines? They aren’t new of course, they have been around for years, and the secret to getting them right is easy – *test* them on real people. There shouldn’t really be any excuse.

Every day I encounter everyday machines someplace whose use is just not very intuitive. You should be able to look at a machine and figure out how to operate it without reading an operating/instruction manual (were they to be well written as well). I’m not a great usability expert, but I know enough about the design and usability of hand tools to know how easy it would be to design a machine interface that actually works well.

Here is the interface to my Miele dishwasher. It is inherently quite simple, and is comprised of three “zones”. The first zone is the cycle selection knob. Yes, it’s a physical interface, but I almost prefer that to one where I have to set the cycle each time I turn the machine on (like my washing machine) – in reality I use one particular cycle consistently (Economy), and the others only on occasion. The second zone is the indication lights, which tell me where in the cycle the machine is currently at. This is the one place where the terms used could be a little clearer, because the lights go from Rinse to Drying, with no indication of washing per se. I would have modified Rinse to Washing (this could actually be a translation issue from German to English, as the German word might encompass both actions).

The last zone involves the error indicator lights. This is nice and simple and deals with the most relevant issues encountered by the dishwasher. Is there a problem with the water intake or drain? Or is the salt reservoir or rinse aid empty. The dishwasher does have both an On/Off button and a Start button, which I find odd, but it does prevent the dishwasher from accidentally starting a cycle.

Even their new washing machines and dryers offer good, yet simple usability. It makes use of a physical rotatable knob to select the appropriate program, and an adjoining panel to select such items  as water temperature and extra options. e.g. pre-wash, soak. Each program does have a pre-programmed set of values, so it is easy to set the program, and start the machine. It even has a “MobileControl” setting to explicitly allow control of the washing machine from a mobile device – if you want this.

Physical interface buttons offer familiarity to the user, and likely less chance of some electronic component failing.

The realization of colour

Colour is a complex sensation, but we should remember that an object has no single characteristic colour because its appearance is affected by a number of factors. If we ask the colour of the girls kimonos from the image below, our first reaction may be to say that they are purple. By this means we identify the hue of the object. However, this description is clearly inadequate. To be more specific, we could say that one kimono is light purple and the other is dark purple. This describes the brightness of the colour. Colour could also be described as bright, dull or vivid, a characteristic known as saturation. Therefore the perception of colour is comprised of three characteristics, any one of which can be varied independently. But we are really describing sensations, not the object, nor the physical stimuli reaching the eye.

A colour image from Japan

How colour changes our perspective of photographs

The first permanent photograph was produced in 1825 by the French inventor Joseph Nicéphore Niépce. Since then photographs have become the epitome of our visual history. Until becoming widespread in the 1950s, colour images were more of an aberration, with monochrome, i.e. black-and-white, being the norm, partially due to the more simplistic processing requirements. As a result, history of good portion of the 19th/20th centuries is perceived in terms of monochromic images. This determines how we perceive history, for humans perceive monochromatic images in a vastly differing manner to colour ones.

The use of black-and-white in historical photographs implies certain ideas about history. There is the perception that such photos are authentic historical images. By the mid half of the 19th century, photography had become an important means of creating a visual record of life. However the process was inherently monochromatic, and the resulting photographs provided a representation of the structure of a subject, but lacked the colour which would have provided a more realistic context. There were some photographic processes which yielded an overall colour, such as cyanotypes, however such colour was unrealistic. The first colourization of photographic occurred in the early 1840s, when Swiss painter Johann Baptist Isenring used a mixture of gum arabic and pigments to make the first coloured daguerreotype. Such hand colouring continued in successive mediums including albumen and gelatin silver prints. The purpose of this hand-colouring may have been to increase the realism of the photographic prints (in lieu of a colour photographic process)  .

The major failing of monochromatic images may be the fact that they suffer from a lack of context. Removing the colour from an image provides us with a different perception of the scene. Take for example the picture of the Russian peasant girls shown in Fig. 1. The image is from the US Library of Congress Prokudin Gorskii Collection, and depicts three young women offer berries to visitors to their izba, a traditional wooden house, in a rural area along the Sheksna River, near the town of Kirillov. Shown in colour, we perceive a richness in the girls garments, even though they are peasant girls in some small Russian town. When we think of peasant Russia in the early 20th century, we are unlikely to associate such vibrant colours with their place in society. Had we viewed only the panchromatic image, our perception would be vastly different.

Fig 1: Russian peasant girls in colour and grayscale (Prokudin Gorskii)

Humans are capable of perceiving approximately 32 shades of gray and millions of colours. When we interpret an image to extract descriptors, some of those descriptors will be influenced by the perceived colour of objects within the image. A monochrome image relies on a spectrum of intensities that range from black to white, so when we view a monochromatic image, we perceive the image based on tone, texture and contrast, rather than colour. In the photograph of the peasant girls we are awed by the dazzling red and purple dresses, when viewing the monochrome image we are drawn to the shape of the dresses, the girls pose, and the content of the image.

Here is a second example of a sulfur stack shown in both colour and grayscale. The loss of meaning in the monochrome image is clear. The representative stack of sulphur is readily identifiable in the colour image, however in the monochrome image, the identifying attribute has been removed, leaving only the structure of the image with a loss of context.

Extracted sulfur stacked in a “vat” 60 feet tall at Freeport Sulphur Co. in Hoskins Mound, Texas. Kodachrome transparency by John Vachon

 

 

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 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]. This is one of those non-sensical algorithms that can be used to profile efficiency, either of a system or language, similar to Ackermann. The amount of recursion performed by this algorithm is significant. 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. 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)

 

 

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.

Stupid switch (ii) – Bad design

In most cases when we learn about the switch statement in C, we get something of the form:

switch(op) {
   case '+' : result = a + b;
              break;
   case '-' : result = a - b;
              break;
   case '/' : result = a / b;
              break;
   case '*' : result = a * b;
              break;
   default : printf("Error! Operator not found\n");
}

Which is pretty innocuous, and could have been coded with slightly less code using an if-else sequence. But switch has a somewhat darer side. While the if statement and the for and while loops allow a single statement without enclosing { }, so does switch, which is not something that is ever really discussed. So technically, this is valid:

switch(0);

as is this:

switch(i)
   i=i+1;

and even this:

switch(x)
   case 0:
      for (i = 0; i < 10; i++)
   case 1:
      for (j = 0; j < 10; j++)
   case 2:
      for (k = 0; k < 10; k++);

They all compile and run. But using them leads to code which is extremely difficult to comprehend, and likely results in the obfuscated code commonly seen in C (more so than any other language). Here is another fun piece of code:

int j, x=0;

switch(x) {
   int i = 4;
   case 0:
      j = i * i;
   default:
      printf("%d %d\n", i, j);
}

When this code runs, the answer produced is something like “32767 1073676289”, which is not the “4 16” expected. But why, it compiles okay? The problem is that the variable i is declared within the switch block, but it is not initialized to the value 4. This means that i contains some type of indeterminate value, in this case 32767, which when squared gives 1073676289.

This code seems odd, but it represents something that a novice programmer might write, and consequently it is compiled, which indicates to the programmer that what they wrote is acceptable.