{∅, {∅}, {∅, {∅}}} : Rage Against the Meat Grinder

General Category => Why Mathematics? => Topic started by: Nation of One on October 18, 2015, 07:55:38 pm

Title: Programming as Mathematics
Post by: Nation of One 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 (https://www.youtube.com/watch?v=Ih9gpJga4Vc)

alternate link: stepanov (http://www.ask.com/youtube?q=how+to+read+stepanov%27s+elements+of+programming&v=Ih9gpJga4Vc&qsrc=472)
Title: Re: Programming as Mathematics
Post by: Nation of One 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 (http://www.stepanovpapers.com/Journeys/Journeys-0.3.pdf)" 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 (http://whybother.freeboards.org/math-diary/mathematical-problem/msg1208/#msg1208) for a revision of Euclid's proofs (http://aleph0.clarku.edu/~djoyce/java/elements/toc.html).  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.   
Title: Re: Programming as Mathematics
Post by: Nation of One 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.
Title: Re: Programming as Mathematics
Post by: Nation of One on November 10, 2015, 01:37:04 am
"Canonical Texts"

Elements of Programming (http://www.elementsofprogramming.com/)

From Mathematics to Generic Programming (http://www.fm2gp.com/)
Title: "Programming as a Mathematical Discipline"
Post by: Nation of One 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 (http://www.cppstdlib.com/code/) ...

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 (http://rayseyfarth.com/asm/) by Ray Seyfarth.

What is tempting about this book is that the author has created ebe (http://qtebe.sourceforge.net/) 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"
Title: Re: Programming as Mathematics
Post by: Holden 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...


Title: Parser for Elements of Programming
Post by: Nation of One 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 (https://parasol.tamu.edu/people/villoria/parser-report.pdf)

<<<2>>>  Axioms: Semantics Aspects of C++ Concepts (http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2887.pdf)

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 (https://github.com/stlab/eop-parser/blob/master/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 (http://ptgmedia.pearsoncmg.com/images/9780321635372/samplepages/032163537X.pdf)

madman mode ...
Title: Re: Programming as Mathematics
Post by: Holden 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
Title: Re: Programming as Mathematics
Post by: Nation of One 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?

(http://i.imgur.com/etuhc8z.jpg)
Title: Re: Programming as Mathematics
Post by: Nation of One 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
Title: Re: Programming as Mathematics
Post by: Nation of One 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.   :)
Title: Show me all the blueprints(The Way of the Future?)
Post by: Holden 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
Title: Anxiety as an Inevitable Consequence of Explorative Learning
Post by: Nation of One on December 26, 2015, 09:12:40 pm
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++ (http://www.amazon.com/Discovering-Modern-Scientists-Programmers--Depth/dp/0134383583/ref=sr_1_1?ie=UTF8&qid=1451181640&sr=8-1&keywords=gottschling+discovering+modern+c%2B%2B)" book, I found a very honest essay called "Don’t Believe Anyone Who Tells You Learning To Code Is Easy (http://techcrunch.com/2014/05/24/dont-believe-anyone-who-tells-you-learning-to-code-is-easy/#.s6edadl:MlQM)" 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.
Title: Programming as TINKERING
Post by: Nation of One 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.
Title: Re: Programming as Mathematics
Post by: Holden 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.
Title: Re: Programming AND Mathematics: HyperNotes!
Post by: Nation of One on March 14, 2016, 10:03:38 pm
Runge Kutta in C++ (http://www.letsthinkabout.us/post/runge-kutta-in-cpp)

This code approximates e to 2.71828 which is close to the value which is close to the value of

e = 2.7182818284590452353602874713527

Interesting ...

This is why I find it so much more relaxing studying at my leisure, since, rather than racing through problems, I can go on a tangent in the midst of one little exercise.

Quote from: amiruddin
Can you solve this equation ?Given the first order differential equations below which is derived from series RLC circuit. Write a program to solve it using Runge-Kutta 4th order method. The output should be in graphical form, i.e. plot of i and q versus t.

Quote from: Bernard Hsu
Hi amiruddin,

you should be able to solve this using the first order differential equation derived from RLC circuit, which was likely covered in your class and lecture. put that equation into

static double dt_dt(double x, double y) { /* your equation here */ }

The output will only give the answer it converges on. If you want graphical output, you can write a method to write to a .csv file and graph from a spreadsheet program.

Cheers!

The output will be numerical and fed into the iteration process.

Anyway, there is a little typo in their code.  I wonder if it is even worth troubling them over.

I fixed it in the attached text file.  Just save as rk4.cpp and complie.

The little error is when they define halfdx = 0.5 * x;

It should be halfdx = 0.5 * dx;

It was a nasty little typo. I kept getting wrong results when I changed the code to handle a different differential.  So I stepped through it with gdb and I noticed halfdx kept coming up as zero when it should have been half of what dx was.

Also, when comparing the results to results I got by hand and with other programs and spreadsheets, the results were different.  I even checked definitions of Runge-Kutta method in textbooks to verify there is a slight error in their algorithm. I made the following three changes:

double rk4(double x, double y, double dx, double(*f)(double, double)) {
   double halfdx = 0.5 * dx;
   double k1 = dx * f(x, y);
   double k2 = dx * f(x + halfdx, y + k1/2.0);// changed from y + k1 * halfdx
   double k3 = dx * f(x + halfdx, y + k2/2.0); // changed from y + k2 * halfdx
   double k4 = dx * f(x + dx, y + k3); // changed from  y + k3 * dx
   return (y + sixth * (k1 + 2 * k2 + 2 * k3 + k4));
}


I also made the code interactive by changing main():

int main(int argc, const char * argv[]) {
  double x, y, dx, target;
 
  std::cout << "\nEnter initial value of dependent variable x: ";
  std::cin >> x;
  std::cout << "Enter inintial value of [dependent] function y: ";
  std::cin >> y;
  std::cout << "Enter the step size dx: ";
  std::cin >> dx;
  std::cout << "Enter the target value y(x): ";
  std::cin >> target;

  Equation eq(x, y, dx, target);
   eq.Run();
   return 0;
}
Other than that, this code is cool since it approximates differentials that might not be solvable by quantitative methods.  What's more, it is short and elegant.  The Runge-Kutta method is surprisingly accurate, even with with ridiculously large step-size.  I appreciate code that does a little task ... as I do not want to become too distracted with libraries such as boost.numeric.odeint (http://www.boost.org/doc/libs/1_56_0/libs/numeric/odeint/doc/html/index.html) ... although, if I live long enough, I would love to learn to use it.  First, I want to concentrate on understanding the mathematical concepts ... so I appreciate Python modules like SymPy as well as Sage which is built upon so much ...

Still, it is more than a little humbling to see that there is certainly no need to reinvent any wheels.  It will take a lifetime to explore, but this gives me even more motivation to continue to devote my energies to mathematical explorations ... god willin' and the crick don't rise ...  :-\

HyperNotes (sleepy time):

Computational Physics Programs C/C++ (http://ww2.odu.edu/~agodunov/book/programs.html)

Polymatheia (http://sherrytowers.com/2014/10/15/a-c-class-for-numerically-solving-odes/)

Runge-Kutta 4th Order ODE Solver (https://people.sc.fsu.edu/~jburkardt/cpp_src/rk4/rk4.html)

Shampine and Gordon ODE Solver (https://people.sc.fsu.edu/~jburkardt/cpp_src/ode/ode.html)

odeint in boost? (http://www.codeproject.com/Articles/43607/Solving-ordinary-differential-equations-in-C)

Holy Fuuck, coders are busy bees out there ... It blows my mind.

Solving ODEs in C++ (http://headmyshoulder.github.io/odeint-v2/index.html)

Peter Gottschling: Odient and MTL4 (https://meetingcpp.com/tl_files/mcpp/slides/12/odeint.pdf)

https://www.youtube.com/watch?v=K3KpSFMw0Oo
Title: math code and the will to know ...
Post by: Nation of One on March 15, 2016, 10:35:02 am
Looking through the boost libraries, you may sympathize with why I just like to make my own simple rudimentary code that does what I need it to do so I don't have to deal with the learning curve of compiling code that depends on huge libraries.

Now, I prefer to focus on the mathematics and keep my "mathematical code" as simple as possible.

For the Runge-Kutta method, I found that it was more efficient as far as time and learning curve to use LibreOffice (https://www.libreoffice.org/download/libreoffice-fresh/) Calc (spreadsheet) using a similar method as A Spreadsheet Solution Using the Fourth-Order Runge-Kutta Method (http://epublications.bond.edu.au/cgi/viewcontent.cgi?article=1130&context=ejsie)

setting cell A1 as step size, h, I can easily just change that as I wrote each formula using $A$1

For other formulas, using syntax such as $C4 would update the row number (4) but leave column (C) constant.

I could analyse the data in a grid.

Now, I am not saying I am not at all interested in the ODE libraries for C++.  I just have to use self-restraint when it comes to my "Will to Know".

To get sidetracked into troubleshooting compile errors just to use odeint or mtl (boost) libraries would only frustrate me.  I want to stay focused on the textbooks working through problem sets, trying out the projects, and basically using CAS, graphing calculator, spreadsheets, tables, and even some home grown rudimentary C++ code ON THE FLY ---- spontaneously in a calm manner.

This is, after all, the benefit of not having to be subjected to some professor's or supervisor's arbitrary agenda!

I think it is ok to learn by reading other people's code ...

Methods (http://uap.unnes.ac.id/jurnal/Ordinary%20and%20Partial%20Differential%20Equation%20Routines%20in%20C,%20C%2B%2B,%20Fortran,%20Java,%20Maple,%20and%20MATLAB.pdf)

Title: Re: math code ---> euler and runge-kutta
Post by: Nation of One on March 16, 2016, 12:00:28 am
I find it very satisfying to understand just enough about code and math to be able to find source code and alter it to suit my needs.  For instance, when in the start of a problem set in one of the DE texts, the authors suggest one use a computer algebra system, or, alternatively writing a program for solving initial value problems, I am thankful that I at least have the confidence to tweak the code ...

If someone's code is written for working with input and output files, I like to alter it to interact with me at the console.  Also, I don't mind redefining the differential equation for each case right in the source code and recompile it each time.  I just comment out all the equations in case I need one again.  Oh, and lest I pull the kind of thing Sickmind Fraud pulled (not acknowledging Schopenhauer's influence on his theories), I better mention that euler3.cpp was more than a little inspired by code written  Alex Godunov (http://ww2.odu.edu/~agodunov/#). Last revision - March 2007. I found it here (http://ww2.odu.edu/~agodunov/book/programs.html), (Computational Physics Programs C/C++)


Also, at compile time, sometimes it is just something as simple as adding a flag such as -static or -std=c++11 to get it to run ...

When I wake up in the morning, I will be glad I tinkered on some code BEFORE diving into the exercises with pencil and paper.  Often, I like to transcribe the working source code into a notebook in pencil since the code itself basically explains the algorithms.   For years I have always liked to make code look as much like the mathematics as possible, calling functions simply f(x, t) or what have you.

Rather than have 3 separate programs to help me check some problems in a numerical methods section, this code (euler3.cpp) gives a menu:

 Solver for first order Ordinary Differential Equations
 
 x'(t) = f1(x,t)   equation
 x(ti) = xi        initial condition
 
 Methods (select one by a key)
 key = 0; simple Euler
 key = 1; modified Euler (predictor-corrector)
 key = 2; 4-th order Runge-Kutta

to compile with gnu gcc:

g++ -g euler3.cpp -o e3 -static

then, to run: ./e3

I like to slow down long enough to compare results with the "spreadsheet versions."

Actually, I find writing simple C++ code, even if spending a little extra time formatting the output so it's easier to read, ends up being more fun than using the spreadsheet method.  With the code, you just have to define the differential equation and recompile, whereas with a spreadsheet, you have to change the cell for y', and then copy and fill down - rather tedious. 

So, in the version I am using, I formatted the output for the console, even placing an increment counter n on both sides of the values of "independent variable" t and "dependent function" x.

I swear, 20 years ago, when I began studying programming in earnest and returning to college to start over with Calculus and Physics, this really is what I envisioned ... growing older by the day and being able to tinker around with computer programs that helped me analyze* mathematical problems.  This is all I ever wanted, so, even though I may appear to be the classic "loser" who has lived an uneventful life, at least, along the way, I have been able to take just enough interest in what the "eggheads" have been up to so as to ... well .. how else to phrase this? ... to be mentally stimulated.

I could not have asked for more from or for myself.  I think I may actually be content.   :-\

* analyze vs. analyse?

You will notice I use the "American English" as opposed to the "British English".  I'm always doubting myself when the editor puts those squiggly red lines under such words.  I kept thinking I forgot how to spell humor or endeavor when it is just the absence of the British u.

I beg forgiveness of the creators of the freeboards free forum software for my lack of manners.  I'm not confused, just stubborn.   I don't take orders from software.  ;)

One of these days, Holden, you might catch this math-code fever ... then you will surely not want to report to a boss ... since you will become a mathematical madman.   :D
Title: Introversion- Mathematics-Schopenhauer
Post by: Holden on March 16, 2016, 01:52:38 pm
I think you like math primarily because you are sick of "people".And so am I.So was Schopenhauer.I literally talk to no one during my off-duty time ,except with you,because I am extremely introverted.With Cioran, I say:
As far as I am concerned, I resign from humanity. I no longer want to be, nor can still be, a man. What should I do? Work for a social and political system, make a girl miserable? Hunt for weaknesses in philosophical systems, fight for moral and esthetic ideals? It’s all too little. I renounce my humanity even though I may find myself alone. But am I not already alone in this world from which I no longer expect anything?

I just wanna do a bit of math & then kick the bucket.That's all.And I think you are also very introverted.That's perhaps your greatest quality.
That's it, I think.Why should I live in history, huh? I don’t want to know anything anymore. Except mathematics.You are right, again.
https://youtu.be/K_M8Pck0xIk
Title: do math then kick bucket
Post by: Nation of One on March 17, 2016, 10:06:16 am
Quote from: Holden
I just wanna do a bit of math & then kick the bucket.That's all.

Perfect. 

Out of nowhere, you have spontaneously suggested a possible solution to my Inquiry into How to Get Through a Life Not Worth Living (https://xhentric.wordpress.com/the-book/eight/).

This also puts to rest the question as to whether hypothetical eternal life would even be something desirable.   ::)

While I am trying to fall asleep, there are parts of the mind that do not "shut down." 

Quote from: Cioran
I no longer want to be, nor can still be, a man. What should I do? Work for a social and political system, make a girl miserable? Hunt for weaknesses in philosophical systems, fight for moral and esthetic ideals?

I have found it is easier to view oneself as a chimpanzee-like organism.  There are many creatures whose lives are sustained by the gargantuan artifice of modern technological industrialized mass society.  Not all creatures succumb to the slaughterhouse or zoo. 

I want to spend as much time going through enough of the core subjects so that no matter where I end up, I might be able to convince someone to send me a particular book of problems to work on. 

Maybe this activity gives consciousness enough to keep itself occupied so that it doesn't turn the focus of its laser beam of attention on  the problem of existence itself.  We will continue to think about the problem of existence itself, but as long as we exist, there is definitely some kind of psychological comfort in becoming more comfortable with "a bit of mathematics."

Finding where one is at is a solitary affair.  One has to defend against having one's consciousness assaulted by mass society.  Around 2AM, just before trying to shut my eyes, I was reading that Proust book, Swann's way, and I was struck by a comment about "journalism."   It's gotten far worse with television and what they have transformed some aspects of the Internet into.

I wonder if I can access the passage through "the cloud" ...

There is no "Kindle for PC" that runs on Linux, which is what I am in.

There is only https://read.amazon.com/ ...

Let's see ... Here it is.  I'll have to type this (oh, the agony!  I am being rushed out the door ... I will skip breakfast.

"The fault I find with our journalism is that it forces us to take an interest in some fresh triviality or other every day, whereas only three or four books in a lifetime give us anything that is of real importance."
Title: Re: Programming as Mathematics
Post by: Nation of One on March 19, 2016, 08:56:55 am
Quote
I think you like math primarily because you are sick of "people"

Perhaps this is true.  While I am sleeping, my mind scans the feelings of its organism.  It processes subtle observations, such as what a rip-off farce "anger management" is ... the mind sees more than I can ever hope to write about.  I should save this for the thread about the Unconscious.

Anyway, this sense of disgust and disdain, this sickness of "people" ... I try not to write down or focus on any particular individual.  I suppose I dislike quite many, if not most people I have met and have not met.   This is not something that I need to be concerned about.  I don't think I have to like anyone.  I suppose most animals are a-s-s-holes as well.  I probably don't want to be in close quarters with most individual organisms on the planet.  It's horrible to consider, no?

At least here, on this message board (and others like it, I'm sure there are countless other groups of two and three or five), we can transcend all the happy-hippy horseshiit, and articulate an honest appraisal of what it means to exist, not some mumbo-jumbo narrative we like to tell ourselves.

So, yes, I might like to engage in the study of mathematics because I want to have as little as possible to do with other people, including the telephone.

One wakes in the morning and must endure time.  Both mathematics and programming require a considerable amount of concentration.  One can study for years and have nothing to really show for it, whereas a professional athlete can earn a great deal of money in one year.  It is nearly impossible to explain why anyone would be interested in these activities if one does not receive some kind of monetary pay-off. 

The first thing one hears is, "Why don't you go back to school and get another diploma or find some kind of "job".  People don't get it.  Formal education has a way of destroying my interest in a subject. 

As you will see when you receive the flash drive with the H Diaries, I have spent a lifetime writing about the details of getting through a life not worth living.  Now I am filling notebooks with notes on mathematics and programs associated with mathematical operations.  I have written enough about how I feel about life in general.  I don't want to write my life story or some kind of existential novel.  I want to slow down long enough to explain details of solving a problem without feeling under pressure to move along to the next problem.

I want to force myself to concentrate on math problems and try to enjoy implementing some methods with code.  That's all.  That life is not worth living is not really a topic of conversation that is going to attract many participants.  Yes, I am sick of people, it's true.  I would not have the patience to sit through lectures in a university, knowing what I know about the slow nature of the learning process.  One may resist using words as strong as "hate," but I hate the thought of needing transportation to a building where one is supposedly learning when one could get further along cracking open the books in isolation.

I use the word hate because this best describes my sentiments.  I hate Career Days.  I hate "Group Projects" ... I hate exams.  I hate student loans.  I hate the farce of society.  I don't need any stamps of approval or recognition from society.   They only keep track of the police records, anyway.  Never in a court of law has "graduating with honors at the university" ever been acknowledged by a judge.  He only brings up my altercations with the police! 

For me, Holden, the game is over.  My only goal is to remain an honest student of mathematics, programming, and pessimistic antinatalist depressive philosophy.

Fortunately, for me, anyway, approaching the age of 50 insures I don't entertain any ideas about making some kind of career out of mathematics or programming.  Fuuck the world.  They can't lock me out of my own brain.  I realize that none of this leads anywhere.  I get that part.

This is a solitary project, and the satisfaction I get from it is impossible to quantify.  To be blunt, I want to devote a couple of years to 3 specific subjects simultaneously.  This is in total defiance of covering the material in robo-mode in a couple semesters.  Hell, if I devote more than 2 years, so be it ... the slower the better as far as I'm concerned.

Perhaps studying these disciplines is an alternative to suicide, an alternative to "spectator sports and automobile worship", an alternative to "gainful employment and therapy", an alternative to "participating in some kind of political protest". 

Daily I have to convince myself to eat food.

Mathematics gives me something to write about other than the pointlessness of existence in general.  So what if it doesn't lead anywhere.  What does lead anywhere but the to the grave, anyway?

What I like most about our correspondence here on this message board, as opposed to jotting down these daily frustrations in a private notebook, is that I can shed some light on daily aggravations that are most likely common to all but hardly ever articulated in such a shameless manner. 

The drudgery involved in feeding the creature ...

I devote myself to studying as a way to endure time.

I am tinkering my life away ... Thankfully, I don't need anyone's permission to crack open a textbook.  Shall I write about the chains of biological necessity?

If I do not crack a couple eggs, there will be no energy ...

It is best to isolate.  Why do we bother to eat food?  I eat food so I can continue to study math.

 :-\

Most people do not dare to articulate their complaints about everyday existence because of the conspiracy which pressures people to preserve some kind of public image.  Keep your complaints to yourself of be accused of whining.  Thomas Ligotti explains this phenomenon very well in Conspiracy Against the Human Race.  No wonder I found that work so appealing.

May we continue to defiantly express our complaints here.

Hell, if I may be brutally honest here, it is quite often the case that studying mathematics makes me long for death even more intensely, since, after all, I wonder what the point is.   :-\
Title: Re: Programming as Mathematics
Post by: Nation of One on August 07, 2019, 08:30:20 am
A Programmer's Introduction to Mathematics (http://gen.lib.rus.ec/search.php?req=Jeremy+Kun&lg_topic=libgen&open=0&view=simple&res=25&phrase=1&column=def)

This looks extremely interesting.

https://pimbook.org/

"Programmers are in a privileged position to engage with mathematics."
Title: Re: Programming as Mathematics
Post by: Nation of One on August 26, 2019, 11:31:05 am
I feel obligated to part of myself to type up some notes from my "exploratory investigations."   Some of these notes are from a 1200 page text book mixed with other sources.    I feel a need to articulate what I find so interesting about "generic programming."


----------------------------------------------------------------------------------------------
First of all, may I suggest From Mathematics to Generic Programming" by Alex Stepanov and Daniel Rose (http://gen.lib.rus.ec/search.php?req=from+mathematics+to+generic+programming&lg_topic=libgen&open=0&view=simple&res=25&phrase=1&column=def), a book I mentioned in the "Generic Programming" thread:  http://whybother.freeboards.org/math-diary/generic-programming/ (very related to this thread).

-------------------------------------------------------------------------------------------
My apologies for putting on my "technician's hat."   Just remember that the creature who types is still this frustrated, albeit philosophical, animal with forever-growling stomach, rotten teeth, bad breath, and excrement quite nasty!   
----------------------------------------------------------------------------------------

From a 2006 paper by Peter Gottschling, "Fundamental Algebraic Concepts in Concept-Enabled C++ (http://ftp://jcmc.indiana.edu/pub/techreports/TR638.pdf)":

symbiosis - the relation between two different species, where each gains benefits from the other.

Using generic programming concepts to define algebraic structures is an organic symbiosis between generic programming and abstract algebra.  At first, the idea of concepts was adapted from algebra to generic programming.  Now, algebraic structures are specified with the generic programming concepts. 
-------------------------------------------------------------------------------------------

In Bjarne Stroustrup's textbook, Programming:  Principles and Practice Using C++, early on in chapter 20, he writes, "We look at the STL [Standard Template Library] not just as a useful set of facilities, but also as an example of a library designed for maximal flexibility and performance.  The STL was desgined by Alex Stepanov to provide a framework for general, correct, and efficient algorithms operating on data structures.

The ideal was the simplicity, generality, and elegance of mathematics. 


From page 681, chapter 19:


GENERIC PROGRAMMING

Templates are the basis for generic programming in C++. In fact, the simplest definition of “generic programming” in C++ is “using templates.” That definition is a bit too simpleminded, though. We should not define fundamental programming concepts in terms of programming language features. Programming language features exist to support programming techniques — not the other way around. As with most popular notions, there are many definitions of "generic programming.” We think that the most useful simple definition is

Generic programming: Writing code that works with a variety of types presented as arguments, as long as those argument types meet specific syntactic and semantic requirements.

When what we parameterize is a class, we get a class template, what is often called a parameterized type or a parameterized class. When what we parameterize is a function, we get a function template, what is often called a parameterized function and sometimes also called an algorithm. Thus, generic programming is sometimes referred to as “algorithm-oriented programming”; the focus of the design is more the algorithms than the data types they use.

Since the notion of parameterized types is so central to programming, let’s explore the somewhat bewildering terminology a bit further. That way we have a chance of not getting too confused when we meet such notions in other contexts.  This form of generic programming relying on explicit template parameters is often called parametric polymorphism. In contrast, the polymorphism you get from using class hierarchies and virtual functions is called ad hoc polymorphism and that style of programming is called object-oriented programming.

The reason that both styles of programming are called polymorphism is that each style relies on the programmer to present many versions of a concept by a single interface. Polymorphism is Greek for “many shapes,” referring to the many different types you can manipulate through a common interface. 

There are several differences between object-oriented programming (using class hierarchies and virtual functions) and generic programming (using templates). The most obvious is that the choice of function invoked when you use generic programming is determined by the compiler at compile time, whereas for object-oriented programming, it is not determined until run time.


So — assuming you have had your fill of philosophy for now — what do people actually use templates for?

 For unsurpassed flexibility and performance:
• Use templates where performance is essential (e.g., numerics and hard real time)

• Use templates where flexibility in combining information from several
   types is essential.


C O N C E P T S


As usual, the benefits have corresponding weaknesses. For templates, the main problem is that the flexibility and performance come at the cost of poor separation between the “inside” of a template (its definition) and its interface (its declaration). This manifests itself in poor error diagnostics — often spectacularly poor error messages. Sometimes, these error messages come much later in the compilation process than we would prefer.

When compiling a use of a template, the compiler “looks into” the template and also into the template arguments. It does so to get the information to generate optimal code. To have all that information available, current compilers tend to require that a template must be fully defined wherever it is used. That includes all of its member functions and all template functions called from those. Consequently, template writers tend to place template definitions in header files. This is not actually required by the standard, but until radically improved implementations are widely available, we recommend that you do so for your own templates: place the definition of any template that is to be used in more than one translation unit in a header file.


(This means you don't have a separate .h and .cpp file for declarations and definitions, respectively; but define everything in one .h file.)

C++14 provides a mechanism for vastly improved checking of template interfaces.  For example, in C++11, we write:

template<typename T> // for all types T
class My_Vector {
 // ...
};

We cannot precisely state what is expected of an argument type T.  The standard says what these requirements are, but only in English, rather than in code that the compiler can understand.  We call a set of requirements on a template argument a concept

A template argument must meet the requirements, the concepts, of the template to which it is applied.  For example, a vector requires that its elements can be copied or moved, can have their address taken, and be default constructed (if needed). In other words, an element must meet a set of requirements, which we could call Element.

 In C++14, we can make that explicit:

template<typename T>    // for all types T
requires Element<T>()     // such that T is an Element

class vector {
// . . .
};

This shows that a concept is really a type predicate, that is, a compile-time-evaluated (constexpr) function that returns true if the type argument (here, T) has the properties required by the concept (here, Element) and false if it does not.

This is a bit long-winded, but a shorthand notation brings us to

template<Element T>   // for all types T, such that Element<T>() is true
class vector {
      // . . .
};

The compiler doesn’t understand our names or read our comments, but being
explicit about concepts helps us think about our code, improves our design of
generic code, and helps other programmers understand our code. As we go along,
we will use some common and useful concepts:

• Element<E>(): E can be an element in a container.

• Container<C>(): C can hold Elements and be accessed as a [begin():end())
  sequence.

• Forward_iterator<For>(): For can be used to traverse a sequence [b:e)
  (like a linked list, a vector, or an array).

• Input_iterator<In>(): In can be used to read a sequence [b:e) once only
  (like an input stream).

• Output_iterator<Out>(): A sequence can be output using Out.

• Random_access_iterator<Ran>(): Ran can be used to read and write a
   sequence [b:e) repeatedly and supports subscripting using [ ].

• Allocator<A>(): A can be used to acquire and release memory (like the
  free store).

• Equal_comparable<T>(): We can compare two Ts for equality using == to
  get a Boolean result.

• Equal_comparable<T,U>(): We can compare a T to a U for equality using
   == to get a Boolean result.

• Predicate<P,T>(): We can call P with an argument of type T to get a Boolean result.

• Binary_predicate<P,T>(): We can call P with two arguments of type T to
  get a Boolean result.

• Binary_predicate<P,T,U>(): We can call P with arguments of types T and
  U to get a Boolean result.

• Less_comparable<L,T>(): We can use L to compare two Ts for less than
  using < to get a Boolean result.

• Less_comparable<L,T,U>(): We can use L to compare a T to a U for less
  than using < to get a Boolean result.

• Binary_operation<B,T,U>(): We can use B to do an operation on two Ts.

• Binary_operation<B,T,U>(): We can use B to do an operation on a T and a U.

• Number<N>(): N behaves like a number, supporting +, -, *, and /.

_____________________________________________________________________

This is a more philosophical treatment of a technical subject than is usually available, so I thought it worthy to be stored here on our "old school message board" for posterity (or just to continue to daydream of ways to bring together my interests in abstract algebra and computing ...

When my stomache growls, I catch myself wishing I were dead and no longer needed to eat food and shiit.   Not much interests me in this world ... and I foresee myself spending the remainder of my days on earth sulking and brooding, with some moments of delight upon grasping such abstractions.

I apologize again for such technical posts.   I am still quite philosophical, but the thoughts I have been "entertaining" have been too dark to verbalize.   Perhaps my heart is finally going bad.   I mean, I don't want to feel so much distress and anguish.  I don't want to make this life any harder than it actually is.

I thank each of you for your philosophical and often poetic prose.

Being a human animal, well, as each of you know, has a very tragic element to it.


Title: Re: Programming as Mathematics
Post by: Nation of One on September 23, 2019, 01:14:44 pm
I am building another specialized command-line activated, but Menu Driven old-style, calculator, this time, a [GENERIC] templated Polynomial calculator which introduces the concept of a "Field" by allowing polynomial operations over various fields or rings, such as real, rational, and complex.

[as I type these words, this woman who spawned me is nagging me to do something I was planning to do anyway : wash windows of domicile.   I scrubbed mold from tub and cleaned liners with bleach/water spray last night, pulled dead flowers this morning].  I pay heavy rent and food and am also a live-in janitor+geek_squad+SystemAdmin::ROOT ??  ? ]

peace
it's a long project

Thanks for the posts.  I'm an avid reader when not "adding content" - mostly, our board is a kind of international smoke signal, so I am merely being polite reporting my activities. 

I am a living man, with all that this entails.

I want to want to scrub the windows as a "spiritual Kata," and not as a job "the Subject, I" is commanded to perform by a demanding, squirrelly-brained parent [ I := 52, womb := 77].

in Spontaneous-and-Perpetual-Misery,
Haywire HenTric AKA Mudslide Mike

The bottom line is that "Maintenance" is my middle name ...
Title: Re: Programming as Mathematics
Post by: Nation of One on September 23, 2019, 04:02:23 pm
NOTES TO ?:
Previous version of polycalc (polymath.cpp) built with Schniederman's (c.2006) templated Polynomial.h, but only implemented with reals (double in C++).  That was written awhile back. 

The current project, this [command-line activated] Generic Polynomial Calculator, originated as an attempt to illustrate some fundamental concepts of algebra with generic-concepts; that is, I wanted to test the robustness of "templated" nature of Schneiderman's Polynomial class.  Moreover, I wanted to test C++ std::complex and my own personal Fraction class, which I have implemented in several other programs/projects to satisfy my lust for displaying the rational form of anything, if possible. 

Likewise, I prefer the algebraic form of complex numbers, z = a + i b, as opposed to the native C++ (STL: #include <complex>), displayed as (a, b), so I was motivated to create various istream >> helper functions for dealing with input of Fractions and std::complex<double>.

I wanted to add to the menu an option to display old school synthetic division process, even though there are built in functions to deal with just that, the Quotient and Remainder (polynomials) after polynomial division.   While +, -, and * are straight-forward to code, / is more complicated.

Long story short, while I have great versions that display fractions and reals, and then even reals and fractions, where the work in the synthetic division process is displayed according to the type (computer programming term) to signify a particular data-structure, whether built into the language, or created from scratch, of the coefficient; that is, according to which Field (a mathematical concept) the coefficients of the polynomial are "over" - I was getting errors while compiling that had to do with difficult things to explain.

I could always use boost library, but I found one particularly basic, well-documented, library created as an assignment at some University called Polynom-Nom has breathed some curiosity into my brain.   I am replacing parts of my code that use my Fraction with its Rational, and parts of my code that use std::complex<double> will be made to use its Complex.


This code hints at the intimate threshold where mathematical phenomena manifests itself, such as mathematical fields and programming data-types, eg:

char choose_Field()  {
   char field = 'R';
   std::cout << "\n-----------------------------------------------------------------------\n";
   std::cout << "Polynomials over which field?"<< std::endl;
   std::cout << "\n-----------------------------------------------------------------------\n";
   std::cout << "   Q (Polynomial over the field of rational numbers x = a/b)\n"
             << "   R (Polynomial over the field of real numbers x = a.)\n"
             << "   C (Polynomial over the field of complex numbers x = a + i b)\n"
             << "\n-----------------------------------------------------------------------\n"
             << "This polynomial is over :  ";

 std::cin >> field;
 std::cout << std::endl;
 return field;
}

______________
So, I investigated other libraries that might better implement the main Polynomial, and I found:

https://github.com/whisperity/polynomnom

There is a slight grammatical error in the first sentence/statement of the README.md, but I am otherwise enjoying incorporating this educational library into my "generic polynomial calculator" code.   It keeps expanding in my mind, and I keep adjusting and changing it according to my needs, borrowing key parts from previous versions, and transforming the interface code after inspecting and studying the STRUCTURE of the "mathematical phenomena."

Oh, the grammatical error is significant as it has to do with multiplicity versus unity, mathematical concepts in their own right. 

_____________________________________________________________
Polynom-Nom Synopsis

Polynom-Nom is a C++ library, based mainly around implementing the concept of polynomials and various discrete mathematical phenomenon. The code was used to deepen my understanding in the field but most importantly to practice implementation in C++.
________________________________________* should be _____________________
                                                          phenomena, as in mathematical phenomena (plural of
phenomenon, which is one thing)

Suddenly I feel like the Henry Fool of Computer Science.

I'll let you know when I get something substantial compiled.   I'm taking it as it goes, all the while incorporating it into documenting a presentation of "The Fundamental Theorem of Algebra," which I plan to use Computer Algebra System, SageMath, to explore factorization of polynomials over Fields:  Real x ---> element of Real Numbers R,
Rational f = a/b ---> element of Rational Numbers Q,
 and Complex z = a + i b ---> element of Complex Numbers C.

There is a function, is_irreducible which will come in handy, and I will want to use Jupyter Notebook as a medium for documenting the exploration.

But, now, back to applying generic=ALGORITHM-based programming to implementing algebraic phenomena.

Hey, Holden, what would you think of an imaginary discipline called "Mathematical Phenomenology" ?   (fixed typo)

It sounds like a symptom of too much LSD.   :-[

Haywire Baboonery

see general theory of polynomials (https://en.wikipedia.org/wiki/Polynomial#Abstract_algebra)  - an "abstract algebraical approach" ...
Title: Programming as Mathematics: Got Sanity?
Post by: Nation of One on October 09, 2019, 05:14:12 am
Programming-Mathematical-Concepts as a Sanity Check

There is a great deal of Madness in this world.  Codemonkeys slaving away on code they may not even care about for 80+ hours per week.   If they are lucky they might code with pure thought and nobel intentions one day ... if they can ever find or program their way out of that maze.

Got sanity?

Where oh where might a little sanity be hiding in this mad world?

With a lot of luck, you might be able to squeeze a few drops of sanity out of your Lifeworld.

Start with mathematics.  Try tinkering around with arithmetic and textual operations, making custom designed command line "operations" - your own personal arsenal of computer algebra ...

If any Sanity is to be had in this or your Lifeworld, it will be found (or not) directly between the ears and nowhere else.
Title: Re: Programming as Mathematics
Post by: Nation of One on November 02, 2019, 01:35:34 pm
From Stroustrup's "Programming:  Principles and Practice Using C++", c.2014:

What are types good for?

Types are good for directly representing ideas into code.

________________________________________________________

An aside:   I am not sure if Bjarne Stroustrup realizes how profound this statement is to a man with deep philosophical tendencies.   This statement, that types are good for directly representing ideas into code, could be a mantra, and becomes even deeper when applied to mathematical phenomena.

Consider the user-defined type, the class Fraction (https://github.com/Gorticide/Rational_Numbers/blob/master/fraction.cpp).    Developing this type helps me to express the "idea," the Qualita Occulta ?, of rational numbers and how to "operate" with them as "numerical structures" consisting of defined members, specifically, two "Integers," the Numerator and the Denominator, and on and on, et cetera.
Title: Re: Programming as Mathematics: ELEMENTS OF PROGRAMMING
Post by: Nation of One on November 12, 2019, 10:23:06 am
Briefly, Elements of Programming is condensed, raw computer science explained via solid, concrete mathematics.
_______________________________________________________________________

From http://elementsofprogramming.com/  : 

Decomposing programs into a system of algorithmic components ...

News  (from the preface to the Author's Edition)

After ten years in print, our publisher decided against further printings and has reverted the rights to us. We are publishing Elements of Programming in two forms: a free PDF (http://elementsofprogramming.com/eop_coloredlinks.pdf) and paperback (http://www.lulu.com/shop/alexander-stepanov-and-paul-mcjones/elements-of-programming/paperback/product-24142479.html).

Elements of Programming (http://elementsofprogramming.com/eop_bluelinks.pdf)
_______________________________________________________________________
Please be advised that this book is terse and DEEEEEEP and may require me 20 years to appreciate.    I am averaging about 1 paragraph per month ... it's just that heavy, the code is that beautiful that it really slows you down, the words, so heavy with philosophical and mathematical meaning, it demands an incredibly slow reading ...

Again, I only post it here hoping someone will at least read section 1.1 of (1) FOUNDATIONS and tell me what goes through your mind after reading it.

___________________________________________________________________________

Starting with a brief taxonomy of ideas, we introduce notions of value, object, type, procedure,  and concept that  represent  different  categories of  ideas in the computer.  A central  notion  of  the  book, regularity,  is  introduced  and  elaborated.   When  applied  to  procedures,  regularity  means that  procedures  return  equal  results  for  equal  arguments.   When  applied to  types,  regularity  means  that  types  possess  the  equality  operator  and equality-preserving copy construction and assignment.  Regularity enables us to apply equational reasoning (substituting equals for equals) to trans-form and optimize programs.



1.1    Categories of Ideas:  Entity, Species, Genus

In order to explain what objects, types, and other foundational computer notions  are,  it  is  useful  to  give  an  overview  of  some  categories  of  ideas that correspond to these notions.  An abstract entity is an individual thing that is eternal and unchangeable, while a concrete entity is an individual thing that comes into and out of existence in space and time. 

An attribute — a correspondence between a concrete entity and an abstract entity — describes some property, measurement, or quality of the concrete entity. Identity, a primitive notion of our perception of reality, determines the sameness of a thing changing over time.  Attributes of a concrete entity can change without affecting its identity.  A snapshot of a concrete entity is a complete collection of its attributes at a particular point in time.  Concrete entities are not only physical entities but also legal,  financial,  or political entities.  Blue and 13 are examples of abstract entities.  Socrates and the United States of America  are  examples  of  concrete  entities.   The  color  of  Socrates’  eyes and the number of U.S. states are examples of attributes.  An abstract species describes common properties of essentially equivalent abstract entities.  Examples of abstract species are natural number and color.  A concrete species describes the set of attributes of essentially equivalent concrete entities.  Examples of concrete species are man and U.S. state.   A function is a rule that associates one or more abstract entities, called arguments, from corresponding species with an abstract entity, called the result, from another species. Examples of functions are the successor function, which associates each natural number with the one that immediately follows it, and the function that associates with two colors the result of blending them.   An abstract genus describes different abstract species that are similar in  some  respect.   Examples  of  abstract  genera  are  number  and  binary operator.  A concrete genus describes different concrete species similar in some respect.  Examples of concrete genera are mammal and biped.   An entity belongs to a single species, which provides the rules for its construction or existence.  An entity can belong to several genera, each of which describes certain properties.   We show later in the chapter that objects and values represent entities, types represent species, and concepts represent genera.
_____________________________________________________________________________

(meanwhile, that some form of the unknown will eat us is a fact of existence - horror highlights the transitory nature of the me [the body, the mind] which is real to the extent it has agency ...)

I want to be one who eventually understands this book, but part of me is grappling with the disquieting question of who this "I" even is, or what it could possibly even mean to "understand" such a book.   If we find the presentation of the ideas elegant, that's one thing, but we still must get on in this world as these miserably needy apes with such delicate psyches, psyches whose flimsiness might be pierced at any moment by the gaping maw of the universe.

That mathematical ideas help us to organize the sequences of on/off [0/1] switches to represent eternal ideas is more than a little sublime, but the possibility for hubris is nil since we are so thirsty for and appreciative of the little we are able to understand in the long run.

What happens to our memories and cognitive functioning as "we" - as meat and bones - are swallowed by the void?

- The Programmer Who Never Was

These notes are simply a message in a bottle to some future "researcher," even it is a future version of my so-called "self," whatever a self is.

RECAP: 

Objects and Values represent ---->  Entities
Types represent  --->  Species
Concepts represent ---> Genera

Let's hope and pray some of us might get this symbiosis by osmosis eventually.

At least Stepanov has gone a long way to show me why I sometimes jokingly view Bjarne Stroustrup as a kind of Immanual Kant.  If you look at Appendix B (written by Stroustrup and Sean Parent) defining a subset of C++ (used in the book) with an extended Backus-Naur form, you will get a sense of why - the strictly rational elegance of mapping invisible thought-stuff-ideas to the structure and syntax of the language.   

I do not claim to understand this text, or to have gotten very far with it, but I have this exciting suspicion that I (we) may be familiar with these ideas already; but have yet to witness them stated and organized with such formal mathematical rigor, with proofs, lemmas, the whole 9 yards.

It's quite an edifice, a great gift to present to someone with a great deal of time on their hands - and a great deal of patience with themselves.
____________________________________________________________________________


footnotes:

1
Elements of Programming (Source code) (http://elementsofprogramming.com/code.html)

This includes a different parser than the one mentioned in footnote 2.


2
 Implementing a Parser for Elements of Programming (https://parasol.tamu.edu/people/villoria/parser-report.pdf)

Excerpt from parser report :

Alexander Stepanov and Paul McJones recently published a magnificent book on structured generic programming titled Elements of Programming. They show-case programming as a mathematical activity, a wonderful journey in the land of simplicity and generality. Their approach makes essential use of axioms (and more generally properties) and concepts,i.e.collections of syntactic, semantics, and complexity requirements on datatypes and operations.

_________________________________________________________________________

Proofs and exercises (https://github.com/robot-dreams/eop) from "Elements of Programming" by Stepanov (author of C++ STL) and McJones
Title: Re: Programming as Mathematics
Post by: Nation of One on March 29, 2020, 04:33:08 pm
From this thread, page 1, end of December 2015 (http://whybother.freeboards.org/math-diary/programming-as-mathematics/msg1611/#msg1611):

Quote from: Holden
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 get this feeling often.  Without reading too much into the analogy, I sometimes feel like the Henry Fool to your Simon Grimm.  That is, I sense you might aim to actually make something of your literary, philosophical, and mathematical musings, whereas I very strongly resist putting myself in a position to be poked with a stick by any slob with a pretense to taste or "knowledge".

Definitley no offense meant.  I think you might be the more practical of us.  This is not to say I am ashamed of my reluctance to try to be taken seriously by this Confederacy of Health Nazis Police.  I have mixed feelings, but I am noticing a desire to complete unfinished "projects" which I egotistically presume will be embraced by a future generation of mathematics students struggling to find clear explanations of what they may be inclined or forced to study.

It is humbling.  If the gods (Fate) is with me (or the receivers), then it will be.  If the oceans rise and it all gets buried by Forces Greater than my passions-Will, then so be it.  I have worked on the mathematics and programming in order to motivate myself to continue to abstain from imbibing alcohol while assisting Maman with "enduring her existence" …

I probably have cheated death many times already, and I have prayed for death - yet here I am, a meat puppet who cares about and is cared about by his meat puppet mother.     :D

If I live to be old, I'll most likely have that drink. 
Title: Re: Programming as Mathematics
Post by: Nation of One on December 23, 2021, 11:19:09 pm
A few links to the future, if it even exists: 

(1)  Metamath: A Computer Language for Mathematical Proofs (http://us.metamath.org/downloads/metamath.pdf)  - the book

(2) http://us.metamath.org/  (the website)

(3) source at github:  https://github.com/metamath/metamath-book
Title: The Foundations of Abstract Reasoning
Post by: Nation of One on December 24, 2021, 10:07:23 am
 My plan is to tackle a few books at once and just go with the flow.  If I live long enough, I might get back to the rational trigonometry after filling in some gaps, facing some old fears (of writing and reading proofs - is it not like writing or reading computer programs?), and basically getting to the roots, the foundations ... the foundations of abstract reasoning.

In From Mathematics to Generic Programming (http://bayanbox.ir/view/3002073151855816404/Alexander-A.-Stepanov-Daniel-E.-Rose-From-Mathematics-to-Generic-Programming-Addison-Wesley-Pearson-2015.pdf), on page vii (Author's note), Alexander Stepanov writes:

Quote from: Stepanov
The separation of computer science from mathematics greatly impoverishes both.  The lectures that this book is based on were my attempt to show how these two activities—an ancient one going back to the very beginnings of our civilization and the most modern one — can be brought together.

While the co-author writes:

Quote from: Rose
While Alex comes from a mathematical background, I do not. I’ve tried to learn from my own struggles to understand some of the material and to use this experience to identify ideas that require additional explanation. If in some cases we describe something in a slightly different way than a mathematician would, or using slightly different terminology, or using more simple steps, the fault is mine.

In the section, What This Book Is About, on page 2 or so, section 1.1:

Quote from: Stepanov
So where does this generic programming attitude come from, and how do you learn it? It comes from mathematics, and especially from a branch of mathematics called abstract algebra. To help you understand the approach, this book will introduce you to a little bit of abstract algebra, which focuses on how to reason about objects in terms of abstract properties of operations on them. It’s a topic normally studied only by university students majoring in math, but we believe it’s critical in understanding generic programming.  In fact, it turns out that many of the fundamental ideas in programming came from mathematics.
----------------------------------------
The abstractions that appear in abstract algebra largely come from concrete results in one of the oldest branches of mathematics, called number theory. For this reason, we will also introduce some key ideas from number theory, which deals with properties of integers, especially divisibility.

This was the direction I had been moving in around 2016 or so, but then I had resurrected a passion for linear algebra, analytic geometry, computer algebra systems, continued fractions - then plunging into the long commitment to revisit "school mathematics" in terms of the "set theoretical presentation" from high school ("New Math" ---> "modern" [abstract] algebra ?), and even a dive into Stroustrup's C++ text, working on the exercises as diligently as a model prisoner/student.   

So, regardless of Dr. Notowidigdo's sense that I have not studied formally a good part of what math majors study, I am confident I can handle the material Stepanov presents.  I was exposed to formal Mathematical Reasoning courses and the like.   Yet I will humbly submit that it would not hurt me to delve deeper into that world of fields, rings, and groups - yes, I get it - concepts underneath "school mathematics" but never presented to students.   Such presentations are reserved for math majors.

Hung-Hsi Wu thinks all those training to become high school (or even elementary school) teachers, ought to have the deeper view (with proofs and understanding) so that they might better communicate to the students.

See What can we do about our dysfunctionalschool mathematics curriculum? (https://math.berkeley.edu/~wu/RNLE1.pdf), Preface and To the Instructor from Rational Numbers to Linear Equations (http://libgen.rs/search.php?req=Rational+Numbers+to+Linear+Equations&lg_topic=libgen&open=0&view=simple&res=25&phrase=1&column=def).

Now, Stepanov's Elements of Programming is a different story, but I am considering pecking away at that book along with From Mathematics to Generic Programming.   Such are the kinds of texts I wish to understand.

Lastly, I am going to commit to the text, Contemorary Abstarct Algebra, if only because the most resources are available for that text.  It's in its tenth edition, so there are free resources available for the 7th and 8th editions, as well as labs and definitely more support than just videos on ZooTube.

I think that a disciplined informal study of Abstarct Algebra will not only help me understand Stepanov's work better, but it would also help me decipher (better) where it is Norman Wildberger might be coming from.   He certainly uses much terminology from abstract algebra.

Why is it I must have a plan?  I'm just chipping away at my ignorance, trying to practice authenticity in a world that rewards phonies and charlatans with a sense of unearned confidence, like the managers in Ligotti's novel of corporate horror, My Work is Not Yet Done.   

The gangsters of the world might mock the likes of me, but I would like to imagine there are a handful of academics who would sympathize with my anti-academic/anti-careerist/anti-professional attitude.
Title: Re: Programming as Mathematics
Post by: Nation of One on December 28, 2021, 08:47:16 pm
Programming is an ancient activity.  In its nature, it is thousands of years old.  Ancient Egyptian scribes were DOING PROGRAMMING with their algorithms.  We think that mathematics and programming are literally the same discipline.   Of course, this might seem like poking the elite [formal structure and method] mathematicians in the chest, but it is honest language nonetheless.

https://youtu.be/Ih9gpJga4Vc?t=261
Title: Re: Programming as Mathematics
Post by: Ibra on December 29, 2021, 07:35:47 am
Mike,
I to be honest, was keen to check Wildberg Math especially it is  vetted by you. but I, likewise, am not a fan of videos.

Anyway that was not a lost effort, you left good trails. for example the link to Zeilberger's opinions was an eye opening, I've gone through half of his opinions.

It is interesting that the method he describes on opinion 65 (https://sites.math.rutgers.edu/~zeilberg/Opinion65.html) is almost the same way you are doing math.

Quote
I applied this principle a few weeks ago when I taught the Buchberger algorithm to my Algorithmic Discrete Math class. First, they had to, during class, compute the Grobner basis of {x+y,x^2+y^2}, all by hand! Then, as homework, also by hand (no cheating please!) they were asked to find the Grobner basis of {x+y+z,x^2+y^2+z^2,x^3+y^3+z^3}. Then, they were asked, using Maple, to perform the same calculations step by step, computing S-polynomials and reducing. Then they were encouraged to try and program their own version, even though it is unlikely to be as efficient as the built-in Maple command. Finally, for ever after, they were given permission to use the built-in command gbasis, and use it as a complete Black Box, without worrying about the details, enabling them to do new research.


I am sure you gone through his site, these opinions  (https://sites.math.rutgers.edu/~zeilberg/OPINIONS.html)might be of interest to you 37, 46.

I find your posts about math illuminating, it sounds like you reached the climax in your hero journey story studying math.

stay well and away from masses
Title: Re: Programming as Mathematics
Post by: Nation of One on December 29, 2021, 12:21:07 pm
Thank you, Ibra, for reminding me about those opinions by Zeilberger.  Today I happen to be coherent and cognizant.  As you know, the inner life of the mind resembles chaos, not order.   I'm afraid some days I am a basket-case, and must resort to spacing out listening to music; but some days, like today, the mind is sharper, more focused.

Contacting [Dr] Gennady Notowidigdo knocked the wind out of my sails (http://whybother.freeboards.org/math-diary/a-re-orientation-of-your-mindset/msg11733/#msg11733).  I was up to Chapter 6 (Spread) in Divine Proportions (http://whybother.freeboards.org/math-diary/a-re-orientation-of-your-mindset/msg11008/#msg11008) when he removed all supportive attempts at solutions to the exercises.  Not to sound too ridiculous, but "I can't work under such conditions."

I still find NJ Wildberger to have a fascinating mind, and I sure would like to see things from his perspective.  If I live long enough, filling in some gaps along the way, who knows, maybe I would jump back into Divine Proportions.   I do not deny continued interest.  I just have to regroup at this time.  How such a regrouping unfolds is yet to be seen.

How can anyone make any plans?

Maybe it is not all done in vain, that our personal efforts might count for something, at least to those who have been as authentic and honest as we have during our explorations.   We might inject some feedback that the rare honest ones to come will appreciate.   

Going over old notebooks, for me, is a way to calmly re-approach the material I wish to focus on.   Should day-to-day life shatter all coherency, and I become just another nervous wreck, then I (we) deal with that, rolling with the punches, clinging to the ropes, licking our wounds.    We are not static, permanent phenomena.  It sure is a blessing to have moments of clarity now and then.

When life becomes overwhelming, remember to HUG YOUR OWN ANIMAL BODY, hug your [embodied] self.  This helps, maybe, because it is life hugging itself.

I am going to check out Zeilberger's opinions, starting with 46 and 37.   What I just read floored me.   In fact, the main reason I chose to study "Computer Science" (a branch of mathematics, as far as I'm concerned) rather than become a "math major" was because I was haunted by Hardy's 'apology' ... At age 30, I felt like an old man compared to those in their twenties.  He had said that Mathematics is a young man's game.

I appreciate your pointing these opinions out to me.

From #46:  Mathematics is an OLD Person's GAME (Provided You Stay Away from the Mainstream) (https://sites.math.rutgers.edu/~zeilberg/Opinion46.html).

That is great news, isn't it?!  So many [not necessarily old] folks I have met in Dirty Jersey from Holden's neck of the woods, and from China as well, seem to have had this "Mathematics is a young man's game" drummed into their heads, that studying after a certain age is a waste of energy.  It has had a depressing effect on me, no doubt.   It has had a depressing effect on them, as well.  Maybe it is some kind of conspiracy to trap people in dead-end, mind-numbingly boring jobs.

Quote from: Doron Zeilberger
One of the many things that outrage me in G. H. Hardy `apology' is the sexist and ageist statement: `Mathematics is a young man's game'. Speak for yourself, G.H.! Just because YOU were finished after forty (or whenever) does not mean that the rest of us are.


https://www.youtube.com/watch?v=wccRif2DaGs
Title: Completing the Square
Post by: Nation of One on June 29, 2023, 02:49:45 pm
Completing the square as an alternative to plugging values into Quadratic Formular


Source Code for Command Line Program attached as text file.


It can be saved as cts.cpp, compiled and used (./cts).
Title: Re: Programming as Mathematics
Post by: Nation of One on February 15, 2024, 04:16:00 pm
Wow

I may end up using old threads from this message board to reflect upon what I was up to before my day to day existence became so "challenging".

 >:( ??? :o :-\