Wednesday, July 29, 2015

Not all those who wander are lost;P

So, as the title of the post suggests I am gonna give words to the Wanderlust that I have about various aspects of computing and, more importantly still, which areas are the most relevant ones to what I intend to do i.e. thinking Mathematically and solving problems.

In the previous posts I have of course, talked about various things that I am doing to improve my programming skills and to, just you know, understand what is important to me and how can I use purposefully to achieve my goals.

Now, at the fist glance text processing( via programming languages or editors) might not seem to be exactly related to Mathematics but when we dig deeper, no, rather dive deeper then we find these are all inter-related.  Take any single Mathematical problem for example, concerning any branch and we find that there are easy pre-built commands in SageMaths to do that for us. But what if we want to store our work simultaneously at a different place in, say text file and we want it to be able to have chinese characters (or any unicode characters) as well. Then we need to be able to manipulate that text file.

That is where the knowledge of Python language comes in!!

Sage, is a mathematical software and it's objective is to provide us with a complete solution to solving Mathematical problems, not so much the computer administration tasks or say doing file manipulation for us. That's the realm of text processing, for which I would much rather prefer to use easiest ways.

OR let us take another example still.

Say, we need to take in data from a particular web-site and then do statistical analysis on that data. The data-fetching part of the equation is of course related only to programming languages and the latter much more Mathematically focused part is the job for Sage. How are we to combine these two processes. Well, for one thing you can use Anaconda to come up with the solution for data-fetching and then you can save it all up in a text file and then you can use Sage to operate upon that data.

Text processing is central to my needs, I mean, just think about it, computers still aren't as adept at understanding spoken language and even less so at obtaining patters from images on their own. That requires and overwhelming ability of a Human brain. Think, a chef and a mixer and you get the idea.

But what computers are really amazing at is speed of doing things which they have evolved doing, which is textual data.

So, I have been exploring many python libraries and trying to figure out the inner workings of each one. Now I am more comfortable with many of them for example - The standard library, MatplotLib and SymPy et cetera but there are even more of them which I find to be useful.

I have used Beautiful Soup and Requests as well in order to get my feet wet in dealing with data-fetching and in the process I have improved my understanding of Web-pages and how the entire things works. Not that I am an expert by any means but I need to have Targets which combine many of my goals together in a coherent system.

When I think about it, it has always been so!! 

I never really felt like competing in programming challenges that happen all over the internet. Why?

The simple reason being, it never made sense for me to solve problems just for the hell of it or say improving my skill in a particular programming language. I had no need of programming at that time.

But I always was interested in Mathematics and Physics so when I came across SageMaths and when I felt that I am relatively free from any workload from University, I decided to dive right in. I think that it can be summarized in the following way, I never really thought that solving Cormen et al - Algorithms book would be of any practical value to me. However, when I think about solving Higher Mathematical problems then, and only then, it makes sense for me to become a better programmer.

Same is true for every other skill like LaTex or Emacs. I need to know why I am supposed to master something, I need to know the purpose of investing my time into something.

Becoming a good programmer and getting a "good job" is not really my thing. I am much more interested in using computers as Problem Solving Tools, in ways that interest me, intrigue me to no end. Having a go at Mathematical Olympiads would make sense (after a while;P ) but right now I need to be able to use the SageMaths tools well enough.

I know it's a bit dis-joint at the moment still but it's all making sense now.

I have always been this way you know, I need to see the big picture, to be able to paint every corner with all my heart and finesse. 

Why do I wish to improve Mathematics?

You ever look up at the stars any more! I do, everyday. They are the one thing that fascinates me to no end, it's like a dance of galaxies and at other times it all seems like a painting. Physics is the reason, I find immense beauty and satisfaction in the fact that this Cosmic Dance can be understood by such a tiny mind as ours. This feeling, for me, is profound. And to this end I wish to do Mathematics.

So, you see! It's a great chain which is tightly linked to every other portion of the chain.

Being able to use computers in ways which are relevant to my goals is the only reason why I would ever really invest my time in doing something.

Mathematicians of this century must be able to program and must be proficient at computers if they are to use this Magic wand to make the chores vanish. 

Saturday, July 25, 2015

Hacking Secret Cyphers !!

