Tag Archives: Computer Programming

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.

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.

 

What is a Code Block?

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

what_is_a_code_block

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

what_is_a_code_block

In Python, a code block is defined as a number of sequential statements, or lines of code, that share the same level of indentation.

In Python Style, an indent is defined as four spaces.

When starting out learning how to program, your programs will consist of a single block of code.

code_block_final

Figure 1:  When learning how to program, you will probably begin to code simple calculators such as the calculator depicted above that converts degrees Celsius into degrees Fahrenheit. The above program consists of merely 1 block of code comprising 7 lines. As you can observe, all seven lines share the same level of indentation.

code_block_final_output

Figure 2: What the code depicted in Figure 1 looks like when interpreted and used.

However, whenever you attain to a greater level of programming ability that will allow you to code programs with greater complexity and sophistication, then more than one block of code will be required:

temperature_converter_code_final

Figure 3: This calculator does much the same thing as the calculator depicted in Figures 1 & 2. It is a lot more complex and sophisticated, though. As we may observe, the above-depicted program comprises several blocks of code. We know this to be the case because the program contains various levels of indentation. The blocks of code that are to be executed when this program is run is contingent upon what the user inputs.

temperature_converter_output_final

Figure 4: What the program depicted in Figure 3 looks like when interpreted and used.

Floor Division in Python

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

floor_division_in_python

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

floor_division_in_python

floor_division_operator

Figure 1:  The Floor-Division operator.  In Python, the Floor-Division operator consists of two forward slashes.  The Floor-Division operator is an example of a binary operator, as it takes two operands: the dividend and the divisor.

With floor division, one number, the dividend, is divided by another number, the divisor, and the result, or quotient – whatever it may happen to be – will be a rounded-down integer value.

Let us consider the Python Equation:

>>>8/5

1.6

>>>

The number, 8, the dividend, is divided by the divisor, 5, and a floating-point number, 1.6, is then returned as a quotient.

eight_divided_by_five_shell_ordinary_division

Figure 2:  When we divide 8 by 5 using the division operator, / , then a floating-point number, 1.6, is returned as a quotient.

division_operator

Figure 3:  This is our Division operator.  When we employ this binary operator, a floating-point number will be returned.

Whenever we employ a Division operator in Python, then a floating point number will always be returned as a quotient, even if the quotient has no significant fractional component.

eight_divided_by_four_shell_ordinary_division

Figure 4:  Whenever we divide the dividend, 8, by the divisor, 4, then the quotient, 2.0, is still returned as a floating-point number despite its not having any significant fractional component.

Let us, again, consider the Python equation:

>>>8/5

1.6

>>>

, but let us do things a little differently:

>>>8//5

1

>>>

In the above example, we have now employed the floor-division operator.  The floor-division operator will always return an integer value, if the 2 operands that it takes be integers.

eight_divided_by_five_shell_floor_division

Figure 5:  When we divide the dividend, 8, by the divisor, 5, we get the quotient, 1, rendered as an integer.

Let us consider 8 divided by 2 in ordinary arithmetic for a moment:

8 ÷ 5 = 1.6

In the above example, we divide an integer by an integer and we obtain a real number as a result, or quotient.

If we wanted a less precise answer, then it would be customary to see:

8 ÷ 5 2

In normal arithmetic, it would be customary to round:

1.6

up to:

2

.

However, in floor division, floating point numbers such as:

>>>1.6

1.6

>>>

are always rounded down to the value of its integral component.

So, in Python, the floor value of:

>>>1.6

1.6

>>>

would be:

>>>2

2

>>>

The floor-division operator will always return an integer as a quotient, unless floating-point numbers be employed as operands.

seven_point_nine_divided_by_three_point_two_shell_ordinary_division

Figure 6:  When we divide 7.9 by 3.2 in conventional division, we obtain the floating-point quotient, 2.46875

seven_point_nine_divided_by_three_point_two_shell_floor_division

Figure 7:  When we divide 7.9 by 3.2 in floor division, we still obtain a floating-point quotient, 2.0, but it does not have a significant fractional component.

Programming a Floor-Division Calculator in Python:

In the following section, we shall program a simple floor-division calculator in Python:

floor_division_calculator

Figure 8:  A simple floor-division calculator programmed in Python.  This program requests that the user input two numbers.  The program then takes these inputs; divides the dividend by the divisor; and then returns a rounded-down quotient.

output_floor_division_calculator_final

Figure 9:  What the previous program, depicted in Figure 8, outputs when run.

 

 

Integer Multiplication in Python.

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

integer_multiplication_python

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

integer_multiplication_python

x_multiplication_symbol_300dpi

Figure 1:  The Multiplication symbol.  This symbol is used as a Multiplication Operator in Mathematics, but not as a Multiplication Operator in programming languages such as Python.

asterisk_300dpi

Figure 2:  Instead of an ‘X’ symbol, we employ the asterisk symbol as a multiplication operator in Python.  Press the keyboard key with this symbol depicted on it so as to effect multiplication.

asterisk_python_font_300dpi

Figure 3:  What the asterisk symbol looks like rendered in Python’s default font.

What goes on, Arithmetically, in Multiplication?

In Arithmetic, Multiplication, is one of the four elementary operations.  We ought to examine what occurs, arithmetically, in integer multiplication.

 

Let us take the equation:

2 × 4 = 8

.  We pronounce the above equation, in English, as:

