Experimenting on Children

10 03 2012

Considering the fact that this blog’s tagline is “things that begin with the letter P” it’s an unfortunate omission that I have not yet touched on the subject of, well, urination.

When one of our kids (name withheld to protect the guilty) was in his bed-wetting phase, I would take him to the toilet before I went to sleep. The first discovery I made was that if I carry him to the toilet he would be insufficiently awake in order to pee so I had to stand him up and walk him there. This lead me to wonder how awake he actually was, I wanted to ask him in the morning but was afraid that if I asked him outright it would be a leading question that would implant the memory in his mind. So how can I know if he really remembered what happened during the night?

The next night I told him “I’m going to tell you the name of an animal, remember it for tomorrow, the animal is Elephant.”  My expectation was that he would say he remembers being woken up during the night but not remember anything I actually said.

The next morning I asked and was surprised to hear that, no, he didn’t remember waking during the night. Disappointed with the anticlimactic end of the experiment and not wanting to sink the experiment I asked him if he remembers me telling me a name of an animal. A surprised grin spread on his face and he said Elephant!

This was the exact opposite of the result I was expecting, I guess this proves you must always run experiments to their conclusion, even (especially) if the outcome doesn’t match your expectations.

Now this experiment can’t be said to be statistically significant since it was run on a sample of one. Your mission internet, should you choose to accept it, is to reproduce this experiment and let me know how it turns out.


On the Complexities of Preparing Dinner

21 08 2011

During a coffee break I mentioned that “even though the kids prefer schnitzel I’d rather prepare baked chicken”

When asked why I explained that “Chicken is O(1) and schnitzel is O(N)“.

This is a case in which the joy of using jargon colloquially overrides strict correctness. Obviously making chicken isn’t O(1) even if you do  have an infinitely large oven.

Image stolen from gas-grill-review.com

Then again the complexity of finding an element in an unsorted sequence isn’t really O(N) either, it’s O(N * Max(Cmp(a, b))). Comparing objects can often be considered O(1)  (e.g. 32 bit integers) but if you want to compare books by the number of the times the letter e show up in them, well then, comparing War and Peace to Les Misérables is far from constant speed (you could use A Void as the null book</aside>)

The real[1] reasons I prefer making chicken to schnitzel are twofold.

  1. The constants are much bigger for schnitzel
  2. Schnitzel making is synchronous while baking chicken is asynchronous

And don’t get me started about the space dirty dishes complexity.

  1. Of course how healthy the food is doesn’t count as a consideration, we are geeks here after all.

Off by One Error

6 02 2011

I’m proud to present the latest instalment of indoctrinating my son to be a programmer.

I was giving the boys a bath when #1 said to #2 “you have 14 toes“, I told him his count is a bit off and he replied: “Fooled you, I counted one toe four times” (what can I say? There’s a reason I’m aiming for programmer not stand-up comedian). I then asked him how many toes he would have counted had he really counted the same one four times and was pleasantly surprised when he immediately answered “13“.

Now anyone can make an OBOE but recognising it at once (before the age of 7), well that shows potential.

A Random Die

6 09 2010

A while ago I told of the first board game my son created, which he played using the die he had previously made (I was a bit disappointed with him for not having opposite sides of the die add up to seven but managed to hide it admirably).

Home-made die

I then asked him if the die was fair.

How can I know if it’s fair?

Toss it a lot of times and see if all the numbers come up approximately the same number of times.

He made a table and started tossing the die. The geek dad in me was highly amused by the picture of a 5½ year old (and his 7 year old cousin) tossing dice and keeping track of the results. I was especially tickled by the fact that whenever a one came out he would put down one line next to the digit 1, and when a six came out he put six lines next to the digit 6 (this was fine as long as his table had cells for each throw but when he run out of columns it was pretty difficult to estimate by sight just how random the die really was).

Tune in on his seventh birthday when I teach him how to run a χ2 test.

Exponential Punishments

20 03 2010

A few days ago some friends came over with their children, our 6 year old and theirs were making the most of it and I decided to dish out some discipline.

I heard somewhere that when a child misbehaves you use the time-out method for their age in minutes (2 minutes for a two year old etc.), however they were just fooling around and I felt 6 minutes was a bit extreme, so I sent him to our room for 2 minutes. When he came out I told him that each time he misbehaves he’ll have to stay in our room for double the time he spent last time.

The advantage of this method is that, if you stick to it, by the time your child misbehaves for the 23rd time he’s no longer legally your responsibility.

The First Bug

27 10 2009

I don’t remember the first bug I ever made but as everybody knows [citation needed] half the fun of parenting is living vicariously through our children.

The other day my first born (age 5¾) decided to make a board game.

He had already made the dice (that’s another story), so he got out his crayons and went to work.

Buggy board game

Buggy board game

The rules were pretty simple

  • Boat: move one step forward
  • Guard tower: lose two turns
  • Torch: move back one step less than the last die throw
  • Cannon (that’s the one with lots of red circles): go back to the beginning
  • Etc.

We were playing merrily along when the configuration in the picture came up, two steps away from the boat, roll the die and…

  1. The die lands on 2
  2. Move two steps to boat
  3. Boat moves us a step forward
  4. Land on torch
  5. Torch moves us back one step less than was rolled
  6. Two was rolled so go back one step
  7. Land on boat (goto 2)

Whoops, we’re in an infinite loop! FB was quick to realize what was going on and quickly stopped his old man from executing the infinite loop (ruining all my fun), we arbitrarily chose which of the two locations to stay on an kept on playing.

What really made my day about this was that this was a non-trivial bug, any non-programmer (which includes most 5 year-olds) would not think to look for an infinite loop and even I who suspected such a thing might occur didn’t really see it before it happened (in my defense I wasn’t looking very hard), most flows didn’t expose this “bug” and it’s only by chance that we ran into it on the first time we played the game.

So anyway that’s my son’s first bug, what was yours?