Category: AI and Life

Mechanical Chef

Mechanical Chef

On November 17th, 2017 at the Maker Faire in Bangalore, on stage before an audience of a few hundred people, a machine cooked a simple Indian side-dish – a potato fry.

The next day it prepared a pot of rice.

In so doing, it became the world’s first machine to cook an Indian meal autonomously.

23593357_1514971115237798_1402609992841796738_o (1)

The Mechanical Chef is the coming to fruition of an idea that germinated in the year 2012, when a colleague and I were walking down Millers Road, on the way to a cup of coffee at a roadside store, and I asked the colleague if there was any way in which we could really change the world and ‘make a dent in the universe’ as it were, in the present millennium.

The colleague was a woman, and she said that if Indian women didn’t have to do any cooking, it would save a large fraction of half a billion women in India 3 hours a day every day of their lives.

That day in 2012, my colleague, Princiya and I started dissecting Indian cooking.

We came up with simple operations that underlay Indian recipes that did not require shaping (we aren’t aiming to prepare rotis {there’s a machine for that already}, idlis or dosas {again, there’s a machine available for that}).

And they were:

  1. Adding ingredients
  2. Heating
  3. Manipulations such as stirring, sieving, grinding, whisking and powdering
  4. Transferring from one container to another

And we came up with a machine that could do all the above.

At the time, there was a Chinese cooking robot which could cook stir-fried (wok-friend) dishes:

and there were several experimental machines like Moley which used expensive robotic arms for cooking.

There is even another team in Bangalore that is also working at present on a cooking robot for Indian food!

 

Our First Design

In 2012 we came up with a much simpler architecture which could support all the above cooking functions (the ones that would be needed for Indian cooking).  It was a type of sensor network for cooking.

It was an improvement over the Chinese automated wok in that it could cook multiple dishes at the same time, and it was an improvement over the robotic arms because it was much simpler and therefore more cost-effective.

We took the drawings to Dr. Raju of Systemantics (a maker of industrial robots in Bangalore) one day.  He listened to us patiently and observed that our machine would need very powerful motors in order to lift heavy vessels up against the force of gravity.

This is a common mistake that firms developing cooking robots make.  Going against gravity is never a good idea when you have to carry kilograms of ingredients in a vessel.  The motors end up having to be big and powerful and friction becomes a very big hindrance to smooth movement.

So, we went back to the drawing board.

 

Our Second Design

Last year (in 2016), we developed a machine that looked a bit like this one at MIT:

… and this one …

In our second design, the cooking vessels moved on a linear rail and ingredients dropped into them from above much like they do in the machines above.

We did not have a grinder and could not transfer ingredients from one container to another at will in our design.

But as we analysed Indian cooking recipes further, we realized that the vast majority of Indian dishes did not need any transferring of ingredients across vessels, and even if they did, we could stop the cooking at a certain point and ask a human to do the transfer without greatly impacting the automatic cooking experience.

We could also get by without grinding for many dishes if we used specially made powders in our cooking machine.

It was with this design that I went to my old friend Prashanth G. B. N., a mechanical engineer and designer of hardware systems, for his advice.

He took a look at the drawings and felt we would have to make the machine even simpler if it had to be used in Indian homes.

 

Our Third Design

He took a sheet of paper and sketched on it a design that had only rotary movements.

“Rotary motion is far simpler to build out than linear motion” he explained.

After developing a detailed drawing of the machine, Prashanth and I took out a patent on the same.

 

From Design to Reality

The Mechanical Chef however only turned into reality when Arpit Sharma, an aerospace engineer from Rajasthan joined me and solved all the mechanical problems that remained.

We had to solve the problem of dispensing powders from a removable and easy-to-wash and easy-to-assemble container.

We had to find ways to completely dissociate the parts that came into contact with the food from the parts that came into contact with the electricals so that the former would be easy to clean.

We had to minimize the number of parts that needed to be cleaned after every cook.

We needed to finesse the electronics and electricals – a job which was often summarily dropped into the lap of a young engineer from Mysore – Avinash Bharadwaj.

To support ourselves as we worked on all these problems and to pay for the hardware, we applied for a grant from the Department of Science and Technology of the Government of India through IIT-Bombay.  In October of this year, we received the grant.

The first prototype that Arpit Sharma built looked like this.

Rendered_CAD_model

And it worked!

 

The Proof of the Pudding is in the Eating

Here’s a video of the machine at work.  And you’re welcome to stop by and be one of the first humans on earth to eat Indian food cooked by a robot.

Here’s how it stirs.

Here’s our mini funding pitch!

Here’s our team at the office with the Mechanical Chef.

IMG_20171207_154327

There’s a little website for it:  http://www.mechanicalchef.com

Write to us if you’d like to drop by and see us.

Advertisements

Mechanical Consciousness

Mankind has attempted for a long time to explain consciousness, one’s awareness  of one’s own existence, of the world we live in, and of the passage of time.  And mankind has further believed for a very long time that consciousness extends beyond death and the destruction of the body.

