Friday, February 19, 2021

Congratulations NASA, perseverance pays off it appears; other musing

 Upon successful landing of the Perseverance Mars rover this week I felt slightly guilty about my recent dig (January 21) that NASA “can no longer field its own hardware, but ... have a diverse workforce.” As a former engineering professional, I had an inside view of a large (civilian) technology organization. Perhaps that was a somewhat corrupted view to the extent that GTE Network Systems relocated to El Paso in 1978 primarily to achieve the shutdown of the company without having to fight the union workers in Albuquerque, NM and San Carlos, CA (GTE subsequently broke up into Verizon and Sprint, not sure if they still are the local phone company in California). I gradually became aware of this plan as floor-level supervisor of the electronic quality engineering audit program to assure the telecommunications equipment manufactured there met official specifications before being shipped.

Higher management could not convince me to stop my people from failing out-of-specification equipment (leading to an amusing battle where I for a time erected a 10-foot chain-link fence around the quality engineering audit area in order to prevent raiders from removing sample lots to the shipping area) and finally told me point-blank quality no longer mattered since the plan was to cease operations. My own superiors, legitimate engineers, left the company and I was forced onto the second-shift gulag in another position in order to permit the shipping goals to be met without further argument on the basis of quality audits. 

After a time, I also left GTE Network Systems and eventually worked for design startups rather than manufacturing facilities, enjoying the highly-motivated highly-talented small-team atmosphere without the layers of parasitic management and HR. As for HR, I recall an amusing interchange with an uncle of mine c. 1977, a pleasantly dull fellow with a corporate appearance who naturally ended up in Human Resources; he  had wondered who would hire me as I made the transition from rock and roll musician after 1975. I laughed at him and told him that anyone who actually had to create something or provide a service requiring talent would find me useful. 

Transitioning from telecommunications to software engineering, I worked, for example on the AMBI Voice-Data-Terminal design, which, using a proprietary multitasking operating system base (I worked for the designer of that operating system), sent and received email over telephone lines (I was hired to improve their communications software at AMBI because I had background in telecommunications as well as computer programming at the hardware level), and had an electronic calendar, notepad and terminal interface to mainframes in 1985.

At any rate, it is not clear how much of the work resulting in the apparent success of the Perseverance mission thus far is actually to be attributed to NASA directly. After Reagan initiated the destruction of government in the 1980s (and the transformation of the American middle-class into self-loathing serfs bizarrely allied with their greedy masters), NASA found itself with increasingly reduced funding and, quoting from a 2012 report, the country found itself “living on the innovation funded in the past.” NASA had a program executive and scientist in Washington, D.C. for the Mars 2020 mission, but the JPL associated with Caltech very likely did the heavy lifting. The seven instruments and experiments of the rover are each developed by different academic institutions (but one included Los Alamos national laboratory).  

The Perseverance was launched from Earth using a ULA (United Launch Alliance, a joint venture between Lockheed Martin and Boeing, founding members of the old military-industrial complex) Atlas 541 rocket with first stage still using  a Russian RD-180 engine burning kerosene (RP-1) and LOX (liquid oxygen). They were hoping the BE-4 engine developed by Jeff Bezos’ Blue Origin company could replace the Russian equipment (it must be difficult to talk about sanctioning someone while you are dependent on them for your space launches), but apparently there was some controversy about the government obtaining Amazon free shipping and the replacement has not yet occurred.

The Perseverance was tucked inside a large payload fairing at the top of the long rocket. With the 5 meter diameter payload (first digit “5” in the Atlas 541 designation) sitting on top of a 3.8 meter diameter by 32.5 meter long Common Core Booster, it appears similar to a bacteriophage:


The “4” in Atlas 541 indicates 4 solid rocket boosters were attached to the base of the rocket (a design taken from Warner Brothers Cartoons as I recall, the famous Acme Rocket design used on the Space Shuttle launches). The “1” in  Atlas 541 indicates a single engine on the Centaur second stage. 

I was surprised to see that US Department of Energy provided the radioisotope thermoelectric generator (MMRTG) providing power on the Martian surface for the Perseverance (don’t see any photovoltaic cells in the pictures so maybe they did not bother with that as a secondary supply, the Sun being somewhat dimmer as far away as Mars, though there is not much air pollution, yet), since that uses plutonium-238, which for a long time after the 1964-1979 detente period, was hard to obtain in the US since we curtailed our production of nuclear weapons materials. 

I became aware of the shutdown of production reactors in 2020 when I was researching nuclear reactors in connection with physics articles I wrote concerning neutrino physics. The first experiment to really establish the existence of the neutrino was conducted at the Savannah River site (Aiken, South Caroline) nuclear weapons reactors. This Reines and Cowan experiment culminated in a 1956 congratulatory telegram from Reines to Wolfgang Pauli, the physicist who had invented the idea of the neutrino in 1930 to explain the problem of the continuous beta-decay energy spectrum. In beta minus decay a neutron in a radioactive nucleus transforms to a proton, emitting an electron, aka beta particle, which should have been observed with a single energy spike, but instead was observed with a continuous range of energy as if it was sharing the process energy with an unseen neutral particle, later shown to be the electron anti-neutrino. It had not been thought possible to detect a neutrino, the neutrino largely ignoring most matter, the Sun and the Earth appearing as fine crystal does to light (i.e., crystal is transparent to photons and matter is more or less transparent to neutrinos).

Well, congratulations to NASA, whatever their exact degree of participation. They surely would have taken most of the blame if there had been a problem in what is without a doubt a project with innumerable (even Cantor could not count them) ways to fail. 

NASA and space travel being on my mind, I read a 2012 report earlier today discussing nuclear propulsion. The figure there (below) gives the transit time for various nuclear-electric propulsion velocity change capability:


One way of doing nuclear propulsion is by using the heat from a fission reactor to generate electricity, which then is used to accelerate ions and eject them from the spaceship thrusters (engine) at very high velocity. Recall Newton’s Third Law of Motion, whenever one body exerts a force on a second body, the target body feels a force equal in magnitude and opposite in direction, i.e., the rocket is pushed in the direction opposite to the departing ion stream, just as the bottle rocket is pushed away from burning  propellant shooting out the back. A nuclear reactor is heavy and the thrust is relatively low compared with chemical engines, so it must be operated continuously to achieve the desired delta-V (change in velocity). It therefore takes a long time to get up to speed and a long time to decelerate at the destination. So you see the flight transit times estimated for various length missions (that does not take into account ion propulsion advances in the last 8 years though, I have a NASA facility relatively near my location out in the desert and they have their own private high-power electric lines, so make of that what you will). 

What caught my interest in the figure though was the label “Interstellar Precursor.” A tear involuntarily came to my eyes as I read this. Interstellar, that means “between the stars.” That implies a destiny beyond a an overpopulated box of bipedal mammals (a specific mammal came to mind but I censor myself for once) with increasingly low intelligence and nasty temperament. Why such a personal connection for me with that idea of interstellar travel? 

I knew a man in 1962, in or out of the body, I cannot say (some may recognize my style here as that of Paul 12:3 in  his Second Epistle to the Corinthians). But he went out to investigate a strange object late one night in the southwest desert and perhaps experienced things which it is not allowed to relate. He began to dream of things to be, sense the thoughts of others, and to live more or less a life parallel to the one here on this workaday planet. He suffered much though--as usual such men must be reminded of their mortality and human frailty, but gold is tried in the fire, and acceptable men in the furnace of adversity (Ecclesiasticus).    

My recent work has shifted to pure mathematics after devoting the last four years mostly to quantum mechanics and then neutrino physics (though that necessarily included a significant amount of applied mathematics). I just published a tutorial on automated theorem proving with the Isabelle Proof Assistant Isabelle Proof Assistant Tutorial. As a friend observed, “well, at least you stay busy.”

Thursday, January 21, 2021

Yesterday, the inaugaration of Joe Biden as President, brought a feeling of relief and hope, despite my general pessimissm about the longterm survival of America. China is correct to control social media. When you have a population of largely emotion-driven humans without much in the way of higher principle or intelligence, it is madness to connect them instantly to one another and amplify every metaphorical emission of the gas of decay.  Competing (in the race to destruction) we have the grotesque perverts (I do not mean sexually, since adult consensual sex is strictly the business of the participants) who infected our universities from the 1960's onward apparently preaching that white, Christian, Western Civilization should apologize for its achievements and open the gates to every barbarian horde that demands a more pleasant place to live. Yes, America began with people leaving Great Britain seeking a better life, but they went to an unsettled, wild land and tamed it, displacing the sparse population of natives, but that has always been the way of evolution--until now where the superior group is being taught to move aside voluntarily for that which could normally not compete.

