Author Topic: Programming as Mathematics  (Read 18872 times)

0 Members and 1 Guest are viewing this topic.

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Programming as Mathematics
« on: October 18, 2015, 07:55:38 pm »
Let me just say that I am not always enthusiastic about learning.  I still lean strongly in the direction of nihilistic defeatism.  It is just that, since I am no longer drowning myself in alcoholic oblivion, for the moment, "particular kinds of programming and mathematics" (as well as particular kinds of philosophy of a defeatist, pessimistic, and nihilistic nature) seem to stimulate this angst-filled brain that protrudes as an appendage of this egg-devouring stomach which is my true inner being, the Will.

It is probable that, because of the career-oriented mentality of industrial society, I am often left wondering what the point is in my "intellectual"  interests.  In other words, when one is not employed or never has been employed as a "programmer", one does not identify oneself as such.

So, while reading Stepanov's Elements of Programming (a hard copy) away from any electronic devices, focusing on only a few pages of a time, I try to slow down so as to appreciate the beauty of the classic mathematical notation.  It really does present programming as a mathematical discipline.  The mathematical notation he uses is elegant.  The book is dense.  It's not a book of tips and tricks.  I have stopped collecting hard copies of books, but for this I made an exception.  I treat it as a holy book, if there can be such a thing.  Maybe "canonical text" is a more appropriate term.

Looking for guidance on how to approach this text, and really wondering what motivates my continued interest in this craft, I found a talk given by Stepanov.  While he may be addressing future and current "employees", this does not prevent me (and others out there like me) from being a little bit inspired.  If we are stimulated by what we are tinkering with, why should we feel we are "goofing off" just because we are not working in a corporate or academic setting?

I think of my great love for Schopenhauer and testify how one who stood totally outside the halls of academia has made the greatest impression on me.

Maybe I am writing this now as a note to myself, for when I question my motives for tinkering around with the ideas I tinker around with.

I will place a link to the talk here.

Stepanov says that his book presents practical programming as a mathematical discipline.  Programming is an intellectually stimulating activity.  I sympathize with the youth who may feel drawn to it but are put off by the confusion ... I cannot imagine how agonizing it must be for someone to have to feign interest in some business oriented web-development project as an "employee" when he would be content thinking about number theory.

Ah, I know I must sound like a confused and rebellious teenager.  One would think, by the time one reaches my age, one would have surrendered to the economic forces that fuel the industries (gaming, sports, music, entertainment, advertising).  Forever outside of all this, it is my destiny to make my way through this life as a stranger in a strange land, as a free spirit who has no profession, no title ... which amounts to having no identity in our world.


Stepanov claims that programming is an ancient activity, that it was not invented by Bill Gates or Steve Jobs ... that it is a thousand year old activity and the name of it is MATHEMATICS.  With mathematical notation, Stepanov goes over a dense set of algorithms that date back thousands of years to ancient Egyptian scribes.  They were doing PROGRAMMING.  I'm not talking about creating video games, but mathematical computation, of course.

Now I know why I am drawn to this man's book.  He says that programming and mathematics are literally the same discipline.   So, my interests are not tied to finding a "position" in the world, or to putting bread and eggs into my stomach ... it is just a very stimulating activity that interests me, and it would interest me even without the electronic/digital machinery, although I must admit, I do appreciate the complexity of how these ones and zeros (on/off switches) are transformed into meaningful representations for us.

Stepanov says, "Mathematics is a science of numbers and shapes."

This is a controversial statement, since we are told mathematics is a science of formal theories ... He does not believe this.  He says Mathematics is about numbers.  I like where he is going with this.  For too long we have been told that Computer Science itself is a branch of Mathematics, but "programming" is lowly grunt work that does not require any appreciation for mathematical concepts.   This is not the case.  Arithmetic and basic operations are mathematical by definition.  In other words, when one hears "Computer Science" one thinks of higher mathematics, but when one hears "programming" one thinks of trouble-shooting device drivers and creating applications for operating systems.

Anyway, they can throw us off the grass, lock up the libraries, charge money for internet access, and turn universities into business schools and vocational training centres, but they have no locks they can place on our minds.  They cannot send us a bill for enjoying our own imaginations.

I am very much interested in this Alexander Stepanov character.  Even though he may be employed by a corporation, he belongs to humanity ... I mean, he is a citizen of the world, so to speak.
Stepanov

alternate link: stepanov
« Last Edit: October 30, 2015, 11:10:41 am by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Share on Bluesky Share on Facebook


Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Re: Programming as Mathematics
« Reply #1 on: October 18, 2015, 11:48:53 pm »
To supplement my reading of Elements of Programming, which, as I mentioned, is quite dense, consisting of mainly mathematical notation - which was why I purchased the hard copy, something I have not allowed myself to do in quite some time, I was very close to ordering From Mathematics To Programming released in 2015.  I still may, but I found the draft of the book called "Three Algorithmic Journeys" at "stepanovpapers" ...

I think you may find this one interesting, Holden.  These ideas are not original, but ancient.

