Category Archives: Computer Science

The Elements of Euclid in Greek and Latin

I was trying to parse my way through an edition of The Elements in Greek and Latin:

https://archive.org/details/euclidisoperaomn01eucluoft/page/x

The name of The Elements in Ancient Greek is:

Στοιχει̃a

or, when transliterated:

Stoicheĩa

.

The Ancient-Greek word, τὰ στοιχει̃α or, when transliterated ‘tà stoicheĩa,’ is a plural form of the 2nd-declension neuter verb, τὸ στοιχει̃ον genitive: του̃ στοιχείου or, when transliterated: ‘tò stoicheĩon,’ genitive: ‘toũ stoicheíou.’

The Ancient-Greek word, ‘tò stoicheĩon,’ can mean ‘an element in a set.’

Figure 1: The elements of this set are alpha, beta, gamma and delta.

The Ancient-Greek word, ‘tò stoicheĩon,’ is formed from the Ancient-Greek masculine noun, ὁ στοι̃χος genitive: του̃ στοίχου or, when transliterated, ‘ho stoĩchos,’ genitive: ‘toũ stoíchou,’ which means ‘steps,’ or ‘a flight of stairs;’ and the Ancient-Greek 2nd-declension neuter nominal suffix, ‘-eĩon,’ genitive: ‘-eíou’ which denotes ‘a means (of),’ ‘an instrument of;’ etc.

Figure 2: a ‘stoĩchos’ or ‘series of steps.’

The term, ‘stoĩchos,’ according to Wiktionary, may be traced back to the indo-european word:

*steigʰ

, which means:

‘climb.’

Hence, etymologically, the Ancient-Greek term, ‘stoicheĩa,’ can be said to mean: ‘the means of climbing up;’ ‘the means of stepping up;’ ‘the means of ascent;’ etc.

This is highly instructive, as, in truth, Elements is a book that is a Jacob’s ladder, of sorts, by which one can ascend, element by element, into the heavens of mathematical knowledge.

Figure 3: With The Elements of Euclid, we advance in our mathematical knowledge element by element. Each element is, conceptually, like a rung, heaving us upwards to Mathematical prowess; to an implicit knowledge of Euclidean Geometry.

Operator Precedence in Arithmetic

The Microsoft Word version of this blogpost. (.docx)

The PDF version of this blogpost. (.pdf)

Operator Precedence in Arithmetic:

Introduction:

Conventional Arithmetic possesses rules for the order of operations. Which operations ought we to evaluate first? In what order ought we to evaluate operations? This is the topic that this chapter wishes to address. ‘Precedence,’ is also sometimes referred to as ‘the order of operations.’

Body:

The Etymological Definition of ‘Precedence:’

Our English noun, ‘precedence,’ is derived from the Latin substantive participle, ‘praecēdentia.’[3] ‘Praecēdentia,’ in Latin, means ‘the abstract concept of which things go before [other things].’

Within the context of Arithmetic, ‘precedence,’ etymologically, means ‘the science of determining which operations go before [other operations];’ ‘the science of determining which operations should be evaluated before [other operations].

The Acronym, ‘P.E.M.D.A.S:’

The acronym, ‘P.E.M.D.A.S.,’ stands for:

  1. Parenthesis;
  2. Exponentiation;
  3. Multiplication and Division;
  4. Addition and Subtraction.

The Acronym, ‘P.E.M.D.A.S.,’ can be easily remembered with the Mnemonic phrase:

‘Please Excuse My Dear Aunt Sally.’[4]

Levels of Precedence:

As we can observe from the above ordered list, some operations share the same level of precedence. For example, the operation, multiplication, and the operation, division, have the same level of precedence. Multiplication and Division share the third level of precedence, in the above list. When we are confronted with an expression or an equation that contains operations at the same level of precedence, seeing that in Anglophone countries, we read from left to right, then we evaluate operations that possess the same level of precedence from left to right. Hence, when two or more operations—within an equation or an expression—share the same level of precedence, then we evaluate them from left to right. Concerning operations at the same level of precedence, we evaluate from beginning at the leftmost operation, and work our way rightwards.

