Sunday, May 31, 2015

Getting Started with Python, R, Julia, Haskell and Emacs !!

Too ambitious ?

No, not really. Just being practical in terms of Investing in the Future and being objective about what to use each tool for. You see, I don't think that anyone ever truly "masters" a language programming or otherwise !

Rather it's a question of being Fluently Functional in the language of your choice. For me these five language mentioned above are useful and their importance is only going to increase as time progresses.

But still too confused about the languages that we are tackling at the same time ?

Oh, don't worry. Remember that we said we are going to work smarter, not only harder ! So, this is another step in that direction. Let's make an Analogy, oh wait a minute, let's first understand how and why to make analogies and approach complex systems.

You see, human brain itself lives in abstractions ! Now, think about it for a minute. Almost all of our activities are intuitive or otherwise based upon abstract information and assumptions. We thrive in it and I think it's even essential to the way we work.

Can you imagine how many factors and possibilities you ignore/overlook when you tell your friend that  "See you at 3, tomorrow" ? You know, that in all probability, this "tomorrow" might not be the way you so casually put it. No, don't get cheeky, no comet is going to hit the planet;)

But even if we overlook all the possible natural factors, we still intentionally ignore so many others. Like, what if there is a traffic jam ? Or what if you decided to help someone cross the road ? What if the electricity failed and the public transport system was brought to a standstill ? Or all your clothes need a good wash and you have been lazy for such a long time ? What if your niece and nephew came to visit on their own ?

And Countless others !!

So, It is vital to form any system that we make Abstractions and Approximations. That's just the way we are;) Now, how can you use it to approach and simplify complex systems or information.

Trust me, now you would have at least a faint idea that you have been doing it your entire life. So already are as perfect as anyone could ever be at this.

So, let's take a leaf out of this observation and apply it to our goals. You see the best way to approach such a task is to divide it into little fractions and try to make them as well defined as you need ( but not more ! ) and then put in the effort.

And another thing that we need to take care of is to relate it to what we already have experienced. You know there is a Sufi saying that "You can only learn, what you already know ", I live by it;P

Find a real world analogy ( or possible application) of the concept you are trying to understand, this is called Active learning and the other kind which involves reading a novel which, if written well, compels us to get " involved " and experience what it wishes to convey as opposed to the Passive learning when we are doing things just to kill time. See, we are very practical and engaged beings by our natural disposition, just that we know and understand what abstractions and perfect rationality would look like.

The greatest of discoveries and inspirations came from real world problems and related events. Creativity is about connecting dots which no one else even sees, until someone points out to them. And the fun part is, they were already there long time before we noticed !!

Oh no, don't worry I am not drifting) Just preparing you for what if to come and how we are to approach it.

Think of computer language like a human language, we don't ever "really know" a language just that we are "Fluently Functional" in a language. Most of us don't ever use all the words we come across while reading, say poetry , well at least not while we are out and about, trying to order lunch in a restaurant;P

First we get used to all the everyday words and only later do we acquire a specialized vocabulary which is related to the work we choose to engage in. A mechanic's vocabulary is different from a teacher's, whose vocabulary is again different from an actor's or a musician's.

So, how is all of this related to the Languages we are talking about ?

Ah, another one of your to-the-point questions. Good)

You see Python is the language upon which Sagemaths is built, Python is the foundation stone so to speak over which the large library of dedicated mathematical functions are built. Though, Python by itself is extremely vast and has it's "Standard Battery" as its library is called by the programming community. So, being comfortable with Python is a must if we are to really know Sage's structure and understand it's various organs. Analogy, Python is like the bloodline which connects various organisms of the sage system !

Don't worry I'll list the resources in the next post so, sit back and just enjoy the story for the moment)

R ( not the rated one;P ) is another language that's wildly famous in  Academic as well as the Commercial systems when it comes to statistics. Yes, it does bring to mind Brad Pitt's - Moneyball, doesn't it ?

It's integrated within the Sage system and this is the reason why sage sort of resembles Frankenstein's monster, but you know what , I'll bet on Sagemaths any day. It's "Why" is absolutely amazing and Humane, it Will only grow and it will grow only faster with time.