I can always take notes like a monk into the sketchbook I call "Math Diary / Computational Sketchbook".

Maybe Stepanov's book projects will help me make sense of what I am interested in ... these ideas are ancient, and I think he may be able to help me make some connections ... I can't let my outsider status rob me of this mathematical inheritance.

I guess I had thought that since all my studying never got me any "gainful employment" that I would transform into some crack-pot madman were I to continue in this manner, as if it were perfectly acceptable to spend one's entire life getting nowhere fast.  I may have even gone on a ten year binge.  Now that the fog is clearing, I realize that employment and a passion for deeper understanding are hardly even related. 

As even Stepanov said in the talk I linked to above, "In our society, deeper understanding is not appreciated."

Yes, if what one is studying is not going to lead to financial security, then many people consider it a waste of effort.  Maybe instead of "The Cave Is Empty" I should call this message board, "For Madmen Only".

If you click on the above link (this one is worth saving to a hardrive or flashdrive, filed under mathroots or something), notice on page 17 or so where Stepanov is going over some "intuitive proofs" such as the ones for (a + b)^2 = a^2 + 2ab + b^2 and pi > 3.

I wonder if this is related to what you were inquiring about, as far as the relevance of Schopenhauer's call for a revision of Euclid's proofs.  He must have been referring to Elements.

Schopenhauer's criticism is that Euclid mixes the genuinely geometrical with the spurious logical proof.

Something that is spurious seems to be genuine, but is false.

At least he took notice of Euclid.  Do our so-called "world leaders" bother to read Euclid?

I wonder how one would go about revising Euclid's Elements.  Would you just cut out the spurious logical proofs and leave the genuinely geometrical which appeals to our intuition?  Leave that kind of task to someone else.  It's certainly not MY calling.

What about if someone is born blind?   They must still possess some kind of representation of three-dimensional space. 

Another thing Stepanov mentions on page 11 of Three Algorithmic Journeys (the 2013 draft of From Mathematics to Generic Programming c. 2015) is that mathematical proofs are essentially a social activity.   
« Last Edit: October 30, 2015, 11:28:24 am by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Re: Programming as Mathematics
« Reply #2 on: October 24, 2015, 02:04:30 pm »
I have to admit, going through From Mathematics to Generic Programming is much more enjoyable than Elements of Programming.  Maybe it will be just what I needed to motivate me to forge ahead. 

One really has to detach and isolate in order to focus.  I don't have to justify the time I spend studying.

Now, when I experimented with pair-bonding, back in the 1990's, my "studies" became very problematic.  She resented my interests in math, programming, and even philosophy - unless I was helping her write a paper for English class ... or helping her friend with math.

That's all in the  past now.  I am free to study Stepanov if I choose.  I am left alone in peace. 

It is a blessing to be so useless.
« Last Edit: October 24, 2015, 04:25:05 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
"Programming as a Mathematical Discipline"
« Reply #4 on: November 18, 2015, 12:40:43 am »
“What do you think of Java?”:

Quote from: Alexander Stepanov
I spent several months programming in Java. Contrary to its authors prediction, it did not grow on me. I did not find any new insights – for the first time in my life programming in a new language did not bring me new insights. It keeps all the stuff that I never use in C++ – inheritance, virtuals – OO gook – and removes the stuff that I find useful. It might be successful – after all, MS DOS was – and it might be a profitable thing for all your readers to learn Java, but it has no intellectual value whatsoever. Look at their implementation of hash tables. Look at the sorting routines that come with their “cool” sorting applet. Try to use AWT. The best way to judge a language is to look at the code written by its proponents. “Radix enim omnium malorum est cupiditas” – and Java is clearly an example of a money oriented programming (MOP). As the chief proponent of Java at SGI told me: “Alex, you have to go where the money is.” But I do not particularly want to go where the money is – it usually does not smell nice there."
   8)

What a sense of humor Stepanov has!  MOP: Money-Oriented Programming.  Ha 

When I finished at the university in 2002, already "a 35-year old," I went on a handful of job interviews, travelling even into Manhattan to Bloomberg - what a nightmare!  After working in a park for 10 years, how could I bring myself to take a bus into the city and wear clothes that made me feel awkward and servile?  It was during this job-hunting process after doing well academically that I became severely depressed, and by 2003 or so I was experiencing severe anxiety, hostility, and eventual chronic depression.  Forget about that for now, it surely did not smell nice where the money was.  The city stinks, the buses stink, the interviews stink.

So now, well over 10 years later ... just by not handing "security deposit" over to yet another slum lord, giving up rental assistance, and purchasing a refurbished computer from Tiger Direct after deciding to join forces with my ageing mother, I quickly became interested in things I had been interested in before and while going to university.   It must have been a combination of exploring Number Theory and Abstract Algebra which led me to the accidental discovery of Sage ... which got me very interested in Python ... with NumPy and then SymPy ... .  I've been in the process of reconstituting.

How did I stumble upon Stepanov?   