An Example of Precedence:

In the expression:

2 ÷ 1 + 3 × 42 – 5 + ( 3 – 2 )

, we first evaluate the operation in parenthesis, i.e.:

( 3 – 2 )

. When we evaluate:

( 3 – 2 )

, then we obtain the difference:

1

.

This renders the original expression as:

2 ÷ 1 + 3 × 42 – 5 + ( 1 )

or as:

2 ÷ 1 + 3 × 42 – 5 + 1

.

Second, we evaluate the exponentiation operation i.e.:

42

. When we evaluate:

42

, then this obtains for us the power:

16

. This renders our original expression as:

2 ÷ 1 + 3 × 16 – 5 + 1

.

The operations, Multiplication and Division, share the same level of precedence. However, given that the division operation is further to the left, on the page, than the multiplication operation, then we evaluate the division operation before we evaluate the multiplication operation.

Given that the division operation:

2 ÷ 1

is further to the left, on our page than the multiplication operation:

3 × 16

, then we evaluate:

2 ÷ 1

before we evaluate:

3 × 16

.

When we evaluate:

<!–

2\div1

–>

2 ÷ 1

, then we obtain the quotient:

2

. This renders our original expression as:

2 + 3 × 16 – 5 + 1

. Then we proceed to evaluate:

3 × 16

, and this obtains for us the product:

48

. This renders our original expression as:

2 + 48 – 5 + 1

.

The operations; addition, and subtraction; share the same level of precedence. In the above ordered list, they are at the 4th level of precedence. We evaluate these operations as we should find them, beginning at the leftmost, and working our way rightward. Hence, we evaluate:

2 + 48

first. This obtains for us the sum:

50

. This renders our original expression as:

50 – 5 + 1

. We then proceed to evaluate the operation:

50 – 5

, which obtains for us the difference:

45

. This renders our original expression as:

45 + 1

. We then proceed to evaluate the expression:

45 + 1

. This obtains for us the sum:

46

.
This renders our original expression as:

46

. We have thus simplified the expression:

2 ÷ 1 + 3 × 42 – 5 + ( 3 – 2 )

to:

46

. We have observed mathematical precedence οr the order of operations in our simplification of the expression:

<!–

2 \div 1 + 3 \times 42 – 5 + \left ( 3 – 2 )

–>

2 ÷ 1 + 3 × 42 – 5 + ( 3 – 2 )

to:

46

.

Conclusion:

In this chapter, we have endeavoured to gain for ourselves an implicit understanding of precedence as it pertains to basic or conventional arithmetic. Boolean arithmetic, an arithmetic of logic employed in Computer Science, also possesses precedence or an order of operations, which we shall examine in a subsequent chapter. In the next chapter, we shall examine precedence or the order of operations as it specifically applies to the C programming language.


Footnotes:

[1] The Etymology of the English mathematical term, ‘arithmetic,’ is as follows. The English adjective, ‘arithmetic,’ is derived from the Latin 1st-and-2nd-declension adjective, ‘arithmētica, arithmēticus, arithmēticum.’ Further, the Latin adjective, ‘arithmēticus,’ is derived from the Ancient-Greek phrase, ἀριθμητικὴ τέξνη or, when transliterated, ‘arithmētikḕ téchne,’ which means ‘the art of counting;’ ‘the skill of counting;’ ‘the science of counting.’ ὁ ἀριθμός genitive: τοῦ ἀριθμοῦ, or—when transliterated: ‘ho arithmós,’ genitive: ‘toũ arithmoũ,’—is a 2nd-declension Ancient-Greek noun that means ‘number,’ ‘numeral,’ Cf. ‘ἀριθμός#Ancient_Greek,’ Wiktionary (last modified: 7th September 2018, at 17:57.), https://en.wiktionary.org/wiki/ἀριθμός#Ancient_Greek , accessed 29th April 2019.[2] Cf. ‘arithmetic,’ Wiktionary (last modified: 25th April 2019, at 04:45.), https://en.wiktionary.org/wiki/arithmetic, accessed 29th April 2019.

