Archive for June, 2009

h1

Smokin’ equations

June 19, 2009

When I was young I used to love visualizing equations (hey, I lived in rural Shropshire! It was that or watch badgers).

This is something I played with when I was about 17.  I still remember it, but I didn’t have the processing power or tools to make a video out of it.  Now I do. The video’s at the bottom of the page, but bear with the maths stuff – I promise it’s REALLY easy.

Initial explanation

I had to write programs to work this stuff out. Fortunately Excel makes it all a bit easier now.

Create a spreadsheet with a sequence of numbers in row 1, and fill in column 1.  This’ll be our x and y axis.

For the values we’ll use y√x.

So:

A very simple equation

We’ll then drag that across to fill in our table.

A spreadsheet of my really simple equation

Now unsurprisingly the numbers get bigger as x and y increase.

Also whenever x (the first row) is a square number (1,4,9,16 etc) then y√x is a whole number.

If we were to plot this as a graph we’d get a really boring graph.

Yawn

Now the interesting bit

Let’s just concentrate on the decimal bits – let’s throw away the whole numbers.

Ooo spikey

Okay, something is going on, but it’s difficult to see what.

The codey bit

The outputInstead I’m going to plot the graph using code. 

I’m going to use white for close to a whole number and black for not near a whole number.

Also, because I want 1 pixel to be 1 number, I’m going to concentrate on a different range.

I’m going to look at the x axis between 2500 (50*50) and  2601 (51*51).  Which will give me a strip 101 pixels wide.

We get some sort of spirally thing going on.

I’ve always thought that it looks a bit like smoke.