Most explanations of consciousness have tended to rely on religion, and on philosophical strains associated with religion.  Possibly as a result, there has been a tendency to explain consciousness as being caused by a “soul” which lives on after death and in most traditions gets judged for its actions and beliefs during its time of residence in the body.

In this article, it is proposed that consciousness can have a purely mechanical origin.

The proposal is merely conjecture, but observations that support the conjecture (though they do not prove it) and I hope, render the conjecture plausible, are provided.  The explanatory power of the model is also somewhat explored.

It is also proposed that the working of the human mind is similar to that of many machine learning models in that they share certain limitations.

 

Preliminaries

First, let me define consciousness.  Consciousness of something is the knowledge of the presence or existence of something (of time or of our selves or of the world around us).

I argue that consciousness requires at the very least what we call “awareness” (that is, being able to sense directly or indirectly what one is conscious of).

Claim:  If I were not aware of something, I wouldn’t be conscious of it.

Argument: If all humanity lived underground for all time and never saw the sky, we would not be aware of the existence of the sky either by direct experience or by hearsay.  So, we couldn’t be conscious of it.  So, it is only when we are aware of the existence of something that we are conscious of it.

So, we have established a minimum requirement for consciousness – and that is “awareness” (being able to sense it).

But does consciousness require anything more than awareness?

The ability to reason and to predict behavior are things the human mind is capable of.

But are they required for consciousness?

Claim:  Reasoning is not required for consciousness.

Argument:  I argue that reasoning is not required because one cannot reason about something that one is not aware of the existence or presence of.  So, anything that one reasons about is something that one has registered the presence of in some manner, in other words, that one is conscious of.

Claim:  Prediction of the behavior of something is not required for consciousness.

Argument:  Prediction of the future behaviour of a thing is not possible without observation over time of how that thing behaves.  So observation (and consciousness) precedes prediction.

Yann LeCun argues that “common sense” is the ability to predict how something might behave in the future (if its future state is not completely random).  If we accept that definition, we might say that common sense builds on consciousness, not the other way around.

So, it appears that consciousness (knowledge of the existence of something) requires the bare minimum of awareness through the senses, and does not require reasoning or the ability to predict.

 

Development

The next question to consider is whether awareness constitutes consciousness or if there is more to it.

Claim:  There is more to consciousness than the signals that our senses send to the brain (awareness).

Argument:  The signals sent to the brain are analogous to signals that are present in completely inanimate things.  A camera has a sensor that records images of the outside world.  Even a pin-hole camera senses the outside world upon the wall on which the image of the sensed world is cast.  Even a shadow can be considered to be a “sensing” of the object that casts the shadow.  That does not imply consciousness.  There must be something else in animate “living” things that produces consciousness.

What is that something extra that is over and above what our senses record?

I believe that the extra thing that constitutes consciousness is the ability to create a model of what we sense and remember it (keep it in memory).

By “create a model”, I mean store a representation of what is sensed in some kind of memory so that what is sensed can be reproduced in some medium possibly at a later stage.

The model cannot be reproduced if it is not stored and remembered, so memory is also key to consciousness.

So, consciousness is the creation of a model in memory of what is sensed.

In other words, anything that can sense something in the world and actively create a model of what it senses (be able to reproduce it exactly or inexactly) is conscious.

I will attempt to justify this claim later.

 

Elaboration

So, the claim is that anything – even if it is a machine – that can actively create a model of something that it senses (is aware of) and store it in memory in such a way as to permit retrieval of the model, is conscious of it.

I am not saying that conscious beings are conscious of every aspect of what they sense as soon as they sense it. It can be possible that they sense and temporarily store a lot of things (for humans, for example, that could be every pixel of what we see outside the blind spot) but only model in a more abstract form and store in memory as an abstraction (and in a retrievable form) those parts that they pay attention to.

So it is possible that a conscious being may be conscious of the pixels of a bird outside the window but not conscious of it as a bird (model it in a more abstract form) or of its colour (model its properties) unless the conscious being pays attention to it.

For example, let us say we’re talking of a human.  Let’s say further that the human sees a mountain.

The human senses (sees) the mountain when rays of light scattered by the surface of the mountain or from things upon the mountain enter her or his eye and impinge upon the retina, triggering a chain of chemical reactions that lead to electrical potentials building up that act upon the nerves in the retinal cortex.

Subsequently, the neurons in the optical pathway of the human’s brain fire in such a manner that eventually, various parameters of the mountain come to be represented in the pattern of neural activations in the human’s brain.

We know that the human has modeled the mountain because the human can be asked to draw the mountain on a sheet of paper and will be able to do so.

Now, the human can be conscious of various parameters of the mountain as well.  For example, if the predominant colour of the mountain is represented in those neural activations, then the human is conscious of the predominant colour of the mountain.  For instance, if the human can answer, accurately or inaccurately, a question about the colour of the mountain, the human can be said to have modeled the same.