I have figured out how to get Emacs-Magit plugin to work on windows. It's quite easy really.

I had to go back a bit and examine my basic assumption which was that the Github's Git for windows which I downloaded was working just fine with the entire system. But it clearly wasn't as Magit wouldn't sense it. So, I installed another Git for windows client and tried to understand the functionality.

The Github's client is much more GUI oriented, though there is an option for the Git shell as well but I haven't been able to go much far with the Git shell till now as I lacked the conscience. But with the second client I was like a monkey on the control panel;P so eventually I used this one to initialize a Git repository in a folder and then I opened up the file in Emacs and tried the entire M-x magit-status thing again. This time it worked!!

Now, all that remains is to understand how to use Git via Magit 'cos it would be awesome to be able to just keep track of all the changes from within the editor.

Another thing being, you remember the Invent with Python website and a book called Hacking secret cyphers with Python. I wish to thoroughly understand the Python language 'cos from what I have explored within Anaconda and of course SageMaths itself, I think I am gonna be using Python for a long time to come. Btw, Anaconda and SageMaths have a great deal of overlap, with Sage actually being the superset of Anaconda with the added benefit of being dedicated to Pure Mathematics so investing time in both is only gonna pay off pretty quickly.

Now, as you very well know by now that Functional Programming is the most intriguing paradigm for me so obviously as a result I gravitate ever so close to Julia and Haskell, and a few others as well. But the main reason why I mention the Hacking Secret Cyphers book by Albert Sweigart ( who is awesome the way he put up such amazing books for everyone, Thanks Al;P ) is that I am planning to port all the code over to Julia language !!

I think that the best way to learn something is via somewhat "dialectic" method. No, I am not a communist;P . But just that I find it easy to remember things when I have absorbed the similarities and make a note about the differences. So, in the process I am obviously gonna be brushing up many undiscovered doubts about the very basics of Python and at the same time I get an opportunity to explore the Julia language. I don't know why but I feel in my bones that Julia is gonna be the Python of future, say about 10 years hence. It has that much of a potential !!

I am gonna use Emacs, Git and of course Anaconda towards that end and in a couple of months or so you shall have a "professional" [ I don't like professionals, really.] "Good" looking code, I hope. Fingers crossed;)

In the next post I am gonna talk about why am I diving deep into programming in such diverse ways and how it all relates to SageMaths and Mathematics as the long term goal.

Friday, July 24, 2015

The Learning Curve - PDF, LaTex files and the Source Code

So, finally I made the The Learning Curve a  good PDF form and I made sure to make various versions of the process. Took me a while)

The actual LaTex codes of the The PDF file are seperated into 3 different versions which sort of  provide a trail for the entire thing. So, without further ado head over to The link to the LaTex files of The Learning Curve - XKCD style plot.

Of course, I have to mention that there are still compilation errors and I am not yet very good at figuring out the logical structure of the document but then again, I shall only improve with time.

You are free to use the file and template in any way whatsoever. But believe you me, when I start producing good quality work I am gonna start using the Creative Common licenses to protect a few rights here and there but rest assured it's gonna be liberal. As far as this particular post is concerned, it's free so have fun.



Monday, July 20, 2015

Emacs the Magnificent;P

Man, I have never come across a piece of software which does so much. I think this is the single most amazing software I have ever come across, second only to SageMaths.

Want to surf the web through a text editor?
         
Yeah, sure. Try out EWW which uses DuckDuckGo search engine.

Want to practice the programming languages along-side your own project? 

Can be done, as easy as a child's play.

Want to take notes, Getting-Things-Done kinda way?

Org-mode.

.... And export them to HTML/PDF/LATEX too?

Yeah, in a jiffy!

Wish to make an outline of your program?

Again Org-mode takes care of it all.

Wish to change the theme/font .... anything at all?

Hell, yeah !!

Seriously, I can go on and on about Emacs and there just are so so many amazing packages and people who make Emacs tick. People, I think apart from SageMaths if you are to learn one software then let it be Emacs. You'll know the true power of programming and the extent of insanely awesome. I am totally in love with Emacs now.

I have come to believe that if you are, even in the very slightest interested in using computers as your tools rather than just "gaming machines" or say "internet surfing" machines. Emacs is the one thing that you need to master.