The R language is useful for explorations in Probability as well Statistics. I don't know about you, but when I was introduced to these subject in Mathematics, there was a lot of manual calculation ( especially in Statistics ) and all too many formulas really discouraged me to explore them on my own. I want to correct that now, the business feels so unfinished, kinda like "It ain't over, till I say it's over ";P

Then there is Julia, which a new programming language, based upon the lessons learned over the years in various aspects of Computer Science like Compiler Design, Parallel Computing, Functional Programming and just plain preference for Interpreted languages. If you don't understand any term, just Google them a bit or skim through them, you will come across them every now and then, so you are going to end up knowing them by heart. So, no pressure)

Another notable factor for Julia being the fact that it can be seamlessly used alongside Python, so if you want to call Python functions from Julia or vice versa, it's pretty easy actually.

Haskell, ah this is one of my favorites. This is a functional language and based along the lines of Lambda - Calculus ( Breath, Breath ! ). This basically means that it approaches programming through an entirely different paradigm for eg. there are no iterators and a lot more recursion. But learning something quite different from what you already know is something which add to you, broadens your horizons. Growth is essential for well being and it virtually guarantees that you would only become a better programmer and would be able to use the Functional aspect of Python and Julia as well.

BTW, the way functional languages work is much more closer to the way we use functions in Mathematics, so that's not a coincidence but a deliberate design.

Finally, Emacs. This is a text editor and I know that there are just so so many modern text editors out there, not to mention another awesome text editor Vim. For me the fact that Emacs itself can be extended using the intrinsic programming language (Elisp, from the LISP family ) is one of the main reasons why I want to use Emacs as a text editor. The learning curve is reputedly quite steep but think about it, if you climb a steep mountain how much more pleasurable it is to actually look back and notice your progress rather than just slogging it out in a long long march with a slow ascent. Doesn't sound appealing to me. And being able to really control the Text is one of the most vital pre-requisites of the programming world, we must not overlook it. 

So, in the next post I am gonna elaborate more on these languages and list important resources which we are to use.





Thursday, May 28, 2015

The Resources


This post is mostly concerned about the excellent resources that are available to us when it comes to Sagemaths. There is a decade-history behind this project and and even longer one behind the main creator of the system William Stein and I recommend that you have a look at his Blog.

The project is as much personal to him as his vision to provide people with a free and an open source option to the Big M's for Mathematics which are, namely :- Mathematica, Matlab, Maple.

Of course, to accomplish this goal would be impossible for a single person and I makes to happy to tell you that there are many brilliant ( and awesome !) collaborators from all around the world who have joined in and are truly carving out something beautiful for us.

There are Many wonderful blog posts out there which do a Great job of explaining "Why" this is necessary, so instead of just re-inventing the wheel and not doing a good job at it, I would really rather have you read these posts which truly reflect the spirit of Sagemaths. You should especially read his personal account of his experience with Computer Algebra Software (CAS), which you can find over here !!

As far as my own personal conviction and experience with Computer Aided Mathematics( CAM ) and CAS is concerned, I am a 100% for  Sage. For me the vision is big enough, it's big enough a personal challenge and the time would be well spent as it only helps the community as a whole to move forward. Sage Rock;P !!

Now, let's move on with the resources that we are to use during our Explorations !

Of course, we have to be perfectly at ease with SageMathsCloud apart from the base Sagemaths website and I hope that this initial getting-to-know period shouldn't take long. The base web-site is the one where we would be able to find all the necessary resources like the Manuals, the Binaries needed to install the software and of course the entire Source Code for Sagemaths.

Take my word for it, the Manuals are HUGE and well-laid out. But, to be frank, it's always tedious to go through manuals, especially if they explain a software system. But, no need to despair folks !!

We have freely available ebooks and Course Materials which we can use a guide. And with time, we will dwelve deeper into the Advanced Application and Usage of Sagemaths to explore and understand various aspects of Computational as well as Mathematical Domain.