Two multiplied by four is equal to eight.

In the above equation, the integer, 2, is the multiplicand[1].  The integer, 2, is what is being multiplied by 4.  I looked up the word ‘multiplication’ in a Latin dictionary[2], and its transliterated equivalent gave:

‘to make many,’

as a definition.

In the above equation, the:

×

symbol is termed ‘the multiplication operator.’  To restate: ‘operator’ is Latin for ‘worker.’  It is the multiplication operator that facilitates the ‘operation’ or ‘work’ of multiplication.  In Python, we use the:

*

, or asterisk symbol, as a multiplication operator.  In Python, the multiplication operator is known as a ‘binary operator[3]’ as it takes two operands.  The operands, in question, are:

2

, the multiplicand, and:

4

, the multiplier.

In the Python equation:

>>> 2 * 4

8.0

>>>

The multiplicand, 2, and the multiplier, 4, are the two operands that the binary operator:

*

takes.

two_asterisk_four_shell

Figure 4:  In Python, we use the * symbol as a multiplication operator.  This is common to most programming languages.  In the above example, we have multiplied 2 by 4, and have got the product, 8.

Let us return to the equation:

2 × 4 = 8

In the above equation,

4

is termed ‘the multiplier.’  In English, the ‘-er’ suffix denotes the agent, or doer of an action.  It is the:

4

that is doing the dividing.  2 is being multiplied by 4.

In the equation:

2 × 4 = 8

the:

=

, or “equals sign,” is termed ‘the sign of equality.’  The sign of equality or equality operator tells us that 2 multiplied by 4 is equal to 8.

In the equation:

2 × 4 = 8

, 8 is termed ‘the product.’  The product is simply the result of multiplication.

The term, ‘product,’ comes from the Latin, ‘to lead forth.’[4]

The result of 2 being multiplied by 4 is 8, so, therefore, 8 is the product.

If we were doing ‘Sums’ in primary school, then:

8

, the product, would be our answer.

Integer Multiplication in Python

In this section, we shall program a simple Integer-Multiplication Calculator in Python.

integer_multiplication_calculator_final

Figure 5:  In the above-depicted program, we have programmed a simple Integer-Multiplication Calculator that requests the user to input a Multiplicand and a Multiplier, which are the two binary operands of the Multiplication Operator.  The Integer-Multiplication Calculator then returns a product.

output_integer_multiplication_calculator_final

Figure 6:  What the Integer-Multiplication Calculator, as depicted in Figure 5, outputs when we, the user, input the Multiplicand, 2, and the Multiplier, 4.  As we can see, the program outputs the product, 8.

Glossary:

-er

  • suffix
    1. denoting a person or thing that performs a specified action or activity: farmer | sprinkler
    2. denoting a person or thing that has a specified attribute or form: foreigner | two-wheeler.
    3. denoting a person concerned with a specified thing or subject: milliner | philosopher.
    4. denoting a person belonging to a specified place or group: city-dweller | New Yorker.

<ORIGIN> Old English -ere, of Germanic origin.

 

-ion

  • suffix forming nouns denoting verbal action: communion.
    • denoting an instance of this: a rebellion.
    • denoting a resulting state or product: oblivion | opinion.

<ORIGIN>  via French from Latin -ion-.

<USAGE> The suffix -ion is usually found preceded by s (-sion), t (-tion), or x (-xion).[5]

<ETYMOLOGY> From the Latin 3rd-declension nominal suffix, ‘-iō, -ōnis’.

 

-ious

  • suffix (forming adjectives) characterized by; full of: cautious | vivacious.

<ORIGIN> from French -ieux, from Latin -iosus.[6]

<ETYMOLOGY> From the Latin 1st-and-2nd-declension adjectival suffix, ‘-iōsa, -iōsus, -iōsum.’

 

-ity

  • suffix forming nouns denoting quality or condition: humility | probity.
    • denoting an instance or degree of this: a profanity.

<ORIGIN> from French -ité, from Latin -itas, -itatis.

<ETYMOLOGY> From the Latin 3rd-declension nominal suffix ‘-itās, itātis.’

 

equation

    1. [MATHEMATICS] a statement that the values of two mathematical expressions are equal (indicated by the sign =)
    2. [mass noun] the process of equating one thing with another: the equation of science with objectivity.
      • (the equation) a situation in which several factors must be taken into account: money also came into the equation.
    3. [CHEMISTRY] a symbolic representation of the changes which occur in a chemical reaction, expressed in terms of the formulae of the molecules or other species involved.

<PHRASES>

  • equation of the first (or second etc.) order [MATHEMATICS] an equation involving only the first derivative, second derivative, etc.

<ORIGIN> late Middle English: from Latin aequatio-(n-), from aequare ‘make equal’ (see EQUATE).[7]

<ETYMOLOGY> from the Latin 1st-and-2nd-declension adjective, ‘æqua, æquus, æquum,’ which means ‘equal;’ and the 3rd-declension nominal suffix, ‘-tiō, (-tiōnis),’ which denotes a state of being.  Therefore, etymologically, an ‘equation’ is ‘a state of being equal.’  Etymologically, therefore, an ‘equation’ is a mathematical statement that declares terms to be equal.


 

multiple

  • adjective.