There were a series of textbook writers who I was studying when I was enthusiastic about Python (which was written in C/C++ I believe), including Hans Petter Langtangen and, of course, William Stein and others.  I did an exhaustive search on related material.  Then I even **** open an "ancient" copy of Knuth's FUNDAMENTAL ALGORITHMS from 1973, a book I had managed to hold onto throughout the chaotic journey from 1998 to the present.  Everywhere I turned I saw Euclid's Greatest Common Divisor algorithm ... Modular Arithmetic and the Chinese Remainder Theorem. 

I have to trace through my notes to find out what succession of events brought my conscious mind to this state of attentiveness, to see just when I became determined to return to exploring C/C++ with a beginner's mind.  C++ has transformed somewhat during my 11 year cycle of self-destructive anguish.  By the end of September I was starting to do some of the exercises in Knuth's Fundamental Algorithms ... the simpler ones ... and I was only interested in Mathematical Preliminaries.  I was repulsed at the thought of putting any effort into learning MIX, Knuth's imaginary (theoretical assembly language). 

Stepanov is first mentioned in my notes on October 7th.  All my "tinkering" with number theory, abstract algebra, and the algorithms behind the kind of Python code I was studying seemed to lead directly to Stepanov.  I became curious about generic programming, and, after so many years of no interest whatsoever, I suddenly felt compelled to pursue some kind of understanding of it.  Prior to this sudden "spark," I did not really want to know certain things ... I sensed it could be overwhelming.  I started off by acquiring a copy of Elements of Programming (Stepanov/McJones).  When it arrived, I felt like I had a holy text of some obscure math cult.

I had been learning about Python for only a couple of months, and I was amazed with the mathematical nature of some of the "scientific packages" ... Now I realize that those couple months of undisturbed leisure was a great experience : valuing the efficiency of IDLE debugger after experimenting with alternative IDEs.   I noticed how similar the interface of Sage was to the interface of IPython, IPython Notebook, SymPy, NumPy, z3Py, and even gap.  In a very spontaneous manner I was exploring the components of Sage.

And then another spark:  I found (freely available on the Internet, of course) the gdb-dashboard, a front-end for the GNU debugger ... it was then I started "tinkering" with C++ again.  I was hesitant.  I decided to invest in some hard copy books, to make some kind of commitment to focusing on "programming as a mathematical discipline". 

Now I am at an age that I don't care about the politics of the question, "Is Computer Science a branch of Mathematics?"    I accept that what I studied in the university was "computer science" and not "programming."   Learning to write a minimal amount of code was part of some of the courses, but all along this has been somewhat separate.   Since reading Stepanov, I can clearly state, I want to relearn how to program, not so much as "computer science" but as a mathematical discipline.  I want to study the abstract level of C++ STL, while at the same time, doing something I would have done years ago if not for the sense of the pointlessness of it.  I also want to study some Assembly Language.   I want some kind of harmony between the higher and lower levels of computing.

Both levels are difficult in different ways.  This must be what I wish to explore for my remaining years or days left as an embodied mind:  Learning about Generic Programming with C++ STL, along with Assembly Language and, yes, a certain branch of mathematics.  When I am studying one of these areas of knowledge, I am enhancing my understanding of the other areas.   And why not?   Would society (or the representative of the corporate state) prefer I took up arms to attack the enemies of the state and consumerist society?   I'm just trying to understand things that have been on my mind for a long time.  Fortunately I am well past the age of being turned into an obedient soldier who does the bidding of something as abstract as "the State".

Social revolution?   Maybe just by pursuing deeper understanding and not caring about "where the money is" IS my own little social revolution.  These interests - mathematics and programming - while there may be plenty of in-fighting between the money-oriented programmers and the deeper-understanding-oriented programmers, are international.  While one might be viewed as a "loser" in one's own consumerist society, one may still be a part of this international intellectual community simply by being receptive of their ideas!

Before the end of October I had also gotten my paws on From Mathematics to Generic Programming, "the other" Stepanov book (with Rose), as well as Euclid's Elements.  I confess that I only use it as a reference.  As for FMGP, I read it once through and will have to read it several more times.  I have yet to get through Elements of Programming.  It is quite terse.  I will chew on small parts very slowly.  By November 10th I realized I would want a tutorial/reference to supplement my explorations, hence,  the Josuttis text ...

Do you see what is going on here? 

I had used the Internet as a resource when tinkering with math and python, and then I gradually became willing and ready for some kind of personal commitment.   I want to catch this wave of interest and enthusiasm while it lasts.  For a long time I was not interested in anything ... except, well, nihilistic and defeatist philosophy, like Benatar's Better Never To Have Been Born.

So, the question I have to ask is, would Stepanov find it worthwhile to study Assembly Language along with C++ STL and generic programming?  I mean, like looking at the assembly code of little programs using the C++ STL ...

Quote from: Stepanov
It is good for a programmer to understand the architecture of modern processors, it is important to understand how the cache hierarchy affects the performance, and it is imperative to know that virtual memory does not really help: if your working set does not fit into your physical memory you are in big trouble. It is very sad that many young programmers never had a chance to program in assembly language. I would make it a requirement for any undergraduate who majors in computer science. But even experienced programmers need the periodic refresher in computer architectures. Every decade or so the hardware changes enough to make most of our intuition about the underlying hardware totally obsolete. Data structures that used to works so well on PDP-20 might be totally inappropriate on a modern processor with a multi-layer caches.  Starting at the bottom, even at the level of individual instructions, is important.

