Thursday, April 9, 2020

Art of Programming - [ PTQ ] == [IPO]

During this modern era of technology, many are seeking computing skills. One of the most prized of those skills is computer programming.

The author had his first experiences programming a computer during his fourth grade summer. This was with the BASIC language. And, that was during 1979. The wisdom of a hoary head and decades of coursework plus professional software development experiences has taught three simple concepts: PTQ or equivalently IPO.

From his early days, in formal computing courses at Vanderbilt among the dorms in the freshman quadrangle during the Spring of 1989, he saw something simple. intrinsic, and fundamental in the construction of all computer programs.

These primitive and fundamental parts were P, the preconditioned input, T, the transformations on the input that occur in the internal portions of the program, and Q, the post-conditioned output. In fact, during those days of his Pascal course, well-taught by a female graduate students whose name he has long forgotten, he penned some notes in his primary red Mead notebook, intended for his prose fiction course, concerning this.

He noticed that programs have three basic parts, I - input, P - processing, and O - output. The input can be null or the output can be null. But, some form of "processing" or "work" must be done, otherwise one would not make use of the computer program.

The first program that most students of software development learn is "Hello, World!". It is a program which will simply place this output on the computer's, tablet's, or phone's screen.

Once a student has learnt how one places output on the console, he has mastered one of the three abstract and primary skills which he must have in his toolkit for a career as a successful software developer.

The second skill one must learn is how one reads in input. Every computing language has numerous means for reading input. This could be from the console, from a file on the computer's file system, or a source on the computer's network such as a web-page. The mechanisms for doing so are similar within a language. Usually, most students first learn how one reads input from the computer screen, the console.

So, the second step in writing a "standard" program is reading input from the screen and simply outputting it again. This might be a program that reads in a person name, such as "Millicent", and printing a message, such as "Hello, Millicent! We are keeping up appearances!"

Yet, simply reading in data and echoing it on the screen, even if it has some interesting textual annotation, is not highly useful.

In comes the process. Processing takes the input which has been supplied and transforms this data so it is in a meaningful form. Then, this altered data, in the form of new, relevant information, is output.

So, when one is faced with writing a program, he must ask himself treat basic questions first.


  1. What is the input and where can it be obtained from the console, a file, the network, or etc?
  2. What information should be output once the input data is obtained?
  3. Finally, how must the input data be processed and transformed so it produces accurate and useful output information?


Input. Process. Output [ IPO ]

So, this answers some questions about the art of programming, but what is this PTQ acronym.

The P stands for precondition. For most, if not all programs, the supplied input must be in a valid range of values. If a teacher were entering grades in a program which will determine a semester's average, a input grade less than zero or greater than one hundred would be out of range. Plus, this input should be numeric and not alphabetic. If creating a well-written and robust program that most likely will not crash while processing, one should check any input and make sure that it is in an acceptable range for any internal computation which will be done.

Yet, one "got-ya" exists with checking preconditions. They require more programming instructions. And, these commands which validate the input by checking its range might be erroneously written.

The T in PTQ is a synonym for the P in IPO. It is simply the internal computations which one uses when working with the input and producing the output. These transformations can be drawn from the pool of commands built-in a computer programming language or the many libraries and packages of commands composed from various combinations of these built-in instructions which are available with these "built-ins" in all modern programming languages.

Finally, the Q is a symbol commonly used in logic courses for post-conditions when discussion proofs about reasoning. So, we use it here, since a program is an instance of logical reasoning represented in a language which a computer can understand. After we have produced output, we can verify that it is in a valid range of acceptable and expected values. So, in the example of a teacher entering assessment scores from the semester, the final grade for the term should be between zero and hundred.

Checking these conditions, both on the "entry" and "exit" of a computing routine when validating input and verifying output, is a crucial part of producing robust programs.

So, after one asks himself the three questions about IPO above, he should ask himself the following questions.


  1. What are the valid ranges of values for the inputs?
  2. Will the chosen processing transform the input properly and produce the expected output?
  3. Is the output produced in an acceptable range of values and reasonable based upon the input and chosen transformations?

And, with a hand-waving summary including a flourish of wild gesticulations, that is basically the general abstraction at the center of the art of computer programming.

Saturday, April 4, 2020

Sionese Zugzwang