having or involving several parts, elements, or members: multiple occupancy | a multiple pile-up | a multiple birth.

  • numerous and often varied: words with multiple meanings.
  • (of a disease, injury, etc.) complex in its nature or effects; affecting several parts of the body: a multiple fracture of the femur.
  • noun.
    1. a number that may be divided by another a certain number of times without a remainder: 15, 20, or any multiple of five.
    2. (also multiple shop or store)

BRITISH a shop with branches in many places, especially one selling a specific type of product.

<ORIGIN> mid 17th century: from French, from late Latin multiplus, alteration of Latin multiplex (see MULTIPLEX).[8]

<ETYMOLOGY> From the Latin 3rd-declension adjective, ‘multiplex, multiplicis’ which means ‘manifold.’  From the Latin 1st-and-2nd-declension adjective ‘multa, multus, multum,’ which means ‘many;’ and the Latin 3rd-conjugation verb, ‘plectō, plectere, plexī, plexum,’ which means ‘to plait,’ ‘to interweave.’

 

 

multiplex

    1. involving or consisting of many elements in a complex relationship: multiplex ties of work and friendship.
      • involving simultaneous transmission of several messages along a single channel of communication.
    2. (of a cinema) having several separate screens within one building.
  • verb. [with object] incorporate into multiplex signal or system.

<DERIVATIVES> multiplexer (also multiplexor) noun.

<ORIGIN> late Middle English in the mathematical sense ‘multiple’: from Latin.[9]

<ETYMOLOGY> From the Latin 3rd-declension adjective, ‘multiplex, multiplicis’ which means ‘manifold.’  From the Latin 1st-and-2nd-declension adjective ‘multa, multus, multum,’ which means ‘many;’ and the Latin 3rd-conjugation verb, ‘plectō, plectere, plexī, plexum,’ which means ‘to plait,’ ‘to interweave.’

 

 

multipliable

  • adjective. able to be multiplied.[10]

multiplicable

  • adjective. able to be multiplied

<ORIGIN> late 15th century: from Old French, from medieval Latin multiplicabilis, from Latin, from multiplex, multilplic- (see MULTIPLEX).

<ETYMOLOGY> From the Latin 3rd-declension adjective, ‘multiplicābilis, multiplicābile,’ which means ‘manifold.’  From the Latin 1st-and-2nd-declension adjective ‘multa, multus, multum,’ which means ‘many;’ and the Latin 3rd-conjugation verb, ‘plectō, plectere, plexī, plexum,’ which means ‘to plait,’ ‘to interweave;’ and the Latin 3rd-declension adjective, ‘habilis, habile,’ which means ‘having.’  The Latin 3rd-declension adjective, ‘habilis, habile,’ is the adjectival form of the Latin 2nd-declension verb, ‘habeō, habēre, habuī, habitum,’ which means ‘to have.’  The etymological meaning of the term, ‘multipliable,’ therefore, is ‘having the ability to be multiplied;’ ‘having the ability to be made many;’ ‘having the ability to be made manifold.’

multiplicand

  • noun. a quantity which is to be multiplied by another (the multiplier).

<ORIGIN> late 16th century: from medieval Latin multiplicandus ‘to be multiplied’, gerundive of Latin multiplicare (see multiply1).[11]

<ETYMOLOGY>  From the Latin 1st-declension verb, ‘multiplicō, multiplicāre, multiplicāvī, multiplicātum,’ which means ‘to multiply, increase, augment.’  ‘Multiplicandum est’ is the neuter gerundive form.  It means ‘that which must be multiplied;’ ‘that which must be made many.’

 

 

 

multiplication

  • noun. [mass noun] the process or skill of multiplying.
    • [MATHEMATICS] the process of combining matrices, vectors, or other quantities under specific rules to obtain their product.

<ORIGIN> late Middle English: from Old French, or from Latin: multiplication(n-), from multiplicare (see multiply1)[12]

<ETYMOLOGY>  From the Latin 3rd-declension feminine noun, ‘multĭpĭcātĭo, multĭpĭcātĭōnis,’ which means ‘a making manifold,’ ‘increasing,’ ‘multiplying.’  From the Latin 1st-and-2nd-declension adjective ‘multa, multus, multum,’ which means ‘many;’ and the Latin 3rd-conjugation verb, ‘plectō, plectere, plexī, plexum,’ which means ‘to plait,’ ‘to interweave;’ and the Latin 3rd-declension nominal suffix, ‘-iō, -ōnis’, which signifies a noun denoting a verbal action.  Therefore, the etymological definition of ‘multiplication’ is: ‘the action of multiplying;’ ‘the action of making many;’ ‘the action of making manifold;’ etc.

multiplication sign

  • noun. the sign , used indicate that one quantity is to be multiplied by another, as in .[13]

multiplication table

  • noun. a list of multiples of a particular number, typically from 1 to 12.[14]


 

multiplicative

  • adjective. subject to or of the nature of multiplication: coronary risk factors are multiplicative.[15]

<ETYMOLOGY>  From the Latin 1st-and-2nd-declension adjective, ‘multiplicātiva, multiplicātivus, multiplicātivum,’ which means ‘of multiplication;’ ‘of the action of making many;’ etc.  From the Latin 1st-and-2nd-declension adjective ‘multa, multus, multum,’ which means ‘many;’ and the Latin 3rd-conjugation verb, ‘plectō, plectere, plexī, plexum,’ which means ‘to plait,’ ‘to interweave;’ and the Latin 1st-and-2nd-declension nominal suffix, ‘-īva, – īvus, -īvum’, which signifies ‘of,’ ‘concerning’.  Therefore, the etymological definition of the English adjective, ‘multiplicative,’ is ‘concerning multiplication;’ ‘concerning the action of making many;’ ‘denoting multiplication;’ ‘denoting the action of making many;’ ‘of multiplication;’ ‘of the action of making many;’ etc.