It is, however, equally important not to stay at the bottom but always to proceed upwards through a process of abstraction. I believe that every interesting piece of code is a good starting point for abstraction. Every so-called “hack,” if it is a useful hack, could serve as a base for an interesting abstraction.  It is equally important for programmers to know.

And so ... there is a tempting book called Introduction to 64 Bit Assembly Programming for Linux and OS X: Third Edition by Ray Seyfarth.

What is tempting about this book is that the author has created ebe to help his students learn ... It's an Integrated Development Environment.

Quote from: Ray Seyfarth
Why the name ebe?

Ebe is an integrated development designed to support Assembly Language.  After teaching assembly language one semester where the students and I depended on using gdb for debugging, I wanted a better solution.  I tried ddd and a few IDEs, but they all suffered from the fact that yasm doesn't provide data type information to gdb.  I started trying to write a debugger in python and decided dbe was a nice name for a debugger.  Since dbe had a source code window which supported nearly all that was needed in an editor, it became apparent that dbe was almost a development environment.  So I decided to expand it to be an IDE and I had to pick a name for a development environment.  The name ebe was too hard resist since it already means extraterrestrial biological entity.  But just to satisfy my sense of fairness, I can claim that is stands for easy beginner environment.  This also explains the alien icon.

So ... along with C++ For Mathematics, it appears that I have revolted against my plan to restrict myself to reading pdf and epub files on the computer.  Realizing that there were some books that I really wanted to focus on ... and now, seeing that I will be carrying my studies into a "day jail" dystopian "treatment center", I justify this investment as a strategy for not only keeping my spirit from being broken by systematic stupidity, but to actually bring excitement into this intellectual adventure.

Rather than trying to focus on one book at a time, I figured it is best to let chaos and confusion gel together, destroying the dichotomy between "low-level" (assembly) and "high-level" STL/generic, and in the process maybe blurring the demarcation between mathematics and programming ... between freedom and the illusion of freedom ... between money-motivated learning and understanding-motivated learning.

Now I can try to sleep so as to be prepared for the morning.  I just wanted to clarify a couple things to myself so that I could acknowledge that this learning project with these books is fairly significant to me.  Regardless of what society pushes, such as "any job is better than no job" or "money talks, bull**** walks" ... I feel I am making some personal breakthroughs.   It is as though I want to study as much as possible before my life falls into severe chaos. 

What do I call this Learning Project I am investing time and funds into?

"Programming as a Mathematical Discipline"
« Last Edit: November 18, 2015, 07:47:59 am by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Holden

  • { ∅, { ∅ } }
  • Posts: 5416
  • Hentrichian Philosophical Pessimist
Re: Programming as Mathematics
« Reply #5 on: November 18, 2015, 02:20:38 pm »
Nice.All these links which you are leaving here,and the files,maybe someday I'd make use of them all.
Speaking of mathematics,during the intensive rocket bombing of London in World War II, it was generally believed that the bombing could not be random because a map of the hits revealed conspicuous gaps. Some suspected that German spies were located in the unharmed areas.
A careful statistical analysis revealed that the distribution of hits was typical of a random process—and typical as well in evoking a strong impression that it was not random. To the untrained eye,randomness appears as regularity or tendency to cluster...


La Tristesse Durera Toujours                                  (The Sadness Lasts Forever ...)
-van Gogh.

There is but one truly serious philosophical problem and that is suicide.-Camus

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Parser for Elements of Programming
« Reply #6 on: November 18, 2015, 04:30:54 pm »
Randomness had a certain pattern to it?   Hmmm ...

As for the links, even though I keep detailed notes of what I am doing, I agree that this trail just might be worth following for someone.  Maybe leisurely intellectual and technical pursuits end up being what we are genuinely most interested in.

I am having trouble forming a sentence.  How does one measure understanding? 


Related to ELEMENTS OF PROGRAMMING

<<<1>>> Implementing a Parser for Elements of Programming

<<<2>>>  Axioms: Semantics Aspects of C++ Concepts

My mind is spread out all over the place.  Even though I am into several texts simultaneously, it all feels very interconnected for me.  After a first time through From Mathematics to Generic Programming, before starting over at the beginning of Elements of Programming, I decided to read Appendix B first.   It introduced Extended Backus-Naur Form.  When I did a quick search for "EBNF and Elements of Programming", I found the above paper which references the second paper.   On the second page of the first paper, "The grammar and semantics sketch for the subset of C++ used in Elements of Programming is described in less than 10 pages ... [p.233 - 241] ..." 

This turns out to be Appendix B, the very place where I started.