This web-history speaks most frequently about concepts in mathematics and computing. They will be discussed in the midst of some other concepts, concerning political science. We have not been posting content as frequently as we were a year or so ago, seeing that we have been busied with numerous projects in computer science education. Yet, those have slowed some in light of COVID-19. So, the author thought that he would pick up this writing project again.


In the text, the Emperor of Ocean Park by Stephen L. Carter, the protagonist is an African American male and law professor who is a chess-fanatic. He is nicknamed after a great Russian Grand Master, Mischa. As such, during his life’s situations depicted in the text, the strategic concept of “zugzwang” is presented.


It, in itself, as shown in this text, is the “chess-playing” situation were a player is facing an imminent checkmate and any move which he makes will simply sink him, weakening his position and further solidifying the situation of the impending checkmate.

This became a blatant fact of life, as the author was streaming news in his quarantined community, on yesterday evening, a couple of days after April 1st. It seems that during the current state of world affairs and the “raging” health pandemic, the government of the United States of America blindly has accepted healthcare equipment from countries with which it has had a bittersweet relationship for numerous decades. This includes the government that spearheaded the former Soviet Union and China.

This is a humbling experience, where the mightiest and greatest nation in the world must ask for help from others. Otherwise, it might collapse. And, this “help” must come from those who its propaganda machine says are untrustworthy.  Yet, if these countries are truly foes, what will stop them from shipping masks, some of which are tainted with COVID-19 or other harmful biological agents.
In this war, which every country is currently fighting, the healthcare workers are a front-line of defense. If their numbers are decimated by contaminated mask and respirators which cannot be sanitized, who will America have for defense.



With this as the case, the battle of dominance as a super-power becomes one of the numbers. As the author’s high school American government instructor named Jack would say, “the country with the most citizen’s wins”, if the number of denizens lost in the battle remains fairly uniform between combatants.

Below is a list of the largest countries in the world based upon an approximate population:

Rank       Country               Population
1              China                  1,426,279,708
2              India                   1,338,558,742
3              United States      327,527,107
4              Indonesia            263,564,697
5              Brazil                  210,193,253
6              Pakistan              194,749,053
7              Nigeria                185,313,910
8              Bangladesh         165,552,994
9              Russia                 144,154,086
10           Mexico                 129,132,150
11           Japan                    127,962,410

Number one is larger than numbers three through seven combined.

Also, in that, the author has a close relative who has a small business that manufactures personal protective equipment kit, he is aware of the fact that the “best priced” wholesale masks, gowns, and nitrile gloves come from mainland China. And, they likely are the largest supplier of such. If that nation takes advantage of this “opportunity” while the United States and its other adversaries are weakened and vulnerable, it could decimate much of the world’s non-Chinese inhabitants.

Is this cause for alarm? Most likely, it is not. China could place the Trump-Pence team and the rest of the inhabitants in the world’s most eminent and well-known super-power with military installations on every continent in “zugzwang”. Although such a situation would likely not happen, it would not be a new strategy as far as the United States military is concerned. It is a well-known fact of history that while smallpox was ravaging the population of true indigenous Americans along with the rest of the European settlers during America's early years, the US Army provided those whom they were displacing from the land with the “gift” of blankets infected with that very same disease. In short, one should always be cautious when offered a “gift”, especially if it is offered for free by an adversary when one is desperate for help.

Yet, the leadership in China and the former Soviet Union likely are above doing such. China simply would not put America’s leadership in such a “zugzwang”. In fact, the world leadership likely operates much like organized crime syndicates in a single region, such as a city. They are simultaneously “friends” and “foes” who have mutual “best” interest. They agree upon the boundaries of each other’s operations and help each other keep their individual regions under control. 

Consider the vacuum that would be created in the world’s sociopolitical and economic systems, if America fell over the course of the next few decades. It would be much like the chaos that one currently sees in the East and Africa after the removal some of its pivotal and powerful leaders such as Hussein and Khadafi. And, it might take a century or more before the reverberations of such a move settles down. That is more instability than anyone is interested in seeing. Such a political tidal current could wash away many of the world’s current super-powers.

Yet, all of this had been said so the author might set the stage for a simple postulate about human behavior and hand-wave through a couple of mathematical suppositions.

“Humans see and perceive what they choose and what they find pleasing and comfortable, although the contrary might be painfully obvious.”

As a martyr and the leader of a peaceful insurrection many centuries ago said while discussing an ancient prophesy…

