Monday, April 21, 2014

Bertrand's Random Chord Paradox 1

   The Random Chord Probability Problem Scratch project described in the February 30, 2014 post stated that the project was a warm up to Bertrand's famous Random Chord Paradox.
  The random chord problem was originally posed by Joseph Bertrand in his work, Calcul des probabilit├ęs (1888). Bertrand gave three arguments, all apparently valid, yet yielding three different results.
   Given a circle with an inscribed equilateral triangle. What is the probability that a randomly selected chord is longer than the side of the triangle?
   Click on the video to see the Scratch simulation of Paradox 1 using the random endpoints method. The code selecs two random points on the circumference of the circle, draws the chord connecting the points, and compares the length of the chord to the length of the side of the equilateral triangle.

   At the beginning of the video, the Picks slider is set to one to show how the random chord appears on the circle. The slider is then set to 1000 Picks and, after 1000 random chords have been picked, the Probability Chord > Side slider shows that the experimental probability (Monte Carlo) is 0.339.
   On can reasonably conjecture that the theoretical probability is 0.333… or 1/3.
   The Bertrand's Paradox 1 Scratch project can be viewed and downloaded at the following link.
   As usual, I have written a document, Bertrand's Random Chord Paradox 1 (PDF), that describes the code used in the project and also presents a theoretical solution to the problem.  To receive a copy of this document, send an email request to

Tuesday, April 15, 2014

Angle Mouse and Other Scratch Geometry Projects

   Years ago I was asked to teach Benjamin Bloom's Taxonomy of Learning Domains to teachers. If I had to pick the one most important statement in the taxonomy it would be this; the ability to paraphrase is a test of comprehension. In other words, the more ways I can state a concept (paraphrase) the better I understand (comprehend) the concept.
   For example, consider the Distance Formula from analytic geometry.
   Is the ability to use the above formula in a Scratch program that computes the distance between an ant and the mouse-pointer a test of the programmer's comprehension  of the formula? That is, the Scratch program is a paraphrase of the distance formula. I've answered that question in the affirmative because I know how to express the formula in code that Scratch understands.
   Watch this short video that will hopefully convince you that the project is truly a paraphrase of the distance formula. As the mouse-pointer is moved, the distance between it and the ant is continuously updated.

   The Ant Chases the Mouse-pointer project can be viewed and downloaded at 
   Here is a second example. This Scratch project is an effort to dynamically 'explain' the angle concept. The project is dynamic because it actually constructs the requested angle.

   This project can also be viewed and downloaded at the following link.
  Now a third and final example. This project is also dynamic in that it constructs the perpendicular to a point chosen at random on a line segment. Watch this short video.

   Click on this link to view or download the Perpendicular project.
   What do you think? Is programming (coding) a higher-level cognitive process than just memorizing a definition? As you can probably guess, I answered that question for myself a long time ago and I want learners, of all ages, to share the joy I experience when I successfully code a program.

Tuesday, April 1, 2014

The Hopalong Attractor of Dr. Martin

   The Hopalong algorithm was introduced to the public by computer scientist A. K. Dewdney as a feature in his Scientific American column, Computer Recreations, in the September 1986 issue. 
   Dr. Dewdney credited Dr. Barry Martin, then a mathematics professor at Aston University, Birmingham, United Kingdom for the attractor. Dewdney named the attractor Hopalong because it hops from point to point.

   Martin's algorithm takes a single seed value and iterates it to produce a wide variety of interesting images.
   The equations are:
                        x = y – SGN(x) * √(ABS(b*x – c))
                        y = a – x
   This series of (x, y) coordinates is specified by an initial point (xo, yo) and three constants a, b, and c. 
   The following is an example taken from the Scratch program where a = 0.4, b = 1, and c = 0 and the magnification set at 100. The initial point is (0, 0), the origin.

   The Scratch project can be viewed and downloaded at the following link.
   If you would like a description of the Scratch code and a Gallery of Hopalong images just send an email request to