[3] ‘praecedēntia’ is the nominative neuter plural of the participle, ‘praecedēns,’ which means ‘going before.’ The form, ‘praecedēntia,’ means ‘those things going before;’ ‘the concept of things going before.’ We shall metamorphose ‘praecedēntia’ into a 1st-declension feminine noun that means ‘precedence.’ ‘praecedēntia’ genitive singular: ‘praecēdentiae,’ is a 1st-declension feminine noun that means ‘precedence.’ ‘praecēdentiae,’ can be further broken down into the preposition, ‘prae,’ which means ‘before;’ and the 3rd-conjugation verb, ‘cēdō, cēdere, cessī, cessum,’ which means ‘to go,’ and the Latin 1st-declension feminine nominative nominal suffix, ‘-ia,’ genitive: ‘-iae,’ which, in this instance, denotes ‘a noun formed from a present-participle stem.’ Hence, the etymological definition of ‘precedence’ is ‘the concept of things going before [other things].’ Within the context of arithmetic, the etymological definition of ‘precedence is ‘the concept of operations being evaluated before other operations.’ Cf. ‘praecedentia,’ Wiktionary (last modified on 9th September 2013, at 02:28.), accessed on 1st May 2019. Cf. ‘praecedens,’ Wiktionary (last modified on 11th November 2016, at 16:40.) https://en.wiktionary.org/wiki/praecedens#Latin, accessed on 1st May 2019.

[4] Stapel, Elizabeth, ‘The Order of Operations: PEMDAS,’ Purple Math (2019), http://www.purplemath.com/modules/orderops.htm, accessed on the 1st May 2019.

Wire-Framing Websites and Apps in Inkscape and Scripted SVG:

html_five_logo_my_from_svg

Figure 1: I drew this HTML logo in Scripted SVG. My development skills, especially my ability to develop web images through code, is really beginning to rise to a professional standard.

phouka_site_wireframe_my_inkscape

Figure 2: I mocked up this old website, phouka.com for an e-book that I am putting the finishing touches to, and hope to release upon Amazon, shortly. This website, developed in 2005, employs a pre-html-5 table layout which is now deprecated. Today, the downloading of fonts by a web-accessor is no longer required thanks to @fontface .

apple_swift_logo_my

Figure 3: I drew this Swift Logo – the Programming Language employed by Apple – in Vector software such as Vector Magic and Inkscape. Apps can be mocked up in Inkscape so as to give the customer a sense of what his/her app’s user experience/ graphical user interface might look like, prior to the app’s development commencing in earnest.

If anyone should require mockups of apps or websites prior to taking this wireframe to a professional website-developer/app-programmer, let me know. Send me a direct message, or something. The advantage of doing this in SVG, is that one can then employ the SVG code and the CSS code generated by Inkscape in the website/app itself.

The Famous Syllogism in Latin, Greek and English:

The Famous Syllogism in Greek, Latin and English.

Click here so as to download a Microsoft Word version of this article.

Click here so as to download a pdf version of this article.

The Famous Syllogism[1] in Greek, Latin and English:

Introduction:

Quite early on, in his Mathematical Analysis of Logic, George Boole–whence in programming and computer science we derive the datatype name, ‘Boolean’– introduces this famous syllogism to us, his readers.

Body:

In Ancient Greek:

ὁ Σωκράτης ἐστιν ἄνθρωπος.

πάντης ἄνθρωποι ἐστι θνητοί.

οὖν ὁ Σωκράτης ἐστι θνητός.

When Transliterated:

ho Sōcrátēs estin ánthrōpos.

pántēs ánthrōpoi esti thnētoí.

oũn ho Sōkrátēs esti thnētos.

In Latin:

Sōcratēs est homō.

Omnēs hominēs sunt mortālēs.

Ergō, Sōcratēs est mortālis.

In English:

Socrates is a man.

All men are mortal.

Therefore, Socrates is mortal.