“[Mat 13:14-15 KJV] 14 And in them is fulfilled the prophecy of Esaias, which saith, By hearing ye shall hear, and shall not understand; and seeing ye shall see, and shall not perceive: 15 For this people's heart is waxed gross, and [their] ears are dull of hearing, and their eyes they have closed; lest at any time they should see with [their] eyes, and hear with [their] ears, and should understand with [their] heart, and should be converted, and I should heal them.”

Yet, men of learning often discount what this leader said as platitudes and emotional opiates for those of a weak, feeble, and untrained mind.

Well, those of great learning, especially, in mathematics, let us discuss what is truly irrational. This incredibly “simple” paradox in modern mathematics, which could result in a dissertation for more than a pair of docs, has been mentioned before in this web history.

When examining the number sets that we have available, such as the integral and rational numbers, we have accepted that some numbers with which we work do not have a rational representation. Yet, is such true without the removal and banishment of at least one key integer from the “primitive set” of integral values? We, as mathematicians, both professional and amateur, accept that values such a π and e have expansions which are never-ending and do not repeat. These are called “irrational” numbers. It is “accepted” that such cannot be formed from a ratio of other numbers. It can therefore be determined that any integers which one can place in a ratio will produce an expansion that eventually terminates or repeats indefinitely. This repetition of the terminal digits of such an expression is signaled with the vinculum, a bar drawn above the final repeating digits of the ratio’s written expansion.

Yet, what if we make use of this symbol, or an equivalent one, on the opposite side of the decimal, when working with the number 10. What is the largest possible power of ten? 10…., one followed by a non-terminating sequence of zeros. Although one could never render such a number, it can and should exist based upon the rules of the basic numbering system. And, it would be an integer, by definition. Plus, it would be less than infinity, because it is less than 9…, or the number which is a never-ending sequence of nines. And, what if we take this “largest” power of ten, LPT, and multiply if by π or e. Thus, we would have the non-repeating, non-terminating integers Zπ and Ze formed from (π * LPT) and (e * LPT). Then, what if we divide Zπ and Ze both by LPT? We will have π = (Zπ / LPT) and e = (Ze / LPT), if the LPT aka “the big honking ten” does exist. And, the irrational becomes rational. At least, for those who will open their eyes, unstop their ears, and soften their hearts. Yet, if men will not do such over the trivial, trifling, and niggerling issues found in numeric manipulation, will they do so over the weightier matters?

And, those great men of learning in academics might explain away how such a misrepresentation concerning the foundations of mathematics has persisted over the centuries and undergirds much of the work done this day is modern STEM fields which will be establishing the technological infrastructure that this world has for any future millennia that mankind might see.

And, as for i, it is the “sloppiest little mathematical bugger” but also is the basis for establishing the set of complex numbers. Yet, alone, it remains a reckless contraction of mathematical information. The great geometers, such as Pythagoras and Euclid, would fast faint at the structuring of such a myopic mathematical misfit. In that, the value i, represents the root of a square area, it, in essence, is the measure of at least a pair of the sides of such a shape. A square of area nine has four sides of length three or negative three, if examining their measures in the first and third quadrants of the Cartesian plane. So, the true square root of 9 is the n-tuple (3,3,3,3) or (-3,-3,-3,-3). That is exact and might be safely condensed becoming (3,3) and (-3,-3) in light of its complex counterpart and the fact that an area is number with a pair of factors. What is the square root of a square with an area of -9? Considering its geometric representation when centered at the origin, starting from that point, and working clockwise, it would be the n-tuples (-3,3,-3,3) and (3,-3,3,-3). This might be safely condensed producing (-3,3) and (3,-3) or 3*(-1,1) and 3*(1,-1) instead of 3i. So, i must truly and simultaneously be (-1,1) and (1,-1).

Does this remind anyone of the superpositions found in quantum mechanics? Well said. The author loves hearing what you are thinking.

Notice the information concerning orientation and direction lost when one simply uses the complex number, i. Doing so, hides the geometric nature of square roots which can be vital when they represent concepts within the worlds of physics and chemistry and not simply those wafting in the miasma of mathematical reasoning.

So, write your i s as (-1,1) and (1,-1), if not (-1,1,-1,1) and (1,-1,1,-1). Then, see what marvelous insights arise.

In a summarized conclusion, this day we find that, in mathematics, as in life and political situations, the irrational just is rational and the complex simply is overly simplified.