multiplicity

  • noun. (plural. multiplicities) a large number or variety: the demand for higher education depends on a multiplity of

<ORIGIN> late Middle English: from late Latin multiplicitas, from Latin multiplex (see MULTIPLEX).[16]

<ETYMOLOGY> From the Late Latin 3rd-declension feminine noun, ‘multĭplĭcĭtas, multĭplĭcĭtātis,’ which means ‘multiplicity, manifoldness.’  From the Latin 1st-and-2nd-declension adjective ‘multa, multus, multum,’ which means ‘many;’ and the Latin 3rd-conjugation verb, ‘plectō, plectere, plexī, plexum,’ which means ‘to plait,’ ‘to interweave;’ and the Latin 3rd-declension nominal suffix, ‘-itās, itātis,’ which signifies a state of being.  Therefore, the etymological meaning of the English term, multiplicity, is ‘the state of being many;’ ‘the condition of being many;’ etc.

 

 

 

multiplier

  • noun.
    1. a quantity by which a given number (the multiplicand) is to be multiplied.
      • [ECONOMICS] a factor by which an increment of income exceeds the resulting increment of saving or investment.
    2. a device for increasing by repetition the intensity of an electric current, force, etc. to a measurable level.[17]

<ETYMOLOGY> From the English verb ‘to multiply,’ which means ‘to make manifold,’ and the English nominal suffix ‘-er,’ which denotes the performer of an action.  From the Latin 1st-and-2nd-declension adjective ‘multa, multus, multum,’ which means ‘many;’ and the Latin 3rd-conjugation verb, ‘plectō, plectere, plexī, plexum,’ which means ‘to plait,’ ‘to interweave;’ and the English suffix ‘-er,’ which denotes the performer of an action.  Therefore, the etymological definition of ‘multiplier’ is ‘the number that multiplies.’

 

 

multiply1

  • verb. (multiplies, multiplying, multiplied) [with object.]
    1. obtain from (a number) another which contains the first number a specified number of times: multiply fourteen by nineteen | [no object] we all know how to multiply by ten.
    2. increase or cause to increase greatly in number or quantity: [no object] ever since I became a landlord my troubles have multiplied tenfold | cigarette smoking combines with other factors to multiply the risks of atherosclerosis.
      • [no object] (of an animal or other organism) increase in number by reproducing.
      • [with object.] propagate (plants).

<ORIGIN>  Middle English: from Old French multiplier, from Latin multiplicare.[18]

<ETYMOLOGY>  From the Latin 1st-conjugation verb, ‘multiplicō, multiplicāre, multiplicāvī, multiplicātum,’ which means ‘to multipliy,’ ‘to increase,’ ‘to augment.’  From the Latin 1st-and-2nd-declension adjective, ‘multa, multus, multum,’ which means ‘many;’ and the Latin 3rd-conjugation verb, ‘plectō, plectere, plexī, plexum,’ which means ‘to plait,’ ‘to interweave.’  Therefore, the etymological definition of the English verb, ‘to multiply,’ is ‘to make manifold;’ ‘to make many;’ etc.

 

 

 

operator

  1. [MATHEMATICS] a symbol or function denoting an operation (e.g. ).[19]

<ETYMOLOGY>  From the 3rd-declension masculine Latin noun, ‘ŏpĕrātor, ŏpĕrātōris,’ which means ‘operator,’ ‘worker.’  The Latin 3rd-declension noun, ‘opus, operis,’ which means ‘work,’ ‘labour.’  From the Latin 1st-conjugation verb, ‘operō, operāre, operāvī, operātor;’ and the 3rd-declension nominal suffix, ‘-or,       (-ōris)’ which denotes a performer of an action.  Etymologically, as regards Mathematics, it is the operator that is said to perform the work of the operation.

 

operation

  • noun.

[mass noun] the action of functioning or the fact of being active or in effect: restrictions on the operation of market forces | the company’s first hotel is now in operation.

  1. [MATHEMATICS] a process in which a number, quantity, expression, etc., is altered or manipulated according to set formal rules, such as those of addition, multiplication, and differentiation.

<ORIGIN> late Middle English: via Old French from Latin operatio(n-), from the verb operari ‘expend labour on’ (see Operate)[20]

 

<ETYMOLOGY>  From the Latin 3rd-declension feminine noun, ‘ŏpĕrātĭo, ŏpĕrātĭōnis,’ which means ‘a working,’ ‘a work,’ ‘a labour,’ ‘operation.’  From the Latin 1st-declension deponent verb ‘operor, operāre, operātus sum,’ which means ‘to work,’ ‘to labour,’ ‘to expend labour on;’ and the Latin 3rd-declension nominal suffix, ‘-iō, (-iōnis),’ which denotes a state of being.  Etymologically, therefore, as regards Mathematics, an ‘operation’ is a ‘mathematical work;’ ‘mathematical working;’ a ‘mathematical labour.’  The mathematical work that would be carried out depends on the operator.  For instance, if the operator be a plus sign, then the mathematical work to be carried out would be addition.  Addition is a type of operation.