I also took a book from the shelf that I have held onto since 2002.  It's another one of thosespecial textbooks I would not part with, even when I was homeless in the streets of Seattle in 2009.  My nephew had allowed me to store a suitcase of books and notes in his apartment.  One of the books I carried 3000 miles West and back was Compilers: Principles, Techniques, and Tools.   I had purchased it my last year at the university even though I was not enrolled in the course.  I ran out of time.  I graduated.  I never got to compilers.  There was so much I wanted to study.  Maybe I was disappointed and disillusioned by the reality of scratching the surface.

Well, sure enough, early in the Compiler text, the second chapter, Aho/Sethi/Ullman go over Backus-Naur Form.   I started reading that text from the beginning ... I am comprehending it, but then I reach a point that I feel like a chimpanzee and it becomes too much for me.  Pass me the bananas, please. 

I am reading several texts at this time, but with each one I am moving slowly, and the concepts are related, even overlapping. 

Shall I try to describe how I feel? I am encouraged when I am able to follow what is being presented.

Note: There is a parser for Elements of Programming other than the one referenced to in the above paper:  exp_parser.hpp written by Sean Parent

I have not tested it out yet since I am continuously looking for other sources just to help me follow along the terse mathematical language in Elements of Programming.

sample of the text

madman mode ...
« Last Edit: November 19, 2015, 10:12:56 am by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Holden

  • { ∅, { ∅ } }
  • Posts: 5416
  • Hentrichian Philosophical Pessimist
Re: Programming as Mathematics
« Reply #7 on: November 19, 2015, 01:59:36 pm »
What I primarily try do is this-I take a small math concept,and I try to study it again & again & again,and suddenly I find new and unexpected understanding developing in my mind-superspecialization,could that be the key to stave off this sickness of the soul which tries to take over me all the time?
I want to be someone who knows more and more about less and less until he knows absolutely everything about NOTHING..

Maybe what I will do is, I will just hide in a room (with a door with at least 7 locks to keep the gorts out) & study Buchberger's algorithm till I'm dead and all.Now,that I will call a life well spent.
https://youtu.be/GmlSSSN7C78
« Last Edit: November 19, 2015, 02:05:40 pm by Holden »
La Tristesse Durera Toujours                                  (The Sadness Lasts Forever ...)
-van Gogh.

There is but one truly serious philosophical problem and that is suicide.-Camus

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Re: Programming as Mathematics
« Reply #8 on: November 19, 2015, 05:07:53 pm »
"I take a small math concept, and I try to study it again & again & again,and suddenly I find new and unexpected understanding developing in my mind."

The difficult thing is transcending the tyranny of public opinion which does not value the activity of deepening one's understanding.   

What do you think of the mantra, "Any job is better than no job at all" ?

It is said that Kafka's Metamorphosis was anti-work.  Locking oneself away in a room to study solely to deepen one's understanding is mocked by the gorts.  One is told, "You have to start somewhere."

It's as though they would respect one more if one were cooking french fries for McDonald's than if one were trying to learn Assembly Language.

This is what I mean when I refer to life in consumer society as a dystopian nightmare, when one is running a debugger on a computer and being accused of sitting on one's a-s-s doing nothing.

Deepening one's understanding is not valued by the gorts.  Why is this?

Rather than defend our position, it may be best to realize there will never be peace with the gort hive for one who values understanding over production, servility, obedience, and conformity.

We lose, but the game is truly flawed.

It reminds me of what Nietzsche said about the philosopher being mocked and dressed in rags.

I think that our gripe with the gort's work ethic hits on something very deep that goes to the heart of the question, "How shall we live?"

I think I am also studying to stave off this sickness of the soul.  And we can die at any moment.  The reason I mention this is because I am hostile to the goal-oriented mantras of job-obsessed societies.   My goal?   Unexpected leaps in understanding.  That is enough of a goal for me.

"The only thing the young should be taught is that there is virtually nothing to be hoped for in life. One dreams of a Catalogue of Disapointments which would include all the disillusionments reserved for each and every one of us, to be posted in the schools." ~ Emile Cioran

"… a satire on conformity begins to make itself felt. The ill are the deserters, the refuseniks. They won’t accept the “co-operative” conventions. They blurt things out. They turn sympathizers away. They won’t go to work. They lie down. They waste time. They fantasize. They don’t go to Church or believe in Heaven. They refuse to read responsibly or make sense of what they read. They are attracted to nonsense, sensation, and rashness. On the other side of the glass is “the army of the upright,” harnessing energy, driving motor cars, going to work and to church, communicating and civilizing.   Reading in bed – like writing in bed – is, it’s suggested, a form of deviancy."  ~ Virginia Woolf

I'm just trying to stay out of trouble ... Who knows what fate has in store for any of us?

I don't even know why I am interested in what I'm studying.  The world really is a swamp of misery, and computer technology does not change that fact.  I don't worship technology or even the math behind it.   I just happen to be somewhat interested in it.

Our biggest tragedy is having been born.   There have been times in my life when I just wanted oblivion.  These technical and mathematical books seem to keep my mind interested.  I can't be surprised when I wake up without enthusiasm.  After all, I'm a non-cooperative refusenik.

I am not going to pretend that deepening my understanding will give me some kind of security.

