Monday, June 15, 2009

Visual thinking

Imagery for diagrams by T. Dreyfus
in
Exploiting mental imagery with computers in mathematics education
By Rosamund Sutherland, John Mason


What attracted me to this article is the analysis of thinking visually or visual mental images, the article has a wider scope. A synopsis of the comments on visual mental images follows:

One cannot think without mental images
A subset of mental images is visual images: mental images with a strong visual component
They can be diagrammatic, 2 or possibly 3 dimensional, static or dynamic, definite or vague
One can watch processes in an evolving visual mental image. Watching the mental images can be more useful than watching real world objects.
It is difficult to analyse others' visual images as we have no direct access to them.
A mental image cannot be measured without being disturbed, (parallels with quantum mechanics), visual images are vague or fuzzy, in communicating an image to others, one needs to make it precise, changing it.
Images can be used for hypothetical reasoning or thought experiments though there are difficulties in retaining an image long enough to transform it and reason with it.
Are visual images pictures, or interpretations of diagrams?
Is diagrammatic information stored analogically or propositionally?
the analogically school believes it is stored like vision
the propositional school holds that interpretations of the visual information are stored
Experiments indicate that the images are interpreted abstractions rather than picture like encodings.
Physical drawings allow chunking, organisation of knowledge into perceptual chunks, do images?
Visual images are probably better at expressing underlying structure than other mental representations.

Thursday, May 21, 2009

Problem visualisation in mathematics and programming


I have been researching into problem visualisation in mathematics and programming following a discussion, originally by Mark Guzdial and continued by Bill Kerr Alan Kay and others and also the parallel discussion by Rob Costello

One paper that has me thinking is the influence of texts' mental images upon problems' resolutions by Giorgio Bagni (2000). It examines the importance of the level of detail of the mental models constructed by students. Bagni asks whether imagining a situation in all its details helps problem solving. Bagni suggests that it can be an obstacle.

Problems were given to 3 Italian school classes, (13-14 years), (14-15 years) and (15-16years).

The first version was briefly stated as an abstract mathematical problem:

The length of the basis AB of an isosceles triangle ABN is 1 000 000 m; the sum of its sides AN, BN is 1 000 001 m; find the length of the height NM.

The second version was embedded in a real world context and included a diagram:

Let us tie a row to two nails very far, say… 1000 km; let us imagine to use a row whose length is exactly 1000 km: so this row will be tight. Then let us tie to the same nails another row, whose length is 1000 km and 1 m; so this second row is a bit longer than the distance between the nails and it will not be tight: in order to stretch it, let us bring the second row in its middle point and let us “raise” such point (see the picture), in order to take it away from the first row, until the second row is completely tight.

a diagram was shown followed by more text

Well, how much must we take away the middle point of the second row? Find the distance between the middle point of the first row, M, and the middle point of the second row, N.

I am hoping that the second version has suffered in the translation from the original Italian to English because it does not read well in English.

Finally the students were shown the correct solution by Pythagoras' theorem which has the result, which may be surprising at first, that by allowing a 1 metre increase in total path length, it is possible to deviate sideways by over 700 metres.

The students in the first group, those given the abstract problem, did significantly better than the second group with the real world problem.

When shown the correct solution, many in the second group, the group that had the problem given in a real world context, had difficulty accepting the correctness of the solution because it was counter intuitive that a such a small increase in total path length would allow such a disproportionately large sideways displacement.

Bagni concludes: “that D’Amore (1997) clearly proved that the full possibility to imagine a situation does not help pupils; now we state that, sometimes, this full possibility can constitute an obstacle to the resolution (or, as in the examined case, to the acceptation of the correct resolution)”.

I hear echoes of Cognitive Load Theory here. The idea that if you are teaching Pythagoras, you should remove any distractors from Pythagoras, so as to minimise the cognitive load on the learner. The learner can then focus their limited processing powers on the material which is to be learnt.

My thought is that the cognitive conflict created by the second problem is valuable for learning and that students should be given time to experience and resolve such cognitive conflict if they are to have more than a superficial understanding of a subject.

This particular cognitive conflict relates to deeper understanding of geometry and physics. It is closely related to the concepts that:

For small x, sin(x) = x.

Over a given distance, the tangent is very close to the circumference if the circle origin is remote.

At x=0, the derivative of sin(x) is maximum but the derivative of cos(x) is zero.

Why is it increasingly hard to pull a rope span, a catenary, the closer to straight it gets? Because your mechanical advantage tends to 1/infinity. Which group of students would you rather have specifying the support structure for electricity cables crossing a busy road?

Jonassen talks of schooling to create real world problem solvers. In school you know that you are doing Pythagoras this week so any problem you are given will be solved in a similar way. Real world problems are poorly specified and multi disciplinary, they require students to have engaged in messy problems.

Labels: , ,

Saturday, March 21, 2009