If the height of the mountain is represented in the neural patterns, then the human is conscious of the height of the mountain.  This can be tested by asking the human to state the height of the mountain.

If the shape of the mountain is vaguely capture in the neural activations so that the human identifies the same with that of a typical mountain, then the human is conscious of the mountain’s shape and that it is a mountain.

This ability to model is not present in what we typically consider an inanimate object.  A pin-hole camera would not actively create a model of what it senses (projects onto the wall) and is therefore not conscious.  Its projection is purely a result of physical phenomena external to it and it has no agency in the creation of the image within it.  So it has no consciousness.

Let’s say we use a digital camera which records the pixels of let’s say a mountain before it.  It can reproduce the mountain pixel by pixel, and so can be said to have a model in its memory of the mountain.  In other words, such a camera is conscious of the pixels of the mountain and everything else in the field of view.  It wouldn’t be conscious of the shapes or sizes or colours or even of the presence of  a mountain in the sense that a human would.

Claim:  Consciousness requires the active acquisition and storage of information from what is sensed.

Argument:  If the “model” is just the result of physical phenomena, say a projected image in a pin-hole camera, then there is no information acquired and stored by the system from what is sensed, and hence no consciousness.

Now, supposing that we were to build a machine of sand that created a representation of the mountain in sand and of the height and colour of the mountain and of the shape of the mountain and of the association of this shape with typical mountain shapes and of every other parameter that the human brain models.

Now, I would argue that this sand machine could be said to be conscious of the mountain in the same way as we are, even though it uses a completely different mechanism to create a model of the mountain.

Claim:  The hypothetical sand machine and a human brain are equivalent

Argument:  Consciousness of something is only dependent on what is modeled, and no on the method of modeling.  So, as long as the parameters of the mountain are modeled in exactly the same way in two systems, they can be said to be conscious of it in the same way.

 

Corollary

We are machines.

 

All right, so that’s a claim as well.

Here are two arguments in support of the claim.

a) Our behaviour in some sensory tasks is similar to that we would expect from machine learning tools called classifiers.

  1. The Himba colour experiment discovered that the Himba tribe of Africa were distinguishing colours differently from the rest of the world. They could not distinguish between blue and green but could distinguish between many shades of green which other humans typically had a hard time telling apart.
  2. People who speak languages that do not have vowel tones have trouble hearing differences in tone. Similarly, people who speak languages where the consonants ‘l’ and ‘r’ are conflated cannot easily tell them apart.

This is typically how a machine learning tool called a classifier behaves.  A classifier needs to be trained on labelled sounds or colours and will learn to recognize only those, and will have a hard time telling other sounds or colours apart.

b) The limitations that our brains reveal when challenged to perform some generative tasks (tasks of imagination) are identical to the limitations that the machine learning tools called classifiers exhibit.

Let me try the experiment on you.   Here’s a test of your imagination.  Imagine a colour that you have never seen before.

Not a mixture of colours, mind you, but a colour that you have never ever seen before.

If you are like most people, you’ll draw a blank.

And that is what a classifier would do too.

So, I would say that the human brain models things like colours or phonemes using some kind of classification algorithm, because it displays the limitations that such algorithms do.

So it is possible that we shall be able to discover by similar experiments on different types of human cognitive functions, that humans are merely machines capable of consciousness (of modeling a certain set of parameters related to what we perceive) and other cognitive functions that define us as human.

 

Further Discussion

People with whom I’ve discussed this sometime ask me if considering consciousness as the process of building a model of something adequately explains feelings, emotions, likes and dislikes and love and longing.

My answer is that it does, at least as far as likes and dislikes go.

A liking of something is a parameter associated with that thing and it is a single-value parameter that can be easily modeled by one or more numbers.

Neural networks can easily represent such numbers (regression models) and so can model likes and dislikes.

As for love and longing, these could result from biological processes and genetic inclinations, but as long as they are experienced, they would have had to be modeled in the human mind, possibly represented by a single number (a single point representation of intensity) or a distributed representation of intensity.  What is felt in these cases would also be modeled as an intensity (represented at a point or in a distributed manner).  One would be conscious of a feeling only when one could sense it and model it.  And the proof that one has modeled it lies in the fact that one can describe it.

So, when  the person becomes conscious of the longing, it is because it has been modeled in their brain.

 

Still Further Discussion

Again, someone asked if machines could ever possibly be capable of truth and kindness.

I suppose the assumption is that only humans are capable of noble qualities such as truth and kindness or that there is something innate in humans which gives rise to such qualities (perhaps gifted to humanity or instilled in them by the divine or the supernatural or earned by souls that attain humanity through the refinement of past lives).

However, there is no need to resort to such theories to explain altruistic qualities such as truthfulness, goodness and kindness.  It is possible to show game theoretically that noble qualities such as trustworthiness would emerge in groups competing in a typical modern economic environment involving a specialization of skills, interdependence and trading.