I found so many interesting resources all over the Internet, yes even more so. I am gonna link to their amazing sites. I highly recommend that you look into it all. I don't even care if I have mentioned their websites in the previous introductory post 'cos everytime I visit their sites I discover something awesome. Spend some time over there.

Emacs is Sexy

Github links to make Emacs all the more awesome

Sacha Chua's Website - This one deserves an award or something. You should totally check out her notes. You are bound to get inspired by the sheer creativity;P

Emacs Life

ErgoEmacs

What the Emacs.d

There are many, many (manyyy!!) awesome websites out there about Emacs but these are the ones which are the most central to my needs ( as a beginner ) now. Also, I have these two amazing books about programming which I thoroughly intend to master in the next couple of months.

How to design Computer Programs

Structure and Interpretation of Computer Programs

These books are in another dialect of LISP, namely Scheme but I think it would be easy enough to port the code to Elisp and thus improve my understanding of the Emacs system at the same time.

The reason for this apparent "detour" being that I know for a fact that I am gonna have to type a lot, to deal with text files and commands al lot in future. So, I am just investing in the Future. I know that it's all a bit chaotic and seems random but, with me, things always fall into the same place after a while. I can't describe this feeling but my hunches and instincts have always lead me right.

Friday, July 17, 2015

Hard Things and The Learning Curve !!

This is the way Hard Things with a "Steep Learning" curve turn out to be. Trust me, if you have a choice between a hard thing and an easy one, pick the hard one, without a doubt. It's the hard things which improve you beyond everything else.

I plotted this curve using the basic template provided in Matplotlib examples, ah I almost forgot, this is the XKCD style curve which I have mentioned in another post previously as well and if you are curious you can head over to XKCD website and admire the artwork as well. I find XKCD to be hilarious and I think that most of my plots are going to be in xkcd style from now on. I am sooo sick of the dry and idiotic "professional" looking curves. These are definitely more fun, a lot more fun.

Actually, this style is one of the reason why I want to understand the basic Sagemaths organs well, 'cos when these are all integrated as a whole in the form of Sagemaths system then there is a bit of overhead involved, as I use SMC at the moment, not the Desktop one so Anaconda based environment provides me with the perfect opportunity to experiment and to understand these organs well. Needless to say that, this can be done in Sagemaths as well;P

I used the following code to come up with this curve and I have tried to put comments in the program to be as informative as possible so you may go right ahead and experiment on your own. I recommend using the basic Anaconda-Spyder based system to begin with. Stay Tuned, more awesome stuff on it's way;P


Tuesday, July 14, 2015

Fun with Python

Python, the more I study and dive deeper into the world of programming and to craft my tools for further work, the more I admire Python. It's impossible to overlook the language now.

From Text Processing to Complex Websites, from Introduction to Programming courses to Multi-Threaded programs, it's everywhere. And I love it. I think, this alone guarantees why Sagemaths is gonna out-evolve every other kind of Mathematical Utility out there, though I believe that Mathematica is quite visionary as well. Then again, if it's a question between well paid programmers and peer reviewed code by idealistic hobbyists. Hobbyists always win.

I am wandering off, aren't I)

Python is one language that I truly believe is the only language, in our times, which flaunts of such a vast applicability and can boast of such a Huge number of dedicated enthusiasts. Plus, it has done wonders to make programming more approachable for everyone. From a curious child to an artist, Python is like Apple, to programming languages; it made programming "fun" and "stylish" for everyone. 

Of course, I am not overlooking Haskell, Julia, R, C++ et cetera nor am I overlooking the various down-points of Python, but I do believe that for a beginner as well as for anyone who wishes to explore the applicability of programming concepts to new fields and to make use of community developed resources. Python is indispensable for explorers of computation.

However, we are time beings. As much as I would love to understand the intricate details of how floating point numbers are dealt in terms of computer programming, that would be a luxury for me; at least at the moment. What I love doing is to have a tool, powerful enough in my hands so that even if I don't know a particular function or routine in a library, I can easily code it and more importantly read it and understand code written by other people as well. Python does it !!

At the moment, I am focusing on a few things based on Pure Python, things which I feel integrate well with my necessity as well as the niche I wish to carve out for myself. The things I am learning at the moment are,

> Text Processing

