Tag Archives: mathematica

Representations of mathematical objects

This is a long post. Notes on viewing.

About this post

A mathematical object, or a type of math object, is represented in practice in a great variety of ways, including some that mathematicians rarely think of as "representations".  

In this post you will find examples and comments about many different types of representations as well as references to the literature. I am not aware that anyone has considered all these different ideas of representation in one place before. Reading through this post should raise your consciousness about what is going on when you do math.  

This is also an experiment in exposition.  The examples are discussed in a style similar to the way a Mathematica command is discussed in the Documentation Center, using mostly nonhierarchical bulleted lists. I find it easy to discover what I want to know when it is written in that way.  (What is hard is discovering the name of a command that will do what I want.)

Types of representations

Using language

  • Language can be used to define a type of object.
  • A definition is intended to be precise enough to determine all the properties that objects of that type all have.  (Pay attention to the two uses of the word "all" in that sentence; they are both significant, in very different ways.)
  • Language can be used to describe an object, exhibiting properties without determining all properties.
  • It can also provide metaphors, making use of one of the basic tools of our brain to understand the world. 
  • The language used is most commonly mathematical English, a special dialect of English.
  • The symbolic language of mathematics (distinct from mathematical English) is used widely in calculations. Phrases from the symbolic language are often embedded in a statement in math English. The symbolic language includes among others algebraic notation and logical notation. 
  • The language may also be a formal language, a language that is mathematically defined and is thus itself a mathematical object. Logic texts generally present the first order predicate calculus as a formal language. 
  • Neither mathematical English nor the symbolic language is a formal language. Both allow irregularities and ambiguities.

Mathematical objects

The representation itself may be a mathematical object, such as:

  • A linear representation of a group. Not only are the groups mathematical objects, so is the representation.
  • An embedding of a manifold into Euclidean space. A definition given in a formal language of the first order predicate calculus of the property of commutativity of binary operations. (Thus a property can be represented as a math object.)

Visual representations

A math object can be represented visually using a physical object such as a picture, graph (in several senses), or diagram.  

  • The visual processing of our brain is our major source of knowledge of the world and takes about a fifth of the brain's processing power.  We can learn many things using our vision that would take much longer to learn using verbal descriptions.  (Proofs are a different matter.)
  • When you look at a graph (for example) your brain creates a mental representation of the graph (see below).

Mental representations

If you are a mathematician, a math object such as "$42$", "the real numbers" or "continuity" has a mental representation in your brain.  

  • In the math ed literature, such a representation is called "mental image", "concept image", "procept", or "schema".   (The word "image" in these names is not thought of as necessarily visual.) 
  • The procept or schema describe all the things that come to mind when you think about a particular math object: The definition, important theorems, visual images, important examples, and various metaphors that help you understand it. 
  • The visual images occuring in a mental schema for an object may themselves be mental representations of physical objects. The examples and theorems may be mental representations of ideas you learned from language or pictures, and so on.  The relationships between different kinds of representations get quite convoluted.

Metaphors

Conceptual metaphors are a particular kind of mental representation of an object which involve mentally associating some aspects of the objects with some aspects of something else — a physical object, an image, an action or another abstract object.

  • A conceptual metaphor may give you new insight into the object.
  • It may also mislead you because you think of properties of the other object that the math object doesn't have.
  • A graph of a function is a conceptual metaphor.
  • When you say that a point on a graph "rises as it goes from left to right" your metaphor is an action. 
  • When you say that the cosets of a normal subgroup of a group "get along" with the group multiplication, your metaphor identifies a property they have with an aspect of human behavior.

Properties of representations

A representation of a math object may or may not

  • determine it completely
  • exhibit some of its properties
  • suggest easy proofs of some theorems
  • provide a useful way of thinking about it
  • mislead you about the object's properties
  • mislead you about what is significant about the object

Examples of representations

This list shows many of the possibilities of representation.  In each case I discuss the example in terms of the two bulleted lists above. Some of the examples are reused from my previous publications.

Functions

Example (F1) "Let $f(x)$ be the function defined by $f(x)=x^3-x$."

  • This is an expression in mathematical English that a fluent reader of mathematical English will recognize gives a definition of a specific function.
  • (F1) is therefore a representation of that function.  
  • The word "representation" is not usually used in this way in math.  My intention is that it should be recognized as the same kind of object as many other representations.
  • The expression contains the formula $x^3-x$.  This is an encapsulated computation in the symbolic language of math. It allows someone who knows basic algebra and calculus to perform calculations that find the roots, extrema and inflection points of the function $f$.  
  • The word "let" suggests to the fluent reader of mathematical English that (F1) is a definition which is probably going to hold for the next chunk of text, but probably not for the whole article or book.
  • Statements in mathematical English are generally subject to conventions.  In a calculus text (F1) would automatically mean that the function had the real numbers as domain and codomain.
  • The last two remarks show that a beginner has to learn to read mathematical English. 
  • Another convention is discussed in the following diatribe.