Essentially the groups that demonstrate less honesty and trustworthiness fail to be competitive against groups that demonstrate higher honesty and trustworthiness and therefore are either displaced by the latter or adopt the qualities that made the latter successful.  So, it is possible to show that the morals taught by religions and noble cultural norms can all be evolved by any group of competing agents.

So, truth and kindness are not necessarily qualities that machines would be incapable of (towards each other).  In fact, these would be qualities they would evolve if they were interdependent and had to trade with each other and organize and collaborate much as we do.

 

Related Work

This is a different definition than the definition used by Max Tegmark in his book “Life 3.0” but his definition of “consciousness” as “subjective experience” confuses it with “sentience” (the ability to feel).

Tegmark also talks about the work of the philosophers David Chalmers and Scott Aaronson, who seem to be approaching the question from the direction of physics – as in we are just particles from food and the atmosphere rearranged, so what arrangement of particles causes consciousness?

I think that is irrelevant.

All we need to ask is “What is the physical system, whatever it is made of, capable of modeling?”

Interestingly, in the book, Tegmark talks about a number of experiences that any theory of consciousness should explain.

Let’s look at some of those.

 

Explanatory Power of this Model

Explaining Abstraction

He talks about how tasks move from the conscious to the unconscious level as we practise them and get good at them.

He points out that when a human reads this, you do not read character by character but word by word.  Why is it that as you improve your reading skills, you are no longer conscious of the letters?

Actually, this can be explained by the theory we just put forth.

When we are learning to read (modeling the text is reading), we learn to model characters when we see a passage of text like this one and read character by character.

But with practice, we learn to model words or phrases at a higher level from passages of text, and direct our attention to the words or phrases because that facilitates reading.

We can chose to direct our attention to the letters and read letter by letter as well, if we so choose.

So, this model can explain attention too.

Attention

The brain is limited in its capacity to process and store information, so the human brain focuses its attention on the parts of the model it has built that are required for the performance of any task.

It can chose to not keep in memory more granular parts of the model once it has built a larger model.  For instance it can choose to not keep in memory the characters if it already has modeled the word.

This also explains phenomena such as “hemineglect” (patients with certain lesions in their brain miss half their field of vision but are not aware of it – so they may not eat food in the left half of their plate since they do not notice it).

We can explain it by saying that the brain has modeled a whole plate from the faulty sensory information provided to it and therefore the user is conscious of a whole plate, but minus the missing information.

Blindsight

Tegmark also talks of the work of Christof Koch and Francis Krick on the “neural correlates of consciousness”.

Koch and Krick performed an experiment where they distracted one eye with flashing images and caused the other eye to miss registering a static image presented to it.

They inferred from this that the retina is not capable of consciousness.

I would counter that by saying that the retina is conscious of the pixels of the images it sees if it constructs models of them (as it does) and stores them.

But if the brain models more abstract properties more useful to the tasks we perform, we focus our attention on those and therefore do not store in the memory the images that are not relevant to the more critical task (the distracting task).

So, I would argue that our consciousness can include models that comes from the retina (if some neural pathway from the retina creates models in memory at the pixel level).

But if our attention decides to focus on and consign to memory better things than what the retina models, it will, and then it will not necessarily model and be conscious of pixels from the retina.

 

Still Other work

Tegmark also talks extensively about the work of Giulio Tononi and his collaborators on something called “integrated information” and the objections to it by Murray Shanahan, but I’ll leave those interested in those theories to refer the work of their authors.

The Vanishing Information Problem – Why we switched to deep learning with neural networks

It’s been a year since my last post.  My last post was about deep (multi-layer) Bayesian classifiers capable of learning non-linear decision boundaries.

Since then, I’ve put on hold the work I was doing on deep (multi-layer) Bayesian classifiers and instead been working on deep learning using neural networks.

The reason for this was simple: our last paper revealed a limitation of deep directed graphical models that deep neural networks did not share, which allowed the latter to be of much greater depth (or to remember way more information) than the former.

The limitation turned out to be in the very equation that allowed us (read our last paper on deep (multi-layer) Bayesian classifiers for an explanation of the mathematics) to introduce non-linearity into deep Bayesian networks:

Sum of Products

The equation contains a product of feature probabilities P(f|h,c) [the part inside the big brackets in the above equation].

This product yields extreme (uncalibrated) probabilities and we had observed that those extreme probabilities were essential to the formation of non-linear decision boundaries in the deep Bayesian classifiers we’d explored in the paper.  The extremeness allowed the nearest cluster to a data point to have a greater say in the classification than all the other clusters.

We had found that when using this equation, there was no need to explicitly add non-linearities between the layers, because the above product itself gave rise to non-linear decision boundaries.

However, because of the extremeness of the product of P(f|h,c), the probability P(h|F) (the probability of a hidden node given the features) becomes a one-hot vector.

Thus a dense input vector (f) becomes transformed into a one hot vector (h), in just one layer.

Once we have a one-hot vector, we don’t gain much from the addition of more layers of neurons (which is also why you shouldn’t use the softmax activation function in intermediate layers of deep neural networks).