Nothing leads anywhere.

Still, if I read Elements of Programming over and over again, eventually, I may understand a little bit more each time around, especially if I supplement it with less terse texts.   I do not claim that this is a great life.  It is what it is.  I am not fooled into envying anyone else either.

Just knowing the nature of being alive prevents me from imagining it would be better to be someone else.  I don't envy anyone.  What about those who write the textbooks I read?  I admire their knowledge.  I appreciate their attempt to communicate their knowledge.  I can respect someone without envying them.

I don't know why I bother studying what I do.  All I know is that not much interests me in this life, and while I do not experience anything like ecstasy (it can be very boring), there are those moments you speak about, those little breakthroughs in understanding.  For me, this will have to be enough.  I don't expect it to lead anywhere.  I don't have to be enthusiastic about anything.

There is some intellectual stimulation in it, but it is not something I go around discussing with strangers.  In the "outpatient treatment" day jail, one of the other "mental health consumers" asked me what I was reading.  I said - hesitantly, not really wanting to open a can of worms by saying generic programming, " ... math and programming".

He replied with a shrug, "Oh ... I can do that" without even looking at the book.  It was Stepanov's From Mathematics to Generic Programming.  I did not even respond.  It's like I always say, it's because I explore knowledge that I am keenly aware of how little I know.  I don't even know what another person's understanding of what they consider to be "programming".

I live a very mentally isolated existence.  Serious pursuits are almost always lonely.

There was something about the way Schopenhauer wrote and thought that made me commit myself to acquiring his work and studying it religiously.  It had a great effect on me, and most likely influenced my way of thinking. 

Now, I can't compare the two thinkers at all, and I am not trying to make a comparison.  It's just that certain things Stepanov has said I have never heard said before.  There is something about his way of thinking that appeals to me, and - since I have nothing better to do, and since not much at all interests me in this world, I guess I owe it to myself to devote some time to this.  Elements of Program is difficult, not just for me --- even Stepanov and McJones admit it is difficult reading ... terse and even boring.   

It's not like reading a novel.  I will be patient ... and, as you say, I am free to go over it again and again and again until something clicks.  These conversations we have are helpful.  Many people might discourage me accusing me of wasting time studying something that may be clearly over my head.  What else would they have me do?

« Last Edit: November 20, 2015, 09:20:27 am by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Re: Programming as Mathematics
« Reply #9 on: November 28, 2015, 12:14:56 pm »
To be clear about how much delight is possible in just rolling up one's sleeves and reiterating an old algorithm in a C++, I will leave this short note (about what I am up to this morning) here.   I am not working on any ground breaking discoveries here.  I am doing simple things that not only bring me clarity, but also make further study more delightful since the process involved in making code produce intelligent results tends to reinforce my comprehension of the mathematical ideas I am implementing.  In turn, implementing the mathematical algorithms tends to force me to further explore the programming language I am expressing the algorithms in (coding in).

For example, consider the problem 35 * x = 8 (mod 12).

Whereas the procedure (function) congruence() I was using in Python just shoots back a result, such as congruence(35, 8, 12) would return 4, when lifting this to C++ I want more explicit and intellectually stimulating results.  I first make sure the primary results match, and then I add clarification.

In C++ after compilation,
./congruence 35 8 12
besides displaying every step of the process to solve this, does not just return "x = 4", but displays as the bottom line, "The solution to 35 * x = 8 (modulo 12) is x = 4 (modulo 12)"

This is for my own aesthetic pleasure, and it can be quite "spiritual" since I am not writing the code for a professor or an audience of any peers whatsoever.  This is simply for my own delight.

Now, to expound a little on the ramifications of such "tweaks":

To get my congruence procedure to return x and the modulo to the main program that calls it, I have to change the return data type from "long integer" to a pair of long integers, and this gently compels me to spontaneously use the C++ Standard Library container "pair".

These are very small and simple events, but for me, this is a delightful way to learn and explore, since the mathematics and the programming are mutually reinforcing in these calm and very natural learning experiences.

It only becomes frustrating if I expect anyone else to care or to become enthusiastic about what it is that is occupying my thoughts.

I am in no way going to give a detailed description of what I am doing right now as I promised a short note just to clarify the nature of my very humble activities.  My Chinese Remainder Theorem Solver procedures are defined in "xcrt.h".  That's where the workhorse, EEA (the extended Eudlidean algorithm) does the work [the pencil and paper work].

#include "xcrt.h"
#include <iostream>
#include <cstdlib>

// Procedure for solving congruence of the form a * x = p modulo n

std::pair<long, long> congruence(long a, long p, long n)  {

   long g = gcd(a, n) ;
        std::pair<long, long> tmp = EEA(a, n);

    if ((p % g) > 0) return std::pair<long, long>(NULL, NULL);

     if ((tmp.first * p/g) % (n/g) < 0) {
      return std::pair<long, long>( n/g + ( (tmp.first * p/g) % (n/g) ), n/g);
   }
   else return std::pair<long, long>( (tmp.first * p/g) % (n/g), n/g);

}


