Sunday, April 27, 2008

STML and friends

STML, not a variant of HTML or VRML or any subset of XML stuff. It is convenient to call the "Short Term Memory Loss" to be STML. Exams are the right candidates for the illustration. There are times when i really regret to have forgotten things, starting from date of birth to things to do and it also goes to an extent of forgetting the name of the person who calls you by name with a welcoming smile. This puts one in an embarrassing situation, one just has to smile sheepishly and slip away till the name is recollected. Though this is not STML, but a memory loss or a late recall. Finally, thought i would scribble out the things in the hazy screen of the hindsight. The material is a pure guess and no references to existing work has been made.

Memory, an experience
Many a times, it has been a personal experience that the events or the data registered in the mind does not immediately fade away. At certain times, we use to have fun games like recollecting the character names, places from the novel, or even the short stories read really long back. It would take a lot of time, hours or even days together to get back the names. Analyzing into how this mechanism works is again a sensational touch with nature.

A book-keeping dictionary
Is memory a book-keeping table? An association of object A is associated with object B by so and so means. No idea. Data organization as memory in humans is one of the complicated mechanism that is being under constant research. The storage mechanism is responsible for many activities, induces sensation, emotions, alertness etc. which might not be directly induced. Almost every other activity has got its path crossing the data warehouse. Of course, the things we can do is really limited if we do not have this storage.

Storage, an abstraction
The storage in humans could be highly abstracted. The moment we see an object, we recognize its type, characteristics, speculate its dynamic behavior and what not? If we see a polished surface, we feel it has got to be smooth. This is primarily because during our learning phase, probably we would've touched a polished surface that is smooth. Moreover, to _agree_ that the surface that is polished would be smooth, requires a higher statistical average so that the 'agreeing' part puts the data into bias.

Lumps and lumps
This gives a little insight into how memory could've been organized. In memory information is organized as 'lumps'. Each lump has a weak interaction with another lump. The strength of the interaction is increased once the event of association between two discrete elements from the lumps increases. For example, the sensory experience we learn from getting hurt by touching a hot plate makes us understand what 'hot' means. Moreover, seeing the steam coming out of boiling water and trying to get our hands really near to the steam would also have a burning effect. In another scenario, the plate is placed on top of a vessel with boiling water. The steam is ventilated through the opening in the top. By seeing this we immediately guess the plate would be hot. How does this happen? It is similar to a classify operation, A can be hot (plate), B can also be hot (steam). Now what happens after learning is that we abstract the sharp common property of the plate/steam out from the object itself. A and B are same in the sense of _hotness_. But the feel of the _hotness_ from A and B are different. One acts on the point or in a small area and the other has a 'spread' effect and affects a larger surface.

Thus by abstracting the 'sense' of 'hotness', the object A and B comes under this class. But behold, if there is just a plate lying on the table, we do not recognize it as hot right? Of course, the abstraction or classification is not sharp, in the sense, there are no strict boundaries. The levels of abstraction for the object that we learn include its:
  • Surface characteristics
  • Behavioral characteristics
  • One's emotional orientation with the object
The surface characteristics of an object include its topology in skeletal form. For a plate, it is going to be "something that is circular or round", that is "colored and/or polished", "rigid, hard", etc. that which is lot more static and physical nature of the object.

The behavioral characteristics include the dynamic characteristics of the object. For instance, we would observe the same object in different scenarios with different behaviors. The plate can also be hot, cold. The plate can be used as a placeholder for some things. And a lot more... So, all these characteristics have links to the abstract object that we perceive, that which is round, metallic, etc.

The emotional orientation with the object is what is really subjective and hard to simulate, or model or find. It depends on how an individual orient him/her self with the object. Being a dynamic object ourselves, we got to interact with the other static/dynamic objects. This makes us have a kind of sensation to different objects. Most often, the sensations are completely and sub-conscious and involuntary. Majority of people would have very blurry or no remembrance at all for the kind of sensation they have towards objects like plate, pen, paper, nail etc. Some would have a sharp remembrance of it because of the events that had happened would've got a sharp impression in their conscious region of memory. For instance, the nail has a kind of 'driving-away' effect in me when i view its sharp edge.