Conclusion:

The Ancient-Greek term, ὁ λόγος or, when transliterated, ‘ho lógos,’[1] means–within the context of logic– ‘statement,’ or ‘argument.’

The Latin 1st-and-2nd-declension adjectival suffix, ‘-ica, -icus, -icum’ means ‘of,’ ‘about,’ ‘concerning,’ ‘pertaining to,’ etc.

Hence, etymologically, ‘logic’ is ‘the study of the truth or falsehood of statements and arguments.’

Conventional arithmetic or Conventional Algebra has quantity for its subject. George Boole developed an algebra, or an arithmetic that had logic as its subject.

Indeed, in his book, The Laws of Thought he terms this ‘arithmetic’ or ‘algebra’ of his ‘a calculus of logic’ by which he meant ‘a system whereby the truth or falsehood of statements/arguments could be analysed.’


[1] This syllogism—and those like it—are sometimes termed ‘barbara.’ The term, ‘barbara’ is a mnemonic device which informs us that this type of syllogism comprises 3 affirmations. The 1st premise affirms that Socrates is a man; the 2nd premise affirms that all men are mortal; and the conclusion affirms that Socrates is mortal.

[2] The 2nd-declension masculine noun ὁ λόγος Genitive:τοῦ λόγου or, when transliterated: ‘ho lógos’ Genitive: ‘toũ lógou.’


Glossary:

    calculus (ˈkælkjʊləs) noun plural -luses

  1. a branch of mathematics, developed independently by Newton and Leibniz. Both differential calculus and integral calculus are concerned with the effect on a function of an infinitesimal change in the independent variable as it tends to zero.
  2. any mathematical system of calculation involving the use of symbols
  3. logic an uninterputed formal system. Compare formal language (sense 2)
  4. (plural -li (ˈkælkjʊˌlaɪ) ) pathology a stonelike concretion of minerals and salts found in ducts or hollow organs of the body[C17 from Latin: pebble, stone used in reckoning, from calx small stone, counter]
    • calcular (ˈkælkjʊlə) adjective relating to calculus
    • calculous (ˈkælkjʊləs) or calculary (ˈkælkjʊlərɪ) of or suffering from a calculus. Obsolete form: calculose
    • calculus of variations a branch of calculus concerned with maxima and minima of definite integrals.[1]

[1] Collins English Dictionary: Complete and Unabridged, 12th edn., Glasgow, U.K., Harper Collins Publishers, 2014, Loc. 66,078.

The Classics Make Engineering Easier: Latin names of Formal Logic Symbols.

 

Introduction:

It is my contention that the knowledge of Latin and Greek make STEM[1] easier to learn. A huge number of STEM terms are derived from Greek and Latin.

 

 

george_boole_my_compressed_2018

Fig 1:
I drew this portrait of George Boole with pencils. George Boole was self-taught and fluent in Latin, Greek and Hebrew by the time that he was 12.

Vel Symbol:

 

vel_symbol_my_scripted_svg

Fig 1:
This is the Vel symbol. You may view the Vector at my CodePen Account.

In Formal Logic this symbol represents ‘disjunction.’ The equivalent in Boolean Algebra is ‘Inclusive Or.’ ‘vel’ is Latin for ‘or.’ One sees this quite a bit in liturgical rubrics[2].

 

The Wedge Symbol

 

conjunction_my_scripted_svg

Fig 1:
This is the Wedge symbol. You may view the Vector at my CodePen Account.

In Formal Logic this symbol represents “conjunction.” The equivalent in Boolean Algebra is “And.” In Latin, ‘ac’ or ‘atque’ is ‘and.’ Sometimes this symbol is called this. One sees this quite a bit in ecclesiastical Latin.

 

‘Annūntiō vōbīs gaudium magnum: habēmus pāpam! ēminentissimum ac reverendissimum dominum [praenōmen] sānctae rōmānae ecclēsiae [cōgnōmen] cardinālem quī imposuit sibi nōmen [nōmen pāpāle].’