int main(int argc, char *argv[])
{
        long a = atol(argv[1]);
   long p = atol(argv[2]);
   long n = atol(argv[3]);

   auto x = congruence(a, p, n);
   if (x.first == NULL) cout << "There doesn't appear to be a solution." << endl;
   else
   {
     cout << endl << "The solution to " << a << " * x = " << p << " (modulo " << n << ") is: ";
     cout << "x = " << x.first << " (modulo " << x.second << ")" << endl;
     cout << endl << endl;
   }
   return 0;
}
___________________________________________________________________________

In the meantime, I sit on the floor just going through exercises with pencil and paper.  I know you understand how such an activity can be most enjoyable, and this is why I declare that we are in an entirely different orbit from those who are hypnotized by the corporate celebrity culture mindfuc-king-machine (hollywood, music industry, city hall, military complex, thera-peutic state ... etc).

I have to pull myself from this browser so as to return my attention to the consoles.   I think I have crossed some kind of threshold where I am content just to do what I do, keeping notes just for my own sake, and that's enough for me.

The idea, which is my pattern of behavior, is to verify my code works with simple cases so that I can rely on it to assist me with more difficult cases.  That's when the inserted print-outs at the various points of the operation pay off.  Again, this just feels more satisfying than using the tools already bulit into Sage.  Don't get me wrong.  I appreciate Sage.  It is often what motivates me to want to make my own little "calculators" from scratch.

I am not serving in any industrial or academic capacity so I am at liberty to goof off.  This is just me goofing off.   :P
« Last Edit: November 28, 2015, 12:26:39 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Re: Programming as Mathematics
« Reply #10 on: November 28, 2015, 04:23:54 pm »
Sometimes even I don't initially understand the method to my madness.  While working through exercises in A Book of Abstract Algebra, I am checking my work with the Chinese Remainder Theorem Solver I spent all day Thursday working on. 

One might wonder why I would put such frantic energy into this.  Now, as I calmly work through the exercises, I able able to verify if my answers are correct, and if not, quickly see where my pencil error was.  I then apply the eraser and document the hand-written procedures in case I ever want to review these exercises.

You see, some textbooks only include only a few solutions to exercises in the back of the book. 

This must be the method to my madness and why, when I am debugging code in the creation process, all the printed statements can remain in a "tutorial version" as the code helps me see the step by step procedure no matter what the input values are.

This is, I humbly submit, simply very cool.   :)
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Holden

  • { ∅, { ∅ } }
  • Posts: 5416
  • Hentrichian Philosophical Pessimist
Show me all the blueprints(The Way of the Future?)
« Reply #11 on: November 28, 2015, 04:46:48 pm »
This is how I handle mathematical problems. There is literally no mathematical problem in the universe which can withstand this onslaught.Or to use your mother tongue-blitzkrieg.

https://youtu.be/-rOornOc-rw

https://youtu.be/kzSlRO57itI
« Last Edit: November 28, 2015, 04:51:08 pm by Holden »
La Tristesse Durera Toujours                                  (The Sadness Lasts Forever ...)
-van Gogh.

There is but one truly serious philosophical problem and that is suicide.-Camus

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
While trying to get myself in the mood to read a few pages from the Josuttis C++ STL book in preparation for the release of the Gottschling "Discovering Modern C++" book, I found a very honest essay called "Don’t Believe Anyone Who Tells You Learning To Code Is Easy" by Kate Ray.

I found it helpful, especially the statement, The anxiety of feeling lost and stupid is not something you learn to conquer, but something you learn to live with.

Quote
Most programming doesn’t require a special brain, but it’s more frustrating and messier than anyone lets on. There are thousands of enthusiastic blog posts, classes and apps that aim to entice you with the promise of a slick, unequivocal procedure for learning to code. They rarely mention the tedium of getting your environment set up (which, trust me, even the nicest of your programmer friends don’t want to help you with, because that stuff is mad frustrating and nobody remembers how they did it).

They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google and knowing which code is best to copy-paste. And they don’t let you in on a big secret: that there is no mastery, there is no final level.

She has zeroed in on the paradox we all face when we are in a constant state of LEARNING:

What I forgot is that the most common state for a programmer is a sense of inadequacy. As a programmer, there is a limitless amount of stuff to learn. You can become a specialist in one language or framework, but if your job is to build things efficiently, you will constantly need to be learning new tools and constantly feel out of your depth. It helps to be mentally prepared for feeling stupid.

I did not care for many of the comments, and I am interested in entirely different things than the author, but I very much agree that one has to be mentally prepared for the anxiety that goes with constantly being out of your depth.  I try not to drown in it.

I think I can apply this attitude to other areas of daily existence.  For instance, just reading the kinds of books I am drawn to, I have get used to the fact that my temperament is mildly depressed, which is why I am drawn to the material in the first place, because the authors I am reading validate my feelings and do not offer a cure, but, rather, fully appreciate how one could be a bit depressed. 

Another part of my temperament, paradoxically, is kind of cheerful, but only because I have learned not to give a damn. 

