Lessons taught; Lessons learnt

Maths, teaching and beyond.

Archive for the ‘javascript’ tag

Classroom Resource: Countdown Timer

without comments

This term my school is running some maths competitions involving timed rounds. The questions are in Word, and I've been getting quite frustrated with the countdown timer built into Activstudio -- in particular, it makes resetting the count very fiddly. There are a lot of countdown/timer applications around, but the ones that do what I want seem to be either stupidly overcomplicated, not free, or to crash all the time.

To get around my frustrations I've cobbled together the following simple countdown timer, written in Javascript:

Source: countdowntimer.html.

Not particularly flashy, but it gets the job done!

You can start/stop/reset the countdown, and alter the starting count in 30s increments, just by pressing buttons, which makes it easy to use on an Interactive Whiteboard. In addition, if you click on the ^^ link (at the bottom right) the timer will open in a new window, with as few toolbars as your security settings allow.

Written by Jon Ingram

April 24th, 2009 at 10:45 pm

Taught: Can you generate Binomial data?

with 2 comments

Background

This is an way of developing the use of the chi-squared distribution, which can also be used to test whether your students can remember what the Binomial distribution looks like!

Start by challenging everyone in the class to generate some data which they feel could be modelled by a Binomial(5,p) distribution, for some value of p. Calculate the value of chi-squared for the frequencies entered (which involves reviewing how to estimate the mean, and what the formula for Binomial is), and then compare that with the critical value needed for the data to be a ‘good fit’ (to, say, a 5% level).

Interactive Binomial Fitness Calculator

I thought I would set myself the challenge of converting this activity into a form which could be directly placed on a Webpage, like this one. After a few days messing around (and a morning wondering why Wordpress didn’t like my Javascript), I can present the following:

Can you generate data which can be modelled well by a binomial distribution?

Try entering frequencies below for data which can be modelled well by Binomial(5, p), for some p. After entering the numbers, click 'Calculate', and the computer will assess how well your data fits a Binomial by performing a chi-squared test.

SuccessesFrequency
0
1
2
3
4
5

(Source: testbinomialmodel.html.)

Note that the condition it is using for goodness of fit is the 5% critical value for chi-squared with four degrees of freedom (6 – 1 because we know the total frequency – 1 because we’re estimating the probability). Note also that it does not combine cells.

Uses

Beyond an initial check of how good students are at modelling a Binomial distribution, this interactive tool can also be used as a tool to explore the Binomial and chi-squared, by systematically altering values and seeing what happens. We can also do something similar, but fix a particular value for the probability of success — this makes it easier to improve by ‘trial and error’ toward a fixed destination, and would also allow us to discuss whether a fit can be too close.

Written by Jon Ingram

August 29th, 2008 at 12:12 pm