October 22, 2017 Sunday
Bedtime Story
Stacking
Last night I had left you with a mysterious
term called stacking, though of course the word stacking per se is not novel
only its usage in computer science is slightly different.
Even in computer science, stacking has more
than one meaning, one that is related to recursion and other that is related to
machine learning or more precisely ensemble learning.
In ensemble learning, stacking is a method
by which an algorithm can be made to learn from the predictions of several
other learning algorithms.
Currently we will not concern ourselves
with this meaning of stacking.
For us, stacking is a technique that allows
recursion to work by constantly changing or updating the input value into the
recursive function.
You can visualize the concept of stacking
by searching in your memory for a visit to a high end restaurant where they
stack the clean plates in some kind of mechanical spring device.
The pyramidal cells, the granule cells and
Schaffer collaterals of my hippocampus immediately take me to some vague
Russian stolovaya where I recall piles of hot steaming clean china plates
stacked neatly over each other.
Whether they had the requisite spring
devise I do not recall.
The clean plates are arranged in a vertical
row piled one over another.
The moment a customer takes away the top
plate for his meal, the one below pops up to become the top plate for another
diner.
Something very similar goes on in the
computer with the factorial program that is written above.
Each value of n can be considered a stack
where a new value of n is either pushed in or popped out.
I will not go too much in detail about
stacking though it is interesting to know that the concept of this idea came
from Alan Turing who used the terms “bury” and “unbury” as a means of calling
and returning from subroutines.
Let us leave the concept of stacking at
that and return to our Y combinator now that we understand a little more the
concepts of recursion and stacking.
Y combinator allows one to perform
recursion in a language that was no recursion or looping mechanism inherent in
it such as lambda calculus.
Let us review a little bit once again the essentials
of lambda calculus.
Lambda calculus is the minimum language
that can define a function.
With just variables, a way of building
functions and way of applying functions put next to each other, recursion can
be encoded into the system.
You will surely remember how we had built
up True and False functions using lambda calculus.
True = λx.λy.x
Nothing can be simpler than this.
Stay tuned to the voice of an average story storytelling
chimpanzee or login at http://panarrans.blogspot.com
Good night mon ami and my fellow cousin ape.
Advertisements
Another great educator and a teacher that I am aware of is
Professor Subhashish Chattopadhyay in Bangalore, India.
While I narrate stories, Professor Subhashish an electronic
engineer and a former professor at BARC, does and teaches real mathematics and
physics.
He started the participation of Indian students at the
International Physics Olympiad.
Do visit him here:
All his books can be downloaded for free through this link:
For edutainment and English education of your children, I
recommend this large collection of Halloween Songs for Kids:
No comments:
Post a Comment