Category Archives: understanding math

Semantics of algebra I

Note: This post uses MathJax. If you see mathematical formulas with dollar signs around them, or badly formatted formulas, try refreshing the screen. Sometimes you have to do it two or three times.

In the post Algebra is a difficult foreign language  I listed some of the difficulties of the syntax of the symbolic language of math (which includes high school algebra and precalculus).  The semantics causes difficulties as well.  Again I will list some examples without any attempt at completeness.

The status of the symbolic language as a language

There is a sharp distinction between the symbolic language of math and mathematical English, which I have written about in The languages of math and in the Handbook of mathematical discourse. Other authors do not make this sharp distinction (see the list of references at the end of this post). The symbolic language occurs embedded in mathematical English and the embedding has its own semantics which may cause great difficulty for students.

The symbolic language of math can be described as a natural formal language. Pieces of it were invented by mathematicians and others over the course of the last several hundred years. Individual pieces (notation such as "$3x+1=2y$") can be given a strictly formal syntax, but the whole system is ambiguous, inconsistent, and context-sensitive.  When you get to the research level, it has many dialects: Research mathematicians in one field may not be able to read research articles in a very different field.

Examples

I think the examples below will make these claims plausible.  This should be the subject of deep research.

Superscripts and functions

  • A superscript, as in $5^2$ or $x^3$, has a pretty standard meaning denoting a power, at least until you get to higher level stuff such as tensors.  
  • A function can be denoted by a letter, symbol, or string, and the notation $f(x)$ refers to the value of the function at input $x$.  

For functions defined on numbers, it is common in precalculus and higher to write $f^2(x)$ to denoted $(f(x))^2=f(x)\,f(x)$.  Since the value of certain multiletter functions are commonly written without the parentheses (for example, $\sin\,x$), one writes $\sin^2x$ to mean $(\sin\,x)^2$.

The notation $f^n$ is also widely used to mean the $n$th iterate of $f$ (if it exists), so $f^3(x)=f(f(f(x)))$ and so on.  This leads naturally to writing $f^{-1}(x)$ for the inverse function of $f$; this is common notation whether the function $f$ is bijective or not (in which case $f^{-1}$ is set-valued).  Thus $\sin^{-1}x$ means $\arcsin\,x$.

It is notorious that words in mathematical English have different meanings in different texts.  This is an example in the symbolic language (and not just at the research level) of a systematic construction that can give expressions that have ambiguous meanings.

This phenomenon is an example of why I say the symbolic language of math is a natural formal language: I have described a natural extension of notation used with multiplication of values that has been extended to being used for the binary operation of composition.  And that leads to students thinking that $\sin^{-1}x$ means $\frac{1}{\sin\,x}$. 

History can overtake notation, too: Mathematicians probably took to writing $\sin\,x$ instead of $\sin(x)$ because it saves writing.  That was not very misleading in the old days when mathematical variables were always single symbols.  But students see multiletter variable names all the time these days (in programming languages, Excel and elsewhere), so of course some of them think $\sin\,x$ means $\sin$ times $x$. People who do this are not idiots.

Juxtaposition

Juxtaposition of two symbols means many different things.

  • If $m$ and $n$ are numbers, $mn$ denotes the product of the two numbers.
    • Multiplication is commutative, so $mn$ and $nm$ denote the same number, but they correspond to different calculations.  
  • If $M$ and $N$ are matrices, $MN$ denotes the matrix product of the two matrices.
    • This is a binary operation but it is not the same operation denoted by juxtaposition of numbers. (In fact it involves both addition and multiplication of numbers.)
    • Now $MN$ may not be the same matrix as $NM$.
  • If $A$ and $B$ are points in a geometric drawing, $AB$ denotes the line segment from $A$ to $B$.
    • This is a function of two variables denoting points whose value is a line segment.  
    • It is not what is usually called a binary operation, although as an opinionated category theorist I would call it a multisorted binary operation.
    • It is commutative, but it doesn't make sense to ask if it is associative.

This phenomenon is called overloaded notation.  

  • In order to understand the meaning of the juxtaposition of symbols, you have to know the type of the variables.
  • The surrounding text may tell you specifically the variables denote matrices or whatever. So this is an instance of context-sensitive semantics. 
    • Students tend to expect that they know what any formula means in isolation from the text.  It may make them very sad to discover that this doesn't work — once they believe it, which can take quite a while.
  • In many cases the problem is alleviated by the use of convention.
    • Matrices are usually denoted by capital letters, numbers by lower case letters.
    • But points in geometry are usually denoted by capital letters too.  So you have to know that referring to a geometric diagram is significant to understanding the notation. This is an indirect form of context-sensitivity.  Did any teacher every point this out to students?  Does it appear anywhere in print?

The earlier example of $\sin^{-1}x$ is a case which is not context-sensitive.  Knowing the types of the variables won't help.  Of course, if the author explains which meaning is meant, that explanation is within the context of the book!  That is not a lot of help for grasshoppers like me that look back and forth at different parts of a math book instead of reading it straight through..  

Equations

Consider the expressions

  1. $x^2-5x+4=0$
  2. $x^2+y^2=1$
  3. $x^2+2x+1=(x+1)^2$

They are assertions that two expressions have the same value. A strictly logical view of an equation containing variables is that it puts a constraint on the variables.  It is true of some numbers (or pairs of numbers) and false of others.  That is the defining property of an equation. Equation 1 requires that $x=1$ or $x=4$.  Equation 2 imposes a constraint which is satisfied by uncountably many pairs of real numbers, and is also not true of uncountably many pairs. But equation 3 puts no constraint on the variable.  It is true of every number $x$.