produce

  1. [GEOMETRY], DATED extend or continue (a line).

<ORIGIN> late Middle English (in sense 3 of the verb) from Latin producere, from pro- ‘forward’ + ducere ‘to lead’.  Current noun senses date from the late 17th century.[21]

<ETYMOLOGY> From the Latin 3rd-conjugation verb, ‘prōdūcō, prōdūcere, prōdūxī, prōductum’ which means ‘to lead forth;’ ‘to bring forth;’ From the Latin preposition, ‘prō,’ which means ‘forth,’ ‘forward;’ and the Latin 3rd-conjugation verb, ‘dūcō, dūcere, dūxī, ductum,’ meaning ‘to lead.’  Therefore the etymological definition of the English verb, ‘to produce,’ is ‘to lead forth;’ ‘to bring forth;’ etc.


 

product

  • noun.
  1. [MATHEMATICS] a quantity obtained by multiplying quantities together, or from analogous algebraic operation.

<ORIGIN> late Middle English (as a mathematical term): from Latin productum ‘something produced’, neuter past participle (used as a noun) of producer ‘bring forth’ (see PRODUCE).[22]

<ETYMOLOGY> From the Latin participle ‘prōductum,’ which means ‘a leading forth;’ ‘a bringing forth;’ etc.  From the Latin 3rd-conjugation verb, ‘prōdūcō, prōdūcere, prōdūxī, prōductum’ which means ‘to lead forth;’ ‘to bring forth;’ From the Latin preposition, ‘prō,’ which means ‘forth,’ ‘forward;’ and the Latin 3rd-conjugation verb, ‘dūcō, dūcere, dūxī, ductum,’ meaning ‘to lead.’  Therefore the etymological definition of the English verb, ‘to produce,’ is ‘to lead forth;’ ‘to bring forth;’ etc.  Hence the etymological definition of the English noun, ‘product’ is ‘[the result that is] brought forth [from the operation of multiplication];’ etc.

 

 

 


[1]  There seems to be some debate as to whether it be the first term – in this instance 2 – that is the multiplicand, or the second term – in this instance 4.  However, the way that I worded it: “two multiplied by four” leaves us in no doubt that it is the first term – in this instance 2 – that is the multiplicand.

[2]  multiplex icis, adj

[multus + PARC-], with many folds, much-winding: alvus…

Latin English Lexicon: Optimized for the Kindle, Thomas McCarthy, (Perilingua Language Tools: 2013) Version 2.1  Loc 62571.

Hence ‘multiplication,’ etymologically, means ‘to make manifold.’

See GLOSSARY

[3]  See the chapter on UNARY AND BINARY OPERATORS

[4]  The Latin 3rd-conjugation verb, ‘prōdūcō, prōdūcere, prōdūxī, prōdūctum.’  From the Latin preposition, ‘prō,’ meaning ‘forth,’ ‘forward;’ and the Latin 3rd-conjugation verb, ‘dūcō, dūcere, dūxī, ductum,’ meaning ‘to lead.’  The etymological meaning of ‘product,’ therefore, seems to be: ‘[the result,] that which is lead forth [from the process of multiplication].’

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

[6]  ibid.  Loc 362542.

[7]  ibid.  Loc 234861

[8]  ibid.  Loc 461693.

[9]  ibid.  Loc 461727.

[10]  ibid.  Loc 461740.

[11]  ibid.  Loc 461758.

[12]  ibid.  Loc 461781.

[13]  ibid.  Loc 461787.

[14]  ibid.  Loc 461790.

[15]  ibid.  Loc 461792.

[16]  ibid.  Loc 461805.

[17]  ibid.  Loc 461810.

[18]  ibid.  Loc 461817.

[19]  ibid.  Loc 493860.

[20]  ibid.  Loc 493797.

[21]  ibid.  Loc 560683.

[22]  ibid.  Loc 560753.

Integer Division in Python.

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

integer_division_python

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

integer_division_python

division_operator_cropped_300dpi

 

Figure 1:  The Division symbol.  This symbol is used as a Division Operator in Mathematics, but not as a Division Operator in programming languages such as Python.

What goes on, Arithmetically, in Division?

Division, in Arithmetic, is one of the four elementary operations.  We ought to examine what occurs, arithmetically, in integer division.

 

Let us take the equation:

8 ÷ 4 = 2

.  We pronounce the above equation, in English, as:

Eight divided by four is equal to two.

In the above equation, the integer, 8, is the dividend.  The integer, 8, is what is being divided up 4 ways.  I looked up the word ‘division’ in a Latin dictionary[1], and its transliterated equivalent gave:

‘to distribute,’

as a definition.  8 elements, the dividend, is being distributed amongst 4 sets, leaving 2 elements – the quotient – in each set.

At the end of the financial year, a portion of a company’s profits is divided up between the company’s shareholders.  This money that is divided up is termed a ‘dividend.’  The term, ‘dividend,’ comes from the Latin gerundive phrase, ‘dividendum est,’ which means ‘that which must be divided.’  In the above equation, it is the integer, 8, that must be divided.

In the above equation, the:

÷

symbol is termed ‘the division operator.’  To restate: ‘operator’ is Latin for ‘worker.’  It is the division operator that facilitates the ‘operation’ or ‘work’ of division.  In Python, we use the:

/