> Communicating with the OS from within the Python shell

> Internet related libraries like Requests

> And of course, the available support for various Programming routines, like Data Structures and Functional Programming support.

The "batteries" in the form of standard library and the numerous mature and battle-tested libraries developed in and for Python provide us with an immensely powerful vehicle. Python and various libraries can be thought of as a beautiful Ship, you can use to explore the wildest reaches of Computational Universe. 

Saturday, July 11, 2015

In the Sea of Manuals!

I have been doing all this work, exploring so many options to get things done, not to mention, figuring out ideas whose time have come and it has been fun to find so many interesting things floating about in the internet. It has been amazing to see so many people doing amazing things and being so overwhelmingly creative with what computers and programming can do. I love every moment of this experience.

But in retrospect, something occurred to me today. I have never reqd so many manuals before, be it on LATEX, SymPy, Matplotlib, Sage, Emacs, R or simply Julia !

Perky, isn't it?

Though the best way to understand open source is to make your way through the labyrinth of manuals. Slowly, Steadily and Surely I understand a lot more than what I initially sought. Confusing, at times, but with the overall goal in mind, Every second well spent!

Wednesday, July 8, 2015

Thing just fall into place)

Hey, I was going through that College Algebra book and I started to realise that typing in all the equations would be such a hectic task and then luckily I read the preface again.

Man, it's so great that the authors have even uploaded the base LATEX files as well. It's just like the open source software, I can alter the content and add or extract to my hearts content if I so choose to. Though, I don't see any reason for doing that 'cos the book is very well written and it starts from the very basics.

I have been able to find many books/courses related to Sage all over the internet but none covers the Basic Algebra comprehensively, I think I can fill up that gap using this book and adding all the work that I can put in.

 Stitz Zeager's book - Latex Code.

See, if you pay attention and work smart and hard, things just fall into place;P

So, in a couple of months you can pretty much expect a PDF file along with the LATEX code which brings together Sage and College Algebra. However, if you are in search of advanced topics such as Differential Equations, Calculus, Cryptography or Game Theory etc there are plenty of resources available on the internet.

Monday, July 6, 2015

Algorithms and Mathematics, are they really the same?

In short, I don't think so. It's like saying Music is all about Piano, not the other way around. Doesn't make sense right!

Matte is meant to be much more than mere mechanical drudgery, it's an art of insights which can only be experienced after a certain study of a few rigorous principles. It's a dream, a collage of axioms; it's not black and white, it's mesmerizingly colourful. Algorithms are the purpose of solving a particular problem so that every time we are to use this path we are sure to reach the destination and have the right answer in the end. 

Algorithm's, I think are something which are to be taught to computers so that we can explore new aspects of Matte and we learn to apply it to the real world in an inspired way. There is a certain magic, within the abstractness and thus the generality of Matte. I mean, the elusive (x) can be anything - from the mass of a Galaxy to the penny you forgot at the shop;P

At the very basic level, Algorithms are the reason why Computers can do what they do; and do it fast. I believe that as we progress we would only need to remember a couple of commands here and there, a few syntaxes and just experiment with all the various ideas that we come up with. On the whole we don't really need to concern ourselves with the way some problem is solved but knowing it wouldn't hurt. That's why the Open Source is such a rage.

Think of it in terms of creating music through Piano, it's good if you know how it all works on the inside but you don't really need that knowledge to create music. I believe, that we should focus upon playing music and for the most part leave the fine-tuning of the Piano, in the capable hands of the experts.

It's not really meant to be a drudgery, life is too short to be held up by mindless, repetitive tasks. We have computers for all that kind of work, What we need to do is only to be creative with problems and how to formalise it in a way that we can use a computer to solve it in an instant. The times, when we really needed to sit down and just do it. I don't think that we need to slog our way through textbooks the way we have been doing it so far, 'cos Matte has become so vast that it's impossible to even wet our feet in a reasonable time. The last couple of centuries have seen an unprecedented advances in Matte. 

I think a lot of the curriculum is still based upon the most fundamental parts, I don't have anything against it. But the thing is, as we pursue our studies in Matte we are compelled to limit ourselves as per a particular field. That makes no sense to me !! I truly believe that there are always, always multiple ways of solving a problem and if we limit ourselves to a particular line of thought or inquiry it prohibits us from exploring and perhaps getting ideas from other branches of Matte. Down with this mindless Drudgery, I say;P