A strictly logical view of symbolic notation does math a disservice.  Here, the notion that an equation is by definition a symbolic statement that has a truth set and a falsity set may be correct but it is not the important thing about any particular equation. When we read and do math we have many different metaphors and images about a concept.  The definition of a kind of object is often in terms of things that may not be the most important things to know about it.  (One of the most important fact about groups is that it is an abstraction of symmetries, which the axioms don't mention at all.)

Equation 1. is something that would make most people set out to discover the truth set.  Equation 2. calls out for drawing its graph.  Equation 3. being an identity means that is useful in algebraic reasoning.  The images they call up are different and what you do with them is different.  The images and metaphors that cluster around a concept are an important part of the semantics of the symbolic language.

I expect to post separately about the semantics of variables and about the semantics of symbolic language embedded in mathematical English.

References

Send to Kindle

Algebra is a difficult foreign language

Note: This post uses MathJax.  If you see mathematical formulas with dollar signs around them, or badly formatted formulas, try refreshing the screen. Sometimes you have to do it two or three times.

Algebra

In a previous post, I said that the symbolic language of mathematics is difficult to learn and that we don't teach it well. (The symbolic language includes as a subset the notation used in high school algebra, precalculus, and calculus.) I gave some examples in that post but now I want to go into more detail.  This discussion is an incomplete sketch of some aspects of the syntax of the symbolic language.  I will write one or more posts about the semantics later.

The languages of math

First, let's distinguish between mathematical English and the symbolic language of math. 

  • Mathematical English is a special register or jargon of English. It has not only its special vocabulary, like any jargon, but also used ordinary English words such as "If…then", "definition" and "let" in special ways. 
  • The symbolic language of math is a distinct, special-purpose written language which is not a dialect of the English language and can in fact be read by mathematicians with little knowledge of English.
    • It has its own symbols and rules that are quite different from spoken languages. 
    • Simple expressions can be pronounced, but complicated expressions may only be pointed to or referred to.
  • A mathematical article or book is typically written using mathematical English interspersed with expressions in the symbolic language of math.

Symbolic expressions

A symbolic noun (logicians call it a term) is an expression in the symbolic language that names a number or other mathematical object, and may carry other information as well.

  • "3" is a noun denoting the number 3.
  • "$\text{Sym}_3$" is a noun denoting the symmetric group of order 3.
  • "$2+1$" is a noun denoting the number 3.  But it contains more information than that: it describes a way of calculating 3 as a sum.
  • "$\sin^2\frac{\pi}{4}$" is a noun denoting the number $\frac{1}{2}$, and it also describes a computation that yields the number $\frac{1}{2}$.  If you understand the symbolic language and know that $\sin$ is a numerical function, you can recognize "$\sin^2\frac{\pi}{4}$" as a symbolic noun representing a number even if you don't know how to calculate it.
  • "$2+1$" and "$\sin^2\frac{\pi}{4}$" are said to be encapsulated computations.
    • The word "encapsulated" refers to the fact that to understand what the expressions mean, you must think of the computation not as a process but as an object.
    • Note that a computer program is also an object, not a process.
  • "$a+1$" and "$\sin^2\frac{\pi x}{4}$" are encapsulated computations containing variables that represent numbers. In these cases you can calculate the value of these computations if you give values to the variables.  

symbolic statement is a symbolic expression that represents a statement that is either true or false or free, meaning that it contains variables and is true or false depending on the values assigned to the variables.

  • $\pi\gt0$ is a symbolic assertion that is true.
  • $\pi\lt0$ is a symbolic assertion that it is false.  The fact that it is false does not stop it from being a symbolic assertion.
  • $x^2-5x+4\gt0$ is an assertion that is true for $x=5$ and false for $x=1$.
  • $x^2-5x+4=0$ is an assertion that is true for $x=1$ and $x=4$ and false for all other numbers $x$.
  • $x^2+2x+1=(x+1)^2$ is an assertion that is true for all numbers $x$. 

Properties of the symbolic language

The constituents of a symbolic expression are symbols for numbers, variables and other mathematical objects. In a particular expression, the symbols are arranged according to conventions that must be understood by the reader. These conventions form the syntax or grammar of symbolic expressions. 

The symbolic language has been invented piecemeal by mathematicians over the past several centuries. It is thus a natural language and like all natural languages it has irregularities and often results in ambiguous expressions. It is therefore difficult to learn and requires much practice to learn to use it well. Students learn the grammar in school and are often expected to understand it by osmosis instead of by being taught specifically.  However, it is not as difficult to learn well as a foreign language is.

In the basic symbolic language, expressions are written as strings of symbols.

  • The symbolic language gives (sometimes ambiguous) meaning to symbols placed above or below the line of symbols, so the strings are in some sense more than one dimensional but less than two-dimensional.
  • Integral notation, limit notation, and others, are two-dimensional enough to have two or three levels of symbols. 
  • Matrices are fully two-dimensional symbols, and so are commutative diagrams.
  • I will not consider graphs (in both senses) and geometric drawings in this post because I am not sure what I want to write about them.

Syntax of the language

One of the basic methods of the symbolic language is the use of constructors.  These can usually be analyzed as functions or operators, but I am thinking of "constructor" as a linguistic device for producing an expression denoting a mathematical object or assertion. Ordinary languages have constructors, too; for example "-ness" makes a noun out of a verb ("good" to "goodness") and "and" forms a grouping ("men and women").

Special symbols

The language uses special symbols both as names of specific objects and as constructors.

  • The digits "0", "1", "2" are named by special symbols.  So are some other objects: "$\emptyset$", "$\infty$".
  • Certain verbs are represented by special symbols: "$=$", "$\lt$", "$\in$", "$\subseteq$".
  • Some constructors are infixes: "$2+3$" denotes the sum of 2 and 3 and "$2-3$" denotes the difference between them.
  • Others are placed before, after, above or even below the name of an object.  Examples: $a'$, which can mean the derivative of $a$ or the name of another variable; $n!$ denotes $n$ factorial; $a^\star$ is the dual of $a$ in some contexts; $\vec{v}$ constructs a vector whose name is "$v$".
  • Letters from other alphabets may be used as names of objects, either defined in the context of a particular article, or with more nearly global meaning such as "$\pi$" (but "$\pi$" can denote a projection, too).

This is a lot of stuff for students to learn. Each symbol has its own rules of use (where you put it, which sort of expression you may it with, etc.)  And the meaning is often determined by context. For example $\pi x$ usually means $\pi$ multiplied by $x$, but in some books it can mean the function $\pi$ evaluated at $x$. (But this is a remark about semantics — more in another post.)

"Systematic" notation

  • The form "$f(x)$" is systematically used to denote the value of a function $f$ at the input $x$.  But this usage has variations that confuse beginning students:
    • "$\sin\,x$" is more common than "$\sin(x)$".
    • When the function has just been named as a letter, "$f(x)$" is more common that "$fx$" but many authors do use the latter.
  • Raising a symbol after another symbol commonly denotes exponentiation: "$x^2$" denotes $x$ times $x$.  But it is used in a different meaning in the case of tensors (and elsewhere).
  • Lowering a symbol after another symbol, as in "$x_i$"  may denote an item in a sequence.  But "$f_x$" is more likely to denote a partial derivative.
  • The integral notation is quite complicated.  The expression \[\int_a^b f(x)\,dx\] has three parameters, $a$, $b$ and $f$, and a bound variable $x$ that specifies the variable used in the formula for $f$.  Students gradually learn the significance of these facts as they work with integrals. 

Variables

Variables have deep problems concerned with their meaning (semantics). But substitution for variables causes syntactic problems that students have difficulty with as well.

  • Substituting $4$ for $x$ in the expression $3+x$ results in $3+4$. 
  • Substituting $4$ for $x$ in the expression $3x$ results in $12$, not $34$. 
  • Substituting "$y+z$" in the expression $3x$ results in $3(y+z)$, not $3y+z$.  Some of my calculus students in preforming this substitution would write $3\,\,y+z$, using a space to separate.  The rules don't allow that, but I think it is a perfectly natural mistake. 

Using expressions and writing about them

  • If I write "If $x$ is an odd integer, then $3+x$ is odd", then I am using $3+x$ in a sentence. It is a noun denoting an unspecified number which can be constructed in a specified way.
  • When I mention substituting $4$ for $x$ in "$3+x$", I am talking about the expression $3+x$.  I am not writing about a number, I am writing about a string of symbols.  This distinction causes students major difficulties and teacher hardly ever talk about it.
  • In the section on variables, I wrote "the expression $3+x$", which shows more explicitly that I am talking about it as an expression.
    • Note that quotes in novels don't mean you are talking about the expression inside the quotes, it means you are describing the act of a person saying something.
  • It is very common to write something like, "If I substitute $4$ for $x$ in $3x$ I get $3 \times 4=12$".  This is called a parenthetic assertion, and it is literally nonsense (it says I get an equation).
  • If I pronounce the sentence "We know that $x\gt0$" we pronounce "$x\gt0$" as "$x$ is greater than zero",  If I pronounce the sentence "For any $x\gt0$ there is $y\gt0$ for which $x\gt y$", then I pronounce the expression "$x\gt0$" as "$x$ greater than zero$",  This is an example of context-sensitive pronunciation
  • There is a lot more about parenthetic assertions and context-sensitive pronunciation in More about the languages of math.

Conclusion

I have described some aspects of the syntax of the symbolic language of math. Learning that syntax is difficult and requires a lot of practice. Students who manage to learn the syntax and semantics can go on to learn further math, but students who don't are forever blocked from many rewarding careers. I heard someone say at the MathFest in Madison that about 25% of all high school students never really understand algebra.  I have only taught college students, but some students (maybe 5%) who get into freshman calculus in college are weak enough in algebra that they cannot continue. 

I am not proposing that all aspects of the syntax (or semantics) be taught explicitly.  A lot must be learned by doing algebra, where they pick up the syntax subconsciously just as they pick up lots of other behavior-information in and out of school. But teachers should explicitly understand the structure of algebra at least in some basic way so that they can be aware of the source of many of the students' problems. 

It is likely that the widespread use of computers will allow some parts of the symbolic language of math to be replaced by other methods such as using Excel or some visual manipulation of operations as suggested in my post Mathematical and linguistic ability.  It is also likely that the symbolic language will gradually be improved to get rid of ambiguities and irregularities.  But a deliberate top-down effort to simplify notation will not succeed. Such things rarely succeed.

References

 

 

Send to Kindle

Mathematical and linguistic ability

This post uses MathJax.  If you see mathematical formulas with dollar signs around them, or badly formatted formulas, try refreshing the screen.  Sometimes you have to do it two or three times.

Some personal history

When I was young, I was your typical nerdy geek.  (Never mind what I am now that I am old.)

In high school, I was fascinated by languages, primarily by their structure.  I would have wanted to become a linguist if I had known there was such a thing.  I was good at grasping the structure of a language and read grammars for fun. I was only pretty good at picking up vocabulary. I studied four different languages in high school and college and Turkish when I was in the military.  I know a lot about their structure but am not fluent in any of them (possibly including English).

After college, I decided to go to math grad school.  This was soon after Sputnik and jobs for PhD's were temporarily easy to get.

I always found algebra easy.  When I had to learn other symbolic languages, for example set theory, first order logic, and early programming languages, I found them easy too.  I had enough geometric insight that I did well in all my math courses, but my real strength was in learning languages. 

When I got a job at (what is now) Case Western Reserve University, I began learning category theory and a bit of cohomology of groups. I wrote a paper about group automorphisms that got into Transactions of the AMS.  (Full disclosure: I am bragging). 

The way Saunders Mac Lane did cohomology, he used "$+$" as a noncommutative operation.  No problem with that, I did lots of calculations in his notation.  In reading category theory I learned how to reason using commutative diagrams.  That is radically different from other math — it isn't strings of symbols — but I caught on. I read Beck's thesis in detail.  Beck wrote functions on the right (unlike Mac Lane) which I adapted to with no problem.  In fact my automorphisms paper and many others in those days was written with functions on the right. 

Later on in my career, I learned to program in Forth reasonably well. It is a reverse Polish language. Then (by virtue of summer grants in the 1990's) to use Mathematica, which I now use a lot:  I am an "experienced" user but not an "expert".

Learning foreign languages in studying math

I taught mostly engineering students during my 35 years at CWRU (especially computer engineering). When I used a text (including my own discrete math class notes) some students pleaded with me not to use $P\wedge Q$ and $P \vee Q$ but let them use $PQ$ and $P+Q$ like they did in their CS courses.  Likewise $1$ and $0$ instead of T and F.  Many of them simply could not switch easily between different codes.  Similar problems occurred in classes in first order logic. 

In the early days of calculators when most of them were reverse Polish, some students never mastered their use. 

These days, a common complaint about Mathematica is that it is a difficult language to learn; at the MAA meeting in Madison (where I am as I write this) they didn't even staff a booth.  Apparently too many of the professors can't handle Mathematica.

I gave up writing papers with functions on the right because several professional mathematicians complained that they found them too hard to read. I guess not all professional mathematicians can switch code easily, either. 

There are many great mathematicians whose main strength is geometric understanding, not linguistic understanding.  Nevertheless, to become a mathematician you have to have enough linguistic ability to learn…

Algebra

The big elephant in the room is ordinary symbolic algebra as is used in high school algebra and precalculus.  This of course causes difficulty among first year calculus students, too, but college profs are spared the problem that high school teachers have with a large percentage of the students never really grasping how algebra works.  We don't see those students in STEM courses.

It is surely the case that algebra is a difficult and unintuitive foreign language.  I have carried on about this in my stuff about the languages of math in my abstractmath site. 

Some students already in college don't really understand expressions such as $x^2$.  You still get some who sporadically think it means $2x$.  (They don't always think that, but it happens when they are off guard.)  Lots of them don't understand the difference between $x^2$ and $2^x$.

In complicated situations, students don't grasp the difference between an expression such as $x^2+2x+1$ and a statement like $x^2+2x+1=0$.  Not to mention the difference between the way $x^2+2x+1=0$ and $x^2+2x+1=(x+1)^2$ are different kinds of statements even though the difference is not indicated in the syntax.

There are many irregularities and ambiguities (just like any natural language — the symbolic language of math is a natural language!): consider $\sin xy$, $\sin x + y$, $\sin x/y$.  (Don't squawk to me about order of operators.  That's as bad as aus, außer, bei, mit, zu.  German can't help it, but mathematical notation could.)

One monstrous ambiguity is $(x,y)$, which could be an ordered pair, the GCD, or an open interval.  I found an example of two of those in the same sentence in the Handbook of Mathematical Discourse, and today in a lecture I saw someone use it with two meanings about three inches apart on a transparency.

Anyway, the symbolic language of math is difficult and we don't teach it well.

Structuring calculations

There are other ways to structure calculations that are much more transparent.  Most of them use two or three dimensions.

  • Spreadsheets: It is easy to approximate the zeros of a function using a spreadsheet and changing the input till you get the value near zero. Why can't middle school students be taught that?
  • Bret Victor has made suggestions for easy ways to calculate things.
  • My post Visible Algebra I suggest a two-dimensional approach to putting together calculations.  (There are several more posts coming about that idea.)
  • Mathematica interactive demos could maybe be provided in a way that would allow them to be joined together to make a complicated calculation. (Modules such as an inverse image constructor.)  I have not tried to do this.

A lot of these alternatives work better because they make full use of two dimensions.  Toolkits could be made for elementary school students (there are some already but I am not familiar with them).  

It is impractical to expect that every high school student master basic algebraic notation.  It is difficult and we don't know how to teach it to everyone. With the right toolkits, we could provide everyone, not just students, to put together usable calculations on their computer and experiment with them.  This includes working out the effect of different payment periods on loans, how much paint you need for a room, and many other things.

STEM students will still have to learn algebraic notation as we use it now.  It should be taught as a foreign language with explicit instruction in its syntax (sentences and terms, scope of an operator, and so on), ambiguities and peculiarities.

Send to Kindle

Visible Algebra I

This is the first in a series of articles about how algebra could be implemented without using the standard language of algebra that so many people find difficult. The code for the graphs are in the Mathematica notebook Algebra1.nb.

An algebra problem

Suppose you are designing a window that is in the shape of a rectangle surmounted by a semicircle, shown above for the window with width 2 and rectangle height 3. 

This example occurs in a tiresomely familiar calculus problem where you put a constraint on the perimeter of the window, thus turning it into a one-variable problem, then finding the values of the width and height that give the maximum area.  In this post, I am not going to get that far.  All I will do is come up with a calculation for the area.  I will describe a way you might do it on a laptop five or ten years from now. 

You have an algebra application that shows a screen with some operations that you may select to paste into your calculation.  The ones we use are called plus, times, power, value and input. You choose a function called value, and label it "Area of window". You recognize that the answer is the sum of the areas of the rectangle and the area of the semicircle, so you choose plus and attach to it two inputs which you label "area of rectangle" and "area of semicircle", like this:

 

The notational metaphor is that the computation starts at the bottom and goes upward, performing the operations indicated.

You know (or are told by the system) that the area of a rectangle is the product of its width and height, so you replace the value called "area of rectangle" with a times button and attach two values called $w$ and $h$:

 

You also determine that the area under the semicircle is half the area of a circle of radius $r$ (where $r$ must be calculated).

 

You have a function for the area of a circle of radius $r$, so you attach that:

Finally, you use the fact that you know that the semicircle has a radius which is half the width of the rectangle.

Now, to make the calculation operational, you attach two inputs named "width" and "height" and feed them into the values $w$ and $h$.  When you type numbers into these buttons, the calculation will proceed upward and finally show the area of the window at the top.

In a later post I will produce a live version of this diagram.  (Added 2012-09-08: the live version is here.) Right now I want to get this post out before I leave for MathFest.  (I might even produce the live version at MathFest, depending on how boring the talks are.) 

You can see an example of a live calculation resembling this in my post A visualization of a computation in tree form.

Remarks

Who

  • This calculation might be a typical exercise for a student part way along learning basic algebra. 
  • College students and scientists and engineers would have a system with a lot more built-in functions, including some they built themselves.

Syntax

  • Once you have grasped the idea that the calculation proceed upward from the inputs, carrying out the operations shown, this picture is completely self-explanatory.
    • Well, you have to know what the operations do.
    • The syntax for standard algebra is much more difficult to learn (more later about this).
  • The syntax actually used in later years may not look like mine.
    • For one thing, the flow might run top down or left to right instead of bottom up. 
    • Or something very different might be used. What works best will be discovered by using different approaches.
  • The syntax is fully two-dimensional, which makes it simple to understand (because it uses the most powerful tool our brain has: the visual system).
    • The usual algebraic code was developed because people used pencil and paper. 
    • I would guess that the usual code has fractional dimension about 1.2. 
    • The tree syntax would require too much writing with pencil and paper.  That is alleviated on a computer by using menus.
    • Once you construct the computation and input some data it evaluates automatically.
  • It may be worthwhile to use 3D syntax.  I have an experiment with this in my post Showing categorical diagrams in 3D.

Later posts will cover related topics:

  • The difficulties with standard algebraic notation.  They are not trivial.
  • Solving equations in tree form.
  • Using properties such as associativity and commutativity in tree form.
  • Using this syntax with calculus.
  • The deep connection with Lawvere theories and sketches.

References

Send to Kindle

The mystery of the prime numbers: a review

The Mystery of the Prime Numbers: Secrets of Creation v. 1, Matthew Watkins (Author), Matt Tweed (Illustrator). Inamorata Press, 2010.

The author and illustrator describe some of the mysteries of the distribution of primes, ending with Riemann's harmonic decomposition of the distribution. (If you don't understand what all that means, you will if you read the book and concentrate a lot). It is the first part of a trilogy which the author promises will culminate in a connection with quantum theory.  I can't wait.

The most remarkable thing about this book is the presentation.  You do not have to understand symbolic math.  The ideas are communicated using many, many pictures and metaphors. For example, you have a number of apples and you can't arrange them into a rectangle (a row doesn't count as a rectangle) then the number is a prime. Technical terminology is avoided, especially when the terminology consists of ordinary English words with new meanings.  So a prime factorization of a number is a "cluster" — and of course it really is since the order the primes occur in is irrelevant. On other occasions he will use the technical term (for example "distribution of primes" but warn you against your understanding being contaminated by the everyday meaning such as "distribute two pencils to each student").