Memory at height of abstraction and Learning
The thing that we've guessed so far is just a small fraction on sub-conscious memory. What is the 'memory' that we say that we 'forget'? It is the information that we store on rather higher level of abstraction. Voluntarily pluggable information, also called as 'consciously memorized' information is subjected to loss and is characterized by weak links, for quicker cleanup. Imagine, a set of information that we learn, at certain time. For instance, certain paraphrases for exams. If we observe ourself into how we learn, it reflects the way the data would be stored. The learning for holding the information temporarily is different from the learning for having a lasting impression. One cannot speculate that the learning methodology that involves 'reading it aloud' is not effective than reading deeply. For instance, reading it aloud when done for considerably longer time, has a subconscious effect and gets registered in the subconscious memory. For instance, the learning that we do when we are really young is of this kind. Our parents teach certain things again and again and thus it gets to the sub-conscious memory. Looking at the ancient 'gurukula' type of educational system, they had this 'memorization' of vedas for young students. Once the sense of the information is 'understood', the 'memorization' is stopped. Many would be curious if they recollect that they would've learned by reading aloud for sometime and as they grew up, dislike that way of learning and would've done deep reading to remember things.

Memory, on the surface is the web of associations held together by sensations. A lump of information could be untouched for years together. The lumps spread across in multiple layers of abstraction. The lumps are highly dynamic and rigid for transformations. Multiple lumps could merge into a single big lump and also subdivide into smaller lumps. Moreover, smaller the lumps, easier for the learning process to make associations and other memory processing. The lump break-down is done during the sleep or resting process sub-consciously. A transformation of memory can happen once we learn a new behavior of already learnt object. The observations constantly query from the lumps and the queried information is sent to the arbiter. The agreeing/disagreeing about a particular event is done by the arbiter. It is a kind of tug-of-war. Both the parts pushes and depending on where the rope is pushed into, the decisions flow.

Loss of Memory
Many a times, after the regret of having memory loss, i observed, the loss that we incur is just a superficial phenomena in most of the cases. The feedback because of a slow recall, sent as a wrong signal as 'forgotten' keeps the mind biased with the thought that the forgetfulness has come in place. Moreover, it is amazing how the 'forgetfulness' feedback has a 'down' effect whereas faster recall of information often misinterpreted as 'more memory, memory power' etc, gives an 'up' effect. Just looking into what 'Loss of memory' means and why is this done, gives an amazing picture into the 'cleaning' work of nature. Nature is 'clean' in the sense, in all her design, she has weaved the mechanism of self-initialization, self-sustenance and self-destruction. The self-destruction of information that we have got on surface is called the memory loss. Though this definition is no where near the fact, but could give a brief sketch. Think of the scenario where one suffers from 'no loss of memory'. The hurt from the hot plate, the scratch due to a fall some years back, yelling of neighbors, etc,etc,... oh my god, so many events that we encounter and if we do not forget, or at least loosen up the associations, it would really consume up all our cells for just book keeping and that would hinder other processes. We could never be efficient, because for every small event, there would be lot of matches in the data warehouse and we could constantly fighting back and forth with ourselves.

STML is just a subset of the general memory loss in terms of definition. As the name says, it is the loss of information from the 'short term memory' or the temporary space where the information which one wants to hold for 'time being' would reside. It would just not be enough to write about the unknown architecture of our memory in this single post!

Hanoi Experiment
I feel one another experiment for improving as well as testing the limits of your short term memory could be the hanoi experiment. Solve the 'Towers of Hanoi' problem in your mind screen. It also calls for testing your abstract visual ability. Standard experiments like remembering words ranging from all related to nothing related, exists to test and improve the short term memory and long term memory.

The hanoi experiment is of particular interest because of its abstract nature. It is easy to solve the problem with 5 plates. As the number of plates are increased, it is difficult for us to imagine _distinctively_ the plates. How do we _distinctively_ imagine 10 plates of different or more specifically increasing sizes? More appropriately, it takes a long time to render the ten plates on the mind screen with finer details. Most often, the plates are visualized only when we are about the pick them up and the process of pushing and popping of plates are done conceptually or abstractly. Observe keenly when you are solving for 5 plates. Stop in between, do some other work not related at all and come back after sometime and resume where you had left. How finer can you proceed? The problem being that the visual screen we have is highly precious in the sense that the objects drawn on it are not richer in details but rather in concepts. You cannot draw a beautiful jewel with lot of finer details, it would simply be herculean. But one could easily draw a set of geometrical structures and do some intersection with that and process that more conveniently.