Now that we have so many awesome resources on the Internet and such advanced computers we can easily focus more upon the actual thinking part of Matte. For some reason this reminds me of a quote, " Anything that we can teach a computer is science, rest is Art ", inspired by Donald E. Knuth, who is considered is the father of Algorithm analysis. So, we need to be artists rather than just calculators ourselves. 

With regard to Data Artist, I imagine beautiful images whose smallest portion has a meaning of it's own. As in, this circles represents the total GDP of some such country but rather than understanding one abstract concept based upon another abstract concept we can understand it as an image, perhaps as a cartoon character even! We are visual beings and be it good or bad, we rely very much so on our basic instincts and senses still, why not use this as well? Instead of building castles upon castles in the air and in imagination, why not have a look at it;)

P.S. I forgot to mention that I use the word Matte, which is a Swedish diminutive of the Mathematics. I don't really like using the latter, it's too loaded;)

Saturday, July 4, 2015

The Pythonic Cousins !!

I have been on to this project for about a month already and looking back, I have learned a lot in a wide range of things. For eg:-

>  Programming in general

> A certain experience in R / Julia / Haskell and a bit of Lua as well

> Made progress with Emacs, but still a long way to go before I feel comfortably say " The OS is just a boot-loader for Emacs" ;)

> LATEX

> MathJax and how to use it to put Beautiful Mathematical Text in webpages

> Have explored HMTL/CSS/JS a bit, so as to be able to customise the blog later on.

> D3.js to various other solutions for

> Came to explore the the various amazing libraries which depend upon Python

> And of course, I know the terrain of Sagemaths Cloud as well as Anaconda quite well now.

> I can solve basic equations in Sage, same is true for plotting as well. But so far, I haven't been able to dive into Mathematics per se.

And now, the two most important question that I need to address are : -

* How to use the three principle components as in Sage-desktop, Sagemaths Cloud and Anaconda?

* When to use a particular tool?


The way I understand it, Sage is like the super-organism whose components are not only limited to python-dependent libraries and sub-systems but also various other languages and other technologies as well. Sagemaths essentially combines the power of cloud computing and Grand Vision of the open source community. It offers LATEX, Terminal and a comfortable environment for a dozen programming languages, not to mention the facilities like completely automated source code management, classroom course management as well.

The problem, for me, is that I need to be able to do my work in the most platform independent and powerful way possible as well as which acts as a back up plan for me, in case I am not able to connect to the internet. Eventually, I think I am gonna move over to the Sagemaths-desktop system based on Ubuntu but that would involve becoming a lot more comfortable with the Linux environment as well, so that's another ball to juggle=)

But the most sensible solution that seems to promise a good and useful learning experience would be to begin with the various parts first and then move up the complexity level. Also, eventually we would be able to pick up the manual of any Python library and use it to our purpose. And believe me, reading manuals is boring but if we have an interesting enough a context, it can be done.

So, I think SymPy is quite useful, from the point of view of Polynomial manipulation and, frankly, I am still not so clear about how to use Rings and Fields. Though these are used in SymPy as well, I think overall the complexity of SymPy is a good deal less than Sagemaths. After SymPy, I am gonna explore NumPy, Matplotlib and Bokeh as well.

Another reason why I think SymPy is better for me, at the moment, is that it aims to be a complete solution to Mathematics in it's own rights, so with this little sub-set of Sage I can finally get started with basic High School Mathematics and even if later on I get stuck at some point using Sage, I would always have a backup to rely upon to get me through anyway, till I find a Sage solution.

Of course, I believe that Sage is definitely strong enough to perform these functions on it's own but I feel that getting myself used to the most basic libraries is only going to make me understand Sage better. However, as far as Sage is concerned, my next project is about the learning how to plot complex functions in Sage.

For these Python oriented parts, we can hone our skills on Anaconda which combines a large number of mature Python Libraries and is quickly becoming a de facto development environment for people who use Python to build applications and who work exclusively with a fixed set of libraries. Anaconda depends on a package manager called Conda, think of it as a huge zip file maker; the only difference being it combines and updates various libraries on a real time basis. And it is platform independent, so once you learn to use it, the learning curve pretty much flattens out after a while.