First off, we really need to get comfortable using Sagemaths on the platform of our choice, be it the desktop version or the internet version which is SageMathsCloud. There are minute differences between the two which are mostly related to the various advantages that the Internet and the Machine offers us. For example, we don't really need to worry about the version of Sagemaths that we are using while we are on the SageMathsCloud and all our files are automatically backed up, not to mention that we can access our account from just about anywhere and from any modern device. The most vital thing that SageMathsCloud needs is a modern Internet Browser. So, you can operate from within your own cosy and personal web environment.

But if the internet connection is wrecked or slow for some reason then SageMathsCloud might not always be the best option to work with. This is again true if you are quite sure of the machine( computer ) that you are using and this in fact would be a better option if you are quite advanced in your knowledge of the *nix systems, most importantly Linux. The Source Code would best be analyzed and modified in this setting. To sum it up, if you are comfortable with the Shell and delight at figuring things out by getting your hands dirty and are fluent in other computer languages as well then, perhaps this is the option that you should really go in with.

Personally, I am gonna start off with the SageMathsCloud and then when I am proficient with the elementary details of how to compute various things and understand a little better how the system is really organized, I will eventually use Sagemaths on my Ubuntu-based machine in harmony with SageMathsCloud, though not as a replacement to it. I really believe  that being on the Internet has it's benefits like being able to do Real Time Collaborations, look things up in an instant and thus getting over the road-blocks pretty quickly and of course, that way I won't have to worry about losing my data to so inexplicable error or virus on my computer.

Now, there are a bunch of books and videos that I find to be extremely helpful when it comes to using Sage as a tool for doing Mathematics which lie comfortably between absolutely-don't-know-anything to oh-I-can-do-that !

A course in Linear Algebra using Sagemaths

Differential Calculus and Sagemaths

Introductory Differential Equations

Hey, I found this book which pretty much covers all the basic Mathematics and is full of good examples, not to mention that it is free to download and use as per the CC license.  So, make sure you head over to Stitz Zeager - ALGEBRA, GEOMETRY, CALCULUS.

Or if you want to explore some advanced topics and courses then have a look at the following list over at sage's Github page.

Courses taught via Sagemaths

The Math books, as I mentioned in the last post as well as pretty basic in their content and I believe that the best way forward would be to spend some time getting the basics right. You know, there is no point really thinking about N-Dimensional space or some such when we are barely acquainted with the 2-D or even 1-D space and understand the underlying approach and techniques that we use for analysis. Though, moving towards this Goal, would be have an excellent motivation value.

By basics, I mean things along the line of,

> Adding/dividing both sides
> Naming meaningful variables and organizing them in a coherent way
> Being able to plot basic graphs and their manipulation
> How to express a formula in a computer language
> Solving equations

And much more.

Oh, yeah, almost forgot these two very important resources about the Sagemath's official documentation.

Sagemaths Help Page

Comprehensive Tutorials

So, the next post onwards we are gonna move in this direction and the books that you do feel comfortable with would do just fine. Actually even if you wish to use a different book on the same topic, I don't think that it would raise any serious difficulty for our cause as the techniques to solve these are pretty much the same. Though a possible stumbling block might be that you come across a concept that we are yet to explore over here then you need to adapt a Hacker Mindset;)

Hacking is a Mindset not a Skillset 

Five Principles of Hacking

Understanding Hacker Mindset

Hacking Mindset

Wondering how it is related to us. Well, by now you should know better, we are hacking Mathematics. That's the goal ! You know, be a rebel, that lone wolf in the wilderness who refuses to give up and get things done against all odds. Yay, that's the spirit;)

Courage is One part Brave, Three parts Fool !!

And a few Ted talks to get you moving.

Ted Talk on Hacking - Lital Marom

Actually, while you are at it. Do take a look at these ones too;P

I just love Ted Talks, they always inspire me to improve every single day and we always need good motivation, so making that a part of your life might not really be such a bad idea)

You should really unleash your creativity; though a Zen patience is only going to help;)

Things are going to be definitely frustrating, unimaginable distractions would turn up every now and then but Have Faith, Be a Good Traveller and Love the Journey and Keep Your Eyes on the Goal !!

Gregory Bard - You will understand why the page looks like that way it is, the reason is just right there in the title. It does make one feel nostalgic, no ?

The goal is to be creative, not only to study mathematics but to create it as well !!