I don't think I could maintain even a little bit of cheerfulness if I were younger and was still deluded about "getting somewhere" with my studies.  I have reached a stage where I can study something just because I am interested.  I am not goal-oriented.  I guess I'm just not wired that way.

The bottom line is that anxiety and despair is the default.  For me, I have no delusions about curing myself of the anxiety and despair, but just not to be paralyzed by it. 

Also, there are times when I lose interest in all technical information and sink into a deeply philosophical mood which can only be called depression ... but I refuse to medicalize this mood!   I do not call it depression.  I call it a philosophical mood.  When I am interested in the exploring and discovering the details of programming in a particular language and environment, I do not call it mania.  It's just tinkering.
« Last Edit: December 26, 2015, 11:24:47 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Mad Dog Mike

  • { }
  • { ∅, { ∅ } }
  • Posts: 5088
  • Life teaches us not to want it.
    • What Now?
Programming as TINKERING
« Reply #13 on: December 27, 2015, 10:34:36 am »
I am no expert, but neither am I a phony liar.   So, all I know is that sometimes I am in "codemode" ... Is there a pattern?  I mean, is there something I do specifically to get into code-mode, that state of mind where I am able to transcend the anxiety, doubts, fears, and sense of pointlessness?

I find I am most in code-mode (and interested) when I have some program loaded into a debugger, and I inspect the variables, data structures, and algorithms ...

There is a certain amount of "not giving a damn" that actually nurtures personal resilience in the face of social rejection and vocational failure.   Learning is an extremely private, subjective, and personal experience. 

I think this is why I latched on to Holden's description of what it is I do when I am in codemode:  tinkering.

The concept of tinkering sounds almost like fun, something one is doing as a leisurely activity.
« Last Edit: December 27, 2015, 10:36:38 am by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Holden

  • { ∅, { ∅ } }
  • Posts: 5416
  • Hentrichian Philosophical Pessimist
Re: Programming as Mathematics
« Reply #14 on: December 27, 2015, 01:13:40 pm »
I am travelling.When I travel I find it very hard to concentrate.I have been thinking of the movie Pi.
I mean of Max Cohen the story's protagonist and unreliable narrator. Unemployed, and living in a dreary Chinatown apartment in New York City, Max is a number theorist who believes that everything in nature can be understood through numbers and of Sol Robeson, Max's old mathematics mentor who is an invalid.
                              .....

Sol and Max sit on either side of a half-played Go board.

            SOL
      Listen to me. The Ancient
      Japanese considered the Go
      board to be a microcosm of
      the universe. Although when
      it is empty it appears to be
      simple and ordered, in fact,
      the possibilities of game play
      are endless. They say that no
      two Go games have ever been
      alike. Just like snowflakes.
      So, the Go board actually
      represents an extremely complex
      and chaotic universe. That is
      the truth of our world, Max.
      It can't be easily summed up
      with math. There is no simple
      pattern.
   
            MAX
      But as a Go game
      progresses, the possibilities
      become smaller and smaller.
      The board does take on order.
      Soon, all moves are
      predictable.

            SOL
      So?
   
            MAX
      So, maybe, even though we're not
      sophisticated enough to be aware
      of it, there is an underlying
      order...a pattern, beneath every
      Go game. Maybe that pattern is
      like the pattern in the market,
      in the Torah. The two sixteen
      number.

            SOL
      That is insanity, Max.
   
            MAX
      Or maybe it's genius. I
      have to get that number.

            SOL
      Hold on, you have to slow
      down. You're losing it, you
      have to take a breath. Listen
      to yourself. You're connecting
      a computer bug I had, a
      computer bug you might have
      had, and some religious
      hogwash. If you want to find
      the number two sixteen in the
      world, you'll be able to pull
      it out of anywhere. Two
      hundred and sixteen steps
      from your street comer to
      your front door. Two hundred
      and sixteen seconds you spend
      riding on the elevator. When
      your mind becomes obsessed
      with anything, it will filter
      everything else out and find
      examples of that thing
      everywhere. Three hundred and
      twenty, four hundred and
      fifty, twenty-three.
      Whatever! You've chosen two
      sixteen and you'll find it
      everywhere in nature. But
      Max, as soon as you discard
      scientific rigor, you are no
      longer a mathematician. You
      become a numerologist. What
      you need to do is take a
      break from your research. You
      need it. You deserve it
      Here's a hundred dollars, I
      want you to take it. If ,you
      won't take it, borrow it.
      Either way, take a break.
      Spend it however you like as
      long as it falls in the
      category of vacation. Real
      world stuff, okay. No math.

   Max looks at his bands.

            SOL
      Just try it. In a week
      you'll laugh about this.
      C'mon, Max. Think about it!
   
   Max gives a half nod.
                                       .....

Do you think that essentially Sol is a bit like Schopenhauer in that he knows that ultimately human effort is fruitless and that Max is Nietzschean?
I will continue to travel till 2nd Jan.
La Tristesse Durera Toujours                                  (The Sadness Lasts Forever ...)
-van Gogh.

There is but one truly serious philosophical problem and that is suicide.-Camus