‘I announce to ye a great joy: we have a Pope!, the most eminent and most revered [forename] lord of the most holy Roman Church, Cardinal [surname], who hath placed upon himself the name [regnal name].’

In the offertory the priest prays:

‘…prō fidēlibus christiānīs vīvīs atque dēfūnctīs…’

‘…for all faithful Christians living and dead…’

In The Young Pope (2016), a Cardinal, disfavoured by Pius XIII/Jude Law, prays this in the frozen wilderness of Alaska, to whence he was banished.


[1]An acronym which stands for ‘Science Technology Engineering & Mathematics.’
[2]The term, ‘rubrīcus,’ in Latin means ‘red.’ Liturgically, the actions of the priest are written in red, whereas what the priest says is written in black.

 

Esse est Perspicī: to be is to be perceived:

of_infinite_scope_my_inkscape

Figure 1:  “Of infinite scope.”  I drew this in Inkscape.

skopos_greek_my_inkscape

Figure 2:  ‘ho skopós’ in Ancient Greek is whence we derive the programming term, ‘scope.’

At present, I am writing an article on ‘scope’ as it pertains to programming.  I am going to try to explain it with Berkeley’s:

“esse est perspicī;”

which means:

“to be is to be percieved.”

, which some suggest to be a foreshadow of  the scientific phenomenon known as:

“quantum observation.”

How far can the quantum observer, as regards the world or universe of the program see, as regards a variable’s declaration and initialisation?

If the quantum observer can see all things; perceive all things; like the omnivident [1] “watcher” portrayed in Figure 1, then the variable is said to be of global scope.

However, as regards the world or universe of the program; should the quantum observer be a little myopic; should his field of perception be limited to a function or an object or some other code block, then the variable in question is said to be of local scope.


[1]  I invented this theological term, as it is convenient.  It describes the ability of a deity to see all things.  From the Latin adjective, ‘omnis,’ which means ‘all;’ and the Latin 2nd-conjugation verb, ‘videō,’ which means ‘I see.’  Incidentally, Goerge Berkely (1685 – 1753) was an Irish Anglican Clergyman.

It is Dangerous to go Alone!

Figure 1: I drew this Link Sprite Pixel by Pixel in SVG.

I am trying to program without assignment statements for the lulz of it. Modern JavaScript – or ECMA script, as it is increasingly being known – is fully compliant with the functional paradigm. “Uncle Bob” gave a great talk on functional programming. Being able to program without equals signs is like completing Zelda 1 without the Master Sword. It is dangerous to go alone without assignment statements… but I do so anyway as I like to program on the edge. According to Uncle Bob, functional programs are less error prone – no side effects and no changes in state – and more efficient, as there is no need for “garbage collection.”

Figure 2:  Being able to arrive at the value, 0, without the use of an assignment statement was something that I was not able to do… until somebody suggested the bitwise double tilde on Stack  Exchange.

 


Below is a Microsoft-Word version of the following blogpost:

let_apostrophe_s_fly_off_on_a_tangent

Below is a pdf version of the following blogpost:

let_apostrophe_s_fly_off_on_a_tangent


 

Let Us Fly Off On a Tangent:

What is a tangent?

As an Idiom:

To fly off on a tangent, idiomatically, is to digress so radically, such that the topic that one now speaks of is only related to the previous topic – prior to the digression – by having only the point that spurred the tangent in common.

As a mathematical term:

In mathematics, a ‘tangent’ is a line that only has a single point in common with the circumference of a circle.

The tangent line touches[1] the circle’s circumference at a single point, and is perpendicular to the radius of the circle.

The angles that the tangent makes with the radius are right, i.e. of magnitude 90°.

tangent_my_svg

Figure 1: A diagram of a tangent line.

In the circle:

A

, the centre is at point:

a

. The radius of the circle is line segment:

| a b |

. The tangent line is:

| x y |

. The tangent line:

| x y |

, only touches the circle:

A

, at a single point, and that point is point:

b

. The tangent:

| x y |

is perpendicular to the radius:

| a b |

. The angle:

xba