It’s actually easier to see on for the smaller values (this is used on my twitter profile http://twitter.com/AdamJTP click the image below for a better look).

Click me for a better look.

So we can sort of see that the squares change as they move up.

Woo-hoo processing power!

I now have much more powerful computers than I had 20 years ago, so I was finally able to get my computer to spit out an animation of how the cells evolve and break up.

So now I’m going to take slices from that chart on the top right and animate them (I’ve never uploaded to YouTube – this could get messy).


YouTube – animated graph of decimal part of y sqrt(x)

Heh – I typed the wrong description in when I upload this image. Oh well.

h1

Maths education dependencies

June 18, 2009

As software developers we’re used to dealing in dependencies. 

.Net reflector add-in

They’re a bit like the Civilization game computer where you move a tribe through different ages.  You couldn’t get monarchy until you’d got a code of laws. Literacy required writing and a code of laws. You’d end up with needing a theory of the atom so you could look at nuclear fission.  I’m not sure why seafaring needed pottery, but anyway…

Part of the Civilization technology map

A personal aside into… mmmm…. maths..

One thing I love about maths is it allows no compromise. There’s no room for an examiner to take marks away from you.  If an answer is correct that’s the end of it.  If it’s a proof you’re after, are the steps small enough and bullet proof?

It’s a lot like coding – but without the messy CSS stuff.

11+ exams – “hello pre-teen, meet stress!”

My son recently had to sit his 11+ exams.  He would be tested in verbal reasoning, non-verbal reasoning and maths.

The one thing we could be pretty certain about was that he’d get close to 100% in the maths paper.  I say “close to” because anyone can make a silly mistake and perhaps misread part of the question.

How could we be so confident?

We only really started to take an interest a couple of months before the exam and we were much too late to find a private tutor.

We tried a few exercises and couple of the approved practice papers. The maths results were pretty mixed. I wasn’t very confident at this point.

Uh-oh

I had the hypothesis that a few links in the chain were weak and this was throwing everything else out.  I set a couple of dozen questions on the fundamentals (number theory, multiplication, fractions, decimals and percentages) and discovered that he had a weak process in long multiplication, fractions were a mystery but everything else was rock solid.  These two foundations threw out everything else that depended on these.

(…see I did get around to talking about dependencies…)

Recovery

I spent about a day drilling the process and concepts into him, and re-tested with a few practice sheets and our remaining two practice papers. Near 100% every time.  Saved!

Now I understand that schools have syllabuses and there is the difficulty in training lots of children simultaneously, but if the dependencies aren’t right then you’re building on sand for the rest of their education.

Actually, I believe the kumon method takes this fundamentalist approach to maths.

My eldest is starting at his grammar school in a few months (he did get in) and I want to track and test that the same thing doesn’t happen again.

Where the hell’s the dependency diagram?

(or critical path analysis, or whatever sort of graph you favour for this sort of thing).

Someone must have worked out how these things depend on each other.  I’ve got a KS3 revision guide next to me and it treats each of the areas as a list of chapters. 

That’s not right.

If you don’t understand percentages, it’ll probably be a key life skill you’ve missed out on, but it won’t affect your algebra or trig.

SI form is important for science (some parts of the sciences curricula will have a dependency on it) but I’d be pretty surprised if you ever need it for Pythagoras’ theorem.

Maybe I don’t know the correct educational terms so I can’t Google it – but I’m at a loss – the pre-requisites for each part of national curriculum (especially for maths) should be given to every parent.  In a solemn ceremony.  With a choir.  Engraved on tablets of marble. …or be available online – which ever is cheaper.

If a child isn’t getting 100% (or close to) in a step then they don’t move on to any steps that depend on it.

…all I know is that the chart below isn’t it.  This is the start of my sketch before I got bored and frustrated.

This isn't it.

..but even my sketch showed me that some areas will be bottlenecks.  Understanding and manipulating equations is fundamental to lots of other stuff.  If you can’t manipulate equations then it’s probably best not to move on until you can.  And success means you can do it (near) 100% of the time.

Okay – each item isn’t really a single piece of text.  You’d have to be rigorous about what do we mean by equations – we’re not expecting children to solve quintics!

A quintic - pretty isn't it?

I want a dependency diagram!

Seriously – I want a dependency diagram across all subjects.  What’s the point in writing history essays if you can’t put a paragraph together.

Don’t give me Avogadro’s number in Chemistry if I don’t understand SI form in maths – it just looks like you were running out of paper and decided to write smaller.

As a parent and student I want to be able to navigate the dependencies and test against them.

…and I want an end to world poverty

Let’s say I want to end world poverty (I’m a bit worried that I wrote “let’s say” – I’m not sure why I wouldn’t want that).  I know it’s hard.  In fact, It’s too hard.  Break it down for me. Let’s build up to it in steps. Where are we as a society in achieving that?

I want Wikipedia for understanding stuff and fixing the world.  Wikistepbystepia.

I want knowledgeable people to be able to refine the dependencies online and document the information behind the boxes and the lines.

…and for proofs and experiments

Let’s say I don’t believe carbon dating (I do, but let’s just say that I don’t).

Don’t feed me the whole mass of data and say “trust the scientists”.

I’m probably happy with tree rings.  Let me see all the journey and I’ll tick off the steps until I get to trusting all this carbon 14 stuff.

…and I don’t want

..and I don’t want toy pseudo decision engine like hunch.com.

…and I don’t want to have to build the bloody thing.

So…

So how am I going to get what I want?  I’ve got a dependency diagram. Right at the bottom I’ve got to firm up my ideas – hmmm… perhaps I should write a blog entry, that usually helps.

h1

…more twitter as a cocktail lounge…

June 15, 2009

Twampoline is only running on one server.  The server is undergoing maintenance at the moment – so I thought I’d add a bit more functionality whilst it’s down.

I like the self-organizing behaviour of the springs and I wanted to added some more – I decided to add mention links as dotted lines with less tension on the springs.

I also wanted to model the chatter that’s overheard in a cocktail lounge – I decided to do this by having random tweets float across the page.

image

I wasn’t keen on launching twitter to post new messages, so I added that in there too (using jQuery UI dialogs).

image

I couldn’t get the LinkControl working in my panels so I just added the links at the bottom of the tweets (which makes the app look like it has a stutter!).

image

…and clicking on an avatar on the left doesn’t take you to their last tweet – it now filters the timeline to just that user’s tweets.

image

Considering that this started as an experiment to model a twitter timeline using springy physics it’s slowly turning into a twitter client.

Oh well, I’m sure I’ll think of something more physicsy to add soon.

h1

twitter as a cocktail party

June 10, 2009

Over the weekend I was musing about how characteristics of my timeline could be modelled as using physical metaphors.  I thought about using 3d space to model my timeline – but I could see it getting in the way of the experience.

Yesterday, night I started modelling my timeline as the twampoline cocktail lounge.

 

Ok – go to http://twampoline.com/lounge – I’ll wait.

 

Today, I get this tweet from @twittorsphere ~ http://www.twitip.com/twitter-is-a-cocktail-party/ ~ maybe they’re in the office over the road.  HEY TWITTORSPHERE – CAN YOU SEE ME?

I quite like timelines – but they don’t feel like a cocktail party.

image

Principles

In a cocktail party:

  • You overhear the last thing people say.
  • You see people talking to each other in groups.
  • People move to be close to the people they’re talking to.
  • People don’t like to be too close to each other.
  • Some people are wall flowers (in a nice way) – they aren’t interacting.
  • Some people are loud, some aren’t.
  • Some people are active – others are looking for their coats.

In pictures

image

image

image

image

image

image

credit to…

@mneme1 for listening to my initial twitter ramblings (although I rather grandly called them soliloquies).

h1

Chaos for eight year olds

June 8, 2009

For me maths isn’t a spectator sport. It’s a game to play, even if you don’t play it well, and I try to teach my children this too. 

This is what we did after Saturday lunch. I’ve put this here for my children to refer back to, and in case anybody else finds it useful.

On Saturday I was talking to my children about population dynamics.

We started talking about populations that doubled in number after each generation:
1,2,4,8,16,32,64,128,256,512,1024 …

Then Fibonacci’s rabbits:
0,1,1,2,3,5,8,13,21,34,55,89,144,…

…and we all agreed that if rabbits really did breed like this we’d be up to our armpits in rabbits by now.

So I asked them to grab their laptops and fire up Excel.

This is a famous (and simple) population model.  All you need to know is the number of "rabbits" will vary between 0 (no rabbits) and 1 (too many rabbits i.e. complete environmental destruction by rabbits!).

If you’re a reading sort of person then Wikipedia and the web will explain it better than I can – http://en.wikipedia.org/wiki/Logistic_map

Whereas here are the "just play with it" instructions for eight year olds. 

There are applets that do this on the web – but I wanted my nippers to create the spreadsheet themselves.

Creating the experiment

1. Open Excel
2. In cell A1 type the number 2

image
3. In cell B1 type the number 0.01 (this is the starting population. Remember 0 is none, 1 is too many).

image

4. In cell B2 type “=A$1*B1*(1-B1)”

image

4a. We talked a bit about what that equation meant – but anyway, who cares…

5. Click on cell B2, grab the little square on the corner and drag it down for at least 100 cells.

image

image

6. Let go and scroll back up to the top

image

7. Click on the B at the top of the page to highlight all of column B

image

8. From the insert menu, choose line chart

image

9. Drag the corners to make the chart bigger

image

Now – playing with the numbers

See that number 2? That’s our “breeding factor”, change it to numbers between 1 and 4.  This is the whole point of the experiment to be able to change these numbers ourselves.

Cell A1 = 2

Gives us the graph below – the graph goes up and stabilizes at 0.5.  My children seemed to think this was the “right amount” (presumably because it’s between 0 and 1).

image

Cell A1 = 2.6

Ooo unexpected! This overshoots a bit before stabilizing at 0.615.  The children already like this model – the number of rabbits is limited (we seem stuck with the rabbit metaphor – damn you Fibonacci!)

image

Cell A1 = 3

Hmmm… that’s tricky, the number bounces about a bit.  Maybe it would get down to a single value if left long enough.

image

Cell A1 = 3.2

Oh no – there’s too many rabbits then the population crashes (then presumably the grass grows back) and then loads of rabbits again

image 

Cell A1 = 3.5

High, low, not so high, not so low, high, low, not so high, … funny looking graph.

image

3.8

Now it gets interesting.  The graph is all over the place!  It swings about, seems to find a level then it’s off again.

image

but what about….

3.8000000001

image

We’ve changed the breeding factor by a tenth of one billionth and got a different graph.  Okay, they’re both spiky but it is clear that the difference is more than a tenth of a billionth.

Further investigation

This is then a good point to talk about the butterfly effect (how a small change in a number lead to a big change in the graph).

And then I left them exploring different numbers. However, navigating is always easier with a map.  If you’re trying this yourself – see if you can work out how the map below relates to the graphs above.

image

Or here’s a video from the excellent sixty symbols website.

…and then…

…we ended up setting up a model to explore the likelihood of “assembling a 747 in a junkyard using a tornado” using a set of wargaming dice.  Okay, we didn’t make a 747 (using wargaming dice?  C’mon that would be weird!), but we did beat godzillions-to-one odds.  But I’ll blog about that another day (unless we find a dead rabbit to mummify first – because that would be VERY cool).

h1

twampoline – examining messaging networks in twitter

June 4, 2009

…you may want to have a look at http://twampoline.com first. I’ll wait…

 

A while back I started wondering about my twitter friends. Specifically how my friends talked to each other and whether there we cliques of friends.

I wasn’t interested in friend/following relationships as that seemed a fairly weak kind of twitter relationship. I was more interested in the “@” stuff that happens in twitter.

I’m a software developer. On Tuesday night I was bored, and it seemed a fairly easy question to answer using technology so I knocked up a quick web app to explore it.

Initially I looked at all mentions and RTs. I started to post some screenshots when the mathematician @PeterRowlett replied to me expressing interest in the graphs.  He hinted that he thought RT/mention relationships was too weak.  Of course, he was right, and now twampoline only looks at direct message relationships.

image 

This is my graph from today.  It’s interesting to see how the graphs change even over a few days. Friends are added, removed, conversations arise (and some drop out of the results) and these all change the graph.  So if you twampoline AdamJTP today you may see a different result.

You can try it yourself by going to http://twampoline.com and entering a twitter username.

…anyway… Here’s the same graph with some explanation.

image

It’s interesting to see the separation between the islands of friends. 

I’m surprised to see my “maths” friends isolated from my work colleagues and social friends (despite repeated #FollowFridays!).

My “chatting” friends are connected by the social hub @snapplynn without her those groups break apart.

The “local” group seem to be well connected.  This may be because we’re a rural area and there are so few of us on twitter and we tend to huddle together? (the Shropshire twibe has very few members (107 today) considering it represents a whole county).

Now compare @deliciouslunch, who (at time of writing) had a similar number of friends to me. 

image

Delicious lunch deliver sandwiches locally. It appears that their local network means that there’s a lot of messaging going on with @ShropStar (local paper), @JimInTheMorning (local radio presenter) and @HoptonHouseBnB (Salopian guest house) being quite chatty.  Even without these bigger local stars there’s lots of messaging going on connecting everybody.

How is the map calculated?

From a username it retrieves all their friends.

For each friend it gets the most recent messages to that person (I leave the number of msgs up to the twitter api).

If the message is from another friend then a connection is added (adding the members if they’re not already on there).

Notes:

A message in either direction counts as a link.

I don’t show friends that aren’t in the messaging network.

I don’t add the original user (because I’m looking for islands).

My BIG grand unified theory of twitter messaging networks

I haven’t got one.  There’s no serious point to this.  This is just a toy to satisfy my idle curiosity.

Give it a go yourself on http://twampoline.com and let me know what you think by sending a twitter message to @AdamJTP

 

Credit where it’s due

Orbifold wrote the clever Silverlight control that moves things about.  I just hooked it into twitter.

@PeterRowlett early tweets with me stopped it being a mess of links (by suggesting removing RTs and mentions)

@snapplynn and @marnweeks for putting up with my repeated following/unfollowing to see how my twitter timeline changed when I was originally thinking about the problem.