This is because one-hot encodings encode very little information.

There’s an explanation of this weakness of one-hot encodings in the following lecture by Hinton comparing RNNs and HMMs.

Hinton points out there that an RNN with its dense representation can encode exponentially more information than a finite state automaton (that is, an HMM) with its one-hot representation of information.

I call this tendency of deep Bayesian models to reduce dense representations of information to one-hot representations the vanishing information problem.

Since the one-hot representation is a result of overconfidence (a kind of poor calibration), it can be said that the vanishing information problem exists in any system that suffers from overconfidence.

Since Bayesian systems suffer from the overconfidence problem, they don’t scale up to lots of layers.

(We are not sure whether the overconfidence problem is an artifact of the training method that we used, namely expectation maximization, or of the formalism of directed graphical models themselves).

What our equations told us though was that the vanishing information problem was inescapable for deep Bayesian classification models trained using EM.

As a result, they would never be able to grow as deep as deep neural networks.

And that is the main reason why we switched to using deep neural networks in both our research and our consulting work at Aiaioo Labs.

Kabir and Language

Kabir
Image from Wikipedia

Yesterday, I went to a concert of songs belonging to the tradition of a 15th century saint-poet called Kabir, and came across a very interesting song that he is said to have composed.

It went something like this.

The cow was milked

Before the calf was born

But after I sold the curd in the market

and this:

The ant went to its wedding

Carrying a gallon of oil

And an elephant and a camel under its arms

From the perspective of natural language processing and machine learning, the incongruous situations depicted in these poems turn out having an interesting pattern in them, as I will explain below.

I found more examples of Kabir’s “inverted verses” online.

The poems at http://www.sriviliveshere.com/mapping-ulat-bansi.html come with beautiful illustrations as well.

Here are a few more lines from Kabir’s inverted verse:

A tree stands without roots

A tree bears fruit without flowers

Someone dances without feet

Someone plays music without hands

Someone sings without a tongue

Water catches fire

Someone sees with blind eyes

A cow eats a lion

A deer eats a cheetah

A crow pounces on a falcon

A quail pounces on a hawk

A mouse eats a cat

A dog eats a jackal

A frog eats snakes

What’s interesting about all of these is that they’re examples of entity-relationships that are false.

Let me first explain what entities and relationships are.

Entities are the real or conceptual objects that we perceive as existing in the world we live in.  They are usually described using a noun phrase and qualified using an adjective.

Relationships are the functions that apply to an ordered list of entities and return a true or false value.

For example, if you take the sentence “The hunter hunts the fox,” there are two entities (1. the hunter, 2. the fox).  The relationship is “hunts”, it returns true for the two entities presented in that order.

The relationship “hunts” would return false if the entities were inverted (as in 1. the fox and 2. the hunter … as in the sentence “The fox hunts the hunter”).

The relationship and the entity can be stored in a database and hence can be considered as the structured form of an unstructured plain-language utterance.

In fact it is entities and relationships such as these that it was speculated would some day make up the semantic web.

Most of Kabir’s inverted verse seems to be based on examples of false entity relationships of dual arity (involving two entities), and that often, there is a violation of entity order which causes the entity function to return the value false.

In the “cow was milked” song, the relationship that is violated is the temporal relationship: “takes place before”.

In the “ant’s wedding” song, the relationship that is violated is that of capability: “can do”.

In the rest of the examples, relationships like “eats”, “hunts”, “plays”, “dances”, “bears fruit”, etc., are violated.

Other Commentary

In Osho’s “The Revolution”, he talks about Kabir’s interest in and distrust of language, quoting the poet as saying:

I HAVE BEEN THINKING OF THE DIFFERENCE BETWEEN WATER

AND THE WAVES ON IT. RISING,

WATER’S STILL WATER, FALLING BACK,

IT IS WATER. WILL YOU GIVE ME A HINT

HOW TO TELL THEM APART?

BECAUSE SOMEONE HAS MADE UP THE WORD ‘WAVE’,

DO I HAVE TO DISTINGUISH IT FROM ‘WATER’?

And Osho concludes with:

Kabir is not interested in giving you any answers — because he knows perfectly well there is no answer. The game of question and answers is just a game — not that Kabir was not answering his disciples’ questions; he was answering, but answering playfully. That quality you have to remember. He is not a serious man; no wise man can ever be serious. Seriousness is part of ignorance, seriousness is a shadow of the ego. The wise is always non-serious. There can be no serious answers to questions, not at least with Kabir — because he does not believe that there is any meaning in life, and he does not believe that you have to stand aloof from life to observe and to find the meaning. He believes in participation. He does not want you to become a spectator, a speculator, a philosopher.

Notes

This genre of verse seems to have been a tradition in folk religious movements in North India.  In “The Tenth Rasa: An Anthology of Indian Nonsense” by Michael Heyman, Sumanya Satpathy and Anushka Ravishankar, they talk about Namdev, a 13th century saint-poet as having authored such verses as well.

