Tag Archives: CDF

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

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

Experiment with abstractmath.org

This is a rant about technical problems with creating abstractmath.org.  You will not get great new insights into mathematical language.  You will not get any purty pictures, either.  But if you read the following anyway and have suggestions, I would appreciate them no end.

I have long been frustrated with the process I used to create articles for abstractmath.  The process has been this:  I write the article in Word using MathType, then use their facility for generating an html file that uses pictures (stored in separate files) for the more complicated math expressions, then load them into the abstractmath website.

There are many good and bad things about this. Two of the most aggravating:

  • It is difficult to change links if I reorganize something.  With a TeX file I could write WinEdt macros to do it, but the Word macro language makes manipulating links (and doing many other things) a %#!!*.
  • The documents look different in different browsers.  IE Explorer 8 does the best job, Chrome looks uglier, and Firefox is the ugliest.  After a document has been posted for a while, sometimes I open it to discover weird things, such as the recent discovery that some of my bullets had turned into copyright signs (Firefox turns bullets into double hyphens that are close to invisible).

For the past few weeks I have experimented with generating PDF documents using PDFLaTeX.   I did this with the section called Functions: Notation and Terminology, the only one that is posted so far.  Posting it required 45 minutes  of fixing links in other articles by hand.

Creating that section in TeX was a pain.  I used GrindEQ Math to convert the original document to TeX, which required a great deal of preprocessing (mostly to recover the links, but for some formatting things too) and postprocessing to fix many many things.  I also had to recreate the sidebars by hand; I used wrapfig. Wrapfig does not work well.

In the process of converting this and some other files that I may post later, I created a bunch of macros in the Word macro language (horrible, although in principle I believe in OOP) and the WindEdt macro language, which is pretty good.  Even with the macros, it is a lot of labor to do the conversion.

I have decided to abandon the effort.  I may post a few more articles that I have already transferred to  PDF, but I doubt I will revise any more from scratch.

One thing that has changed since I started doing the conversions was that a recent revision of MathType allows you to type the equations directly in TeX and to toggle back and forth between MathType form and TeX form.  Before that you had to select symbols from a palette.  That was the single most frustrating thing about using Word with MathType.  I type fluently in TeX but I couldn’t use it.  Now that I can type the TeX in directly the prospect of editing articles and writing new ones using Word is much less painful.

So one direction I will go in is to revise the articles already on the web using Word and MathType.  I also expect to kill a good many of the incomplete or less well thought out ones in favor of links to Wikipedia.

But there is another direction, opened up by Mathematica’s Computable Document files.  I have published some experiments with this in the last four posts here.  I expect to be able to turn some of the articles in abstractmath.org into computable documents.  The reader will have to have to have the free CDF Player on their computer, but if you download it once you have it forever.

Send to Kindle

Comparing graph and cograph (Version 2)

This post has been superseded by the post Demos for graph and cograph of calculus functions.

New Version 6 July 2011

This is a new version of a post originally created on 30 June, 2011. –Charles Wells

When you put the graph and cograph of a function with parameters side by side, interesting things may happen.  I have created the files CographExample.nb and CographExample.cdf to illustrate this.

The .nb form is a Mathematica Notebook, which requires Mathematica to run and allows you to manipulate the objects and change the code in the notebook as you wish.  The .cdf file contains the same material and can be viewed using Mathematica CDF Player, which is available free here.  The CDF Player allows you to change the parameters with the slidebars, so that you can experience the phenomena discusses in the example, but you cannot otherwise modify the file.

You cannot include a Mathematica computable document directly into a Word Press document, so here are screenshots of the cograph example with several different settings of its parameters.

Some Screenshots and sample questions follow.  These not in the original version.  I added these thanks to encouragement by Sam Alexander.

Screenshots


Questions for discussion

My idea is that students will manipulate the slider to see what happens and do some algebra on the relations between a, b and x to explain the phenomena that occur.

Questions about the graph (left figure).

G1. Prove that the two straight lines are parallel for any choice of a and b.

G2. When do the red and blue straight lines in the graph coincide? Answer: The lines coincide when a=1 or b=0 .

  • “When do the…” translates into “for what values of a and b do the…”. I predict that which way you ask the question will make a big difference for some students. To answer this question, you are not solving for x but for a and b. If you ask “When…” they have to discover this for themselves.
  • The answer is disjunctive: This may be a new idea for some of the students.

G3. Find a formula in terms of a and b for the distance between the two straight lines in the graph. Answer: |b-ab|.

Questions about the cograph.

C1. When do the red and blue arrows in the cograph coincide? Answer: Same as answer to Question G1.

C2. In the cograph, for what aand b are the arrow targets for a given choice of x closer together than the arrow sources? Answer: $latex  |a|>1$. b is irrelevant.

C3. Manipulate a and b. For some values the blue arrows all cross each other at the same point. (Same question for red arrows.) When does this happen? Answer: When a is negative.

  • The abstract setting of the cograph is shifted by this question (and the next) as follows: The arrows originally provided a visual pointer from the input to the output of the function. All of a sudden we are treating them as mathematical objects(straight line segments in the plane).
  • The abstraction is also broken in another way: The space between the source line and the target line is just a visual separation, but after this question both lines lie on the xy plane. The question turns a visual illustration into a mathematical object.

C4.  Describe the common point where all the red arrows cross when a is negative. (Same question for blue arrows.) Answer: The point is \left(\frac{b}{1-a},\frac{3 a}{a-1}\right).

Send to Kindle