is a right angle.

. The angle:

yba

is a right angle.


[1]. The Latin participle, ‘tangēns, tangent-, ’ means ‘touching.’ Therefore, etymologically, a tangent line is only touching a circle’s circumference at a single point. The Latin 3rd-conjugation verb, ‘tangō, tangere, tetigī, tāctum,’ means ‘to touch.’ We also derive the adjectives ‘tangible’ and ‘tactile’ – both of which concern ‘touching’ – from this Latin verb as well.

Addendum:

You may take a look at the SVG code with which I scripted the diagram of a tangent at my Codepen account.

 

I am back

martymcflycropped1200dpi

I took a bit of a break from WordPress, there for a while.  I have blogged on blogger.  I shall begin to repost those blogposts, here.

My Blogger blog.

I shall also begin to blog on minds.

I spent a lot of time learning graphic design on Codepen.

I spent a lot of time learning programming on soloLearn

It is extremely manage all of one’s social media.

 

 

Flow Control Statements

(Click the below link for a Microsoft Word version of this blog-post)

flow_control_statement

(Click the below link for a pdf version of this blog-post)

flow_control_statement

 

if_jpeg_segment

Figure 1: I drew the above segment of a Flowchart Algorithm in Microsoft Word.

In programming, statements such as:

if

, which introduce a condition, are known as:

flow-control statements

.

One way to conceive of Computer Algorithms, is to represent them as Flowcharts.  The:

if

statement alters or controls the flow of the algorithm.

In the above depicted example[1], if the condition tested by the:

if

statement should be found to be true, then the logical execution of the algorithm will flow down the left-hand side of the page.

In the above depicted example, if the condition tested by the:

if

statement should be found to be true, then the logical execution of the algorithm will flow down the left-hand side of the page.

In the above depicted example, if the condition tested by the:

if

statement should be found to be false, then the logical execution of the algorithm will flow down the right-hand side of the page.

When we introduce a logical split into our algorithm, then this is termed:

‘branching’

.

The true and false tributaries of the depicted flow-chart algorithm are termed:

‘branches’

.

branching

Figure 2:  The algorithm branches.  We can instruct the computer to do different tasks depending upon whether the logical condition tested by the if statement be found true or false.

if_jpeg_segment

Figure 3:  In this segment of a Flowchart Algorithm, we can see that it branches after we test a logical condition with an if statement.  In the depiction, above, we can observe the true branch of the Algorithm, and the false branch of the Algorithm.  I drew the above illustration in Microsoft Paint.

algo_second_version_final

Figure 4: I drew this flow-chart algorithm in Microsoft Word.

In Figure 4, we have a flow-chart algorithm that describes a program that takes an integer – either a 1 or a 0 – inputted by the user, and which outputs a string contingent upon what the user has inputted.

The above algorithm solves a computational problem.  The computational problem that the above algorithm solves may be stated as:

 How can we test a litteral inputed by a user so as to see if it should equate to Boolean True or Boolean False?

Mutual Exclusion:

The:

true

 and:

 false

branches of this algorithm are termed:

‘mutually exclusive’

.

A logical test is performed, and if that which is tested be true then that excludes the possibility of its being false.

A logical test is performed, and if that which is tested be false then that excludes the possibility of its being true.

If the true branch of the algorithm be executed, then the false branch of the algorithm will not be executed.

If the false branch of the algorithm be executed, then the true branch of the algorithm will not be executed.

Branching in Python:

We shall now write a program in Python that corresponds to the algorithm depicted in Figure 4.

python_branch_program_final

Figure 5:  This is the python program that corresponds to the algorithm in Figure 4.

output_0_false

Figure 6:  This is what is outputted by the Python program depicted in Figure 5 should the user input the value, 0.

output_1_true

Figure 7:  This is what is outputted by the Python program depicted in Figure 5 should the user input the value, 1.

output_2_invalid_boolean_input

Figure 8:  This is what is outputted by the Python program depicted in Figure 5 should the user input a literal that is not a 1 or a 0.

More on Branching in Algorithms in General:

As we can see from the algorithm depicted on Page 5, the:

true

and:

false

branches of the algorithm converge or attain a confluence prior to the:

“Goodbye!”

string’s being outputted.

The:

“Goodbye!”

string will be outputted regardless of the result of the logical condition tested by the:

if

statement.

Back to If Statements in Python:

One quintessential piece of Python syntax is the colon.  The colon is used to declare that what follows will be an indented code block.

colon_black_pen

Figure 9:  In Python, if statements are always terminated by colons.  In Python, the colon always declares that the preceding code block will be indented.  The code block that follows the colon that terminates the if statement is indented[2].  I drew the above image with pens.

Back to Branching in Algorithms in General:

Trees are not the only things that branch.  Rivers also branch into tributaries.  Rivers also flow downwards[3], and so it is an excellent analogy so as to conceive of branching in algorithms.

branching_river

Figure 10:  Another way to conceive of branching in flow-chart algorithms: the flow-chart algorithm branches into true and false code blocks after a logical condition is tested, before re-attaining a confluence prior to “Goodbye” being printed.  The two tributaries of the flow-chart algorithm merge together again prior to “Goodbye” being printed.  Regardless of whether the true code block or the false code block be executed, “Goodbye” will nonetheless be printed.

What is the Purpose of Writing an Algorithm prior to Writing a Program?

An algorithm is imperative[4] knowledge.  It tells one how to do something.  In computing, an algorithm tells one how to solve a computational problem.

In computing, an algorithm is a series of commands that solves a computational problem.

There are two approaches to programming:

Seat-of-the-Pants Method:

With this method, the programmer just dives into writing the program.  However, the programmer still composes an algorithm, only this time, the algorithm is mental.  At each stage of his writing a program, the programmer still must imagine what he must command the computer to do for it to solve a computational problem.  The programmer just does not take the time to write this series of commands or algorithm down.

Write-the-Algorithm-First Method:

With this method, the programmer solves the computational problem first prior to his commencing writing the program.  He does this by writing an algorithm.

The advantage of writing an algorithm is that it does not limit the programmer to a solution in a single language such as Python.  Should the programmer take the time to write out the algorithm first, then it will allow him to easily compose a program that corresponds to that algorithm not only in Python, but in whatever programming language that he should so choose.

Writing a Program that Corresponds to our Algorithm in C:

In Figure 4, we wrote an algorithm that solved a computational problem.  The computational problem that was solved by the algorithm depicted in Figure 4 can be stated as:

How can we test a litteral inputed by a user so as to see if it should equate to Boolean True or Boolean False?

With the above-stated computational problem solved, we can now easily write a program that corresponds to the algorithm, not only in Python syntax, but in C syntax, as well.

c_program_true_false_code_final

Figure 11:  The C program that corresponds to the algorithm depicted in Figure 4.

 

output_0_false_c

Figure 12:  What the C program depicted in Figure 11 outputs should the user input a 0.

output_1_true_c

Figure 13:  What the C program depicted in Figure 11 outputs should the user input a 1.

output_2_invalid_boolean_input_c

Figure 14:  What the C program depicted in Figure 11 outputs should the user input a literal that is neither a 0 or a 1.

Glossary:

confluence

  • noun. the junction of two rivers, especially rivers of approximately equal width.
    • an act or process of merging: a major confluence of the world’s financial markets.

<ORIGIN> late Middle English: from late Latin confluentia, from Latin confluere ‘flow together’ (see CONFLUENT).[5]

<ETYMOLOGY>  From the Latin 1st-declension feminine noun, ‘conflŭentĭa, conflŭentĭae,’ which means ‘a flowing together.’[6]  From the Latin preposition, ‘cum,’ which means ‘together;’ and the Latin 3rd-conjugation verb, ‘fluō, fluere, fluxī, fluxum,’ which means ‘to flow;’ and the Latin 1st-declension nominal suffix, ‘-tia, -tiae,’ which denotes a state of being.  A confluence, therefore, etymologically, is ‘a flowing together.’