Is it all getting too technical, as in a techie jargon or something;) 

Yeah, it does seem like that, no? But don't worry 'cos once I figure things out I will definitely make some PPTs and PDFs walkthroughs upload them over here  so that you don't have to go through all the confusion as well. Remember, the Hacker Culture(!) post, "We must Avoid reinventing the wheel over and over again" !!

Thursday, July 2, 2015

Disclaimer And Licensing !!

As I realise that there is gonna be a lot of "new" code and stuff, I think it is important for me to be able to focus on things which hold value for me. And at the moment, my priority is to improve myself and to combine all of my interests in a coherent whole, my niche and an environment which is more like what a studio is for an artist. Just that, nothing more. I am not looking to make money off of this blog or something, just to use the blog a way of reaching out and using the peer pressure to keep myself going. Not to mention, that having such a wonderful progress log is wonderful when I look back and helps me realise that, no matter how frustrating it might be at some moment, I have come a long way and this perspective keeps me moving forward and towards my goals.

I focus so much more on the content, which to be honest is quite amateurish at the moment and has tons of rough edges but overtime, I know in my bones, it's gonna grow into something wonderful; all the more wonderful. Of course, it's a long long journey and I would like to focus my energies which matter to me the most, which is, to constantly improve at using the tools to solve Mathematical and Physical problems; to explore constantly.

I don't seek to "earn" through the blog, nor do I care much about the traffic as such. The best thing that I believe can happen via this blog is that I wish to inspire people to look at Programming, Mathematics and Physics as just another skill set; something they can play with, something they can be really really creative in. Rather than something that is often reserved for "Geniuses" or "Intelligent" people.

So, to be able to convey things in the most meaningful, though with a few rough edges, is by putting up great content in the blog. And often I just look something up on Google and use the first few images, codes, articles it shows up and I pay less attention to the "Credit" section of the resource. I would like to clarify that I would probably often include a proper link/citation to the original resource but, knowing myself, I would forget a few here and there. So, just to be clear, You can absolutely all the code, all the resources which I link/upload at all times and I claim nothing in return.

As the content is gonna improve in quality and becomes all the more mature and useful, I would look in to Creative Commons licensing for the content. So, at best you would only need to include the my name as an attribute to be able to use the content any way you like, as far as the CC license permits.

For all the other authors, whose work I refer to; I am merely pointing in their direction and building upon their work. It is only because of their open-mindedness, hard-work and generosity that I am able to do what I need to do. So hats off to these wonderful people.

I believe, Internet is the greatest resource we have ever built; our Greatest Invention and it should always be free. And it is only because of these people that we are only limited by our imagination. The world is all the more Humane.

All the content on this blog would always be free and that's how I have acquired a huge part of my knowledge and this is how I wish to contribute positively to our collective knowledge as well.

Wednesday, July 1, 2015

The LATEX rendering of an article by Barry Barett on E = mc2

So, after trying to grapple with the LATEX code, I have produced an amateurish rendering of an Article by Barry Barett  and though the result is less than satisfactory, I have learned loads on how to render text as per the LATEX code and formatting, how to use Sagetex  and embed the output from within the system into a TEX file and ofc, how to share a file on the blog as well; A good learning experience, for sure.

With this wonderful experience under my belt, I would definitely improve the quality of the PDF's that I will upload in the future;P

Below is the PDF version of the article which I wanted to convert into a LATEX file.

Link to the PDF version of the article


This is the result of all the effort that I put in, quite amateurish but a good start, I believe. I skipped a lot of stuff and focused on the most basic elements of the articles, which made sense to me at the time. So, here it is the partial rendering.


And this is the LATEX code which produced the file
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
\documentclass[12pt, letterpaper]{article}
\usepackage[utf8]{inputenc}
%%\DeclareMathSizes{12}{30}{16}{12}
\usepackage{amsmath} % for the "align" and "align*" environments



\title{The Most Famous Equation in Physics}
\author{Abhinav Sharma \thanks{ Thanks to sharelatex.com}}

\date{February 2014}

\begin{document}

\begin{titlepage}
\maketitle
\end{titlepage}