Turtle Fileview

A fileviewer for Turtle Art using the programmable Python brick

The Python brick code
def myblock(lc,x):
text=lc.heap.pop(-1)
if x==0:
dialog = gtk.FileChooserDialog("Load...", None, \
gtk.FILE_CHOOSER_ACTION_OPEN, \
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK))
dialog.set_default_response(gtk.RESPONSE_OK)
fname = None
response = dialog.run()
if response == gtk.RESPONSE_OK:
fname = dialog.get_filename()
dialog.destroy()
f = open(fname, "r")
f.seek(0)
text = f.read()
f.close()
text="".join([z for z in text if ord(z)>0])
lc.heap.append(text)
lc.heap.append(text[int(x*500):int((x+1)*500)])
The file selection dialog box


Output screen, viewing a py file

Labels: , ,

Sunday, March 15, 2009

Turtle Oscilloscope


For the experimental Turtle Art Portfolio V18 for the XO hardware, this program uses the programmable brick and sensor input . (As at V19 Turtle Art Portfolio, the 2 imports below are no longer required.) (As at V44 of Turtle Art, the programmable block is supported but sensor input still is not.)


# Oscilloscope
# Tony Forster, March 2009
#

from taturtle import *
from math import *
def myblock(lc,x): # x is volts input
ox=lc.tw.turtle.xcor #old x coordinate
oy=lc.tw.turtle.ycor #old y coordinate
nx=ox + 1 #new x coordinate
ny= x #new y coordinate
setxy(lc.tw.turtle, nx, ny) #jump to new coord.
draw_line(lc.tw.turtle,ox,oy,nx,ny)
return

A better oscilloscope

Labels: , , , ,

Saturday, March 14, 2009

XO - Electricity and magnetism

Required
XO laptop
75mm (3 inch) nail
insulated copper wire
3.5 mm phono plug
refrigerator magnet

Method
Wrap 50 turns of insulated wire onto a nail and connect the two ends to a phono plug as shown (if it is a stereo plug, probably the red wire and the copper shield). Connect the phono plug to the microphone input.


Start the Measure activity, sound tab, time base, maximum vertical sensitivity, minimum sweep speed (as shown).


Wipe the sharp end rapidly over the back of the fridge magnet, try both directions.


Questions
Try a different number of turns of wire
Try moving the nail more slowly, what happens to the period, frequency and amplitude of the wave?
What is happening?
Why does it work better on one axis of the magnet? (hint rub 2 magnets together)

Labels: , ,

Thursday, March 12, 2009

Data logging with the OLPC

The OLPC XO can measure external inputs with its microphone jack

Specifications

Standard 3.5mm 2-pin switched mono microphone jack; selectable 2V DC bias; selectable sensor-input mode (DC or AC coupled); (1)

If using a stereo plug it is the red wire plus the earth.

It is protected at the input by a 5V zener diode and has a measurement range of 0.3V to 1.9V. The allowable input is -0.5V to 5V Inputs outside this range will cause excessive current and damage. (2) (3)

Addition of a 150k ohm series resistor would (I expect, no guarantee) give a reduced sensitivity in voltage mode (0-4V) but allow inputs to +- 100V without damage. Input impedance in resistance, volume and pitch modes is much lower but a 1k ohm series resistor should still allow inputs to +-12V.

Measure V20

Resistance mode

350 ohms to 10 k ohms (0.2V to 1.78V, open circuit is 2.2V) the volume slider on the sound tab has no effect on sensitivity, half scale is 1.1V or 2.8k ohm resistance

Voltage mode

DC coupled, 0.3V to 1.78V

there is still 0.6V bias at open circuit, input resistance =140k ohms

Sound

Selecting the sound tab which allows sensitivity and timebase adjustment applies 2.2V bias and has AC coupling. Sensitivity is adjustable from 1mV peak-peak full screen to 0.2V peak-peak full screen.


TurtleArt V32

(sensor input is disabled in V42, maybe this stuff is irrelevant)

Resistance

Measuring resistance with Turtle Art

299 = 16 k ohms (maximum)

150 = 3.2 k ohms

0.2= 350 ohms (minimum)

The bias voltage is only applied briefly, approximately 140 mS, any circuitry would need to stabilise in this time. The cycle repeats quite quickly in the above program.

Bias voltage, reading resistance in Turtle Art

Voltage

When doing forever print voltage, open circuit gives a reading of 221. The bias is still applied but the cycle time is much slower, 500 mS for a program cycle

The voltage readings are inconsistent, when applying 0.3 V at the input ( from a source impedance of 30 K ohms), the output jumps between zero and full scale. Maybe its too sensitive, reading millivolts with a 0.3V deadband?

Pitch

Forever print pitch is broken, error: global name real fft is not defined

Volume

With the internal microphone, forever print volume gives an unstable reading, 30-200. Forever print volume wait 1 gives a background level of round 30

