Code & Mathematical Expression Language in Life Notes

Code & Mathematical Expression Language in Life

  • Goals:
    • Explore how math systems resemble language.
    • Facilitate language analysis.
    • Model language.
    • Understand the fundamental symbolic underpinnings of mathematical expressions.

Code

  • A regularized system of meaningful symbols found in:
    • Human languages
    • Mathematical expressions
    • Programming codes

Mathematics

  • Definitions:
    • "The science of quantity"
    • "All mathematics is symbolic logic"
  • A system of expressing numeric values.
  • Mathematical expressions use a coded system.

Numerals, Numeric Glyphs, and Numbers

  • Numeral:
    • A unit of language that expresses a quantity or amount, or number.
  • Numeric Glyph:
    • A unit of writing that represents a numeral or its corresponding quantity/number.
  • Numeral characters (numeric glyphs):
    • As pictograms:
      • 11 = the amount of one (number/concept).
      • 22 = the amount of two.
      • 1010 = the amount of ten.
      • etc.
    • As logograms:
      • 11 = one
      • 22 = two
      • 1010 = ten
      • etc.

Numeral Systems

  • Hindu-Arabic numeric glyphs:
    • Some with iconic origins: 1,2,3,41, 2, 3, 4
  • Hindu-Arabic numeric glyphs:
    • Some with origins in older systems: 5,6,7,8,95, 6, 7, 8, 9
      • Possibly acrophonic (e.g., origin of 5 resembles letter for first consonant of panca).
      • Or, alphanumeric (e.g., 6 has same origin as 6th glyph in Arabic abjad).
    • Compare with Greek numerals:
      • α=1,β=2,γ=3,δ=4,\alpha = 1, \beta = 2, \gamma = 3, \delta = 4, …
      • ι=10,κ=20,λ=30,\iota = 10, \kappa = 20, \lambda = 30, …

Symbolic Expressions

  • Expression:
    • Any meaningful symbol or combo of symbols.
  • Statement/Assertion:
    • An expression that can be true or false.
  • Question:
    • Checks for truth/falsehood.
  • Term:
    • An expression that is a participant/argument of a statement or a question.
    • Some symbol signifying a quantity or amount (e.g., one, two, 1, 2).
    • Terms have values.
    • c.f. nouns identify reference / concepts / categories
  • Symbolism of operators:
    • Words/glyphs representing operations, functions.
    • Examples: ,+,,×,÷,=,f(),, +, –, \times, \div, =, f(), …
  • Complex Term:
    • A quantity expressed through a combination of symbols.
    • Examples: 12,2+312, 2 + 3
    • Interpreted with a grammar, ordering of characters, operators, and parentheses.

Linguistic & Mathematical Statements

  • Statements:

    • Expressions that can be true or false.
    • Example:
      • Asif sees Yael.
      • 2+3=52 + 3 = 5
    • Asif sees Yael:
      • Contains a verb "see" with two arguments (subject & object; one who sees, one who is seen).
      • An expression with terms and operators.
    • 2+3=52 + 3 = 5
      • Operator ++ with two arguments (2,32, 3).
      • == is a relational operator that asserts identity of value for two arguments (2+32+3 and 55).
      • Mathematical schooling trains how to resolve more complex terms to simpler terms.
  • Terms and statements can differ in their structure across systems of expression:

    • 2+32 + 3
    • sum(2,3)\text{sum}(2,3)
    • x=yx = y
    • isEqual(x,y)\text{isEqual}(x,y)
    • x.isEqual(y)x.\text{isEqual}(y)

Order of Magnitude

  • A degree of quantity oriented to the numeric base.
  • Quantities larger than the base are expressed with symbolic complexity.
  • In the decimal system:
    • Each value between 0-9 has a simple glyph.
    • 1010 is "symbolically complex".
  • Each additional column represents another order of magnitude (“ones,” “tens,” “hundreds”).
  • Base 8 System:
    • b8 b10
    • 000 0
    • 111 1
    • 222 2
    • 333 3
    • 444 4
    • 555 5
    • 666 6
    • 777 7
    • 10810 8
    • 11911 9
    • 121012 10
    • 131113 11
    • 141214 12
    • 151315 13
    • 161416 14
    • 171517 15
    • 201620 16
    • 10064100 64
  • Base 6 System:
    • b6 b10
    • 000 0
    • 111 1
    • 222 2
    • 333 3
    • 444 4
    • 555 5
    • 10610 6
    • 11711 7
    • 12812 8
    • 13913 9
    • 141014 10
    • 151115 11
    • 201220 12
    • 211321 13
    • 221422 14
    • 231523 15
    • 241624 16
    • 251725 17
    • 553555 35
    • 10036100 36