The base of the experiment is to have fun and feel the joy of the mind screen, also to smile at the limitations of the abstract screen and the trick the abstract part does to solve the problem.

Cantor, was never wrong

An attempt to refute Cantor's diagnolization proof that real numbers are uncountable, would be in vain. Why? People do not believe in his proof philosophically for the reason that it is so simple. It is the inherent fear with bad experiences that we had with lot many proofs that we keep constantly asking for a proof that is either lengthy or complicated to have a rock solid stability, which is again kind of contradictory. People do try to refute Cantor's arguments by showing up a counter example, and this only shows that they would've gone wrong somewhere in understanding the conventions followed for the most abstract form, the infinity.

Sample Function
Recently, myself and my roomie Vinay were investigating the properties of the function presented below:

The trivial constraints on the above function being that,

If one just experiments with this function all we can see is that given any n, it would map _uniquely_ to a real number in the open interval (0, 1). So, cannot this be a mapping from N->(0, 1) that would effectively refute Cantor's proof?

Integers
Behold, there is a hidden flaw in evaluating the above argument. The flaw is that the set that maps to open interval (0, 1) is _not_ an integer. It might sound crazy, or even freaky to a non-analyst but it makes all the more sense if we could see the dynamics of integers.

Integers, as an infinite set, grows down in one direction. So, at any given instance, however long it might be, the number of digits in each of them would be finite. Given a very long integer, we could always say, what the next integer would be, isn't? Now, take for example a number 111111... Is this an integer? No! Because, one could say of many reasons. One of them being that the growth of this number till infinity is on the horizontal direction and when we group all numbers of this form, that would naturally grow vertically too. This gives an explanation why it could be in a one-one map with (0, 1). The function does nothing but remove the period in elements from (0, 1) and to make things unique, the 0s that are prefixed after period are suffixed in case of the mapping set. Hence, 0.0001 would be mapped from 1000. Another reason being that the next number is not known in this case! which fundamentally fails to be in something called as an 'enumerable' group.

Infinity, flavors fly-overs
So, what is this infinity all about? Why is this so mysterious? No one knows precisely, may be that if one knows, we might not be in a finite existential state, probably :) But one amazing thing about infinity is that, there are different flavors of it existing. One is the infinity of the integers, infinity of the reals, infinity of power-set of reals, and so on and on and on. Does the set of all infinities of the sets namely, aleph0, aleph1, etc.. countable? (Might not be trivial to prove). All uncountable sets are of same size since we have no way to count or to size them up. On this regard, one could slightly agree upon the beliefs Jains had over the infinities. According to them there exists four kinds of infinities, to that which is one dimensional as a line, two dimensional as an area, three as a volume, and the fourth as the infinitely infinite cosmos or the eternity.