\textbf{\textit{PART A:  Does the inertia of a body depend upon its energy content?}}



Students of physics know the answer to the question Einstein asked in the title of his celebrated paper, "Does the inertia of an object body depend upon its energy content?" because in it Einstein derived the equation $E=mc^2$ . The inertia (or mass) of an object at rest is equal to $\frac{E}{c^2}$, where E is the energy content of the object. A remarkable fact about this paper and many of his other early papers is their relative simplicity. I believe I can briefly state the few mathematical and physical assumptions used in the paper. These are conservation of energy, the principle of relativity, the formulas for the kinetic energy of a particle and the relativistic energy of light and the binomial theorem. Given these assumptions, and a cleverly devised thought experiment to apply them to,  can be derived as though it were a simple undergraduate word problem. 



\textbf{\textit{PART B: The Toolkit: Physical and Mathematical Assumptions}}


\textbf{Physical Assumptions:}

1. \textit{Conservation of Energy}: Energy is neither created or destroyed. The total energy in an isolated system remains constant. In Einstein's thought experiment, the system consists of all the volume enclosing a box.

$$ E_{initial} = E_{final}$$
  

A classic example of conservation of energy. the pendulum
The bob of a pendulum has kinetic $ \frac{1}{2} m v^2$  and potential energy $ m g h$ ,where $m$ is the mass of the bob, $v$ is its velocity, $h$ is its height and $g$ is a number that is determined by the strength of gravity. According to conservation of energy



$$ \frac{1}{2} m v^2 + m g h = constt$$

   

As the bob ascends and its velocity decreases, h increases to keep the equation constant. When the height is maximum, the velocity is zero and when the height is zero, the velocity is maximized. As the bob swings back and forth, kinetic and potential energy vary, but the total energy of the system remains constant.

2. \textit{The relativistic equation for the energy of light}

The energy   of a light ray in a frame moving with a constant velocity v can be determined from its energy  in a stationary frame from 
 
 
{\Large {$$l^{'} = {l} \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } \right)$$}}

 
[assuming the moving frame is parallel to the x-axis of the stationary frame and   is the angle of the light ray from the x-axis]
 
If the light ray is moving parallel with the x-axis and in the same direction as the moving reference frame then $\phi = 0$  and $cos(0)=1$ and therefore

{\Large {$$l^{'} = {l} \left(\frac{  1 -  \frac{v}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } \right)$$}}
 
If the light ray were moving in the opposite direction, then (because $\cos (2*pi)= -1\)$ the negative sign (_) before the $ \frac{v}{c}$ term is replaced by a positive sign(+). Einstein used this fact to simplify the mathematics of his derivation.

3. \textit{relativity: the freedom to choose different reference frames }

The principle of Special Relativity states that if a physical principle or equation holds in a stationary frame, it must also hold in a frame moving relative to it at constant velocity. We can evaluate a process from either reference frame. In the derivation of $E=m c^2$ below, the energy of a simple system is calculated in different frames of reference moving at constant velocity $v$ relative to one another and, in accordance with the principle of relativity, it is assumed that the principle of conservation of energy holds equally in both frames of reference. 

4. \textit{kinetic energy} As mentioned above, the kinetic energy of a particle with mass $m$, is

$$ \frac{1}{2} m v^2$$

Mathematical Assumptions:

1. Elementary Algebra 

The Binomial Series:



$$ {\left( 1 + x\right)}^\alpha =  \sum_{k = 0}^{+\infty}  \binom{\alpha}{k} x^k$$

$$ & = 1 + \alpha x + \frac{\alpha(\alpha - 1)}{2!} x^2 + \cdots $$



 


2. Calculus (optional)
The Taylor Series:

$$  f(x) = f(0) + x f^{'}(0) + \cdots $$  
    
These assumptions (and keen physical intuition)  are all you need to derive $E=mc^2$. So, before I guide you through Einstein's derivation, try and derive it yourself. If I was a high school physics teacher I'd like to assign this word problem as extra credit. 





The mass-energy equivalence is described by the famous equation
 
$$E=mc^2$$
 
discovered in 1905 by Albert Einstein. 
In natural units ($c$ = 1), the formula expresses the identity
 
$$ E = m c^2 $$





\textit{\textbf{PART D: The Derivation. Solving the Word Problem }}


The initial total energy of the box, relative to the stationary system (x,y,z), in Einstein's thought experiment is $E_0$  . This is the energy of the system, in the stationary frame, prior to the emission of the light rays.

The initial total energy of the box, relative to the moving frame (t,u,v), is $H_0$  . This is the energy of the box, relative to the moving frame, prior to the emission of the light rays.  

If $E_1$ is the energy of the box, relative to the stationary frame, after the emission of the light rays and the total energy of both light rays is $L$ then, by conservation of energy

$$ E_0 = E_1 + \frac{L}{2} + \frac{L}{2} $$ 

If $H_1$ is the energy of the box, relative to the moving frame, after the emission of the light rays and the energy of the light rays in the moving frame is given by                           


{\Large {$$l^{'} = {l} \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } \right)$$}}
   

then, by conservation of energy and the relativistic equation for the energy of light

$$ H_0 = H_1 +  \frac{l}{2} \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } \right) +  \frac{l}{2} \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } \right)$$
 
and therefore
$$ H_0 = H_1 +  {l} \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } \right)  $$

 

Einstein then calculates that

$$ H_0 - E_0 - \( H_1 - E_1 \) = {l} \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } - 1\right)  $$
 

The first and second H-E terms on the left are measures of the change in energy of the box at the same instant in time due only to the relative motion of the two frames of reference. The first H-E term is the initial change in energy of the box due to relative motion of the two frames and the second term H-E term is the change in energy of the box after the emission of the light ray, but again, only due to the relative motion of the two frames. 

Because the H-E terms measure the change in energy of the box due to the relative motion of the two frames only, the additive constant C representing any other energy left over (such as the internal molecular energies of the box etc) is constant

$$ H_0 - E_0 = K_0 + C $$ 
$$ H_1 - E_1 = K_1 + C $$
and therefore C cancels out leaving only the change in kinetic energy as

 
$$ K_0 - K_1  = {l} \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } - 1\right)  $$
 