External input shown below, 1 kHz square wave applied through 4 uF and 100 k ohms, reads 30 for low inputs but jumps to 200 for a 2V p-p square wave in the unbiased state, note that for the period bias is applied, the early period, the input impedance is lower and the square wave has a smaller amplitude.

Forever print volume wait 1, screen size 0-3V height and 200 mS width, for the earlier part bias is applied, initial pulses of bias as in previous shot are just visible

Turtle Art Experimental V18V19

forever print pitch fails on the 8th loop, error audiograb.py line 65 unpack requires a string length of n. This is a buffer underrun issue and does not occur for manually repeated print pitch. Specifically, unpack() is failing if the buffer from alsaaudio has an odd number of bytes. In the trace below, odd length buffers were hacked to return zero. Doesn't seem to be doing anything sensible.

pitch for a 30 mV 1 kHz square wave, Turtle Oscilloscope

forever print resistance 500 ohms to 15 k ohms but unstable at zero ohms, alternating between 0.2 and 150 . Again, the 150's are caused by undersize buffers, this time even length.

forever print voltage 299 for 0V and 1.9V, 0.2 for 1.2V

This can be fixed by replacing the code in audiograb.py at line 87

   elif self.sensor_type==3:
sensor_val1 = (audioop.avg(buf, 2)*0.00152333) + 50.0

Giving a range of 0.4V to 1.9V for 0-299 but similarly to resistance returns occasional 150's for zero volts input. Again, the 150's are caused by undersize buffers, this time even length.

Turtle Oscilloscope, 0V input, values of 0 occasionally returned by audioop.avg, which after scaling (x+50)*3 =150

At line 358

changing set_capture_gain() seems to have little effect on mode 3 (voltage)but
changing set_mic_boost() gives a range of 1.06V-1.2V in mode 3 (voltage).

forever print volume 299 is 40 mV p-p, occasionally gives 0 or large negative number. Again, the errors are caused by undersize buffers, -ve for buffer length =1.

Volume, Turtle oscilloscope, 30 mV 1 kHz square wave, note spikes to zero

Notes

(1) http://wiki.laptop.org/go/Hardware_specification

Microphone input: standard 3.5mm 2-pin switched mono microphone jack; selectable 2V DC bias; selectable sensor-input mode (DC or AC coupled); (1)


(2) http://wiki.laptop.org/go/Talk:Measure

"What is the maximum voltage I can put into the mic/input port on the XO without risking damaging it?

Short answer -- 0.3V to 0.9V . ... -- there is a 5V reverse biased Zener diode at the input that protects the input ...

My measurements (I used a current-limited adjustable voltage supply) indicate no more than -0.5 volts to +5.0 volts. Beyond these voltages my audio input port drew large, potentially-destructive currents. This voltage is measured relative to the "chassis common" (the outer "shell" of the audio plug). Therefore: even a little AA 1.5 volt battery improperly applied (i.e. "backwards") may damage the laptop.

The Analog Devices AD1888 sound chip has the ability to sample DC voltages. Experimentally it has been found out that the range is fairly linear, however the range that it can sample is restricted to 0.3V - 1.9V, with all the internal gains turned to the minimum."


(3) http://wiki.laptop.org/go/Measure/Hardware

"The XO hardware has been designed to facilitate measurement of DC voltages by the addition of an electronic switch that can be controlled via a setting on the Alsamixer called 'Analog Input' . The high-pass filter can also be turned on/off by a setting 'High Pass Filter' in Alsamixer. The ability to control V_REFOUT (bias voltage) is also available and is done by the control 'V_REFOUT' in Alsamixer.

Measured between the center conductor and the shield (ground, i.e. +0 volts). When an input voltage is greater than +5.0 volts or less than -0.5 volts the input-protection circuitry draws currents greater than 100 milliamperes and will damage the laptop. Also, the AD1888 codec's absolute maximum voltage (given a 5.0 volts supply) is -0.3 volts to +6.3 volts.

You must use input protection resistors and voltage divider if voltages greater than +5 volts will be applied. Resistors and a fast-blow fuse are recommended. Resistors should be present in both the ground circuit and the signal circuit, and this may introduce noise. A better circuit is a high-impedance differential-input amplifier."


(4) http://www.jgc.org/blog/2008/03/building-temperature-probe-for-olpc-xo.html

John Graham-Cumming:Building a temperature probe for the OLPC XO-1 laptop


(5) http://www.olpcnews.com/software/applications/oscilloscope_children_learning.html

An XO Oscilloscope to Measure Children's OLPC Learning, One Laptop Per Child News

Labels: , ,

Sunday, March 08, 2009

One Player Pong for TurtleArt

For the experimental fork of TurtleArt V18

Move the bat with the A and D keys
Issues:
Slow execution speed
Running out of canvas for the blocks

Labels: , ,