It could have been so different. America would welcome applicants for citizenship who offered something and who did not overwhelm the present capability to bring in more population. The days of trying to populate a wilderness are long passed. There are too many people here now (and everywhere on Earth for that matter). It is a zero sum game, but that is not the worst of it. Already we begin to see infrastructure failures, more power failures, etc. as the marginally competent are given jobs. NASA can no longer field its own hardware, but hey, they have a diverse workforce. The national lab system, along with the US military, actually employs foreign nationals. I wonder if I am living in a madhouse where the inmates have taken over.

Well, if the essential goodness of a single man in a single office can overcome all of the above, then President Biden has a chance. I think of Lot trying to find smaller and smaller groups of good men...

I am old and tired, but persist in my research and writing. I published my best work in neutrino physics, Solar neutrino parameters and then returned to formal mathematics, resuming work with the automated proof assistant, Isabelle. I am in the process of writing a tutorial on using Isabelle for classic mathematics, proving that the square root of a prime number (the problem was originally that of the Pythagoreans, i.e., how to deal with the diagonal in a unit square, which turns out to be an incommensurable number) cannot be a rational number. There are many ways to go on that. I am following one of the routes taken by the Isabelle community, where the square root of two is assumed to be rational and then a contradiction is proven, i.e., that p must divide both m and n of the ratio square root of p = m/n with m and n positive integers n non-zero and coprime, but p is prime so cannot be 1 yet gcd(m,n) must be 1 if they are relatively prime.

I was a little unhappy to see Isabelle using properties of real numbers in the proof, which is required apparently because abstract properties involving division demand a field and the integers cannot be a field since they do not have a multiplicative inverse. Isabelle does take the approach of deriving most properties of numbers from basic principles, e.g., the Peano axioms, rather than stating axioms or postulates. In that way, they build a rock-solid structure that rests upon formally proven natural deduction steps and continues in the same manner.

...and so it goes, recalling one of my late wife's (Cheri) common utterances.

Saturday, September 26, 2020