Fraud detection using computers

For a long time, we’ve been interested in using mathematics (and computers) to detect and deter fraud.  It is related to our earlier work on identifying perpetrators of terrorist attacks.  (Yeah, I know it’s not as cool, but it’s some similar math!)

Today, I want to talk about some approaches to detecting fraud that we talked about on a beautiful summer day, in the engineering room at Aiaioo Labs.

That day, in the afternoon, somebody had rung the bell.  A colleague had answered the bell and then come and handed me a sheet of paper, saying that a lady at the door was asking for donations.

The paper bore the letterhead of an organization in a script that I couldn’t read.  However the text in English stated that the bearer was a student collecting money to feed a few thousand refugees living in a refugee camp in Hyderabad (the refugees’ homes had been destroyed in artillery shelling on the India-Pakistan border and that there were a few thousand families without shelter who needed food and medicines urgently).

On the sheet were the names and signatures of about 20 donors who had each donated around 1000 rupees.

Now the problem before us was to figure out if the lady was a genuine student volunteer or a fraudster out to make some quick money.

There was one thing about the document that looked decidedly suspicious.

It was that the amounts donated were all very similar – 1000, 1200, 1300, 1000, 1000, 1000, 1000.

All the numbers had unnaturally high values.

So, I called a friend of mine who came from the place she claimed the refugees (and the student volunteers) were from and asked him to talk to her and tell me if her story checked out.

He spoke to her over the phone for a few minutes and then told me that her story was not entirely true.

She was from the place that she claimed the refugees came from, but she was in fact collecting money for her own family (they had come south because one of them had needed a medical operation and were now collecting money to travel back to their home town).

When we asked her why she had lied, she just shrugged.

We felt it would be fine to help a family in need, so we gave her some money.

However, the whole affair gave us an interesting problem to solve.

How do you tell if a set of numbers is ‘natural’ or if it has been made up by a person intent on making them look natural?

Well, it turns out that statistics can give you the tools to do that.

Method 1

In nature, many processes result in random numbers that follow a certain distribution. And there are standard distributions that almost all numbers found in nature belong to.

For example, on the sheet of paper that the lady had presented, the figures for the money donated should have followed a normal distribution.  There should have been a few high values and a few low values and a lot of the values in the middle.

Since that wasn’t the case I could easily tell that the numbers had been made up.

But you don’t need a human to tell you that.  There are statistical tests that can be done to see if a set of numbers belongs to any expected distribution.

I looked around online and found an article that tells you about methods that can be used to check if a set of numbers belongs to a normal distribution (a distribution that occurs very frequently in nature): http://mathforum.org/library/drmath/view/72065.html

Some of the methods it talks about are the Kolmogorov-Smirnov test, the Chi-square test, the D’Agostino-Pearson test and the Jarque-Bera test.

Details of each can be found at these links (taken from the article):

One common test for normality with which I am personally NOT familiar, is the Kolmogorov-Smirnov test.  The math behind it is very involved, and I would suggest you refer to other resources such as this page

  Wikipedia: Kolmogorov-Smirnov Test
    http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test 

You can read more about the D'Agostino-Pearson test and get a table that can be used in Excel here:

  Wikipedia: Normality Test
     http://en.wikipedia.org/wiki/User:Xargque#Normality_Test 

 Wikipedia: Jarque-Bera Test
     http://en.wikipedia.org/wiki/Jarque-Bera_test 

One item of note: depending on how your stats program calculates kurtosis, you may or may not need to subtract 3 from kurtosis.

 See: Wikipedia Talk: Jarque-Bera Test
      http://en.wikipedia.org/wiki/Talk:Jarque-Bera_test

On to the next method:

Method 2

Another property of many naturally occurring numbers is that about one third of them start with the number 1 !!!  Surprising isn’t it?!!

Well, it turns out that this applies to population numbers, electricity bills, stock prices and the lengths of rivers.

It applies to all numbers that come from power law distributions (power laws govern the distribution of wealth, connections on facebook, the numbers of speakers of a language, and lot of numbers related to society).

This is called Benford’s law:  http://en.wikipedia.org/wiki/Benford’s_law

(I believe that Benford’s law would have applied to the above case as well – donations would have a power law distribution – if you assumed that all donors donated money proportional to their wealth).

When I read about Benford’s law on Wikipedia (while writing this article), I found that it is already being used for accounting fraud detection.

The Wikipedia says:

Accounting fraud detection

In 1972, Hal Varian suggested that the law could be used to detect possible fraud in lists of socio-economic data submitted in support of public planning decisions. Based on the plausible assumption that people who make up figures tend to distribute their digits fairly uniformly, a simple comparison of first-digit frequency distribution from the data with the expected distribution according to Benford’s Law ought to show up any anomalous results. Following this idea, Mark Nigrini showed that Benford’s Law could be used in forensic accounting and auditing as an indicator of accounting and expenses fraud.[10] In practice, applications of Benford’s Law for fraud detection routinely use more than the first digit.[10]