, or forward-slash symbol, as a division operator.  In Python, the division operator is known as a ‘binary operator’ as it takes two operands.  The operands, in question, are:

8

, the dividend, and:

4

, the divisor.

In the Python equation:

> > >8 / 4

2.0

> > >

The dividend, 8, and the divisor, 4, are the two operands that the binary operator:

/

takes.

integer_division_shell

 

Figure 2:  In python, we use the / symbol as a division operator.  This is common to most programming languages.  In the above example, we have divided 8 by 4, and have got the quotient, 2.0.

Let us return to the equation:

8 ÷ 4 = 2

In the above equation,

4

is termed ‘the divisor.’  In Latin, the ‘-or’ suffix denotes the agent, or doer of an action.  It is the:

4

that is doing the dividing.  8 is being divided by 4.

In the equation:

8 ÷ 4 = 2

the:

=

, or “equals sign,” is termed ‘the sign of equality.’  The sign of equality or equality operator tells us that 8 divided by 4 is equal to 2.

In the equation:

8 ÷ 4 = 2

, 2 is termed ‘the quotient.’  The quotient[2] is simply the result of division.

The result of 8 being divided 4 ways is 2, so, therefore, 2 is the quotient.

If we were doing ‘Sums’ in primary school, then:

2

, the quotient, would be our answer.

Integer Division in Python

In this section, we shall program a simple Integer-Division Calculator in Python.

integer_division_program_quotient_included_final

Figure 3:  In the above-depicted program, we have programmed a simple Integer-Division Calculator that requests the user to input a dividend and a Divisor.  The Integer-Division Calculator then returns a quotient.

integer_division_program_output_final_quotient_included

Figure 4:  What the Integer-Division Calculator, as depicted in Figure 3, outputs when we, the user, input the Dividend, 8, and the Divisor, 4.  As we can see, the program outputs the quotient, 2.

Glossary

divide

  • verb.
  1. [with object] [MATHEMATICS] find how many times (a number) contains another: 36 divided by 2 equals 18.
  • [no object] (of a number) be susceptible of division without a remainder: 30 does not divide by 8.
  • find how many times (a number) is contained in another: divide 4 into 20.

<ORIGIN> Middle English (as a verb): from Latin divider ‘force apart, remove’.  the noun dates from the mid 17th century.[3]

<ETYMOLOGY>  From the Latin 3rd-conjugation verb, ‘dīvidō dividere, dīvīsī, dīvīsum,’ which means, ‘to divide;’ ‘to separate.’  From the Latin inseparable particle, ‘dĭs,’ or ‘dis-’ which means ‘in two;’ and the Latin 2nd-declension verb, ‘videō vidēre, vīdī, vīsum,’ which means ‘to see.’  The etymological sense of the preceding seems to be ‘to arrange something such that it appear in two.’

dividend

    1. a sum of money paid regularly (typically annually) by a company to its shareholders out of its profits (or reserves).
      • a payment divided among a number of people, e.g. winners in a football pool or members of a cooperative.
      • an individual’s share of a dividend.
      • (dividends) a benefit from an action or policy: buying a rail pass may still pay dividends.
    2. [MATHEMATICS] a number to be divided by another number.

<ORIGIN> late 15th century (in the general sense ‘portion, share’): from Anglo-Norman French dividend, from Latin dividendum ‘something to be divided’, from the verb divider (see DIVIDE).[4]

<ETYMOLOGY>  From the Latin gerundive, ‘dīvidendum est,’ which means ‘that which must be divided.’  From the Latin 3rd-conjugation verb, ‘dīvidō dividere, dīvīsī, dīvīsum,’ which means, ‘to divide;’ ‘to separate.’  From the Latin inseparable particle, ‘dĭs,’ or ‘dis-’ which means ‘in two;’ and the Latin 2nd-declension verb, ‘videō vidēre, vīdī, vīsum,’ which means ‘to see.’  The etymological sense of the preceding seems to be ‘to arrange something such that it appear in two.’

 

 

division

  • noun. [mass noun]
    1. the action of separating something into parts or the process of being separated: the division of the land into small fields | a gene that helps regulate cell division.
      • the distribution of something separated into parts: the division of his estates between the two branches of his family.
      • [count noun] an instance of members of a legislative body separating into two groups to vote: the new clause was areed without a division.
      • [LOGIC] the action of dividing a wider class into two or mor subclasses.
    2. the process of dividing one number by another.
      • [MATHEMATICS] the process of dividing a matrix, vector, or other quantity by another under specificrules to obtain a quotient.

 

<ORIGIN> late Middle English: fromOld French devisiun, from Latin divisio(n-), from the verb dividere (see DIVIDE).[5]

<ETYMOLOGY>  From the Latin 3rd-declension Feminine noun, ‘dīvīsiō, dīvīsiōnis,’ which means ‘a division,’ ‘a distribution.’

 

 

divisor

  • noun. [MATHEMATICS] a number by which another number is to be divided.
    • a number that divides into another without a remainder.

<ORIGIN>  late Middle English: from French diviseur or Latin divisor, from dividere (see DIVIDE).[6]

<ETYMOLOGY>  From the Latin 3rd-declension masculine noun, ‘dīvīsor, dīvīsōris,’ which means ‘one who distributes.’

 

 

 