September 26, 2020, fear and loathing on planet of the apes? Never thought I would see a parallel to Clodius (the Publius Claudius Pulcher of the factions in 59-50 BC Rome when Caesar was away in Gaul) here in United States of America. United. "United?" About a third of the US population is anti-intellectual, narcissistic, insolent, overweight and with indications of worrisome repressed sexual tensions (I haven't the heart to discuss projection with these folks, many of whom have been my colleagues many years ago in the music business, but it is embarrassingly obvious that their vile slander against well-known and respected public servants comes from within themselves rather than without), i.e., a perfect breeding ground for Clodius and his ilk. Another third are anti-Western civilization indoctrinated and busily gnawing away the foundations of the American experiment, one that produced the most advanced society up to now, technologically and socially (in history, how many times have you seen a nation fight for the peace of all? or generally greet other races and cultures with some acceptance in a world where genocide was always the rule sooner or later and still is, that being the natural tendency of animals). 

What about the remaining third of the population? That contains many relatively affable folk who just want to do what they are capable of as best they may, whatever the profession, and enjoy friends and family in peace. Within that group is a smaller percentage of truly noble persons, many of whom I have had the pleasure of meeting and interacting with over the years. I owe my life in fact to many of those unsung heroes, the ones who go against the grain to do what is right, that being the definition of integrity really, i.e., not having oneself contaminated by the crowd, but maintaining an intact core of self, self-guidance and that deeper well-spring of humanity that cannot be explained in evolutionary terms (despite the convolutions of the self-hating types like Dawkins attempting to mislead many)

A small group of intellectuals created the American founding documents (John Adams in particular), for the first time a revolution guided by the lessons of history guided by transcendent philosophy and nobility of character. Adams knew well the danger of the population taking direct control of the reins of government and engineered protections that worked well for a time. Those protections relied on a minimum fraction of the population being of higher integrity and capability and somehow reaching the positions in government. We have unfortunately reached a heretofore unseen low in that regard both in the relevant population and the individuals that population elects to power, directly or indirectly. One can only hope that a Marcus Aurelius will emerge from the US military ranks if the situation deteriorates drastically in the next few months.

There is of course a basic absurdity in much of the organization of humans. One can surmise that the beings who appear to have been monitoring our progress are at a loss to explain how most of the capability of a society is wasted providing resources for a parasitic few, to the point that even the infrastructure of the civilization begins crumbling (not to mention why humans breed uncontrollably like bacteria in a Petri dish, seeming not to notice they are overgrowing their environment, with the inevitable outcome of widespread disease and largescale die off). It is necessary for progress that the level of mankind be increased, but the evolutionary trends are opposite to that now and for many centuries past. With the CRISPR technology one nation or another will begin to "upgrade" their genome, but without proper guidance (yes of course, I mean men who think and feel as do I, grin) those changes may eliminate much of the genius and nobility of man at his best. 

These considerations make me fear that my work (physics primarily the last four years), passing on my hard-won understanding to other students in various venues, e.g., Neutrino Physics, or Neutrino computer code, articles, is simply "fiddling while Rome burns." Well, we persevere, feeling blessed that we are able to study and write in a subject we had not been formerly able to pursue. We implemented C++ computer code in Python/NumPy lately in order to graph the flavor transition probability of muon neutrinos at 1300 km baselines in the range of 0.3 to 10 GeV (including the effect of their passage through Earth mantle), using the exact equations originated by Zaglauer and Schwarzer c. 1988 and in particular their 2019 implementation in C++ (we wrote software in C back in the 80's and are inclined to agree with many that C++ is too extensive, though useful if you adopt a subset of its features) by FermiLab physicist Stephen J. Parke (along with Denton, Barenboim, and Terne). I have read much of Parke's work, going all the way back to his 1986 paper "Resonant Solar Neutrino Oscillation Experiments", in which he gave a detailed treatment of the recent suggestions by Mikheyev and Smirnov which turned out to be the likely solution of the solar neutrino deficit problem first exposed by Ray Davis experimental work assisted by John Bahcall development of the Standard Solar Model. We graph the performance of the Parke equations in their C++ form, our implementation in Python/NumPy and an approximation from the T2K experiment:


The T2K code (green) continues higher at 0.3 GeV (far left of graph), but it is known to be less accurate at that level. We spent many hours yesterday troubleshooting our ZS code in order to obtain pixel-to-pixel agreement with the Parke code. The error turned out be a single parenthesis that our aging eyesight did not properly view as enclosing the entire denominator of a long equation in fraction form. It was enjoyable to be writing C (well, C++) code again and compiling, after some 33 years. Like bicycling, you never really forget how to code, you just fall down more often, perhaps.





Monday, August 5, 2019

We came in with a Bang

I was alluding to the Big Bang, the creation event that the atheist scientist community really hated to have to swallow. I happened to be reading the description of the 1978 Nobel Prize awards, which included Arno Penzias and Robert Wilson for their 1965 discovery of the CMB, the cosmic microwave background, that simmering remnant of the explosion of space-time some 13.8 billion years ago (using the 2018 Planck report figure), and found the Nobel site (hopefully written in 1978) described it "as tempting to assume that the universe was created by a cosmic explosion...though other explanations are possible." In 1978 I considered it well-established that the Big Bang was the origin of the Universe, but as I say, some had to be dragged kicking and screaming to that conclusion. They managed to save their position (atheist, PC, etc.) by creatively proposing that our universe is only a single bubble in a huge froth of universes, the "multiverse." Besides being conveniently unfalsifiable, the concept also provides some justification for the relative lack of progress in theoretical physics for the last half century (or more if you demand equivalence to the discovery of quantum mechanics and relativity at the turn of the twentieth century) in that it can now be claimed (with a straight face) that it is really impossible to discover more about nature now because the remainder of what happened is simply random turns of the dials on each bubble that pops into the Multiverse (this goes well with a string theory diet).

In any case, after my previous post I began to feel guilty about my brief characterization of CMB photons at a single frequency equivalent to 2.725 K temperature. The CMB photons are described by a spectrum, a curve describing about how much power (equivalent to about how many photons there are) at each of a range of frequencies, so it is a little misleading to speak about a single frequency. I accordingly dropped my other work (a physics study I have spent two years on at this point) to add a little more to my discussion.

I was surprised (again, and why is it that most surprises are undesirable? must be my life's experience or the deterioration of this world during my lifetime) to find that the equations and presentations of the data related to blackbody radiation (the CMB radiation is almost exactly that of a blackbody spectrum equivalent to a perfect radiator at 2.725 degrees Kelvin) are ambiguous at best, and possibly flatly wrong on occasion, depending on the author (there are many different forms for the equations and units involved, e.g., intensity at unit area vs integrated over a hemisphere). It is not that the mathematics and physics involved is new, Max Planck got the ball rolling back in 1901 or so, when he invented what became known as the Planck constant, h, in order to avoid the ultraviolet catastrophe. Scientists up to that time had made very accurate measurements of the frequencies of radiation emitted from hot objects, in particular those constructed to be the equivalent of a blackbody. By blackbody I mean an object that does not reflect any electromagnetic energy, like a mirror reflects, instead absorbing everything that comes its way and in turn emitting a very precise spectrum of energy related to its own temperature. At the time they created hollow cavities,  termed "hohlraum", with a tiny hole out of which they could measure radiation intensity and character inside. Almost all the radiation of the hohlraum is trapped inside, bouncing around internally, which has the effect that its internal heat is solely related to its own temperature rather than through exchange processes with the environment by which it might otherwise come to equilibrium.

A few had offered equations to characterize the blackbody radiation, but they had the undesired quality of blowing up a short wavelength, i.e., creating an ultraviolet catastrophe. Planck laboriously (I have discovered through the accounts of many scientists that scientific work requires a lot of effort, which makes me feel a bit better about my own self-inflicted pain in that area) came up with the idea that the radiation could not simply be any number on the real number line, but rather would have to come in integer multiples of this odd constant, 6.62607004e-34 Joules seconds (I have one of his 1901 papers and see he got very close to this present value of h, he giving 6.55e-27 erg second; an erg is 1e-7 Joule). He hoped for some time that someone would find a way to explain this in some other way, but quantum mechanics took off within a few years, changing everything Planck and every other scientist had known in the way of a world view (along with special and general relativity, most people are aware Einstein created that new area, but less aware that he only received the Nobel Prize for his work in creating quantum mechanics, he having found immediate use for Planck's constant in describing the photoelectric effect).

I'll see if I can somehow type the Planck law equation of interest to me (it is a real pain in the neck to work without LaTex math or its online version MathJax):
𝐈(Ξ½,T) = (2β„Žπ‚³ / c²) (1 / exp(β„Žπ‚/kT) - 1)
Whew that is ugly. Well anyway. That equation gives you the radiation intensity as a function of frequency (that is the Ξ½, a Greek letter nu) and time (per second) in, depending on what constant units you use, J or W per m^2 (meter squared) per steradian (a chunk out of the surface of a sphere, picture the radiation emerging from the eyes of angry Superman stuck in a big ball, say a hohlraum, and cones of death ray hit the surface). The famous Planck's constant is the β„Ž, which is privileged to have its own Unicode symbol up here apparently. exp means "exponential", i.e., Euler's number raised to the power of the stuff in parentheses next to it. I would have liked to put a "B" subscript on the k to signal that this is Boltzman's constant, put that was perversely impossible (every letter other than b had a subscript when I looked at the menu here). T is temperature in Kelvin absolute degrees. The frequency Ξ½ is in Hz (cycles per second). I wrote some computer code (I work in a Jupyter notebook environment, where I can type perfectly typeset mathematics in one place and active Python computer code in another, with all the scientific software available for that environment, SciPy, NumPy, SymPy, Matplotlib, etc.---first time in years I have felt like computers were actually fulfilling some of their promise, despite Gates' constant attempts to sabotage anyone's efforts to accomplish that...the Borg operating system, as it is known in the world-wide computing community) to graph the result of a spectrum of frequencies from 100 MHz to 1000 GHz input to that equation above:

And there you have it (hoot, there it is?). I encountered so many errors and misuse of the Planck equations in the literature that I intentionally used the same spectrum covered in a figure in a 2011 paper by P.J.E. Peebles (The natural science of  cosmology, 2011) as a cross check on my methods. Peebles, by the way, was one of the scientists who Penzias and Wilson shared their discovery with in 1965; they published a letter in 1965 Astrophysical Journal, vol. 142, p.419-421 and Peebles, along with his collaborators, published "a possible explanation for the observed excess noise temperature [of the antenna]" You have to consider that this was an age when men in science conducted themselves like gentlemen, with integrity and understatement. It is probably difficult to understand for anyone of the current era. These folks knew they had probably found the simmering heat of the Creation, but described it in clear, non-hyperbolic terms as the Bell Telephone scientists that they were (they had used a re-purposed piece of satellite communication equipment, a giant horn, I kid you not, used to communicate with a couple of early telecommunications satellites). Bell Telephone Labs, that is another loss of that age. Amazing discoveries that came out of their work, most of it freely shared with the world. I was just reading Nyquist's 1924 paper (published in a Bell technical journal) on Certain Factors Affecting Telegraph Speed the other day. That was the work that in many ways started the field of communications theory, his name still used today as the term for the minimum sample frequency to prevent aliasing (the Nyquist criterion). I should add that "the horn" was a microwave horn, not something you might find in the Alps. At high frequencies electromagnetic fields can be guided through suitably configured plumbing as it were.

In any case, I wanted to make it clear that there were more frequencies involved in the CMB than my June 17, 2019 post discussed. I had mentioned 57 GHz. You can see that the peak of the spectrum is around 160 GHz. Penzias and Wilson's 1965 article specifically dealt with the 7.35 cm flux, 4080 MHz or 4.080 GHz (their horn was tuned to that frequency, like trumpets with air, there are favored notes in electromagnetic radiation for the particular construction), which is pretty far out on the left tail of the distribution I graphed above.







Monday, June 17, 2019

Loose associations, binary thinking, time-space, neutrinos, and counting

I was thinking about the tree structure of syntax diagrams (that I discussed in my previous post) and began to wonder about the matter of binary decisions. By binary decision I mean having two choices only, i.e., branch to the left or branch to the right. In the most fundamental expression of such a dualism, mystics must inevitably confront the paradox of God as the spiritual light, but also the cause of nature's black deeps (paraphrasing Carl Jung). You encounter this tension of the pairs of opposites throughout the temporal world, that is to say, the world where we find ourselves conscious and proceeding through time moment by moment. There is no change where there is no time, and anything material, at least anything with mass, experiences time.

For example, neutrino particles (the Standard Model of physics, incorporating the electromagnetic, weak and strong nuclear forces or interactions, classifies all the subatomic particles known to date; there is the familiar electron, proton and neutron, but there are many others, including the electrically neutral and difficult to detect neutrino) must have some small mass and experience time since it apparently does change. The neutrino can be observed to interact in three different "flavors," i.e., electron, muon, tau (the flavors are simply the type of charged lepton it appears with in an experimental observation), and in fact oscillates among those three states (or the probability of catching it interacting with a particular lepton changes periodically with distance) as it travels, which involve the propagation of its composite mass states at slightly different rates.

The propagating neutrino mass states (there are three of those, different from the interaction flavor "state", i.e., the mass states are the true neutrino, the flavor states simply a convention) are energy-momentum four-vectors, rank-1 tensors really. Before Einstein and Special Relativity we conceived of physical objects occupying space, e.g., we could bring two objects into contact and that contact would end where the "space" occupied by each met. We had a vague notion of an abstract "space" in which objects existed, but that notion really required a body of reference (following Einstein's 1921 Princeton lectures on Special and General Relativity).

You may recall from high school algebra that we could construct Cartesian coordinate systems where we indicate the position of points (and objects consisting of the loci of such points) in a three-dimensional grid with three axes, π‘₯, 𝑦, and 𝑧.  A line connecting two points in this grid could be described by an interval π‘ ² = ∆π‘₯² + ∆𝑦² + ∆𝑧², where the "∆π‘₯" notation means "the difference in position between the two points in relation to the π‘₯-axis." Time was thought to be independent of space, a separate concept. We would speak about events occuring at different Cartesian coordinates simultaneously, without a lot of thought about what that implied. Einstein realized that there are no instantaneous effects across distance, the speed of propagation of effects being limited to the speed of light. Accordingly, it became clear that only events had physical reality, the time and the location of the event varying (mathematically, not as opinion) by observer frame of reference.

By 1895, Henri PoincarΓ© commented that the recent results (1887) of the Michelson-Morley experiment, which failed to show any variation in the speed of light with respect to the translational velocity of the Earth, implied a principle of relativity which prevented a moving observer from detecting any difference in the laws of physics compared with another observer at rest (there are a number of qualifications here, but we will leave it in a simple form).  You might have expected, contrarily, that if space was a substance, an aether through which light travelled, like an ocean wave through water, that it might travel a bit slower going upstream in a river as it were, or in the case of the Earth moving in its orbit around the Sun, light might propagate a little slower moving against the direction of motion of the Earth.

In 1904 Hendrik Lorentz summed up his recent work including PoincarΓ©'s contributions, on transforms from one frame of reference to another, consistent with the Maxwell electromagnetic equations implying the constancy of the speed of light in all inertial systems. He proposed the Lorentz transformation still used today, time dilation and contraction of bodies along the direction of motion. Interestingly, the contraction concept was originally introduced by Oliver Heaviside (you can find a copy of this work from The Electrician, 1888, on pg 511 of the Heaviside Electrical Papers, Vol. II, published 1894). Heaviside had analyzed the movement of a charged spherical conductor and found that the charge distribution could only remain static only if the sphere shortened in the direction of motion, becoming an oblate spheroid by a factor  (1 −𝑣²⁄𝑐²)¹⁄² .

For our context, we are interested in the fact that these new ideas required our old view of a separate three-dimensional space and one-dimensional time be replaced by a four-dimensional space-time continuum, which Einstein presented in a unified way in his 1905 papers. Our three-dimensional coordinate equation above becomes instead an invariant space-time interval 𝑑𝑠² = 𝑐²π‘‘𝑑² - 𝑑π‘₯² - 𝑑𝑦² - 𝑑𝑧², connecting points in a space-time coordinate system (we replaced the ∆π‘₯² notation with 𝑑π‘₯², which means about the same thing, a difference, albeit infinitesimal, between two points). Though this space-time interval is measured to be the same by all observers, moving clocks tick more slowly and objects shrink in the direction of their motion, i.e., as we alluded to previously, different observers might not agree about time and location of events, but they can all agree on the space-time interval. The Lorentz transformation permits, e.g., an observer at rest to calculate the time experienced on a moving object. For example, the proper time 𝜏 on the moving object, say a rocket headed away from the Earth (say along the π‘₯-axis) would be π‘‘πœ = 𝑑𝑑 ∕𝛾, where 𝛾 = 𝟷  ∕ (𝟷 −  π›½² ) and  π›½ = 𝑣 ∕𝑐 (the velocity we observe for the rocket, divided by the speed of light).

𝑑𝑠² = 𝑐²π‘‘𝑑² - 𝑑π‘₯² - 𝑑𝑦² - 𝑑𝑧²  = (𝑐𝑑𝑑 )² [𝟷 −  π›½² ]  =  (𝑐𝑑𝑑  ∕ 𝛾)²   = (π‘π‘‘πœ)²

That is, we observe time in the moving clock frame as 𝑑  = π›Ύπœ, their clock tick intervals appear longer than ours by a factor 𝛾, i.e., their clock appears to be running slowly in comparison with our clock at rest. Though we may not agree on clock times or the lengths of objects, we all calculate 𝑑𝑠² to be the same number, just as we may rotate three-dimensional vectors in Euclidian space without changing their length.

The time-space interval example above used the position (or position-time) four-vector, π‘₯ᡘ  = {π‘₯⁰, π‘₯¹ ,π‘₯², π‘₯³}where the first component is time (multiplied by the speed of light), 𝑐𝑑, and the remaining three variables are the usual Cartesian π‘₯,𝑦,𝑧 axis coordinates (numbered 𝟷,2, 3 superscript to indicate a contravariant vector). We wanted to look at another type of four-vector though.  Above we mentioned the energy-momentum four-vectors that describe the three mass states that comprise a propagating neutrino particle. They look like π‘α΅˜  = {𝑝⁰, 𝑝¹, 𝑝², 𝑝³}. The 𝑝⁰ component is now 𝐸, the relativistic energy and the remaining three components are the momenta on the π‘₯,𝑦,𝑧 axes. What we wanted to note was that the neutrino mass states, 𝜈₁,𝜈₂, and 𝜈₃, each propagate as an energy-momentum four-vector, together initially, but because their relative masses differ slightly they travel at slightly different velocities and, amazingly, are believed to separate after a sufficient distance.

We may simplify the analysis by considering only two of the four-momenta (we are not concerned with relativistic frames of reference here, so the 𝛾 factor will be omitted), described by the relativistic energy relation, 𝐸 =  (𝑝² + π‘š²)¹⁄² (the square root of the squared momentum and mass). 𝐸 is one of the 𝐸₁ and 𝐸₂ and the rest mass π‘š is one of π‘š₁ and π‘š₂ in turn. Using the binomial expansion that can be reduced to 𝐸ⱼₖ =  π‘β±Όβ‚– + π‘šβ±Όβ‚–² ∕ 2𝑝ⱼₖ for each 𝐸ⱼₖ and π‘šβ±Όβ‚–.

The difference between any two mass state energies becomes π›₯π‘š² ∕ 2𝑝 (𝑝 here is half the sum of the two momenta, 𝑝 =  (𝑝ⱼ  + 𝑝ₖ )/2) and the relative velocity difference then π›₯𝘷 = π›₯π‘š² ∕ 2𝑝² or  π›₯𝘷 = π›₯π‘š² ∕ 2𝐸², 𝑝 and 𝐸 being very close for the highly relativistic neutrino (it propagates at very near the speed of light). If the size of the neutrino propagating mass states are roughly 𝜎 (the length of a packet) then the distance at which the mass states separate is 𝐿 = 𝜎 ∕ π›₯𝘷. We estimate that neutrinos arriving from a supernova at the center of our Milky Way galaxy might arrive with their mass components separated by up to 41 meters, a detectable difference of about 137 ns (billionths of a second) apart. As far as we know though, none of the current supernova detection experiments are set up to detect separated packets.

Resuming our original thread, the neutrino has mass, therefore it cannot travel at the speed of light, by Einstein's equation for relativistic energy, writing in a form with the rest mass and 𝛾 factor,  πΈ = π›Ύπ‘šπ‘²  = π‘šπ‘² ∕ (1  − π‘£² ∕𝑐²)¹⁄².

You see in that equation that if v, the velocity of the neutrino, were to equal the speed of light, c, in the denominator, the v2 divided by c2 would equal 1 (since a number divided by itself is 1), and since that is subtracted from 1 beneath the radical, the result of the subtraction will try to go to zero. The denominator of a fraction is not allowed to be zero because that operation is not defined. a/b = c implies a = bc and there is no number c that could be multiplied by zero to get a non-zero number a. 

However, it you graph y = 1/x as x approaches zero (becomes very small in absolute value) from negative infinity (the left, e.g., -3, -2, -1, -0.9, ....-0.000001...) and as x approaches zero from the right or positive infinity (e.g., 3, 2, 1, 0.9, 0.00001...) y goes to either negative or positive infinity (the red line in the graph heads straight up to infinity or straight down to infinity as it nears the y axis):


So that tells you that E, the energy of a relativistic particle (or any particle with mass), would go to infinity as the particle approached the speed of light. Since there isn't infinite energy available (at least not since the moment of Creation at the Big Bang), particles with mass are not allowed (by the laws of this universe) to reach the speed of light (the neutrinos are pretty close though, but have a very tiny mass). If a particle travels at the speed of light, it cannot change because time for the particle does not exist (a change is an event in time that occurs when something passes in time from one state to another).

Light, on the other hand, is propagated by photon particles, which have no mass and travel only at the speed of light. So the photons from the Big Bang moment of Creation have not changed in the intervening billions of years separating us from the Big Bang? Well, space has expanded under their feet as it were. The photons we detect today as CMB (cosmic microwave background) were emitted at Recombination, about 380,000 years after the Big Bang, when hydrogen and helium atoms are formed, taking up most of the free electrons, making it possible for photons to free stream without many collisions at an equivalent temperature of about 4000 K, with a wavelength of around 3.60 millionths of a meter. When they are detected today, because the Universe has been expanding over the intervening billions of years, they have been stretched out to a wavelength of about 5279 millionths of a meter, a frequency of about 57 GHz (your cell phone frequency is about 1.9 GHz and microwaves lie between 0.1 to 1000 GHz, hence the term cosmic "microwave" background).

Aside from the stretching they are beyond time as it were. Recall from our earlier discussion that we observe time in a moving clock frame as 𝑑  = π›Ύπœ, clock tick intervals on a moving object lengthening by a factor 𝛾, where  π›Ύ = 1∕ (1  − π‘£² ∕𝑐²)¹⁄².

You can see we get the same problem of the fraction as a whole going to infinity as the velocity equals the speed of light (and photons, having no mass, always travel at the speed of light in vacuum), which you may interpret as time being frozen more or less for the thing travelling at the speed of light (if it takes infinity to reach the next clock tick time has stopped).

GPS satelllites move at 14,000 km/hr and have to correct for relativistic time dilation of 7 ΞΌs/day (slower satellite clock). (They also have to correct for the General Relativity opposing effect of the gravitational redshift from the Earth's gravitational field making clocks back on the Earth's surface relatively slower than the satellite clock, i.e., clocks in a "gravitational well" run slower.)

If we are able to send people to nearby star systems someday and reach significant percentages of the speed of light, the travellers (astronauts) will find that people back on Earth have aged more than they have. For example, if they travel 10 light years (round trip and neglect the year or more accelerating at both ends) at 80% of the speed of light they will age 7.5 years and their friends and family back on Earth will have aged 12.5 years (at 0.8 speed of light they would cover 10 light years in 12.5 years and their clocks are at 0.6 of "normal" so they would age only 7.5 years).

I have glossed over the idea of a quantity going to infinity, proposing that once we see a quantity headed in that direction we can safely envision a progression conceptually reaching infinity, i.e., one foot placed after the other in a never-ending march, counting each step (as I suggested above when pointing to the graph of 1/x heading up or down to infinity since we could see it was "headed that way").

We assume that we have always had the idea of adding more things to increase the number of things in hand. I've got one apple and if you give me another, why then of course I have two then. In fact though it takes more than two years for human children to grasp that the difference between "one thing" and "more than one thing" can be more abstractly understood as the successor function which generates all of the numbers with which we count, i.e., the natural numbers (1, 2, 3...some include 0). A child can proudly perform the counting script they have been taught, naming, say, one toy fish, two toy fish, three and so on. However, typically the 2.5 year old child who has just "counted" the toys in that way will hand you one fish if asked for one, but give you an arbitrary handful if asked for any number other than one!

After additional months of experience the child slowly, in a stepwise fashion, learns to understand "two" then "three." Sometime after this comes the great leap forward, where the child grasps implicitly the induction definition of natural numbers, i.e., that each word in the counting routine actually defines how many things you are considering and that each successive count adds one to the number of things (in your set) and that this can be continued indefinitely, with no upper bound (see Evolutionary and developmental foundations of human knowledge, by Marc Hauser and Elizabeth Spelke).

Although a chimpanzee can laboriously learn to associate a number symbol with a particular number of objects, they never (at least not after 20 years of training on one particular subject) progress to the understanding of the successor function, i.e., chimps cannot learn that a new number symbol means that one has been added to the previous set of items. It appears though (from research done by Spelke and others) that humans and some non-human primates both draw on a core neurophysiological basis for (1) representing the approximate cardinal values (about how many items are present) of large groups of objects or events and (2) representing the exact number of object sets or events when there are only a small number of individual units.

It appears that the uniquely human capability to construct the natural numbers (i.e., use the successor function) relies first on the core perception of one versus many, then mapping other number words to larger numerosities, then noticing that the progression in the language (the words representing numbers) of the counting routine corresponds to increasing the cardinal value of the set, the number of units in hand. This (and other research) suggests that natural language ability is involved in the human leap from those core perceptions shared by some non-human species to the natural number concepts unique to humans.

There has been some controversy about extending the concept of infinity, at least in the context of mathematics, namely, the Brouwer-Hilbert controversy about the foundations of mathematics at the beginning of the twentieth century.

L.E.J. Brouwer did not believe that the rules of classical logic laid out by Aristotle have an absolute validity independent of the subject matter to which they are applied. For example, Aristotle defined the Law of the Excluded Middle, which reasonably from our experience in life states that any proposition is either true or it is not true, e.g., Socrates is either a mortal or he is not a mortal, he cannot be something in between the two.

The claim of formal logic is that this law (of the Excluded Middle) applies simply because it is an accepted rule of logic, not because we have seen examples which permit us to infer that it is true in a specific case (e.g., the case of whether Socrates is mortal or not). Brouwer objected to making such an automatic claim via logic when offering a formal proof in mathematics. Brouwer wanted to see a proof that constructed specific examples (actual mathematical entities) rather than simply claiming one or the other of two contradictions must necessarily be true.

This may seem like rather abstract contentions among mathematicians, but if you go with Brouwer (and his intuitionist stance) then you are not allowed to extend presumptions to the infinite (which would cramp our style in the discussions earlier). For example, the induction axiom of mathematics states that if a mathematical proposition P(n) is true for n = 0, and if, for all natural numbers n, P(n) being true implies that P(n + 1) is true also, then P(n) is true for all natural number n. You will recognize our successor function from our earlier discussion. The so-called "animal instinct" here is that it must be true since you can conceive of marching forever, one foot placed after another in a never ending march, thereby defining infinity.

The alternative notion would be Georg Cantor's aleph-null, a completed infinity all at once without laying out the steps leading there. Well, strictly speaking aleph-null or aleph-naught represents any countable infinite set, for example, the natural numbers N. The real numbers, R are also infinite, but not countable. Cantor developed his famous diagonal argument to prove that R, the set of real numbers was not countable, though it was infinite.

Cantor's diagonal argument for showing a set is uncountable goes like this: Enumerate (list) all of the members of the set T of infinite sequences of binary digits (ones or zeros). No matter how you list them there will always be a member of the set that you miss, because you can draw a diagonal slash from left top corner to right bottom infinity corner, pull out the string of digits selected by your slash, then complement each of the digits you obtained, i.e., if there is a "1" replace it by a "0" and if a "0" replace by "1." The sequence you end up with cannot have been in the list because it differs from every string in the list by the nth digit:


In the above example the diagonal slash pulls the red digits 01000101100... and complements each of those to get s = 10111010011... You can see that s cannot have been in the list because you have made it differ by one digit in each listed sequence by complementing the slashed sequence. Therefore it is impossible to count, i.e., enumerate or list all of the numbers (each sequence represents a number in the set) in the set because every time you complete your list, a new unique number pops up in the diagonal slash!

David Hilbert designed a formal definition of mathematics where no intuitive notion about "reality" or actual examples or objects was necessary, but rather just rigorous definitions of symbols and the operations you could apply to them. Hilbert believed you could find a rote procedure for manipulating the symbols of his formal mathematics such that you could decide automatically whether a particular theorem expressed in his symbols was consistent, in effect putting all mathematicians out of work. This would make use of the Law of the Excluded Middle also, by assuming that such an automatic proof machine could decide if any arbitrary string of symbols was a correct theorem or was not a correct theorem (either it was or it was not, proof by contradiction accepted).

In 1900 Hilbert presented a number of questions to the international congress of mathematicians. Questions one and two were (1) was the system of mathematics he offered complete and (2) was it consistent,

A mathematical proof system, a set of axioms, is complete if any statement within its formal language may be proven or its negation proven using only the axioms. Such a system is consistent if it is impossible to construct a valid argument that is inconsistent, i.e., impossible to construct a statement from its axioms which is both true and false. Questions 1 and 2 were answered by Kurt Godel in 1930, proving that undecidable propositions may be constructed in any minimum arithmetic system).

The third question, was the system of mathematics decidable (the so-called Entscheidungsproblem) was answered shortly thereafter by Alan Turing and independently by Alonzo Church. Turing created the concept of an automatic computation machine and proved that there cannot be a general process for determining whether a given formula of mathematics in the symbolic logic of the system is provable within the system. Turing's mental concept used in the proof was rapidly developed into physical digital computers that we use today.

It remains a bizarre paradox that Turing's work, which implied that mathematics really required a mind, something not a machine, was soon used to "support" the premise that the human mind is a kind of computer. John von Neumann, by some accounts the most intelligent human who ever lived (where intelligence means the capacity to do the things measured on IQ tests, e.g., use memory and manipulate symbols, concepts, not the same thing as wisdom), helped design several of the initial digital electronic computers in the 1940's. He left notes for an incomplete book setting out his thoughts about human brains and computers.

Neumann thought of the computer, whether analog representing numbers by variable physical quantities like voltage produced by electronic circuits representing equations or by the presence of absence of a marker (digital) producing an input stream of pulses and operating on them to produce an output stream of pulses, as devices that performed arithmetic operations on numerical data under the control of logic. Oddly, von Neumann, who was well aware of the distinction between manipulation of symbols (as we mentioned regarding Hilbert and Brouwer above) and the interpretation of those symbols by a human, tacitly assumed that computers manipulated numbers, rather than symbols. Neumann assumed that brains compute (becoming part of the philosophy of mind), but offered no justification for that assertion.

Computers are designed by humans to manipulate symbols which are subsequently interpreted by humans, but it does not appear (to me) that brains perform arithmetical operations on numerical data. David Berlinski offers the analogy that some people are able to accept without consideration the thesis that the human mind is like a computer but would balk at the suggestion that the human mind is like an abacus, though the fact is that there is no difference fundamentally between an abacus and a Turing machine or the digital computers which were developed from Turing's conception. They are all mechanical devices which when manipulated by humans produce symbolic output of use when interpreted by a human. However, as physicist Lee Smolin (a theoretical physicist with contributions in the field of quantum gravity) has observed, neuroscience "is a field that is as bedeviled by outdated metaphysical baggage as physics is. In particular, the antiquated idea that any physical system that responds to and processes information is isomorphic to a digital programmable computer is holding back progress."

That is a good transition back to our original thread, the discussion of the pairs of opposites in the temporal versus the eternal (since perhaps the most fundamental dualism is the Light vs the Darkness speaking in spiritual terms). I suppose some might propose that the middle is not really excluded, i.e., that things are not really one state or another (particularly at this moment in history).





Tuesday, June 13, 2017

Natural Language Processing

I have been studying natural language processing lately (otherwise known as computational linguistics). I began with NLTK (Natural Language Toolkit), an open source natural language processing tool kit. This is a superb guide to practical computational linguistics featuring a free comprehensive textbook (which is frequently used for a single semester course in natural language processing at advanced undergraduate or postgraduate level) and software package running in a Python environment on Windows or Linux.The field covers a wide range, but an example readily available to many people these days is the process by which your smart phone accepts vocal commands from you. This involves segmenting the phonemes (the individual pieces of spoken words, nominally involving a consonant and a vowel), putting breaks in the incoming stream of language sound you make and then attempting to match those with words from a lexicon (large list of possible words).
This is no easy task, but it is followed by the even more challenging pursuit of meaning, attempting to map what you have spoken to actions the phone can take, including the object of such an action. For example, if you commanded your phone "search for Mexican restaurants in Las Cruces" the phone would look for a command in that string of sounds, a command it recognizes. If it successfully recognized "search for" then it would branch in its processing logic to objects of such a command, i.e., what you want to search for.

This would require tagging each word in the utterance (what you just said to the phone) to identify the command and its object(s). The phone would have to recognize that "(Mexican) restaurants" is the search object.

Here is a look at the result of a natural language processor tagging the text string of the utterance we are discussing (we will ignore the details of how the sounds you made became this text stream):

>>> grammar = nltk.data.load('grammars/large_grammars/atis.cfg')
>>> parser = nltk.parse.EarleyChartParser(grammar)
>>> text = nltk.word_tokenize("Look for Mexican restaurants in Las Cruces.")
>>> nltk.pos_tag(text)
[('Look', 'NN'), ('for', 'IN'), ('Mexican', 'JJ'), ('restaurants', 'NNS'), ('in', 'IN'), ('Las', 'NNP'), ('Cruces', 'NNP'), ('.', '.')]

Notice how each word in the utterance (what you said to the phone) has now been tagged with a part of speech label (which we refer to as simply "tag").  'IN' means "preposition."  'NN' means "singular noun," 'NNS' means 'plural noun,' and 'NNP' means 'proper noun' (typically the name of a person or place). These grammatical tags are taken primarily from the Brown Corpus, a landmark publication by Brown University in 1964, featuring over a million words of running text or edited prose published in the United States in 1961.

Before I ran the parser on our target utterance I had to give it a grammar (you can see that I loaded the atis.cfg grammer in the Python IDLE session above (Python is a computer programming language frequently used in science; IDLE is an integrated development environment, i.e., a windowed application that makes it easier to write and test code). The ATIS grammar, developed by Microsoft Research, was extracted from a treebank of the DARPA ATIS3 training sentences. Sentences are typically parsed into treelike structures. Well, I will see if a picture is worth a thousand words here and show you a tree parse diagram of the sentence we are working with (from a parse done later to correct mislabelling of the verb):

It does appear somewhat like an upside down tree, where the tree's root is at the top and its branches become developed as it proceeds down the page, the inverse of an oak tree rooted at the ground and branching above. A treebank (in the context of computational linguistics) is a database of such syntactic or parse trees. Such a treebank can be analyzed to discover typical patterns of syntax, i.e., the way the different parts of speech are normally organized in sentences of a particular language. For example, English sentences typically have the subject first (going left to right) and it usually is a noun or noun phrase. The predicate, the part to the right of the subject typically, is formed around a verb. We form sentences without having to think much about it, having brains that are evolved to learn and process language (I will agree with Noam Chomsky on this and may say more about it later), but it is difficult to program a machine to do this. One of the ways to construct a computer program that will parse sentences is to analyze a treebank and produce rules of grammar that describe the frequent patterns in the treebank (like subject/NN-->predicate/VP).

A context free grammar (CFG) is often used to formally present the rules of grammar in a form a computer can process. For example, S --> NP VP, which tells us that the symbol 'S' on the left, symbolizing 'sentence' can be produced by a noun phrase (NP) followed by a verb phrase (VP). There are many different ways to form sentences (understatement). In fact, that is one of the things that distinguishes human speech from animal communications (well, it used to), i.e., that each utterance is potentially unique, never previously said, created by putting together the blocks of language by the rules of grammar to accomplish the communication of a potentially novel thought. So you really want a computer to help grind through huge treebanks of sentences labelled with their parts of speech (POS) tags and generate grammar rules as much as possible (since the rules will be lengthy, i.e., many lines of the kind of production rule I just showed you above).

DARPA, the Defense Advanced Research Projects Agency (of the United States government), has done linguistics research among other things.  For example, they created the TCP/IP protocol that we use to communicate over the Internet---that protocol was designed to assure an email got to its destination even if a city or two was destroyed by a nuclear attack, TCP/IP being able to try different routes if a particular city disappears). They have also been working on true artificial intelligence (not the chicanery promoted as AI by many software folks and companies, which I won't name since I am blogging on their platform), but they abruptly went "black" on the subject after 2012, now only presenting this effort as using mammalian brain structural hints to create advanced computer chips. Their actual intent is to create true mammalian brain intelligence, which I will prove by reproducing one of their press images from 2012 (which seems to have been removed) describing the SyNAPSE project (to alarm those of you who have watched the Terminator movie series):


DARPA was interested in machine reading and other computational linguistics subjects and produced the ATIS3 training sentences which Microsoft used to produce the ATIS grammar that I gave to the Earley parser I used to analyze the "look for Mexican restaurants in Las Cruces" sentence above. The Earley parser is a chart parser that uses a set of grammar rules (as just discussed) in a dynamic programming environment, trying to predict which of the grammar rules to use next as it moves from left to right across a sentence trying to match up rules with the words and POS tags it encounters. It is important to predict which rule to use next because to simply scan through the entire CFG grammar file for each word of each sentence might take a prohibitively long time. The ATIS grammar I used above has about 5,235 lines (rules).

Well, some of you who have persisted in the grueling task of reading my entire post may be wondering if I noticed that the Earley parser mislabelled the verb 'look' in the sentence. Yes, I did. So I had to obtain a more robust computational package (I am sure I could have gotten better results with NLTK had I spent more time teaching classifiers, but I was in a hurry), my simple sentence being a somewhat unfair target, being a command to a machine and missing a subject (that being understood by most humans to be 'you,' i.e., the person or thing being commanded).

I got hold of a language processing pipeline from the Natural Language Processing (NLP) group at Stanford University and ran their coreNLP pipeline as a local server, using http post to request parsing of the target sentence from my IDLE Python console (assisted in that http post process by use of a nice Python package called Requests, advertised as 'the only non-GMO HTTP library for Python, safe for human consumption' by its ingenious author, Kenneth Reitz, and some interface Python code written by a postgrad AI student at Berkeley, Smitha Milli). The Stanford NLP software is industrial strength but did churn for a minute or two to produce a correct parse:

c:\stanfordcnlp>java -cp "c:\stanfordcnlp\*" -Xmx1500m edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 60000 -annotators tokenize, ssplit,pos,depparse,parse
...
[main] INFO CoreNLP - Starting server...
[main] INFO CoreNLP - StanfordCoreNLPServer listening at /0:0:0:0:0:0:0:0:9000

Then I started a Python IDLE session and requested service from the Stanford server locally:
 
ActivePython 2.7.10.12 (ActiveState Software Inc.) based on
Python 2.7.10 (default, Aug 21 2015, 12:07:58) [MSC v.1500 64 bit (AMD64)] on win32
...
>>> from pycorenlp import StanfordCoreNLP
>>> nlp = StanfordCoreNLP('http://localhost:9000')
>>> text = ('Look for Mexican restaurants in Las Cruces.')
>>> properties = {'annotators': 'tokenize,ssplit,pos,depparse,parse', 'outputFormat': 'json'}
>>> output = nlp.annotate(text, properties)

...and the server response was:

>>> print(output['sentences'][0]['parse'])
(ROOT
  (S
    (VP (VB Look)
      (PP (IN for)
        (NP
          (NP (JJ Mexican) (NNS restaurants))
          (PP (IN in)
            (NP (NNP Las) (NNP Cruces))))))
    (. .)))
>>>


So, we got the proper tagging and parse of our sentence. I wanted to see a tree visual of this so I laboriously manually entered into NLTK the CoNLL2000 IOB tag lines corresponding to the parse from the Stanford NLP parse:

>>> chunkTest = """
look VP B-VP
for IN B-PP
restaurants NNS B-NP
Mexican JJ I-NP
in IN B-PP
Las NNP B-NP
Cruces NNP I-NP
. . O
"""
>>> nltk.chunk.conllstr2tree(chunkTest, chunk_types=['VP', 'NP', 'PP']).draw()


...and obtained the following visual presentation of the Stanford parse:




CoNLL2000 was the 2000 Conference on Computational Natural Language Learning (CoNLL-2000). Chunking captures larger pieces of a sentence, grouping POS tagged words into chunks like VP (verb phrases), NP (noun phrases) and PP (prepositional phrases). The data file format they used was IOB, which you can see above were each line of a sentence with a word, a POS tag and an IOB chunk tag specifying 'B' for beginning of a chunk, 'I' for 'in a chunk', and 'O' for 'out of a chunk, i.e., not a recognized chunk type.' 

I had better close this post, since I am getting some strange edit behavior and may be exceeding the size limits here. Stay tuned though---I intended to talk more about what is is machines are doing when they process language.

 










Saturday, November 26, 2016

A directed graph representation of a rank 3 sudoku

Sudoku is a single-player game where the player attempts to choose entries from {1,2,3,4,5,6,7,8,9} to complete a partial assignment on a 9 x 9 matrix (rows and columns like a chess board or checkerboard). None of those 9 numbers (digits) may appear twice in any row, column or any of the nine "blocks" (nine 3 x 3 submatrices on that 9 x 9 row x column board). It should be clear that each of the nine numbers must appear once in every row, column and box (since there are nine cells in each and no number may appear twice in any of those subsets).

The Sudoku board can be interpreted mathematically as a graph: The graph will have 81 vertices with each vertex corresponding to one of the 81 squares (or cells) on the Sudoku 9 x 9 grid. Solving the Sudoku puzzle then amounts to a graph coloring problem, where the term "color" has a general theoretical meaning in graph theory, but does originate in early work done with the practical motivation of determining the minimum number of colors required to distinguish the countries sharing a border on a map. The "colors" in the case of Sudoku amount to the 9 digits that have to be correctly assigned to the cells of the Sudoku board given a partial assignment with a minimum of 17 cells filled in (that is a complex mathematical theoretical problem, the MNC problem, i.e., proving that a minimum of 17 cells must be filled in if you are providing a Sudoku game problem with only a single solution rather than several that might work). If you have not played Sudoku (I find puzzles annoying but enjoy researching why they are annoying), here is what a game might look like:

This is a very difficult Sudoku puzzle, the Will Shortz Puzzle No. 301. Just to illustrate what I am talking about, here is the solution to that puzzle (spoiler alert if you were going to try to solve the puzzle first):


Returning to the graph discussion, each vertex is then one of the 81 cells in the 9 x 9 Sudoku. The connections between these vertices are called edges. The rules of the game I gave earlier are used to define the edge connections: (1) any vertices (cells) in the same column are connected with an edge (2) any of the vertices (cells) in the same row are connected with an edge and (3) any of the cells in one of the 9 three by three boxes (you can more or less see them above in the bold lines overlaying the lighter grid) are connected with an edge. There are 810 edges connecting the vertices (cells) by these rules. This is a regular graph, i.e.,the degree of every vertex is the same. That is, the  total number of edges connected to each vertex (cell) is the same and is in fact 20. There is a mathematical equation to give that number for similar graphs of various ranks (the rank of the 9 x 9 Sudoku is 3; the number of rows or columns is therefore n x n or 9): 3n(squared) - 2n - 1. So for n = 3, the degree of each vertex is 3 squared = 9 x 3 = 27 - 2 x 3 = 6 - 1 = 27 - 6 - 1 = 20 (pardon me for not using markup language to make the mathematical notation pretty; it is late as I write and I do not want to force a MathJax download on visitors anyway). Since each edge connects two vertices, the total number of edges is then (81 vertices / 2 ) x (20 edges per vertex) = 810. The coloring problem then becomes how to assign a digit from a selection of 1 - 9 to each vertex such that no two adjacent vertices (two vertices are adjacent if they share a connecting edge, the mathematical equivalent of two cells being in the same row, column or 3 x 3 box) have the same digit.

In any case, I finally reach the purpose of this discussion, which is to share my first computer generated drawing of the vertices and edge connections of an empty Sudoku (that is, none have been assigned digits since the labels would further clutter the already dense graph). The vertices are around the perimeter of the circular graph (they are colored red, in the human sense of color, and they are much too large, but this was my first plot) and they are connected by the spider web of edges as defined above (I hope you enjoy it as much as I apparently do). You can click on the picture below to see the full size picture of the graph:



Saturday, November 12, 2016

All this time and still hearts of darkness

Around 1991 Gordon Sumner (aka Sting) wrote a song, "All This Time," about the impermanence of the things of men in relation to nature. Talking about an old town in Britain, Sumner sings:

The teachers told us, the Romans built this place:
They built a wall and a temple, an edge of the empire garrison town,
They lived and they died, they prayed to their gods, but the stone gods did not make a sound...
And their empire crumbled, 'til all that was left were the stones the workmen found
...And all this time [centuries] the river flowed in the falling light of a northern sun

The dual message of the song was that there is no meaning to life and no eternal being(s) or metaphysical basis for existence. Sumner claims that he was actually writing about the death of his own father, but he has said elsewhere that he is agnostic and believes that religious faith is dangerous. In the song he quotes from the New Testament (adding a sarcastic but amusing paraphrase) then sees "the old man [God] laughing," earlier he mocks the appearance of Christian priests then asserts that he would like to "bury the old man [God and belief in God] at sea," and asks "Father [God], if Jesus exists, how come he never lived [or lives] here?" Roman historian Tacitus writing c. 117 AD in book XV chapter 44 of his Annals recorded that during the reign of Tiberius 14 – 37 AD, the Roman procurator of Judaea, Pontius Pilatus, had executed "Christus." Jesus, the Latinized Greek version of the common Hebrew name, Yeshua or Joshua, was declared by his followers to be the expected messiah, the Greek translation for which is khristos, i.e., Latin Christus. So whatever else you may believe, you may be certain Jesus did live there at any rate. 

It should be noted that Tacitus was no supporter of Christianity and only mentioned this incidentally to reporting that the emperor Nero was widely suspected of having ordered the burning of Rome July 18, 64 AD and therefore found it necessary to fix the blame for the fire on someone else, so chose the Christians. Tacitus added that the Christians were already hated for their "abominations" and "hatred against mankind" and that though Pontius Pilatus had temporarily checked "a most mischievous superstition" (by executing Christus) it had "again broke out not only in Judaea, the first source of the evil, but even in Rome, where all things hideous and shameful from every part of the world find their centre and become popular."

Civilizations are indeed transitory though, as is human existence in this world. Rome had existed as a republic, with elected officials for about 500 years before internal conflicts and civil strife resulted in Julius Caesar being appointed perpetual dictator in 44 BC. He was followed by a succession of mostly evil absolute rulers (emperors) until the fall of the empire in 476 AD.

The Roman empire crumbled from within, the expense of constant war and general profligate spending having broken the financial health of the country and created a huge gap between the rich and the poor. The government had become completely corrupt, the Roman Senate incompetent and powerless and the   thousands of soldiers comprising the personal body guard of the emperor (the Praetorian Guard; before the end of the Roman Republic it had been illegal for military units to operate within the city) began to instead select the emperor themselves, often auctioning off the post to the highest bidder and hastening the replacement process by murdering the emperor.

The Roman people naturally lost trust in their government. The once invincible Roman military forces that had expanded the boundaries of the empire, projecting power into every area of the ancient world and making possible profitable commerce while keeping the barbarian armies at bay began to be made up of foreign troops without any real loyalty to Rome. Large foreign migrations overwhelmed the empire. By 476 AD Rome abdicated to the Germanic warlord Odoacer and that was the end (the fact that every citizen presumably had the right to bear arms did not seem to protect them from invasion by a large professional army).

I happened to read Julius Caesar's commentary on The Gallic Wars recently. Caesar was a brilliant military commander (who, as we mentioned earlier, eventually became dictator of Rome, promoted by a grateful and hopeful people) who brought most of Gaul, present day Europe south of the Rhine, under control 58 – 50 BC.

After Caesar's commentaries I finally got around to reading Joseph Conrad's 1899 novella, Heart of Darkness (I had been intending to read this since I saw Francis Ford Coppola's adaptation of the story in his 1979 film, Apocalypse Now). With synchronicity, Conrad's narrator in the story, Marlow, began talking of when the Romans had first arrived in Britain some nineteen hundred years earlier. In his commentaries Julius Caesar had written an engaging account of his invasion of Britain 55 and 54 BC. Marlow imagines the experience of the Roman legionaries at "the very end of the world, a sea the colour of lead, a sky the colour of smoke...going up this river [the Thames]...sand-banks, marshes, forests, savages,---precious little to eat for a civilized man...Here and there a military camp lost in a wilderness...death skulking in the air, in the water, in the bush...They were men to face the darkness...They were no colonists...they were conquerors, and for that you want only brute force...your strength is just an accident arising from the weakness of others. They grabbed what they could get for the sake of what was to be got. It was just robbery with violence, aggravated murder on a great scale, and men going at it blind—as is very proper for those who tackle a darkness."

Caesar had decided to proceed into Britain because he discovered that in most of the wars of Rome with Gaul the peoples of Britain had helped the Gauls with supplies and other support. In his commentaries Caesar described the Britains: "Most of the inland inhabitants do not sow corn, but live on milk and flesh, and are clad with skins. All the Britains, indeed, dye themselves with wood, which occasions a bluish color, and thereby have a more terrible appearance in fight. They wear their hair long, and have every part of their body shaved except their head and upper lip." He goes on to describe the difficulty in fording the river Thames and the Brits defense of the banks by "sharp stakes fixed in front, and stakes of the same kind fixed under the water covered by the river." Caesar pursues the local forces, who are concealed "in intricate and woody places." He remarks that "the Britons, when they have fortified the intricate woods, in which they are wont to assemble for the purpose of avoiding the incursion of an enemy, with an entrenchment and a rampart, call them a town." 

Returning to Heart of Darkness, Marlow, talking to his shipmates aboard a vessel anchored on the Thames, begins to tell them about a trip he made up the Congo River into the "heart of Africa." 

Going up that river was like traveling back to the earliest beginnings of the world, when vegetation rioted on the earth and the big trees were kings. An empty stream, a great silence, an impenetrable forest. The air was warm, thick, heavy, sluggish. There was no joy in the brilliance of sunshine. The long stretches of the waterway ran on, deserted, into the gloom of overshadowed distances. On silvery sandbanks hippos and alligators sunned themselves side by side... There were moments when one’s past came back to one, as it will sometimes when you have not a moment to spare for yourself; but it came in the shape of an unrestful and noisy dream, remembered with wonder amongst the overwhelming realities of this strange world of plants, and water, and silence. And this stillness of life did not in the least resemble a peace. It was the stillness of an implacable force brooding over an inscrutable intention. It looked at you with a vengeful aspect...

The reaches opened before us and closed behind, as if the forest had stepped leisurely across the water to bar the way for our return. We penetrated deeper and deeper into the heart of darkness. It was very quiet there. At night sometimes the roll of drums behind the curtain of trees would run up the river and remain sustained faintly, as if hovering in the air high over our heads, till the first break of day. Whether it meant war, peace, or prayer we could not tell. ...

We were wanderers on a prehistoric earth, on an earth that wore the aspect of an unknown planet. We could have fancied ourselves the first of men taking possession of an accursed inheritance, to be subdued at the cost of profound anguish and of excessive toil. But suddenly, as we struggled round a bend, there would be a glimpse of rush walls, of peaked grassroofs, a burst of yells, a whirl of black limbs, a mass of hands clapping of feet stamping, of bodies swaying, of eyes rolling, under the droop of heavy and motionless foliage. The steamer toiled along slowly on the edge of a black and incomprehensible frenzy. The prehistoric man was cursing us, praying to us, welcoming us—who could tell? We were cut off from the comprehension of our surroundings; we glided past like phantoms, wondering and secretly appalled, as sane men would be before an enthusiastic outbreak in a madhouse. We could not understand because we were too far and could not remember because we were travelling in the night of first ages, of those ages that are gone, leaving hardly a sign—and no memories....

The earth seemed unearthly. We are accustomed to look upon the shackled form of a conquered monster, but there—there you could look at a thing monstrous and free. It was unearthly, and the men were—No, they were not inhuman. Well, you know, that was the worst of it—this suspicion of their not being inhuman. It would come slowly to one. They howled and leaped, and spun, and made horrid faces; but what thrilled you was just the thought of their humanity—like yours—the thought of your remote kinship with this wild and passionate uproar. Ugly. Yes, it was ugly enough; but if you were man enough you would admit to yourself that there was in you just the faintest trace of a response to the terrible frankness of that noise, a dim suspicion of there being a meaning in it which you—you so remote from the night of first ages—could comprehend. And why not? The mind of man is capable of anything—because everything is in it, all the past as well as all the future. What was there after all? Joy, fear, sorrow, devotion, valour, rage—who can tell?—but truth—truth stripped of its cloak of time.

Marlow continues up the Congo and eventually finds Kurtz, the legendary ivory trade agent the company had tasked him with locating. Kurtz turns out to be somewhat of a sociopath, having apparently taken on a god-like role with the local natives, decapitating and mounting heads on poles among other behavior impressive to the jungle folk, for the primary purpose of extorting all of the ivory from them that could be collected and sent back up the river (it was and still is a very valuable commodity). But he was nevertheless revered by Marlow and others:

That was not the point. The point was in his [Kurtz] being a gifted creature, and that of all his gifts the one that stood out preeminently, that carried with it a sense of real presence, was his ability to talk, his words—the gift of expression, the bewildering, the illuminating, the most exalted and the most contemptible, the pulsating stream of light, or the deceitful flow from the heart of an impenetrable darkness.

Later, Marlow watches Kurtz die:

Anything approaching the change that came over his features I have never seen before, and hope never to see again. Oh, I wasn’t touched. I was fascinated. It was as though a veil had been rent. I saw on that ivory face the expression of sombre pride, of ruthless power, of craven terror —of an intense and hopeless despair. Did he live his life again in every detail of desire, temptation, and surrender during that supreme moment of complete knowledge? He cried in a whisper at some image, at some vision—he cried out twice, a cry that was no more than a breath: “‘The horror! The horror!

Marlow returns to civilization [sic] and delivers some of the dead man's personal letters to Kurtz' fiancee. In an emotional scene, the grieving woman tells Marlow, "What a loss to me—to us! To the world."  She begs him to tell her the last eloquent words of Kurtz as he died. Marlow replied, deciding he had better create a better last memory for her, "The last word he pronounced was---your name." I couldn't help but laugh as I read this, recalling Peter Eckermann's words on the death of Goethe (Johann Wolfgang Goethe, d. 1832; he is revered by the Germans, in large degree because of his noble appearance---I attempted to read Goethe's Wilhelm Meister's Apprenticeship and found it so insipid as to be impossible to continue; I grant his Faust had a potent theme, i.e., selling one's soul to the devil for power over the physical world): 

The morning after Goethe’s death, a deep desire seized me to look once again upon his earthly garment. His faithful servant, Frederick, opened for me the chamber in which he was laid out. Stretched upon his back, he reposed as if asleep; profound peace and security reigned in the features of his sublimely noble countenance. The mighty brow seemed yet to harbour thoughts. I wished for a lock of his hair; but reverence prevented me from cutting it off. The body lay naked, only wrapped in a white sheet; large pieces of ice had been placed near it, to keep it fresh as long as possible. Frederick drew aside the sheet, and I was astonished at the divine magnificence of the limbs. The breast was powerful, broad, and arched; the arms and thighs were elegant, and of the most perfect shape; nowhere, on the whole body, was there a trace of either fat or of leanness and decay. A perfect man lay in great beauty before me; and the rapture the sight caused me made me forget for a moment that the immortal spirit had left such an abode. I laid my hand on his heart – there was a deep silence – and I turned away to give free vent to my suppressed tears.

Well, I am not sure I do feel the remote kinship Conrad spoke of, but I am increasingly aware of the silent jeer of the river (Sumner's wrote “all this time the river flowed, endlessly...like a silent tear,” but it seems to me more a jeer to humanity in 2016).