Method 3

There are also methods that can be used by governments and large organizations to prevent fraud in the issuing of tenders.

More about that in my next article.

In trust we god

in_trust_we_god

Can trust affect the outcome of political events (war), business transactions (pricing) and economic affairs (poverty)?

This is a problem that I’ve been very interested in for many years.

A few years ago I came across papers in economics and game theory that supplied the mathematical tools that we need to analyse such problems.

So, I’ll take each area of interest 1) politics 2) business and 3) economics and explain how trust matters in each case.

1.  Politics

Can the outcome of something like war be determined by trust?

Let’s assume an army of 2 soldiers.

In a war, the benefits to each soldier can be modeled as a bi-matrix (normal-form game) as follows:

soldier 2 fights soldier 2 flees
soldier 1 fights 5, 5
–5, 0
soldier 1 flees 0, -5
0, 0
Normal form or payoff matrix of a 2-player, 2-strategy game

The first of the two numbers in the matrix represents the payoff to soldier 1.

The second of the two numbers in the matrix represents the payoff to soldier 2.

(The soldiers win something (represented by 5 points) if their army wins; they win nothing if their army loses; and they lose their life (represented by -5 points) if they do not flee and their army loses; we assume the army wins if both soldiers do not flee and loses if one or both flee).

If soldier 1 trusts soldier 2 not to flee the battlefield, the best strategy for soldier 1 is to stay and fight as well (since he will then get more benefits than if he flees).

If soldier 1 does not trust soldier 2 to stay on the battlefield (if he suspects that soldier 2 will run away), then the best strategy for soldier 1 is to run away himself (so that he does not remain on the battlefield and get killed).

So, this model shows that if two equal 2 man armies meet on a battlefield, the one whose soldiers trust each other more will win.

2.  Business (Pricing)

There is a very interesting paper by George A. Akerlof (‘The Market for “Lemons”: Quality Uncertainty and the Market Mechanism’).

It tries to explain why the price of a new car in a show room is so much higher than the price of a new car in the second-hand car market.

For example, a car costing $25,000 fresh out of the showroom, might fetch $18,000 if sold as a used car in the used car market.

Akerlof’s paper tries to explain why the price dropped so sharply.

Akerlof suggests that the price drop is a result of the uncertainty surrounding the quality of the car in the used-car market.

A certain percentage of cars in a used-car market will be defective (since anyone can sell a car in an unregulated market, and unscrupulous people would have put defective cars up for sale).

Let’s say 50% of the cars in the used car market are defective.

Now, a person buying a used car a day old will only be prepared to risk paying 50% of the showroom price for the car (because of the 50% chance that the car is worth nothing).

The Price of Trust

This result has the following unintended consequence:

The more a person trusts a seller, the higher the price he will be willing to offer for a car.

I’ll give you an example of that.  (I’m sorry, but this is a bit racist).

When I was a student in North Carolina, and I was looking to buy a used car, I was given the following piece of advice by my fellow students.

They said, “Go for a car that an American is selling because they will tell you about any problems that it has.  Don’t buy a car from an Asian or an Indian unless you know them well.  They won’t tell you if there are any problems.”

I see the same effect even when doing business in India today – a lot of business happens through connections.

Price Sensitivity

It might also explain why Indians are so price sensitive.

Indians are said to be very price-sensitive, preferring the less expensive offerings over more expensive ones that promise better quality (I recall Richard Branson said that at one point while explaining why he didn’t want to enter India).

I think the price sensitivity is a result of Indians not being able to trust promises of higher quality from their countrymen.

Price becomes the only measure that Indian buyers are able to trust to when making a purchasing decision, leading to extreme price-sensitivity in the Indian market.

Hiring and ‘Brain Drain’

Even in hiring, this can have the effect of driving down salaries.

When hiring someone, an Indian firm is likely to offer a lower salary than the market, because they don’t trust in the abilities of the person being hired.

In Akerlof’s paper, he talks about a side-effect of a lack of trust.  He says that good quality cars will just stop being sold on the low-trust markets.

The applies to the job market in India as well:  Indian firms tend to offer lower salaries, which might lead to the best engineers choosing MNCs over Indian firms or leaving Indian shores altogether.

3.  Economics

I’ve described in an earlier blog how man-in-the-middle systems of government can fail to work efficiently if the man-in-the-middle is corrupt.

I’ve described in that post how resources can be wrongly allocated in the presence of corruption.

https://aiaioo.wordpress.com/2013/08/15/who-betrayed-ekalavya-2/

The result of an inefficient allocation of our resources is poverty.