Diatribe 

You would expect $f(x)$ by itself to mean the value of $f$ at $x$, but in (F1) the $x$ has the property of a bound variable.  In mathematical English, "let" binds variables. However, after the definition, in the text the "$x$" in the expression "$f(x)$" will be free, but the $f$ will be bound to the specific meaning.  It is reasonable to say that the term "$f(x)$" represents the expression "$x^3-x$" and that $f$ is the (temporary) name of the function. Nevertheless, it is very common to say "the function $f(x)$" to mean $f$.  

A fluent reader of mathematical English knows all this, but probably no one has ever said it explicitly to them.  Mathematical English and the symbolic language should be taught explicitly, including its peculiarities such as "the function $f(x)$".  (You may want to deprecate this usage when you teach it, but students deserve to understand its meaning.)

The positive integers

You have a mental representation of the positive integers $1,2,3,\ldots$.  In this discussion I will assume that "you" know a certain amount of math.  Non-mathematicians may have very different mental representations of the integers.

  • You have a concept of "an integer" in some operational way as an abstract object.
  • "Abstract object" needs a post of its own. Meanwhile see Mathematical Objects (abstractmath) and the Wikipedia articles on Mathematical objects and Abstract objects.
  • You have a connection in your brain between the concept of integer and the concept of listing things in order, numbering them by $1,2,3,\ldots$.
  • You have a connection in your brain between the concept of an integer and the concept of counting a finite number of objects.  But then you need zero!
  • You understand how to represent an integer using the decimal representation, and perhaps representations to other bases as well. 
  • Your mental image has the integer "$42"$ connected to but not the same as the decimal representation "42". This is not true of many students.
  • The decimal rep has a picture of the string "42" associated to it, and of course the picture of the string may come up when you think of the integer $42$ as well (it does for me — it is a an icon for the number $42$.)
  • You have a concept of the set of integers. 
  • Students need to be told that by convention "the set of integers" means the set of all integers.  This particularly applies to students whose native language does not have articles, but American students have trouble with this, too.
  • Your concept of  "the set of integers" may have the icon "$\mathbb{N}$" associated with it.  If you are a mathematician, the icon and the concept of the set of integers are associated with each other but not identified with each other.
  • For me, at least, the concept "set of integers" is mentally connected to each integer by the "element of" relation. (See third bullet below.)
  • You have a mental representation of the fact that the set of integers is infinite.  
  • This does not mean that your brain contains an infinite number of objects, but that you have a representation of infinity as a concept, it is brain-connected to the concept of the set of integers, and also perhaps to a proof of the fact that $\mathbb{N}$ is infinite.
  • In particular, the idea that the set of integers is mentally connected to each integer does not mean that the whole infinite number of integers is attached in your brain to the concept of the set of integers.  Rather, the idea is a predicate in your brain.  When it is connected to "$42$", it says "yes".  To "$\pi$" it says "No".
  • Philosophers worry about the concept of completed infinity.  It exists as a concept in your brain that interacts as a meme with concepts in other mathematicians' brains. In that way, and in that way only (as far as I am concerned) it is a physical object, in particular an object that exists in scattered physical form in a social network.

Graph of a function

This is a graph of the function $y=x^3-x$:

Graph of a cubic function

  • The graph is a physical object, either on a screen or on paper
  • It is processed by your visual system, the most powerful sensory management system in your brain
  • It also represents the graph in the mathematical sense (set of ordered pairs) of the function $y=x^3-x$
  • Both the mathematical graph and the physical graph are represented by modules in your brain, which associates the two of them with each other by a conceptual metaphor
  • The graph shows some properties of the function: inflection point, going off to infinity in a specific way, and so on.
  • These properties are made apparent (if you are knowledgeable) by means of the powerful pattern recognition system in your brain. You see them much more quickly than you can discover them by calculation.
  • These properties are not proved by the graph. Nevertheless, the graph communicates information: for example, it suggests that you can prove that there is an inflection point near $(0,0)$.
  • The graph does not determine or define the function: It is inaccurate and it does not (cannot) show all of the graph.
  • More subtle details about this graph are discussed in my post Representations 2.

Continuity

Example (C1) The $\epsilon-\delta$ definition of the continuity of a function $f:\mathbb{R}\to\mathbb{R}$ may be given in the symbolic language of math:

A function $f$ is continuous at a number $c$ if \[\forall\epsilon(\epsilon\gt0\implies(\forall x(\exists\delta(|x-c|\lt\delta\implies|f(x)-f(c)|\lt\epsilon)))\]

  • To understand (C1), you must be familiar with the notation of first order logic.  For most students, getting the notation right is quite a bit of work.  
  • You must also understand  the concepts, rules and semantics of first order logic.  
  • Even if you are familiar with all that, continuity is still a difficult concept to understand.
  • This statement does show that the concept is logically complicated. I don't see how it gives any other intuition about the concept. 

Example (C2) The definition of continuity can also be represented in mathematical English like this:

A function $f$ is continuous at a number $c$ if for any $\epsilon\gt0$ and for any $x$ there is a $\delta$ such that if $|x-c|\lt\delta$, then $|f(x)-f(c)|\lt\epsilon$. 

  • This definition doesn't give any more intuition that (C1) does.
  • It is easier to read that (C1) for most math students, but it still requires intimate familiarity with the quirks of math English.
  • The fact that "continuous" is in boldface signals that this is a definition.  This is a convention.
  • The phrase "For any $\epsilon\gt0$" contains an unmarked parenthetic insertion that makes it grammatically incoherent.  It could be translated as: "For any $\epsilon$ that is greater than $0$".  Most math majors eventually understand such things subconsciously.  This usage is very common.
  • Unless it is explicitly pointed out, most students won't notice that  if you change the phrase "for any $x$ there is a $\delta$"  to "there is a $\delta$ for any $x$" the result means something quite different.  Cauchy never caught onto this.
  • In both (C1) and (C2), the "if" in the phrase "A function $f$ is continuous at a number $c$ if…" means "if and only if" because it is in a definition.  Students rarely see this pointed out explicitly.  

Example (C3) The definition of continuity can be given in a formally defined first order logical theory

  • The theory would have to contain function symbols and axioms expressing the algebra of real numbers as an ordered field. 
  • I don't know that such a definition has ever been given, but there are various semi-automated and automated theorem-proving systems (which I know little about) that might be able to state such a definition.  I would appreciate information about this.
  • Such a definition would make the property of continuity a mathematical object.
  • An automated theorem-proving system might be able to prove that $x^3-x$ is continuous, but I wonder if the resulting proof would aid your intuition much.

Example (C4) A function from one topological space to another is continuous if the inverse of every open set in the codomain is an open set in the domain.

  • This definition is stated in mathematical English.
  • All definitions start with primitive data. 
  • In definitions (C1) – (C3), the primitive data are real numbers and the statement uses properties of an ordered field.
  • In (C4), the data are real numbers and the arithmetic operations of a topological field, along with the open sets of the field. The ordering is not mentioned.
  • This shows that a definition need not mention some important aspects of the structure. 
  • One marvelous example of this is that  a partition of a set and an equivalence relation on a set are based on essentially disjoint sets of data, but they define exactly the same type of structure.

Example (C4) "The graph of a continuous function can be drawn without picking up the chalk".

  • This is a metaphor that associates an action with the graph.
  • It is incorrect: The graphs of some continuous functions cannot be drawn.  For example, the function $x\mapsto x^2\sin(1/x)$ is continuous on the interval $[-1,1]$ but cannot be drawn at $x=0$. 
  • Generally speaking, if the function can be drawn then it can be drawn without picking up the chalk, so the metaphor provides a useful insight, and it provides an entry into consciousness-raising examples like the one in the preceding bullet.

References

  1. 1.000… and .999… (post)
  2. Conceptual blending (post)
  3. Conceptual blending (Wikipedia)
  4. Conceptual metaphors (Wikipedia)
  5. Convention (abstractmath)
  6. Definitions (abstractmath)
  7. Embodied cognition (Wikipedia)
  8. Handbook of mathematical discourse (see articles on conceptual blendmental representationrepresentationmetaphor, parenthetic assertion)
  9. Images and Metaphors (abstractmath).
  10. The interplay of text, symbols and graphics in math education, Lin Hammill
  11. Math and the modules of the mind (post)
  12. Mathematical discourse: Language, symbolism and visual images, K. L. O’Halloran.
  13. Mathematical objects (abmath)
  14. Mathematical objects (Wikipedia)
  15. Mathematical objects are “out there?” (post)
  16. Metaphors in computing science ​(post)
  17. Procept (Wikipedia)
  18. Representations 2 (post)     
  19. Representations and models (abstractmath)
  20. Representations II: dry bones (post)
  21. Representation theorems (Wikipedia) Concrete representations of abstractly defined objects.
  22. Representation theory (Wikipedia) Linear representations of algebraic structures.
  23. Semiotics, symbols and mathematical visualization, Norma Presmeg, 2006.
  24. The transition to formal thinking in mathematics, David Tall, 2010
  25. Theory in mathematical logic (Wikipedia)
  26. What is the object of the encapsulation of a process? Tall et al., 2000.
  27. Where mathematics comes from, by George Lakoff and Rafael Núñez, Basic Books, 2000. 
  28. Where mathematics comes from (Wikipedia) This is a review of the preceding book.  It is a permanent link to the version of 04:23, 25 October 2012.  The review is opinionated, partly wrong, not well written and does not fit the requirements of a Wikipedia entry.  I recommend it anyway; it is well worth reading.  It contains links to three other reviews.

Notes on Viewing  

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

Send to Kindle

Representing and thinking about sets

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 Representing sets.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.

Representations of sets

Sets are represented in the math literature in several different ways, some mentioned here.  Also mentioned are some other possibilities.  Introducing a variety of representations of any type of math object is desirable because students tend to assume that the representation is the object.

Curly bracket notation

The standard representation for a finite set is of the form "$\{1,3,5,6\}$". This particular example represents the unique set containing the integers $1$, $3$, $5$ and $6$ and nothing else. This means precisely that the statement "$n$ is an element of $S$" is true if $n=1$, $n=3$, $n=5$ or $n=6$, and it is false if $n$ represents any other mathematical object. 

In the way the notation is usually used, "$\{1,3,5,6\}$", "$\{3,1,5,6\}$", "$\{1,5,3,6\}$",  "$\{1,6,3,5,1\}$" and $\{ 6,6,3,5,1,5\}$ all represent the same set. Textbooks sometimes say "order and repetition don't matter". But that is a statement about this particular representation style for sets. It is not a statement about sets.

It would be nice to come up with a representation for sets that doesn't involve an ordering. Traditional algebraic notation is essentially one-dimensional and so automatically imposes an ordering (see Algebra is a difficult foreign language).    

Let the elements move

In Visible Algebra II, I experimented with the idea of putting the elements at random inside a circle and letting them visibly move around like goldfish in a bowl.  (That experiment was actually for multisets but it applies to sets, too.)  This is certainly a representation that does not impose an ordering, but it is also distracting.  Our visual system is attracted to movement (but not as much as a cat's visual system).  

Enforce natural ordering

One possibility would be to extend the machinery in a visible algebra system that allows you to make a box you could drag elements into. 

This box would order the elements in some canonical order (numerical order for numbers, alphabetical order for strings of letters or words) with the property that if you inserted an element in the wrong place it would rearrange itself, and if you tried to insert an element more than once the representation would not change.  What you would then have is a unique representation of the set.

An example is the device below.  (If you have Mathematica, not just CDF player, you can type in numbers as you wish instead of having to use the buttons.) 

This does not allow a representation of a heterogenous set such as $\{3,\mathbb{R},\emptyset,\left(\begin{array}{cc}1&2\\0&1\\ \end{array}\right)\}$.  So what?  You can't represent every function by a graph, either.

Hanger notation

The tree notation used in my visual algebra posts could be used for sets as well, as illustrated below. The system allows you to drag the elements listed into different positions, including all around the set node. If you had a node for lists, that would not be possible.

This representation has the pedagogical advantage of shows that a set is not its elements.

  • A set is distinct from its elements
  • A set is completely determined by what the elements are.

Pattern recognition

Infinite sets are sometimes represented using the curly bracket notation using a pattern that defines the set.  For example, the set of even integers could be represented by $\{0,2,4,6,\ldots\}$.  Such a representation is necessarily a convention, since any beginning pattern can in fact represent an infinite number of different infinite sets.  Personally, I would write, "Consider the even integers $\{0,2,4,6,\ldots\}$", but I would not write,  "Consider the set $\{0,2,4,6,\ldots\}$".

By the way, if you are writing for newbies, you should say,"Consider the set of even integers $\{0,2,4,6,\ldots\}$". The sentence "Consider the even integers $\{0,2,4,6,\ldots\}$" is unambiguous because by convention a list of numbers in curly brackets defines a set. But newbies need lots of redundancy.

Representation by a sentence

Setbuilder notation is exemplified by $\{x|x>0\}$, which denotes the positive reals, given a convention or explicit statement that $x$ represents a real number.  This allows the representation of some infinite sets without depending on a possibly ambiguous pattern. 

A Visible Algebra system needs to allow this, too. That could be (necessarily incompletely) done in this way:

  • You type in a sentence into a Setbuilder box that defines the set.
  • You then attach a box to the Setbuilder box containing a possible element.
  • The system then answers Yes, No, or Can't Tell.

The Can't Tell answer is a necessary requirement because the general question of whether an element is in a set defined by a first order sentence is undecidable. Perhaps the system could add some choices:

  • Try for a second.
  • Try for an hour.
  • Try for a year.
  • Try for the age of the universe.

Even so, I'll bet a system using Mathematica could answer many questions like this for sentences referring to a specific polynomial, using the Solve or NSolve command.  For example, the answer to the question, "Is $3\in\{n|n\lt0 \text{ and } n^2=9\}$?" (where $n$ ranges over the integers) would be "No", and the answer to  "Is $\{n|n\lt0 \text{ and } n^2=9\}$ empty?" would also be "No". [Corrected 2012.10.24]

References

  1. Explaining “higher” math to beginners (previous post)
  2. Algebra is a difficult foreign language (previous post)
  3. Visible Algebra II (previous post)
  4. Sets: Notation (abstractmath article)
  5. Setbuilder notation (Wikipedia)
Send to Kindle

Visible algebra II

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 Wolfram website. The code for the demos is in the Mathematica notebook algebra2.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.

More about visible algebra

I have written about visible algebra in previous posts (see References). My ideas about the interface are constantly changing. Some new ideas are described here.

In the first place I want to make it clear that what I am showing in these posts is a simulation of a possible visual algebra system.  I have not constructed any part of the system; these posts only show something about what the interface will look like.  My practice in the last few years is to throw out ideas, not construct completed documents or programs.  (I am not saying how long I will continue to do this.)  All these posts, Mathematica programs and abstractmath.org are available to reuse under a Creative Commons license.

Commutative and associative operations

Times and Plus are commutative and associative operations.  They are usually defined as binary operations.  A binary operation $*$ is said to be commutative if for all $x$ and $y$ in the underlying set of the operation, $x*y=y*x$, and it is associative if for all $x$,$y$ and $z$ in the underlying set of the operation, $(x*y)*z=x*(y*z)$. 

It is far better to define a commutative and associative operation $*$ on some underlying set $S$ as an operation on any multiset of elements of $S$.  A multiset is like a set, in particular elements can be rearranged in any way, but it is not like a set in that elements can be repeated and a different number of repetitions of an element makes a different multiset.  So for any particular multiset, the number of repetitions of each element is fixed.  Thus $\{a,a,b,b,c\} = \{c,b,a,b,a\}$ but $\{a,a,b,b,c\}\neq\{c,b,a,b,c\}$. This means that the function (operation) Plus, for example, is defined on any multiset of numbers, and \[\mathbf{Plus}\{a,a,b,b,c\}=\mathbf{Plus} \{c,b,a,b,a\}\] but $\mathbf{Plus}\{a,a,b,b,c\}$ might not be equal to $\mathbf{Plus} \{c,b,a,b,c\}$.

This way of defining (any) associative and commutative operation comes from the theory of monads.  An operation defined on all the multisets drawn from a particular set is necessarily commutative and associative if it satisfies some basic monad identities, the main one being it commutes with union of multisets (which is defined in the way you would expect, and if this irritates you, read the Wikipedia article on multisets.). You don't have to impose any conditions specifically referring to commutativity or associativity.  I expect to write further about monads in a later post. 

The input process for a visible algebra system should allow the full strength of this fact. You can attach as many inputs as you want to Times or Plus and you can move them around.  For example, you can click on any input and move it to a different place in the following demo.

Other input notations might be suitable for different purposes.  The example below shows how the inputs can be placed randomly in two dimensions (but preserving multiplicity).  I experimented with making it show the variables slowly moving around inside the circle the way the fish do in that screensaver (which mesmerizes small children, by the way — never mind what it does to me), but I haven't yet made it work.

A visible algebra system might well allow directly input tables to be added up (or multiplied), like the one below. Spreadsheets have such an operation In particular, the spreadsheet operation does not insist that you apply it only as a binary operation to columns with two entries.  By far the most natural way to define addition of numbers is as an operation on multisets of numbers.

Other operations

Operations that are associative but not commutative, such as matrix multiplication, can be defined the monad way as operations on finite lists (or tuples or vectors) of numbers.  The operation is automatically associative if you require it to preserve concatenation of lists and some other monad requirements.

Some binary operations are neither commutative nor associative.  Two such operations on numbers are Subtract and Power.  Such operations are truly binary operations; there is no obvious way to apply them to other structures.  They are only binary because the two inputs have different roles.  This suggests that the inputs be given names, as in the examples below.

Later, I will write more about simplifying trees, solving the max area problem for rectangles surmounted by semicircles, and other things concerning this system of doing algebra.

References

Previous posts about visible algebra

Other references

 

Send to Kindle

Generating a Collatz tree

I have written a short Mathematica program that generates the function tree of the Collatz function.  The code is in the document collatz.nb on the abmath website.

Examples

Here are some examples.  The first one is generated by the integers between 1 and 26.  (27 is to be avoided because it makes a shoot that is 111 nodes high.)  The primes from 1 to 26 generates the same tree. 

This one is generated by the odd numbers from 1 to 26: 

This is generated by the even numbers from 1 to 50:

 

Remark

This program is not of great import, but it was fun doing it and I learned more Mathematica. In particular, I learned that you cannot assign to a parameter in a function definition. For example, I had to write fv[gl_List, n_Integer] := (nn := n; ggl := {nn}; (Sow[1]; While[! MemberQ[ggl, cf[nn]], (Sow[nn]; Sow[cf[nn]]); nn = cf[nn]]) // Reap) instead of fv[gl_List, n_Integer] := (Sow[1]; While[! MemberQ[gl, cf[n]], (Sow[n]; Sow[cf[n]]); n = cf[n]]) // Reap) (where n:=cf[n] wouldn't have worked either).

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

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

Metaphors in computing science I

(This article is continued in Metaphors in computing science II)

Michael Barr recently told me of a transcription of a talk by Edsger Dijkstra dissing the use of metaphors in teaching programming and advocating that every program be written together with a proof that it works.  This led me to think about the metaphors used in computing science, and that is what this post is about.  It is not a direct answer to what Dijkstra said. 

We understand almost anything by using metaphors.  This is a broader sense of metaphor than that thing in English class where you had to say "my love is a red red rose" instead of "my love is like a red red rose".  Here I am talking about conceptual metaphors (see references at the end of the post).  

Metaphor: A program is a set of instructions

You can think of a program as a list of instructions that you can read and, if it is not very complicated, understand how to carry them out.  This metaphor comes from your experience with directions on how to do something (like directions from Google Maps or for assembling a toy).   In the case of a program, you can visualize doing what the program says to do and coming out with the expected output. This is one of the fundamental metaphors for programs. 

Such a program may be informal text or it may be written in a computer language.

Example

A description of how to calculate $n!$ in English could be:  "Multiply the integers $1$ through $n$".  In Mathematica, you could define the factorial function this way:

fac[n_] := Apply[Times, Table[i, {i, 1, n}]]

This more or less directly copies the English definition, which could have been reworded as "Apply the Times function to the integers from $1$ to $n$ inclusive."  Mathematica programmers customarily use the abbreviation "@@" for Apply because it is more convenient:

Fac[n_]:=Times @@ Table[i, {i, 1, 6}]

As far as I know, C does not have list operations built in.  This simple program gives you the factorial function evaluated at $n$:

 j=1;  for (i=2; i<=n; i++)   j=j*i; return j;  

This does the calculation in a different way: it goes through the numbers $1, 2,\ldots,n$ and multiplies the result-so-far by the new number.  If you are old enough to remember Pascal or Basic, you will see that there you could use a DO loop to accomplish the same thing.

What this metaphor makes you think of

Every metaphor suggests both correct and incorrect ideas about the concept.  

  • If you think of a list of instructions, you typically think that you should carry out the instructions in order.  (If they are Ikea instructions, your experience may have taught you that you must carry out the instructions in order.)  
  • In fact, you don't have to "multiply the numbers from $1$ to $n$" in order at all: You could break the list of numbers into several lists and give each one to a different person to do, and they would give their answers to you and you would multiply them together.
  • The instructions for calculating the factorial can be translated directly into Mathematica instructions, which does not specify an order.   When $n$ is large enough, Mathematica would in fact do something like the process of giving it to several different people (well, processors) to speed things up.
  • I had hoped that Wolfram alpha would answer "720" if I wrote "multiply the numbers from $1$ to $6$" in its box, but it didn't work.  If it had worked, the instruction in English would not be translated at all. (Note added 7 July 2012:  Wolfram has repaired this.)
  • The example program for C that I gave above explicitly multiplies the numbers together in order from little to big.  That is the way it is usually taught in class.  In fact, you could program a package for lists using pointers (a process taught in class!) and then use your package to write a C program that looks like the  "multiply the numbers from $1$ to $n$" approach.  I don't know much about C; a reader could probably tell me other better ways to do it.

So notice what happened:

  • You can translate the "multiply the numbers from $1$ to $n$" directly into Mathematica.
  •  For C, you have to write a program that implements multiplying the numbers from $1$ to $n$. Implementation in this sense doesn't seem to come up when we think about instruction sets for putting furniture together.  It is sort of like: Build a robot to insert & tighten all the screws.

Thus the concept of program in computing science comes with the idea of translating the program instruction set into another instruction set.

  • The translation provided above for Mathematica resembles translating the instruction set into another language. 
  • The two translations I suggested for C (the program and the definition of a list package to be used in the translation) are not like translating from English to another language.  They involve a conceptual reconstruction of the set of instructions.

Similarly, a compiler translates a program in a computer language into machine code, which involves automated conceptual reconstruction on a vast scale.

Other metaphors

In writing about this, I have brought in other metaphors, for example:

  • C or Mathematica as like a natural language in some ways 
  • Compiling (or interpreting) as translation

Computing science has used other VIM's (Very Important Metaphors) that I need to write about later:

  • Semantics (metaphor: meaning)
  • Program as text — this allows you to treat the program as a mathematical object
  • Program as machine, with states and actions like automata and Turing machines.
  • Specification of a program.  You can regard  "the product of the numbers from $1$ to $n$" as a specification.  Notice that saying "the product" instead of "multiply" changes the metaphor from "instruction" to "specification".

References

Conceptual metaphors (Wikipedia)

Images and Metaphors (article in abstractmath)

Images and Metaphors for Sets (article in abstractmath)

Images and Metaphors for Functions (incomplete article in abstractmath)

 

 
Send to Kindle

Offloading chunking

In my previous post I wrote about the idea of offloading abstraction, the sort of things we do with geometric figures, diagrams (that post emphasized manipulable diagrams), drawing the tree of an algebraic expression, and so on.  This post describes a way to offload chunking.  

Chunking

I am talking about chunking in the sense of encapsulation, as some math ed. people use it.  I wrote about it briefly in [1], and [2] describes the general idea.  I don't have a good math ed reference for it, but I will include references if readers supply them.  

Chunking for some educators means breaking a complicated problem down into pieces and concentrating on them one by one.  That is not really the same thing as what I am writing about.  Chunking as I mean it enables you to think more coherently and efficiently about a complicated mathematical structure by objectifying some of the data in the structure.  

Project 

This project an example of how chunking could be made visible in interactive diagrams, so that the reader grasps the idea of chunking.  I guess I am chunking chunking.  

Here is a short version of an example of chunking worked out in ridiculous detail in reference [1]. 

Let \[f(x)=.0002{{\left( \frac{{{x}^{3}}-10}{3{{e}^{-x}}+1} \right)}^{6}}\]  How do I know it is never negative?  Well, because it has the form (a positive number)(times)(something)$^6$.    Now (something)$^6$ is ((something)$^3)^2$ and a square is always nonnegative, so the function is (positive)(times)(nonnegative), so it has to be nonnegative.  

I recognized a salient fact about .0002, namely that it was positive: I grayed out (in my mind) its exact value, which is irrelevant.  I also noticed a salient fact about \[{{\left( \frac{{{x}^{3}}-10}{3{{e}^{-x}}+1} \right)}^{6}}\] namely that it was (a big mess that I grayed out)(to the 6th power).  And proceeded from there.  (And my chunking was inefficient; for example, it is more to the point that .0002 is nonnegative).

I believe you could make a movie of chunking like this using Mathematica CDF.  You would start with the formula, and then as the voiceover said "what's really important is that .0002 is nonnegative" the number would turn into a gray cloud with a thought balloon aimed at it saying "nonnegative".  The other part would turn into a gray cloud to the sixth, then the six would break into 3 times 2 as the voice comments on what is happening.  

It would take a considerable amount of work to carry this out.  Lots of decisions would need to be made.  

One problem is that Mathematica doesn't provide a way to do voiceovers directly (as far as I know).  Perhaps you could make a screen movie using screenshot software in real time while you talked and (offscreen) pushed buttons that made the various changes happen.

You could also do it with print instead of voiceover, as I did in the example in this post. In this case you need to arrange to have the printed part and the diagram simultaneously visible.  

I may someday try my hand at this.  But I would encourage others to attack this project if it interests them.  This whole blog is covered by the Creative Commons Attribution – ShareAlike 3.0 License", which means you may use, adapt and distribute the work freely provided you follow the requirements of the license.

I have other projects in mind that I will post separately.

References

  1. Abstractmath article on chunking.
  2. Wikipedia on chunking
Send to Kindle

Offloading abstraction

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 Tangent Line.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.


The diagram above shows you the tangent line to the curve $y=x^3-x$ at a specific point.  The slider allows you to move the point around, and the tangent line moves with it. You can click on one of the plus signs for options about things you can do with the slider.  (Note: This is not new.  Many other people have produced diagrams like this one.)

I have some comments to make about this very simple diagram. I hope they raise your consciousness about what is going on when you use a manipulable demonstration.

Farming out your abstraction load

A diagram showing a tangent line drawn on the board or in a paper book requires you visualize how the tangent line would look at other points.  This imposes a burden of visualization on you.  Even if you are a new student you won't find that terribly hard (am I wrong?) but you might miss some things at first:

  • There are places where the tangent line is horizontal.
  • There are places where some of the tangent lines cross the curve at another point. Many calculus students believe in the myth that the tangent line crosses the curve at only one point.  (It is not really a myth, it is a lie.  Any decent myth contains illuminating stories and metaphors.)
  • You may not envision (until you have some experience anyway) how when you move the tangent line around it sort of rocks like a seesaw.

You see these things immediately when you manipulate the slider.

Manipulating the slider reduces the load of abstract thinking in your learning process.     You have less to keep in your memory; some of the abstract thinking is offloaded onto the diagram.  This could be described as contracting out (from your head to the picture) part of the visualization process.  (Visualizing something in your head is a form of abstraction.)

Of course, reading and writing does that, too.  And even a static graph of a function lowers your visualization load.  What interactive diagrams give the student is a new tool for offloading abstraction.

You can also think of it as providing external chunking.  (I'll have to think about that more…)

Simple manipulative diagrams vs. complicated ones

The diagram above is very simple with no bells and whistles.  People have come up with much more complicated diagrams to illustrate a mathematical point.  Such diagrams:

  • May give you buttons that give you a choice of several curves that show the tangent line.
  • May give a numerical table that shows things like the slope or intercept of the current tangent line.
  • May also show the graph of the derivative, enabling you to see that it is in fact giving the value of the slope.

Such complicated diagrams are better suited for the student to play with at home, or to play with in class with a partner (much better than doing it by yourself).  When the teacher first explains a concept, the diagrams ought to be simple.

Examples

  • The Definition of derivative demo (from the Wolfram Demonstration Project) is an example that provides a table that shows the current values of some parameters that depend on the position of the slider.
  • The Wolfram demo Graphs of Taylor Polynomials is a good example of a demo to take home and experiment extensively with.  It gives buttons to choose different functions, a slider to choose the expansion point, another one to choose the number of Taylor polynomials, and other things.
  • On the other hand, the Wolfram demo Tangent to a Curve is very simple and differs from the one above in one respect: It shows only a finite piece of the tangent line.  That actually has a very different philosophical basis: it is representing for you the stalk of the tangent space at that point (the infinitesimal vector that contains the essence of the tangent line).
  • Brian Hayes wrote an article in American Scientist containing a moving graph (it moves only  on the website, not in the paper version!) that shows the changes of the population of the world by bars representing age groups.  This makes it much easier to visualize what happens over time.  Each age group moves up the graph — and shrinks until it disappears around age 100 — step by step.  If you have only the printed version, you have to imagine that happening.  The printed version requires more abstract visualization than the moving version.
  • Evaluating an algebraic expression requires seeing the abstract structure of the expression, which can be shown as a tree.  I would expect that if the students could automatically generate the tree (as you can in Mathematica)  they would retain the picture when working with an expression.  In my post computable algebraic expressions in tree form I show how you could turn the tree into an evaluation aid.  See also my post Syntax trees.

This blog has a category "Mathematica" which contains all the graphs (many of the interactive) that are designed as an aid to offloading abstraction.

Send to Kindle

Freezing a family of functions

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 algebra1.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.

Some background

  • Generally, I have advocated using all sorts of images and metaphors to enable people to think about particular mathematical objects more easily.
  • In previous posts I have illustrated many ways (some old, some new, many recently using Mathematica CDF files) that you can provide such images and metaphors, to help university math majors get over the abstraction cliff.
  • When you have to prove something you find yourself throwing out the images and metaphors (usually a bit at a time rather than all at once) to get down to the rigorous view of math [1], [2], [3], to the point where you think of all the mathematical objects you are dealing with as unchanging and inert (not reacting to anything else).  In other words, dead.
  • The simple example of a family of functions in this post is intended to give people a way of thinking about getting into the rigorous view of the family.  So this post uses image-and-metaphor technology to illustrate a way of thinking about one of the basic proof techniques in math (representing the object in rigor mortis so you can dissect it).  I suppose this is meta-math-ed.  But I don’t want to think about that too much…
  • This example also illustrates the difference between parameters and variables. The bottom line is that the difference is entirely in how we think about them. I will write more about that later.

 A family of functions

This graph shows individual members of the family of functions \( y=a\sin\,x\) for various values of a. Let’s look at some of the ways you can think about this.

  • Each choice of  “shows the function for that value of the parameter a“.  But really, it shows the graph of the function, in fact only the part between x=-4 and x= 4.
  • You can also think of it as showing the function changing shape as a changes over time (as you slide the controller back and forth).

Well, you can graph something changing over time by introducing another axis for time.  When you graph vertical motion of a particle over time you use a two-dimensional picture, one axis representing time and the other the height of the particle. Our representation of the function y=a\sin\,x is a two-dimensional object (using its graph) so we represent the function in 3-space, as in this picture, where the slider not only shows the current (graph of the) function for parameter value a but also locates it over a on the z axis.

The picture below shows the surface given by y=a\sin\,x as a function of both variables a and x. Note that this graph is static: it does not change over time (no slide bar!). This is the family of functions represented as a rigorous (dead!) mathematical object.

If you click the “Show Curves” button, you will see a selection of the curves in middle diagram above drawn as functions of x for certain values of a. Each blue curve is thus a sine wave of amplitude a. Pushing that button illustrates the process going on in your mind when you concentrate on one aspect of the surface, namely its cross-sections in the x direction.

Reference [4] gives the code for the diagrams in this post, as well as a couple of others that may add more insight to the idea. Reference [5] gives similar constructions for a different family of functions.

References

  1. Rigorous view in abstractmath.org 
  2. Representations II: Dry Bones (post)
  3. Representations III: Rigor and Rigor Mortis (post)
  4. FamiliesFrozen.nb.
  5. AnotherFamiliesFrozen.nb (Mathematica file showing another family of functions)
Send to Kindle