As regards algorithms, by way of an analogy, a confluence can be said to describe the merging of two or more branches of a flow-chart algorithm.

 

 

 

confluent

  • adjective. flowing together or merging.

<ORIGIN> late 15th century: from Latin confluent- ‘flowing together’, from confluere, from con- ‘together’ + fluere ‘to flow’.[7]

<ETYMOLOGY>  From the Latin 3rd-declension masculine noun, ‘cōnfluēns, cōnfluēntis,’ ‘ which means ‘confluence.’ ‘flowing together.’  From the Latin preposition, ‘cum,’ which means ‘together;’ and the Latin present active participle, ‘fluēns, fluēntis,’ which means ‘flowing.’

 

As regards algorithms, by way of an analogy, two or more branches of an algorithm can be said to be confluent when they merge together.

 

 

imperative

  • adjective.
  1. of vital importance;crucial:  immediate action was imperative | [with clauseit is imperative that standards are maintained.
  2. giving an authoritative command; peremptory:the bell pealed again, a final imperative call.
  • [GRAMMAR] denoting the mood of a verb that expresses a command or exhortation, as income here!
  • noun.
  1. an essential or urgent thing:free movement of labour was an economic imperative.
  • a factor or influence making something necessary:the biological imperatives which guide male and female behaviour.
  1. [GRAMMAR] a verb or phrase in the imperative mood.
  • (the imperative) the imperative mood.

<DERIVATIVES> imperatival adjective.  imperatively adverb.  imperativeness noun.

<ORIGIN> late Middle English (as a grammatical term): from Late Latin imperativus (literally ‘specially ordered’, translating Greek prostatikē enklisis ‘imperative mood’), from imperare ‘to command’, from in- ‘towards’ + parare ‘make ready’[8].

 

<ETYMOLOGY>  from the Latin 1st-and-2nd-declension adjective, ‘impĕrātīva, impĕrātīvus, impĕrātīvum,’ which means ‘pertaining to the command;’ ‘of the command.’  From the Latin 1st-conjugation verb, ‘imperō, imperāre, imperāvī, imperātum,’ which means ‘to command,’ ‘to order,’ and the Latin 1st-and-2nd-declension adjectival suffix ‘-īva, -īvus, -īvum,’ which means ‘of,’ ‘concerning,’ ‘pertaining to.’  From the Latin prefix ‘in-’ which expresses the concept of ‘unto,’ ‘toward,’ and the Latin 1st-conjugation verb, ‘parō, parāre, parāvī, parātum,’ which means ‘to make ready,’ ‘to prepare.’  The etymological sense, therefore, of the English adjective, ‘imperative’ is: ‘concerning the command;’ ‘pertaining to the command;’ ‘of the command;’ ‘concerning the order;’ ‘pertaining to the order;’ ‘of the order;’ ‘concerning the making ready of;’ ‘pertaining to the making ready of;’ ‘of the making ready of;’ etc.

 

As regards algorithms, ‘imperative’ denotes the type of knowledge expressed by a series of commands, as opposed to declarative knowledge.

 


[1] i.e. the example depicted in Figure 1.

[2]  In Python style, an indent is worth 4 spaces.

[3]  As does a flow-chart algorithm.

[4]  From the Latin 1st-conjugation verb, ‘imperō, imperāre, imperāvī, imperātum,’ which means: ‘to command,’ ‘to order.’  Cp.  Latin English Lexicon: Optimized for the Kindle, Thomas McCarthy, (Perilingua Language Tools: 2013) Version 2.1  Loc 46105.

[5]  Oxford University Press.  Oxford Dictionary of English (Electronic Edition). Oxford.  2010.  Loc 146068.

[6]  Cp.  Latin English Lexicon: Optimized for the Kindle, Thomas McCarthy, (Perilingua Language Tools: 2013) Version 2.1  Loc 23064.

[7]  Oxford University Press.  Oxford Dictionary of English (Electronic Edition). Oxford.  2010.  Loc 146082.

[8]   ibid.  Loc 345790