All those philosophical discussions over the infinite can be read from: [http://en.wikipedia.org/wiki/Infinity_(philosophy)]

Recently i found a paper submitted with similar spirits of refuting the proof: [http://www.arxiv.org/pdf/math/0103124v1]

Close clockwise, Open counter-clockwise

Guessing the Guesser
In an event of opening a tap, or rather a lid we involuntarily do a counter-clockwise movement. The opposing action happens in case of closing it. So, how does that happen? Aroused by curiosity of how this memory is organized, i did a little observation. Of course this did not cover many scenarios, but did gives some partial insight as to how certain rules of game have been encoded in the memory.

Experimenting with Lid/Tap
Whenever i open the tap or a lid, i have this feeling of loosening or a 'fall' with a recessive flavor. And whenever i had to close the lid, i had a feeling of sitting over the top and tightening up which had a dominant flavor. So, is that related to something that we are talking about? Yes indeed! Whenever i had to open or close (lid or something that requires a spin), i get this feeling triggered and hands automatically work upon it. Does not matter where the location of opening is. Be it in a vehicle where a small knob has to be opened inside the chassis.

Counter Experiment
On the contrary, to check if this might have some truth, just imagine a room of lids of two types. One is a blue lid and the other a green. We assume the experimenters (of course humans) attach themselves equally to both the colors. This is to be ensured to play a fair game. Now, the blues have a peculiar (rather unconventional) property that they open clockwise and close the other way. They behave exactly opposite to the way the greens operate. Now, the experimenter has to randomly operate on the lids by opening certain lids and closing certain other if they are open.

The Outcome
What would be the outcome of this thought experiment? Compare the outcome with the normal lids the experimenter would successfully operate (open/close) on. With the color lids in place, the initial phase would be a learning for the experimenter to make a conscious move, slowing down his actual speed accounting for learning as we would call as 'getting used to'. After sometime, surprisingly, the experimenter would just start with a fairly good speed on the task. But when compared to the monotonic lid open/close, it would be slow by certain folds. Why is this discretion in speeds?

The way it gets allocated
The way the things gets stored in the mind, the way we perform. It is rather interesting to make a guess or to investigate on the reason why the above could've occurred. Just list out the combinations one would have to generate to have a comfort in opening the lids.
Blue Lid: [Open] Clockwise [Close] Counter-clockwise
Green Lid: [Open] Counter-clockwise [Close] Clockwise
So, we have a total of 4 (not so large) combinations. That would take sometime as well as a proper emotional event (in terms of 'feel' patterns) to be registered. So that on seeing the color of the lid or its shape, we would get the emotional pattern triggered and the involuntary notion takes an action and makes us to open the lid in an appropriate way. The time for learning this is relatively low and is highly subjective. All one needs to get through is to choose appropriate 'feel' patterns. Most often, if we just think of this event, we would end up with feel patterns automatically. The mind seems to cook up with what it had in the 'mood' room.

This is also another reason why once out of this experiment, if the experimenter is so involved, or learnt deeply, [s]he would involuntarily try to open a conventional blue lid in an opposite way.

Im Driving... Eureka!
Not funnily or coincidentally though, if you have ever wondered how one could drive a complex car/bus/flight or a ship? If you say it is not at all complex, try to list down the states that the vehicle could be put into and the appropriate actions that must be performed at those stages. Then you could really be proud of yourself! But be proud of the nature's creation, and proceed to see how this could be possible. All one could arrive at is, we _do not_ maintain state tables marked by transition functions as one would come across in the theory of automata. They define the actions that take place in a thin line. Moreover, the actions have to be achieved faster bypassing the conscious unit. Involving the consciousness in place would be costlier in terms of time as well as energy. The conscious unit in mind does decision making and it needs lot more inputs such as environment factors etc. that would take a high initial time.

One would not want to think a lot and always come across the 'get use to' phase in driving, isn't? This could be achieved only if we have an involuntary access to actions. The involuntary actions are granted with associations to certain 'feel' or emotional patterns. I feel i need to drive this vehicle. Immediately i sit inside the vehicle and my hand involuntarily plugs in the key at the keyhole, turns it on and starts it. Then, as if pre-programmed, the mind allocates consciousness to something other than keen details of driving, such as enjoying(!!) the beauty of the landscape through which i drive rather than remembering myself to escalate the gear levels as and when i top speed. Also, by seeing another vehicle coming on the other side, the leg automatically goes to the brake and applies it.

Interesting fact is that how do one learn how hard to press the brakes? Hmm, again if we observe into what we do, we apply the brake rather slowly and gracefully when we are at a top speed and if we are at slower speed, we do apply it pretty hard when compared to the above. How does the body measure how much speed are we running on? We do not see the meters every time and apply brake. All seems to happen partially involuntarily.

Habits - Happy Bits
The actual strategy behind it all is to associate a 'feel' pattern which generates an appropriate current pattern that commands the body parts to operate in a way they are ought to be. This is also one more reason why sometimes certain things called 'habits' come into picture. "Oh sorry, I've done it habitually", an usual sentence, isn't? Getting into a habit is rather easy, but getting out is rather hard. Generally believed to be an universal advice, is rather true in most of our senses. It is easy to get into a habit that is small or locally capture-able. We mean by locally capture-able when an event (or habit) is small enough to be associated with not so large 'feel' pattern that does not require involvement of consciousness. Once got associated, depending on the likeliness or exposure to situations that would kindle such feel patterns, we have a high probability of exhibiting that habit. To overcome something of a habit is to consciously observe when we do it and try negating the registered feel patterns thus reducing the strength of impact of the same.

A literary ODE
Oh, my GOD! What all did you put in top of me? How did you ever come up with such a design? If given divinely eyes and a choice to read a book, i would choose "THE BOOK" which is suppose to have all the answers to all the "ask-able" questions. Still miles or rather lights away from the perceived reality, let the journey proceed.

The Legacy of Literate Programming

Might be an older philosophy, stumbled on it recently, the "Literate Programming". The key idea behind it is really interesting.

What is it all about?
Explain what you are programming in a humanly way or to a human rather than to a calculating maching. For example, we would've come across code with comments distributed/disturbed over the subroutines. Instead of making the comments as a part of sources, the sources are made as parts of comments. It makes the reader easier to follow up with what code is doing and all that stuff.

The Short History:
But there are still many pros/cons about this philosophy. Primary credits to Donald Knuth and Silvio Levy for their work in evolving the CWEB structured programming architecture. One striking thought as explained above has evolved the art of literate programming. Explain stuffs to the human, through a nice chain of linked chapters that explains the flow of the code.

Components:
All that is packed up with the CWEB is a couple of programs, known as ctangle and cweave. The former does the work of converting the _coded_ document into the _code_ and the later weaves the _coded_ document as a _document_ or in short to a '.tex' file. The interesting fact is that CWEB package is in itself CWEBized.

So, Pros/Cons?
There could be lot of statements made for or against the above system of programming. Just a small analysis would reveal that, at the end of our mind, what we finally do is a small discussion with ourself in the virtual spherical of our imagination. It is only a matter of "_typing_ that would distract the thought" feeling and laziness that would prevent most of us from becoming a literate programmer. Moreover, actually looking from a positive aspect of documentation and maintainability point of sources, this would be the better or rather the best way! But at the end the truth is that not all programs could be written this way. I could assure it would quite possibly take some years to convert the whole of GCC or Linux Kernel to make it compatible the CWEB way. But some apps or utilities/tools could be written this way.

Pointers/Where next?/Some more?
CWEB is easily reacheable. Googling it would reveal most connected one at Stanford. There are some more extensions done by people. Particularly a 'noweb' extension to any language by Norman Ramsey:
Future Generations
Bored of coding? (Ofcourse it would never be the case if we really wanted to code :) If so, here are some interesting extensions and analysis on how things were and how things might become. Initially it all started with some freaky machine language code of symbols, which dusted off to assembly to save the minds of yelling coders of the so called mechanical gadgets. Invention of assemblers and compilers relieved them of their burden. High level languages were highly evolved with analysis of what languages are all about and stuffs like that.

After crazy coders who prefer just 26 variables for any code, the maintainability, extensibility and all other xyz-bility were under question. To do a justice to all of the above and to increase our own ability, the coding standards and _good_ practices of software engineering were called up. Even then the place where the beasty processor rests and the place from where we command always required a bridging highway that was costlier in terms of explainability. Documents were always remote to exactly the stuff which they are suppose to _explain_ with _ _!

To remove this defect, the literate programming way has come up to create a document that is nothing but an explanation of what you speak to yourself or your toy if you might have nearby when coding! So, it calls for managing an internal reference in the mind so as to keep intact what we wanted to say and what we wanted to implement. A close observation would reveal, generally what we wanted to say is little than what needs to be implemented. We should learn to compromise between these factors before CWEBbing the code.

The above method is still ineffective when considered as a final limitation of coding. Last but not the least it is the exact replica of the logical web of patterns that gets wired/wound up in ones thought space. An optimal as well as a clean/neater way to just represent those logical patterns. People might argue, it is all a language (higher) for. May be they would come up with a VHLL, or a Very-High level language or some form of that. But nothing could replace the formless form of logical connections that happens to enumerate the problem at hand in mind. The ultimate aim of reducing the system of program would be to just draw a sketch, represent systems in an abstract way, represent interactions in an abstract way, and all that has already existing! Yes, it is more closer to UML diagrams. Represent the states of the code, how they work and things like that. We could extract reasonable documentation provided we have a grammer/theasaurus verifier that could do a reasonable construct of sentences and stuffs. We could also extract the code from the sketch representation of the above.

Obfuscated Code ----> Documented code ----> Coded Document ----> Generalized document/State charts.

The Threat: Software engineers, behold! We might be left with no jobs! But quantum is still there at our disposal and so, let us welcome our invisible yet inevitable quantum.