The author is not afraid of saying the same thing several times, using different metaphors and rewording.  He will notice that some ideas will make you uncomfortable, such as the prime number theorem which "ought" to tell you the exact number of primes less than a number instead of merely estimate it.  (How many of your teachers ever admitted that an idea may make you uncomfortable and this is why it does…)  His explanation of functions and graphs is pictorial (using the endograph — arrows from one place to another on the real line) and kinetic (a ball rising from the x axis, hitting the graph, and being knocked horizontally to the y axis).

This makes me believe a reader who finds algebraic equations hard to understand and the nomenclature baffling can still get a reasonable mental picture of what primes are and what the Prime Number Theorem and Riemann's theorem on the distribution are actually saying.  It won't be easy: such a reader will have to concentrate and stop and think a lot (and I hope doodle pictures) and at times it will be slow going.  But this book makes it possible for someone who has no self-confidence in their ability to understand math to understand some deep stuff that many mathematicians find as astonishing as anything in math.

If we had a hundred authors writing books like this about different parts of math we would (in the long run) have fewer people who hate math or claim it all sounds like gibberish.

The long time reader of Gyre & Gimble will note that I have been saying for years that math should be explained like this.  So naturally I am pleased to recommend this book.  (Even so, all the times I taught primes I never thought of defining a prime number by saying you can't arrange your trinkets into a rectangle.  Oh, the chagrin…)

 

Send to Kindle

Metaphors in computing science 2

In Metaphors in Computer Science 1, I discussed some metaphors used when thinking about various aspects of computing.  This is a continuation of that post.

Metaphor: A program is a list of instructions.

  • I discussed this metaphor in detail in the earlier post.
  • Note particularly that the instructions can be in a natural or a programming language. (Is that a zeugma?)  Many writers would call instructions in a natural language an algorithm.
  • I will continue to use “program” in the broader sense.

Metaphor: A programming language is a language.

  • This metaphor is a specific conceptual blend that associates the strings of symbols that constitute a program in a computer language with text in a natural language.
  • The metaphor is based on some similarities between expressions in a programming language and expressions in a natural language.
    • In both, the expressions have a meaning.
    • Both natural and programming languages have specific rules for constructing well-formed expressions.
  • This way of thinking ignores many deep differences between programming languages and natural languages. In particular, they don’t talk about the same things!
  • The metaphor has been powerful in suggesting ways of thinking about computer programs, for example semantics (below) and ambiguity.

Metaphor: A computer program is a list of statements

  • A consequence of this metaphor is that a computer program is a list of symbols that can be stored in a computer’s memory.
  • This metaphor comes with the assumption that if the program is written in accordance with the language’s rules, a computer can execute the program and perhaps produce an output.
  • This is the profound discovery, probably by Alan Turing, that made the computer revolution possible. (You don’t have to have different physical machines to do different things.)
  • You may want me to say more in the heading above: “A computer program is a list of statements in a programming language that satisfies the well-formedness requirements of the language.”  But the point of the metaphor is only that a program is a list of statements.  The metaphor is not intended to define the concept of “program”.

Metaphor: A program in a computer language has meanings.

A program is intended to mean something to a human reader.

  • Some languages are designed to be easily read by a human reader: Cobol, Basic, SQL.
    • Their instructions look like English.
    • The algorithm can nevertheless be difficult to understand.
  • Some languages are written in a dense symbolic style.
    • In many cases the style is an extension of the style of algebraic formulas: C, Fortran.
    • Other languages are written in a notation not based on algebra:  Lisp, APL, Forth.
  • The boundary between “easily read” and “dense symbolic” is a matter of opinion!

A program is intended to be executed by a computer.

  • The execution always involves translation into intermediate languages. 
    • Most often the execution requires repeated translation into a succession of intermediate languages.
    • Each translation requires the preservation of the intended meaning of the program.
  • The preservation of intended meaning is what is usually called the semanticsof a programming language.
    • In fact, the meaning of the program to a person could be called semantics, too.
    • And the human semantics had better correspond in “meaning” to the machine semantics!
  • The actual execution of the program requires successive changes in the state of the computer.
    • By “state” I mean a list of the form of the electrical charges of each unit of memory in the computer.
    • Or you can restrict it to the relevant units of memory, but spelling that out is horrifying to contemplate.
    • The resulting state of the machine after the program is run is required to preserve the intended meaning as well as all the intermediate translations.
    • Notice that the actual execution is a series of physical events.  You can describe the execution in English or in some notation, but that notation is not the actual execution.

References

Conceptual blend (Wikipedia)

Conceptual metaphors (Wikipedia)

Images and Metaphors (article in abstractmath)

Semantics in computer science (Wikipedia)

Send to Kindle

A visualization of a computation in tree form

The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome. The source code is the Mathematica Notebook Live evaluation of expressions in TreeForm 3, which is available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The code is ad-hoc.  It might be worthwhile for someone to design a package that produces this sort of tree for any expression. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work.

This demonstration shows the step by step computation of the value of the expression $3x^2+2(1+y)$ shown as a tree.  By moving the first slider from right to left, you go through the six steps of the computation. You may select the values of $x$ and $y$ with the second and third sliders.  If you click on the plus sign next to a slide, a menu opens up that allows you to make the slider move automatically, shows the values, and other things.

Note that subtrees on the same level are evaluate left to right.  Parallel processing would save two steps.

A previous post related to this post is Making visible the abstraction in algebraic notation.

  

 
Send to Kindle

Conceptual blending

This post uses MathJax.  If you see formulas in unrendered TeX, try refreshing the screen.

A conceptual blend is a structure in your brain that connects two concepts by associating part of one with part of another.  Conceptual blending is a major tool used by our brain to understand the world.

The concept of conceptual blend includes special cases, such as representations, images and conceptual metaphors, that math educators have used for years to understand how mathematics is communicated and how it is learned.  The Wikipedia article is a good starting place for understanding conceptual blending. 

In this post I will illustrate some of the ways conceptual blending is used to understand a function of the sort you meet with in freshman calculus.  I omit the connections with programs, which I will discuss in a separate post.

A particular function

Consider the function $h(t)=4-(t-2)^2$. You may think of this function in many ways.

FORMULA:

$h(t)$ is defined by the formula $4-(t-2)^2$.

  • The formula encapsulates a particular computation of the value of $h$ at a given value $t$.
  • The formula defines the function, which is a stronger statement than saying it represents the function.
  • The formula is in standard algebraic notation. (See Note 1)
  • To use the formula requires one of these:
    • Understand and use the rules of algebra
    • Use a calculator
    • Use an algebraic programming language. 
  • Other formulas could be used, for example $4t-t^2$.
    • That formula encapsulates a different computation of the value of $h$.

TREE: 

$h(t)$ is also defined by this tree (right).
  • The tree makes explicit the computation needed to evaluate the function.
  • The form of the tree is based on a convention, almost universal in computing science, that the last operation performed (the root) is placed at the top and that evaluation is done from bottom to top.
  • Both formula and tree require knowledge of conventions.
  • The blending of formula and tree matches some of the symbols in the formula with nodes in the tree, but the parentheses do not appear in the tree because they are not necessary by the bottom-up convention.
  • Other formulas correspond to other trees.  In other words, conceptually, each tree captures not only everything about the function, but everything about a particular computation of the function.
  • More about trees in these posts:

GRAPH:

$h(t)$ is represented by its graph (right). (See note 2.)

  • This is the graph as visual image, not the graph as a set of ordered pairs.
  • The blending of graph and formula associates each point on the (blue) graph with the value of the formula at the number on the x-axis directly underneath the point.
  • In contrast to the formula, the graph does not define the function because it is a physical picture that is only approximate.
  • But the formula does represent the function.  (This is "represents" in the sense of cognitive psychology, but not in the mathematical sense.)
  • The blending requires familiarity with the conventions concerning graphs of functions. 
  • It sets into operation the vision machinery of your brain, which is remarkably elaborate and powerful.
    • Your visual machinery allows you to see instantly that the maximum of the curve occurs at about $t=2$. 
  • The blending leaves out many things.
    • For one, the graph does not show the whole function.  (That's another reason why the graph does not define the function.)
    • Nor does it make it obvious that the rest of the graph goes off to negative infinity in both directions, whereas that formula does make that obvious (if you understand algebraic notation).  

GEOMETRIC

The graph of $h(t)$ is the parabola with vertex $(2,4)$, directrix $x=2$, and focus $(2,\frac{3}{4})$. 

  • The blending with the graph makes the parabola identical with the graph.
  • This tells you immediately (if you know enough about parabolas!) that the maximum is at $(2,4)$ (because the directrix is vertical).
  • Knowing where the focus and directrix are enables you to mechanically construct a drawing of the parabola using a pins, string, T-square and pencil.  (In the age of computers, do you care?)

HEIGHT:

$h(t)$ gives the height of a certain projectile going straight up and down over time.

  • The blending of height and graph lets you see instantly (using your visual machinery) how high the projectile goes. 
  • The blending of formula and height allows you to determing the projectile's velocity at any point by taking the derivative of the function.
  • A student may easily be confused into thinking that the path of the projectile is a parabola like the graph shown.  Such a student has misunderstood the blending.

KINETIC:

You may understand $h(t)$ kinetically in various ways.

  • You can visualize moving along the graph from left to right, going, reaching the maximum, then starting down.
    • This calls on your experience of going over a hill. 
    • You are feeling this with the help of mirror neurons.
  • As you imagine traversing the graph, you feel it getting less and less steep until it is briefly level at the maximum, then it gets steeper and steeper going down.
    • This gives you a physical understanding of how the derivative represents the slope.
    • You may have seen teachers swooping with their hand up one side and down the other to illustrate this.
  • You can kinetically blend the movement of the projectile (see height above) with the graph of the function.
    • As it goes up (with $t$ increasing) the projectile starts fast but begins to slow down.
    • Then it is briefly stationery at $t=2$ and then starts to go down.
    • You can associate these feelings with riding in an elevator.
      • Yes, the elevator is not a projectile, so this blending is inaccurate in detail.
    • This gives you a kinetic understanding of how the derivative gives the velocity and the second derivative gives the acceleration.

OBJECT:

The function $h(t)$ is a mathematical object.

  • Usually the mental picture of function-as-object consists of thinking of the function as a set of ordered pairs $\Gamma(h):=\{(t,4-(t-2)^2)|t\in\mathbb{R}\}$. 
  • Sometimes you have to specify domain and codomain, but not usually in calculus problems, where conventions tell you they are both the set of real numbers.
  • The blend object and graph identifies each point on the graph with an element of $\Gamma(h)$.
  • When you give a formal proof, you usually revert to a dry-bones mode and think of math objects as inert and timeless, so that the proof does not mention change or causation.
    • The mathematical object $h(t)$ is a particular set of ordered pairs. 
    • It just sits there.
    • When reasoning about something like this, implication statements work like they are supposed to in math: no causation, just picking apart a bunch of dead things. (See Note 3).
    • I did not say that math objects are inert and timeless, I said you think of them that way.  This post is not about Platonism or formalism. What math objects "really are" is irrelevant to understanding understanding math [sic].

DEFINITION

definition of the concept of function provides a way of thinking about the function.

  • One definition is simply to specify a mathematical object corresponding to a function: A set of ordered pairs satisfying the property that no two distinct ordered pairs have the same second coordinate, along with a specification of the codomain if that is necessary.
  • A concept can have many different definitions.
    • A group is usually defined as a set with a binary operation, an inverse operation, and an identity with specific properties.  But it can be defined as a set with a ternary operation, as well.
    • A partition of a set is a set of subsets of a set with certain properties. An equivalence relation is a relation on a set with certain properties.  But a partition is an equivalence relation and an equivalence relation is a partition.  You have just picked different primitives to spell out the definition. 
    • If you are a beginner at doing proofs, you may focus on the particular primitive objects in the definition to the exclusion of other objects and properties that may be more important for your current purposes.
      • For example, the definition of $h(t)$ does not mention continuity, differentiability, parabola, and other such things.
      • The definition of group doesn't mention that it has linear representations.

SPECIFICATION

A function can be given as a specification, such as this:

If $t$ is a real number, then $h(t)$ is a real number, whose value is obtained by subtracting $2$ from $t$, squaring the result, and then subtracting that result from $4$.

  • This tells you everything you need to know to use the function $h$.
  • It does not tell you what it is as a mathematical object: It is only a description of how to use the notation $h(t)$.

Notes

1. Formulas can be give in other notations, in particular Polish and Reverse Polish notation. Some forms of these notations don't need parentheses.

2. There are various ways to give a pictorial image of the function.  The usual way to do this is presenting the graph as shown above.  But you can also show its cograph and its endograph, which are other ways of representing a function pictorially.  They  are particularly useful for finite and discrete functions. You can find lots of detail in these posts and Mathematica notebooks:

3. See How to understand conditionals in the abstractmath article on conditionals.

References

  1. Conceptual blending (Wikipedia)
  2. Conceptual metaphors (Wikipedia)
  3. Definitions (abstractmath)
  4. Embodied cognition (Wikipedia)
  5. Handbook of mathematical discourse (see articles on conceptual blendmental representationrepresentation, and metaphor)
  6. Images and Metaphors (article in abstractmath)
  7. Links to G&G posts on representations
  8. Metaphors in Computing Science (previous post)
  9. Mirror neurons (Wikipedia)
  10. Representations and models (article in abstractmath)
  11. Representations II: dry bones (article in abstractmath)
  12. The transition to formal thinking in mathematics, David Tall, 2010
  13. What is the object of the encapsulation of a process? Tall et al., 2000.

 

Send to Kindle

Making visible the abstraction in algebraic notation

The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome. The source code is the Mathematica Notebook Handmade Exp Tree.nb, which is available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work.

Algebraic notation

Algebraic notation contains a hidden abstract structure coded by apparently arbitrary conventions that many college calculus students don't understand completely. This very simple example shows one of the ways in which calc students may be confused:

  1. $x+2y$
  2. $(x+2)y$

Students often mean to express formula 2 when they write something like \[x\!\!+\!\!2\,\,\,\,y\] (with a space).  This is a perfectly natural way to write it. But it is against the rules, I presume because in handwriting it is not clear when you mean a space and when you don't. 

Formula 1 can also be written as $x+(2y)$, and if it were usually written that way students (I predict) would be less confused.   Always writing it this way would exacerbate the clutter of parentheses but would allow a simple rule:

Evaluate every expression inside parentheses first, starting with the innermost.

Using trees for algebra

Writing algebraic expressions as a tree (as in computing science)

  • makes it obvious what gets evaluated first
  • uses no parentheses at all.

An example of using the tree of an expression to do calculations is available in Expressions.nb (requires Mathematica) and Expressions.cdf (requires CDF player only) on my Mathematica website.  I could imagine using tree expressions instead of standard notation as the normal way of doing things. That would require working on Ipads or some such and would take a big amount of investment in software making it intuitive and easy to use.  No, I am not going to embark on such an adventure, but I think it ought to be attempted.  (Brett Victor has many ideas like this.)

Transforming algebraic notation into trees

The two manipulable diagrams below show the algebraic notation being transformed into tree form.  I expect that this will make the abstract structure more concrete for many students and I encourage others to show it to their students.  Note that the tree form makes everything explicit.>

After I return from a ten-day trip I will explore the possibility of making the expression-to-tree transformer turn the expression into an evaluable tree as in Expressions.nb and Expressions.cdf.  In the I hope not to distant future students should have access to many transformers that morph expressions from one form into another.  Such transformers are much more politically correct than Optimus Prime.

Offloading chunking and Computable algebraic expressions in tree form are earlier posts related to this post.

 

Send to Kindle

Improved clouds

The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome.

The source code for these demos is Animated Riemann.nb at my Mathematica Site. The notebook is is available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work.

The animated clouds show two hundred precalculated clouds for each picture, so you get the same clouds each time you run the animation.  It would have taken too long to generate the random clouds on the fly.  Each list of two hundred took about seven minutes to create on my computer.

In my post Riemann Clouds Improved I showed examples of clouds of values of Riemann sums in such a way that you could see the convergence to the value, the efficiency of the midpoint rule, and other things.  Here I include two Riemann sums that are shown

  • as manipulable graphs,
  • in clouds in an animated form.

Each manipulable graph (see Elaborate Riemann Sums Demo) has a slider to choose the mesh (1/n) of the partitions.  The small plus sign besides the slider gives you additional options. The buttons allow you to choose the type of partition and the type of evaluation points.

Each cloud shows a collection of values of random Riemann sums of the function, plotted by size of mesh (an upper bound on the width of the largest subdivision) and the value of the sum.  The cloud shows how the sums converge to the value of the integral. 

Every dot represents a random partition.  The sums with blue dots have random valuation points, the green dots use the left side of the subdivision, the brown dots the right side, and the red dots the midpoint.  The clouds may be suitable for students to study.  Some possible questions they could be asked to do are listed at the end.

Pressing the starter shows many clouds in rapid succession.  I don't know how much educational value that has but I think it is fun, and fun is worthwhile in itself.

Quarter Circle

Manipulable graph:

Animated cloud

 

Sine wave

Manipulable graph:

Animated cloud

Questions

I am not sure of the answers to some of these myself.

  • Why is the accuracy generally better for the sine wave than for the quarter circle?  
  • Why are the green dots above all the others and the brown dots below all the others in the quarter circle?
  • Why are they mixed in with the others for the sine curve?  In fact why do they tend upward? (Going from right to left, in other words in the direction of more accuracy).
  • Why are the midpoint sums so much more accurate?
  • Why do they tend downward for the sine wave?
  • Is it an optical illusion or do they also tend downward for the quarter circle? 

Notes:

Send to Kindle