Think about it for a minute, how many brilliant "Geniuses" have been there, how many "good-at-maths" people we have met in our lives and how many still do We remember. How many amongst these people with "special" abilities leave a mark on History ?

I believe that it's about creating and exploring, merely learning something is a waste of time and as a species which is really only limited by time, we must spend it carefully. Knowledge is meant to be expanded and if we don't really aim to Add to it, then the entire endeavour isn't really worth it !!





Sunday, May 24, 2015

In The Beginning...

What is the Blog about ?

I have started this blog to speak up on topics which I feel strongly about, like

> The use of Computer Aided Mathematics in education, it is about redesigning the way we do Mathematics. 

> On the necessity of teaching programming to everyone, to show that it is nothing to be afraid of !!

> Focus upon the best open source tools which are only gaining momentum and are quite popular 
(and Free!) to express these ideas.

> We are going to learn Computers and Programming through Mathematics and within the context of solving Mathematical Problems.

Who is the blog for ?

Oh, this one's simple. Autodidacts, passionate hobbyists, die hard programmers, Mathematicians and as well for dreamer and for the ones who aren't afraid to be a child again, to learn and to feel dumb again, to be frustrated when it doesn't work out and to be almost orgasmic( for adults ! ) when it does.

To explore and to overcome challenges, that's pretty much everyone who can benefit from the blog.

Is it for advanced learners ?

No, absolutely not. I myself have no special knowledge about the software or programming in general but over the past couple of years I have explored many different computer languages, different platforms and experimented with tools like Github, Emacs, Vim, terminal shell etc.

I find the best way to learn and to practice things, it is best to do it within a context you are passionate about, so if you are passionate about Computers and Mathematics, then you have come to the right place and at the right time.

I am no advanced user, rather more like a scout who has explored the wilderness and is now returning in full force to chart the entire territory.

For me the context to learn the various yet correlated fields of knowledge and expertise like Text Editing, Mathematics, Shell Programming, Programming Languages and various associated programming paradigms along with the process of software development is the one driving goal.
The goal is sufficiently big so as to keep me moving forward. 

But why Mathematics ?

A good question !

You see, computers only evolved to assist the process of Mathematical Discovery and Reasoning.
But over the years, they have become an epicentre of so many other activities that one could hardly have imagined at the time of the conception of computers.

The hardware took off in its own, so did the software and then there is the Internet. But somehow it is yet to revolutionise the way we do Mathematics, it is yet to alter our all-too-narrow definition and understanding of what is the nature of a Mathematical Knowledge and yet to overcome our morbid excuses like "I am not good with numbers" or "Maths is just not my thing " !!

Then came Sagemaths, which is freely available due to the hard work of many developers who share a vision that the software must be free and should not be a black box rather open for everyone to see, modify, adapt and improve. With the advent of this utility most of the other specialized packages which have been developed over the years have been united within this software and have been made into a cohesive whole.

This enables us to do Mathematical Experimentation in an uninhibited way and with an unprecedented ease. Mathematics doesn't have to mean something which is only for a "gifted" few but it is just like any other skill or a muscle. You work hard, you improve.  You enjoy, what you do, you become a Genius. Period !

How would the blog be structured ?

I'll do my level best to start from the very basics be it programming, mathematics, text editing or shell programming.

And only after doing the basics shall we move on to the next phase.The narrative of the blog would be primarily driven by Mathematical Topics like Algebra, Geometry, Calculus etc and to learn every other required skill within these contexts.

But of course there are many other topics which are richer in the various flavours of programming like C language, Julia language or reading and modifying a source code.

I am going to make  number of Sagemaths projects and make them public for any and everyone to see and modify.

What do I get out of the deal ?

Oh, I get the world out of it. Ever since I was a child I was fascinated by Mathematics, I never really liked that feeling of incompetence; of course I might be slow, I might fail a few exams here and there but that doesn't mean that I don't have it in me rather, most of the time it was the context that failed to inspire my interest. I do love that Mythical Perfectly Rational world,

I believe that We are not Here to feel incompetent, We are Here to Endure, Improve and surpass Ourselves. Constantly and Ceaselessly.