Binary Numeric Systems

  • Binary numbers: base 2 numeral system.

    • b2 b10
    • 000 0
    • 111 1
    • 10210 2
    • 11311 3
    • 1004100 4
    • 1015101 5
    • 1106110 6
    • 1117111 7
    • 100081000 8
    • 100191001 9
    • 1010101010 10
    • 1011111011 11
    • 1100121100 12
    • 1101131101 13
    • 1110141110 14
    • 1111151111 15
    • 100001610000 16
  • Binary:

    • Information encoded using on/off or yes/no.
    • on = 1, off = 0.
    • Each “spot” or column is a bit.
    • A chunk of bits is a byte.
      *Binary numbers, as 4-bit expressions:
    • 000000000 0
    • 000110001 1
    • 001020010 2
    • 001130011 3
    • 010040100 4
    • 010150101 5
    • 011060110 6
    • 011170111 7
    • 100081000 8
    • 100191001 9
    • 1010101010 10
    • 1011111011 11
    • 1100121100 12
    • 1101131101 13
    • 1110141110 14
    • 1111151111 15
    • Using symbols:
    • 0\Box\Box\Box\Box 0
    • 1\Box\Box\Box\blacksquare 1
    • 2\Box\Box\blacksquare\Box 2
    • 3\Box\Box\blacksquare\blacksquare 3
    • 4\Box\blacksquare\Box\Box 4
    • 5\Box\blacksquare\Box\blacksquare 5
    • 6\Box\blacksquare\blacksquare\Box 6
    • 7\Box\blacksquare\blacksquare\blacksquare 7
    • 8\blacksquare\Box\Box\Box 8
    • 9\blacksquare\Box\Box\blacksquare 9
    • 10\blacksquare\Box\blacksquare\Box 10
    • 11\blacksquare\Box\blacksquare\blacksquare 11
    • 12\blacksquare\blacksquare\Box\Box 12
    • 13\blacksquare\blacksquare\Box\blacksquare 13
    • 14\blacksquare\blacksquare\blacksquare\Box 14
    • 15\blacksquare\blacksquare\blacksquare\blacksquare 15
  • 8-digit system = 8 bits per byte.

    • Range of 00000000 (0) to 11111111 (255).
    • 256 possible values in an 8 bit space.
  • Used in many computing contexts:

    • Internet Protocol (IP) addresses: 255.255.255.255
    • RGB (red-green-blue) values: 255.255.255
    • ASCII: 256 glyphs in basic typeset
    • Max # of rupees for Link in Legend of Zelda
  • Other binary systems:

    • Looms, music boxes
    • Morse code
    • Punch cards

Extensions of Mathematical Expression in Programming Languages

  • Terms can be non-numeric.
  • Operators can be non-arithmetic.
  • Statements use more operators aside from ,=,<,>, =, <, >
  • Computers interface between levels of code.

Levels of Code

  • Low-level vs. high-level:
    • HL: characters, human-readable commands.
    • LL: bits, bytes, cryptic commands.
    • All data & expression is reducible to binary.

Low-Level Code

  • Programmatic expressions that interface with circuitry & machinery.
  • Expressions in binary notation.
  • Statements, commands, terms.
  • Lexical expression of command: arbitrary.
  • Programmatic expressions that interface with circuitry & machinery.
    • 1/01/0 expression matches physical characteristics of the medium.
    • "Phonological" expression of statement: iconic.

Code and Computers

  • Code:
    • A system of symbols and rules for expressing information in a form usable by a computer.
    • Generally used to get a computer to do something that a human wants it to do.
    • Code is commands, whereas human language is not (generally).
    • Constructions with embedded statements and terms.

Expressions in Code

  • A system with terms, operators, statements.
  • Terms may be variables or constants.
  • Operators include functions.
  • Wider range of statements.
  • Statements may resolve to TRUE or FALSE.
  • “Control” statements – ask questions.
  • Terms:
    • Constants:
      • 1212
      • 2+32 + 3
      • pi\text{pi}
    • Variables (representing numbers, arrays, strings):
      • i=2i = 2
      • j=(2,3,4)j = (2, 3, 4)
      • k="pizza"k = \text{"pizza"}
  • Terms as commands:
    • > i 2
    • > 2 + 3 5
    • `> k