For example, the Indian government has tripled defence spending in the last 10 years – through heavy borrowing – when it is possible to show that we need to allocate whatever money we have to education (see our arguments for that https://aiaioo.wordpress.com/2012/06/04/algorithms-to-combat-poverty/).

World Bank studies (that you can get off an Indian Reserve Bank website) show that corrupt governments spend more on arms (because of how easy it is to hide kickbacks from arms deals) than honest governments.

So, the economic prosperity of a country can be impacted by corruption.

Causes of Corruption

But we can ask a deeper question:  “What causes corruption?”

I’ll try to show right here that it is a lack of trust.

Take for example two players in a bidding war (let’s say that they are bidding for a government contract).

Each has the choice to give a bribe or not to give a bribe.

Player 1 is more likely to give a bribe if player 1 does not trust player 2 to not offer a bribe to the government official.

It’s the same decision matrix that I have used for the case of the 2 soldier army.

So you get it?

Everything depends on trust.

Philosophy

I am probably way out of my depth on this, but the ancient Greeks seem to have had two views on the supreme ideal that man should strive for.

According to the Wikipedia article on Dialectics:

“The Sophists taught arête (Greek: ἀρετή, qualityexcellence) as the highest value, and the determinant of one’s actions in life.”

But there lived in Greece a man who disagreed with that notion:  ”Socrates favoured truth as the highest value, proposing that it could be discovered through reason and logic in discussion: ergo, dialectic.”

But the above models seem to suggest that truth (honesty) results in trust (you know that the guy next to you is honest and won’t lie about the quality of a car or bribe a government official to get ahead of you).

And what the Akerlof paper shows is that trust rewards and promotes quality.

In other words, the two Greek concepts of quality (of the values mankind must uphold for its own good) are probably one and the same.

Related Posts:

1.  Framework for evaluating values

2.  What traffic can reveal about society

3.  Who betrayed Ekalavya?

4.  Can economics change the world?

5.  Is there an algorithm to combat poverty?

6.  Why dance is undervalued

7.  Is 5 very far from 4?

Related Far-out Posts:

1.  Splitting the Truth into Precision and Recall

2.  Does AI have Buddha nature?

[The image in this picture was taken from a circulated Facebook post.  The copyright owner of the image is unknown at this time and if anyone knows him/her I’d like to make sure they’re ok with my using the image and acknowledge them].

Should Cecilia have said “insecure” instead of “unsecure”?

In this funny PhD Comic, the main character – Cecilia (the girl in red) – says:

“Do you realize how unsecure your coffee distribution system is?”

That made me wonder – should she have said ‘insecure’?

Even the WordPress spell-checker has a problem with “unsecure”.

It thinks that “unsecure” is a spelling error.

However, the word “insecure” doesn’t sound as if it were the right term to use in the context of computer security.

That is because the word “insecure” is usually used in the context of a person to mean a person who is not confident and self-assured.

To call a computer “insecure” would be a bit like saying that the computer had self-image issues.

Others have written about this cognitive dissonance as well (see http://english.stackexchange.com/questions/19653/insecure-or-unsecure-when-dealing-with-security for a nice discussion).

Given the problem, the author of the cartoon seems to be justified in using a newly-minted word (one not found in any dictionary) in order to describe the lack of security.

This is also very interesting because it throws some light on how words are born.

Before I can explain what I mean, I’ll need you to take a look the Oxford dictionary’s definitions of the word “insecure” (from the Oxford English Dictionary online search at http://oxforddictionaries.com/definition/english/insecure?q=insecure):

insecure

adjective

  • 1   uncertain or anxious about oneself; not confident:  a rather gauche, insecure young man,  a top model who is notoriously insecure about her looks
  • 2   (of a thing) not firm or fixed; liable to give way or break:  an insecure footbridge 

                 not sufficiently protected; easily broken into:  an insecure computer system

  • 3   (of a job or situation) liable to change for the worse; not permanent or settled:  badly paid and insecure jobsa financially insecure period

There are three ways in which the word “insecure” can be used.

The second usage would have been perfect for the context of computer security.

But the first usage might be conflated with the second in that context.

And that is because (sorry, I no longer recall the references to support this claim) computers appear to the human mind to have human-like characteristics (we say things like “Google tells me that …” or “my computer has gone to sleep”).

So, the only word in the dictionary that can do the job – the word “insecure” – has a conflict of interest.

And therefore, a new word needs to be coined that is not susceptible to the same sort of ambiguity.

And if the new word “unsecure” catches on, then one day, the second sense of the word “insecure” could become extinct in the context of computers.

Oh well, “it’s only words!”

POST EDIT

A friend pointed out that the Google NGram Viewer shows a history of the use of the word “unsecure”: http://books.google.com/ngrams/graph?content=unsecure.

The word seems to have been in use between 1650 and 1850 (there is evidence of use in literature), and has in more recent times simply fallen out of circulation (being eclipsed by “insecure” in around 1750).  Thanks, Prashant.

(You can also search for those early usages in books – http://books.google.com/books?id=WmpCAAAAcAAJ&pg=PA12&dq=%22unsecure%22&hl=en&sa=X&ei=aOcLUq7aA-3iyAHu8YGwAg&ved=0CDMQ6AEwAA#v=onepage&q=%22unsecure%22&f=false)