This can be approximated by the Binomial or Taylor Series "neglecting magnitudes of fourth order or higher." Applying the Binomial Theorem approximation above, 

$$ \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } \right) = 1 + \frac{1}{2} \frac{v^2}{c^2} $$ 
 

therefore
 $$ K_0 - K_1 =  \frac{1}{2} \frac{v^2}{c^2} $$
 
By comparing this to the expression for Kinetic energy   one can infer that the change in mass of the box due to the emission of light is equal to L/c^2. Recall that L is the total energy of the light rays emitted from the box, therefore $E=m c^2$. 

An Important Proviso: By using the binomial approximation in  this derivation, it was assumed that v < < c. If v were close to c, then this approximation would be invalid. This is why mc^2 is the rest energy of an object. The slower the box in the derivation is moving, the more accurate the approximation becomes. If an object is moving close to the speed of light, then the E=mc^2 approximation must be replaced by E^2 = (mc^2)^2 + (pc)^2 where p  is momentum.    

From this equation it directly follows that:—If a body gives off the energy L in the form of radiation, its mass diminishes by L/c². The fact that the energy withdrawn from the body becomes energy of radiation evidently makes no difference, so that we are led to the more general conclusion that the mass of a body is a measure of its energy-content; if the energy changes by L, the mass changes in the same sense by L/9 × 1020, the energy being measured in ergs, and the mass in grammes.                                                                    
 





\begin{align}
$$ cos\left( \phi\right)$$

$$ 1 -  \frac{v cos\left( \phi\right)}{c} $$

$$ \sqrt{\left( 1 - \frac{v^2}{c^2} \right)}$$

\end{align}




$$l^{'} = {l} \frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } $$



{\Large {$$l^{'} = {l} \left(\frac{  1 -  \frac{v cos\left( \phi\right)}{c}}{\sqrt{\left( 1 - \frac{v^2}{c^2} \right)} } \right)$$}}



%%\begin{align*} % the "starred" equation environments produce no %%equation numbers
%%a &= b\\  % if no alignment is needed, use the gather* instead of %%the align* env.
%%  &= c
%%\end{align*}



%%$$ \sum_{n=-\infty}^{+\infty} f(x) $$



$$ \cdots = sin(\phi) $$


\end{document}