And, through this blog I hope to reach out to people who can help me in the process, At this station, Help is always appreciated. Be it the way I select questions, the way that I structure the answers or the way that I approach a particular problem, help appreciated;)

Of course, there is tons that I have to learn in the journey and having fellow passengers is only going to ease the journey. Each and every thread expressed within the blog would definitely lead to an entire field of study in it's own right. 

What do you get out of the deal ?

There has been a movement going on all across the world which urges us to rethink our entire education system. I think we need to rethink how and for what purpose do we really "think". All around the world Mathematics, Physics and the application of these principles in various  forms occupy the top position in Hierarchy. Though this blog is about Mathematics and Programming (perhaps even Physics later on ! ) but I believe that we should never limit ourselves to these fields only.

For me, a musician, a dancer, a magician, a comedian, an athlete or a martial artist i.e. the entire spectrum of human creativity and expression are equally human and humane. There is hardly any hierarchy if not for the "utitily" and "money" of a form of human creativity.

The reason that I believe CAM is the way to the future is that we should be able to express our own creativity in multiple forms and not to be limited by all the mechanical and dry details of the traditional education. We should have loads of time to improve ourselves if we only learn to do things properly !! 

I hope that You get to be a Genius, yes a Genius ! We are going to redefine the term together, understand the mythical muse better.With the motto "Smart work not only hard work !!" as our starting point.

Being human means being creative;P

Is it necessary to have any background in computers or mathematics at all ?

No, I don't think so. We are going to start from the basics and build ground up upon that solid foundation.

If you know how to make an account, click and point and type fairly quick, you will do just fine. Otherwise if you need to use resources or need to discuss thing our with me, I will be happy to list out resources and put them up in the blog as links and to talk.

What are the tools that I am going to focus upon ?

The main goal is to slowly and gradually build upon our knowledge of Sagemaths and our Creativity in Mathematics, starting from the most fundamental basics of Mathematics and to move towards The Art of Proof.

That is,  gain an access and a better understanding of the Heart of Mathematics.

But Sagemaths is not only a tool for doing mathematics, it can be also be dissected and understood with purely a software development process point of view, or from a testing point of view, how to document code and how can we make it all personal. Make it all come alive with our personality in it, after all the created must resemble the creator.

We will store code on Google or other Github repositories, not that I know much about them now but with this context I am sure that we will understand how the these really work and how easy it is to collaborate with each other.

Besides Sagemaths includes so many other facilities that we can't just explore just now for example Julia is there, Haskell is there, so are R and SQL. Honestly there are many other such beautiful components, not to mention Jupyter being a central feature of Sagemaths future.

And of course, then there is the wonderful Python with it's documentation techniques and LATEX and debugging techniques for codes. This blog aims to be the principle practice laboratory.

Which books are you going to use ?

Let me put forward only a brief overview of the books and topics, there would be a much more complete list in upcoming posts. I own a few books on various basic Mathematical topics  

> Loney - Trigonometry

> Loney - Coordinate Geometry

> R.D. Sharma

The last one isn't an international book but my preference would be for freely available books, CC - licensed books and Open Source resources off the Internet. You would be surprised how easy it is to learn something in this age, there just are so many wonderful resources on the net.

Isn't it amazing that Internet has truly been on of the few things that our entire species has been fascinated by, the other one being exploration of anything and everything. Of course, this is all accomplished when we are not acting foolishly, which happens only rarely. But well, here we are;)

Do we have to stick yo the same speed as you ?

No, not really. If you think that you are already familiar with a topic then you can skip forward as per the Itinerary, go back and experiment with similar questions. Come up with new example and notable cases. I would love to discuss what works and what doesn't , especially the "Why".

What if you posted something wrong ?

By all means, talk to me !!

Tell me what you think and discuss how we can improve the content of the blog. Teach me how to use something or show me the alternatives. Send me links, comments anything.

But be a Yaysayer, not  Naysayer.

Constructive criticism is always welcome;)

Will the blog posts be long ?

Probably so !

Especially so when we are beginning but then again we have to cover a lot of ground but with time we are going to gain proficiency and focus more on problems than just the background.

The main goal should be consistently raising the bar !!