equation

    1. [MATHEMATICS] a statement that the values of two mathematical expressions are equal (indicated by the sign =)
    2. [mass noun] the process of equating one thing with another: the equation of science with objectivity.
      • (the equation) a situation in which several factors must be taken into account: money also came into the equation.
    3. [CHEMISTRY] a symbolic representation of the changes which occur in a chemical reaction, expressed in terms of the formulae of the molecules or other species involved.

<PHRASES>

  • equation of the first (or second etc.) order [MATHEMATICS] an equation involving only the first derivative, second derivative, etc.

<ORIGIN> late Middle English: from Latin aequatio-(n-), from aequare ‘make equal’ (see EQUATE).[7]

<ETYMOLOGY> from the Latin 1st-and-2nd-declension adjective, ‘æqua, æquus, æquum,’ which means ‘equal;’ and the 3rd-declension nominal suffix, ‘-tiō, (-tiōnis),’ which denotes a state of being.  Therefore, etymologically, an ‘equation’ is ‘a state of being equal.’  Etymologically, therefore, an ‘equation’ is a mathematical statement that declares terms to be equal.


 

operator

  1. [MATHEMATICS] a symbol or function denoting an operation (e.g. ).[8]

<ETYMOLOGY>  From the 3rd-declension masculine Latin noun, ‘ŏpĕrātor, ŏpĕrātōris,’ which means ‘operator,’ ‘worker.’  The Latin 3rd-declension noun, ‘opus, operis,’ which means ‘work,’ ‘labour.’  From the Latin 1st-conjugation verb, ‘operō, operāre, operāvī, operātor;’ and the 3rd-declension nominal suffix, ‘-or,       (-ōris)’ which denotes a performer of an action.  Etymologically, as regards Mathematics, it is the operator that is said to perform the work of the operation.

operation

  • noun.
    • [mass noun] the action of functioning or the fact of being active or in effect: restrictions on the operation of market forces | the company’s first hotel is now in operation.
  1. [MATHEMATICS] a process in which a number, quantity, expression, etc., is altered or manipulated according to set formal rules, such as those of addition, multiplication, and differentiation.

<ORIGIN> late Middle English: via Old French from Latin operatio(n-), from the verb operari ‘expend labour on’ (see Operate)[9]

 

<ETYMOLOGY>  From the Latin 3rd-declension feminine noun, ‘ŏpĕrātĭo, ŏpĕrātĭōnis,’ which means ‘a working,’ ‘a work,’ ‘a labour,’ ‘operation.’  From the Latin 1st-declension deponent verb ‘operor, operāre, operātus sum,’ which means ‘to work,’ ‘to labour,’ ‘to expend labour on;’ and the Latin 3rd-declension nominal suffix, ‘-iō, (-iōnis),’ which denotes a state of being.  Etymologically, therefore, as regards Mathematics, an ‘operation’ is a ‘mathematical work;’ ‘mathematical working;’ a ‘mathematical labour.’  The mathematical work that would be carried out depends on the operator.  For instance, if the operator be a plus sign, then the mathematical work to be carried out would be addition.  Addition is a type of operation.

 

 

 

 

 

 


[1]  dīvīsiō ōnis, f

[VID-], a division, distribution…

Latin English Lexicon: Optimized for the Kindle, Thomas McCarthy, (Perilingua Language Tools: 2013) Version 2.1  Loc 32190

See GLOSSARY

[2]  See the chapter, TWO WAYS OF CONCEPTUALISING DIVISION https://mathsandcomedy.com/2016/06/29/one-way-of-conceptualising-division/

https://mathsandcomedy.com/2016/07/03/another-way-of-conceptualising-division/

[3] Oxford University Press. Oxford Dictionary of English (Electronic Edition). Oxford. 2010.  Loc 202778

[4]  ibid.  Loc 202820

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

[6] ibid. Loc 203079

[7]  ibid.  Loc 234861

[8]  ibid.  Loc 493860.

[9] ibid.  Loc 493797

The Concatenation of Strings and Variables in Python.

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

the_concatenation_of_strings_and_variables

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

the_concatenation_of_strings_and_variables

Usually., when I need to concatenate[1] strings and non-string variables, I employ the:

+

sign and the:

str()

method to do so.

concatenation_str_method_program

Figure 1:  In the above program, we use the plus sign and the str() method so as to concatenate the integer variables, x and y, to a string contained within a print() statement.

concatenation_str_method_program_output

Figure 2:  What the program depicted in Figure 1 outputs.

However, it is also possible to concatenate strings and non-string variables by simply using a comma:

concatenation_comma_program

Figure 3:  In this example, we simply use a comma to concatenate the string,         “x = ” with the integer variable, x; and the string, “y = ” with the integer variable, y.

concatenation_comma_program_output

Figure 4:  What the program depicted in Figure 3 outputs.    Note that this program’s output is identical to what the program depicted in Figure 1 outputs.


[1]  See chapter on CONCATENATION.

Integers in Python:

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

what_is_an_integer

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

what_is_an_integer

What is an Integer?

In Mathematics:

An integer is a number that has no fractional[1] component.  The term ‘integer’ in Latin means ‘whole.’  So an Integer is a Whole Number[2].  A person who practises wholesome behaviour is a person with integrity.

In Number Theory, the set of integers is very often represented by a boldface Capital ‘Z’[3]:

Z

Sometimes, in Number Theory, the set of integers is represented by a blackboard bold ‘Z’:

  \mathbb {Z}

The set of integers comprises:

  • the number:

0

  • the sequence of positive Natural Numbers:

{1, 2, 3, 4, 5…}

  • the sequence of negative integers:

{-1, -2, -3, -4, -5…}

In Python:

In Python, integers are a datatype.  This datatype is assigned the keyword:

int

int_key_word

Figure 1:  In Python, the int keyword represents the integer datatype.

In Python, we can use the:

int()

method so as to convert numbers that might exist as strings, or other datatypes, to integers:

type_conversion_string_to_int

Figure 2:  In the above example, we convert the number, 3, from a Python string to a Python integer by using the int() method.  This is called ‘type conversion.’

type_conversion_float_to_int

Figure 3:  In the above example, we convert the number, 3.0, from a Python float to a Python integer by using the int() method.  This is called ‘type conversion.’

Glossary:

integer

  • noun.
    1. a number which is not a fraction; a whole number.
    2. a thing complete in itself.

<ORIGIN early 16th century (as an adjective meaning ‘entire, whole’): from Latin, ‘intact, whole’, from in(expressing negation) + the root of tangere ‘to touch’.  Compare with ENTIRE, also with Integral, integrate, and INTEGRITY[4].

<ETYMOLOGY> From the Latin 1st-and-2nd-declension adjective, ‘integra, integer, integrum,’ which means ‘complete,’ ‘whole,’ ‘intact.’  From the Latin prefix ‘in-,’ which expresses negation; and the Latin verb ‘tangō, tangere, tetigī, tāctum,’ which means ‘to touch.’  Etymologically, therefore, an ‘integer’ is a number that is ‘intact’ i.e. which does not have a fractional component.

 

 

 

 

 


[1]  Whereas ‘integer’ comes from the Latin word for ‘whole,’ ‘fraction’ comes from the Latin supine ‘frāctum,’ which means ‘broken.’  The term ‘fraction’ is derived from the Latin 3rd-conjugation verb, frangō, frangere, frēgī, frāctum,’ which means ‘to break,’ ‘to shatter.’  If something be fragile, then it is easily broken; it is liable to shatter.  A fraction, etymologically, is like a broken-off piece of a number.

[2]  I speak, here, in general parlance.  Mathematically, some would argue a difference between whole numbers and integers.  Mathematicians sometimes regard whole numbers as comprising the sequence of positive integers: {0, 1, 2, 3, 4, 5…}.  I am merely trying to get across the concept that an Integer has no fractional part.

[3]  The ‘Z’ represents the plural of the German feminine noun, ‘die Zahl,’ ‘the number,’ which is ‘die Zahlen.’

[4]  Oxford University Press. Oxford Dictionary of English (Electronic Edition). Oxford. 2010.  Loc 357261

Triple Quotes in Python.

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

three_quotes_blind_mice_ii

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

three_quotes_blind_mice

triple_single_quote_marks

Figure 1:  Triple quotes are a peculiarity of Python’s.

 

Triple quotes are peculiar to the syntax of the Python programming language.

Multi-line Comments:

One use for them is to enable multi-line comments:

biographical_comment

Figure 2:  In this short program that calculates Voltage, I use triple quotes so as to make a multi-line biographical comment concerning Count Alessandro Volta.

In many programming languages, such as C, we can make similar multi-line comments by enclosing these comments within:

/* */

as in:

/* Your multi-line comment goes here. */

Multi-line Strings:

Triple quotes can also be employed so as to print multi-line strings.

three_blind_mice

Figure 3:  I drew the above image with gel pens; felt-tip pens; and pencils.   In the following example, we are going to use triple quotes so as to print the nursery rhyme, Three Blind Mice, as a multi-line String.

Let us say that we have a piece of text that we wish to print to screen:

three_blind_mice_screenshot

Figure 4:  This is the piece of text that we wish to print to screen.

One way, that we might imagine of doing this, would be to simply copy the text and then to paste it inside a:

print(“”)

statement:

three_blind_mice_string_wont_work

Figure 5:  We do not even need to run this program to see that it will not work, but we shall:

f5_three_blind_mice_screenshot

Figure 6:  This is what occurs when we try to run this defective program.

Another option would be to enter in the text manually, and to apply the correct formatting ourselves:our_formatting_3_blind_mice

Figure 7:  This works.  It took a lot of effort on our part, though.

our_formatting_3_blind_mice_output

Figure 8:  The result of the program depicted in Figure 7’s being run.

We can actually print the above String within single quotes by using the:

\n

sequence:

three_blind_mice_escape_n

Figure 9:  We can print Three Blind Mice as a String within a single print() statement by using the \n sequence.

n_sequence_blind_mice_output

Figure 10:  The result of the program depicted in Figure 9’s being run.

But that program that the computer refused to interpret:

three_blind_mice_string_wont_work

Figure 11:  We tried to print out a multi-line string by only using single quotes.  As we can observe from the syntax-highlighting, the program is defective and cannot be interpreted.

f5_three_blind_mice_screenshot

Figure 12:  To restate: the computer refuses to interpret this program.

There is a way of fixing the program that will not run in Figures 11 and 12 without too much ado: by simply adding two more quotation marks at each end:

triple_quotes_single_print_statement

Figure 13:  Now our print() statement contains triple quotation marks at each end.

Having added the triple quotes, our program will now be interpreted without any difficulty:

result_triple_quotes_output

Figure 14:  What the previous debugged program outputs.  We debugged the program that would not be interpreted by replacing single quotes with double quotes.