Sunday 28 December 2014

Nim (Part 2) - harder

So, how can you figure out the solution to the more complex 'nim' game? (See my previous post for info on the game).

It's actually amazingly simple (well - somewhat simple) but needs a bit of background in binary numbers to appreciate.

First, a reminder that a binary number is composed of a 'ones' column (the right-most digit in the number), then a 'twos' column, then a 'fours' column, etc, like below:



So this is 1 'four' plus 0 'two' plus 1 'one' = 5 (in decimal)
In decimal of course, we have the 'ones' column, 'tens' column, etc, like below:


And this would be 1 'hundred' plus 1 'one' = 101 (in decimal)

Now for the solution. All you do is write out the number of toothpicks in each pile in binary, one below the other. Then add up the columns to see whether each column is even (0, 2, 4, etc) or odd. Finally, if all column sums are even then we call the overall sum 'even'. Everything else will be 'odd'.

Two things that I will note (but not prove):
1. If the overall sum is 'even', then if you take 1 or more toothpicks from any pile you will make the overall sum 'odd'.
2. If the overall sum is 'odd', then there is always a way to take away from one pile so that you make the overall sum 'even'.

So if you can make the sum 'even' on your turn, you can also always do that on your next turn since your opponent will always make it 'odd' on their turn.

a) If you follow this strategy you will win the game where the last person to take a toothpick wins.

Here's an example with three piles of 3, 5 and 8 toothpicks respectively:
Pile 1 (3) 0 1 1
Pile 2 (5) 1 0 1
Pile 3 (8) 1 0 0
Even Odd Even

If you take away 2 from pile 1 you change it from binary 011 to binary 001 and now the sum of all the columns is even. If you keep this up, you will always leave toothpicks in at least 2 piles until you force your opponent to take the second-last pile and you then take the last one.

b) If you are playing the more common version of nim where the person to take the last toothpick loses, then play as above until only one heap has a size of 2 or more. Then remove all toothpicks from the larger heap and you win.

Finally, if you are playing a version of the game where you can only take away up to 'k' toothpicks at a time, then first (in your mind) reduce the size of each heap modulo k + 1 (that is, remove all multiples of k + 1 until you just have a remainder that is between 1 and k). Assuming that you are playing the 'last person to take a toothpick loses' version, then:
- If this makes all the heaps of size zero just take k objects from one of the heaps.
-Otherwise, follow the above strategy 'a'.

This is just an intro to nim, but should be enough that the explanations you read elsewhere make sense (e.g. the wikipedia nim entry)

Saturday 27 December 2014

Nim (Part 1) - easy

Nim is "a game in which two players alternately take one or more objects from one of a number of heaps, each trying to take, or to compel the other to take, the last remaining object".

(This post looks at an 'easy' version of Nim and how to solve it. My next post looks at the solution to the harder variants.)

My first experience with Nim was the simple version ('easy') where you start with a pile of (say) 15 toothpicks. You are allowed to take away 1, 2 or 3 toothpicks in your turn and then it is the other player's turn. You continue taking turns until someone has to take the last toothpick (and they lose).

This type of game is pretty easy to analyze. You can see that if you leave your opponent 1 toothpick you win. And if you leave them 1+4 = 5 toothpicks you also win (since if there are 5 toothpicks and they take 'x', you just take '4-x' on your turn and that leaves 1...giving you the win). So the winning strategy is to leave your opponent with 1 + (some multiple of 4) in the pile. If the pile starts with 15 and you get to go first, take 2 (leaving 13 = 1 + 4(3)) and you are already in a winning position.

Finally, if you are allowed to take 'k' toothpicks on each turn, then just leave 1 + some multiple of (k+1) toothpicks and you win. (And if the rules are that you need to take the last toothpick yourself to win, then just leave 1 + some multiple of k.)

The next variant I had heard of (call it 'hard') extended this game to 3 piles. The version I played had piles of 3, 5 and 8. During your turn you can take 1, 2, or 3 toothpicks from any one pile. Again, the objective of the game was to leave your opponent with the last toothpick.

I'll leave the analysis of this to be a simple case of the 'hardest' case:

  • you have any number of piles
  • each pile has some number of toothpicks
  • during your turn you can take any number of toothpicks from any one pile

What is the winning strategy?

I'll leave this to my next post...but it's actually a fairly easy(!) solution - if you're good at converting numbers to binary and then adding up columns to see if they are even or odd.

Saturday 13 December 2014

Attack (or escape) of the soft plastic bait

Take a look at the picture below:


That's my fishing tackle box, with something strange 'escaping' from the bottom. Taking a closer look:


One of the soft plastic worms that was loose on the bottom of my tackle box has eaten through the plastic base!

At first I thought it was melted by heat - maybe I had left some matches in there and they caught fire, or it had rested against something hot - but there is also damage to a different plastic container that contained some soft bait.


You can see in this picture that the worm on the right, and some of the bait on the left have started to dissolve through the clear plastic container. The picture below shows the right side a little better.


Seems a little bizarre to say the least...and I have to admit that these have been in my tackle box for probably close to 30 years(!) so they have had time to plan and execute their escape.
(Update: OK - closer to 40 years but don't tell anyone)

Checking the internet, this discussion makes sense...the compound that keeps the bait soft can also eat away at other plastic (like your tackle box).

Friday 12 December 2014

Tough Terrans

It seems that in most Science Fiction stories the aliens are much tougher than we poor earthlings and we're forever being terrorized by them.

However, I remembered a couple of stories from many years ago where we were the tough ones.

One was "With Friends Like These" (Alan Dean Foster) which was about aliens coming to Earth to ask for our help (after previous generations had finally beaten back we expansionist earthlings to our home planet and surrounded it with a force field that could only be broken from the outside). Pretty lightweight but humorous. Available online but the free places seemed like they may not have the author's permission so I can mention iTunes as a possibility (or find an old second-hand copy of the book of short stories with the same title).

Another one was "Danger - Human" (Gordon Dickson...the first short story he had published I think) where aliens who are worried about earthlings (because they found out that every 'n' hundred thousand years humans would suddenly expand into the universe and wreak havoc) figure out how to stop the next wave of us taking over the galaxy. Or not. It's available at the following link: http://www.baenebooks.com/chapters/0743471741/0743471741___1.htm

Terrans rule!

Friday 5 December 2014

Super Smell

As I slowly worked my way into the 21st Century - technology-wise that is - I started listening to podcasts on my cool, new technology ipod nano.


OK, I was using the cast-off from one of my boys, but it seemed to be an improvement over my previous music player.


(Though I have to admit this is still pretty cool looking...just doesn't have the functions)

Getting back to the 'super smell' part of this post, I've been listening to Quirks and Quarks podcasts on the aforementioned nano, and there was an interesting one earlier this year about the sense of smell. I had heard (and it seemed to be a common estimate) that we can only distinguish somewhere around 10,000 smells, but is seems that newer research might push that up to trillions!

And smells certainly seem to be able to trigger memories. You don't particularly remember them, but when you smell something specific the memory comes back.

One example I had involving smell occurred about 25 years ago when my older brother and I visited England and did a bit of a tour of 'the relatives'. We were visiting the house where my grandfather's youngest brother and his wife were supposed to be living (we weren't 100% sure that we were at the correct address) but when Albert answered the door he was smoking a pipe, and I instantly recognized it as being the same tobacco blend that my grandfather had smoked! I hadn't smelled it for many years (my grandfather had died many years before this) and would have not been able to describe it (either before or since) but when I smelled it, it instantly brought back a memory of recognition - and sure enough, it was the same blend.

Monday 10 November 2014

Gulls (though not seagulls?)

Seagull or Sea Gull is a common, informal, name for Gulls, sea birds in the family Laridae.

Just thought I'd post this picture because I liked it (and took it, and played around with the colour):


Food companies that try to fool you

There are many ways that companies are trying to avoid raising prices - though I think that often it is more like "there are many ways that companies are trying to avoid being seen as raising prices".

Now, I'm sure that this company/food would never try to fool you, but I've seen so many things under the general category of "make the container smaller" that I wonder if there are any products that have remained the same. Beer maybe? Some of the worst offenders:
1. Allen's Apple Juice - if the can gets any smaller it will be 'individually sized'
2. Frozen Juice
3. Some pop (soda for my potential American reader)

I thought I'd also found an especially egregious example with pizza (under the similar "large package but less weight/volume" category, but I later saw that it was due to 'thin crust' versus 'regular'. Still, if you're buying thin crust I'm guessing you are probably getting a little less of the toppings too:

Standard size, and 901 g.


Standard size, and 480 g.

Oh well, I'm sure that craft brewers will never change the size of their bottles!

Saturday 25 October 2014

The Monty Hall "pick a door...should you switch" problem

Many of you will have heard of this classic problem - known as the Monty_Hall_problem.
Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?
There are two slightly different interpretations of this problem, with (unsurprisingly) different answers. (*Note: updated since my original post*)
  1. IF we assume that Monty always has to pick a goat when he shows you a door, then you will do best to switch (there is a 2/3 probability of winning if you switch, 1/3 probability of winning if you stay). Your overall chance of winning a car if you plan to switch in this scenario is 2/3. See more discussion below.
  2. IF Monty picks a door randomly, then switching and staying both give you the same result! He's either going to:
    1. show you the car (in which case you've lost)...this will occur 1/3 of the time
    2. show you a goat. You now have a 50/50 proposition, since Monty was not *required* to show you a goat. He randomly picked a door and now there is a 50/50 chance that the car is behind your door, and a 50/50 chance that it is behind the other not-yet-selected door. So whether you stay or switch you will get it right 1/2 of the time. If' you're the type of person who kicks themselves more if you switch and are then found to be wrong to switch, then by all means stay.
So in Case #2, your overall chance of winning a car is only 1/3! If you stay with your pick we already know that you have a 1/3 probability of winning. But if you were planning to switch (which would give you the 2/3 probability of #1) you get KO'd 1/2 the time when Monty actually reveals a car, so your net probability of wining is 1/2 * 2/3 = 1/3.
So why do so many people not believe the answer to #1? There are a couple of simple explanations to prove that it is true...maybe people don't have the attention span to actually go through the thinking. Two ways to bring yourself to a new understanding of probability:

a) Just try the combinations! (See also the simple table in the link I gave to wikipedia in the first sentence). If you do this, you will find that out of all possibilities (i.e. 3 possible initial guesses by you x 3 possible positions for the car) you will win 6 times out of 9 if you switch.
  • For any time that you chose correctly at first (3/9 of the possibilities above) you will lose when you switch
  • For any time that you chose incorrectly at first (6/9 of the possibilities above) you will win when you switch
b) What I have found compelling for many is to imagine a situation where there are many more doors, and Monty picks all but one of those doors and shows goats behind all of them. Now would you switch? Here it seems to be more reasonable to people that if there were, say, 100 doors and they pick 1 that they will have a 1/100 chance of winning (and that there is a 99/100 chance that the car is in one of the other 99 doors). So if Monty shows 98 of those doors have goats, you should switch. Only 1/100 of the time will you have selected the right door, but 99/100 of the time Monty will have found it for you out of all the other doors!

Here's a simple table (using the $ to indicate a good prize, and 0 to indicate a bad one). If the prize was originally behind door 1 you win by staying (in blue below). If the prize was originally behind ANY OTHER DOOR you win by switching (in green below).





Friday 17 October 2014

Cat in your luggage?

Many years ago we visited England and Greece (and had a wonderful bus tour of the southern Peloponnese...perhaps more on that later).  While in London we had bought the following at Covent Garden:


A metal cat to place in the garden. It was pretty small (and thin) so we had put it into our checked luggage and pretty much forgotten about it. We went to Greece and on a cruise on the Mediterranean and were finally returning to Canada from Athens.

At the airport they X-Ray all your luggage. Suddenly the man doing that work looked up and asked me "Do you have a cat in your luggage?" He actually motioned me around to look at his screen...there was the 'cat' clear as day and the 'eyes' seemed to be glowing in the X-Ray. He then laughed and let us through...guess it wouldn't have made the same X-Ray picture unless it was...


...something he didn't want to distub.

Sunday 12 October 2014

Raccoons

Not sure if there are more around now than in the past but they still do the same things...walk around mostly ignoring humans, and getting into garbage.

They scare Toronto's mayor of course (though that might just be when he's in a drunken stupor). But does this guy...

...really look like he would scare a municipal leader? Even if he was with friends?


Of course, they do:
  • sh*t in your yard
  • rip up anything stored outside
  • break into any 'raccoon-proof' container having any kind of food scraps in it
  • scare the local cats
And they have supernatural strength! Perhaps part-mayor Ford was right to be scared. Below is a raccoon paw print beside our house 'pounded' right into the concrete!


(one of about 100 paw prints around here...I imagine the last time they poured concrete - the owners of the house that is, not the raccoons - that the raccoons decided to make a statement)

We don't seem to openly declare war on feeding them though. Like Montreal:


No need for signs here...everyone knows that feeding them will just hasten the 'inevitable'...

(insert 'Raccoon' where necessary)

Finally, for the trivia lovers here's a list of fictional raccoons, to show how much they have added to our literature. Much beloved, all of them (though they didn't include my favourite 'Raccoon Tune' book).



Wednesday 1 October 2014

Block'd (Part 1)

Where to start? After the recent amazing games at the worlds (plus the huge timing scandal for the Marathon players) it has probably become the number one talked about game on the web!

Or not.

I found this game on my now almost antique Nokia 2720 (which has v1.3.2 of Block'd). It's challenging to play and I'm going to try and give a short overview - then encourage you to buy my old phone so that you can play it!

My version came out in 2008 and was from EA. I see that they now disavow any knowledge of the game (their 'Answer HQ' here). But there does seem to be a site where you can download it (http://java.mob.org/game/blockd.html) though I have no idea if it's a safe/valid/etc site.

There are two 'modes' that you can play: Speed and Marathon. I'll talk about Marathon mode here and possibly (if there's a huge response) continue on to Speed mode later.

Here's a screen shot of a typical screen (though at a high level). You have blocks of different colours (the game starts with just 3 colours, and works up to 6). If you click on a block that is touching 1 or more other blocks with the same colour, then you remove all 'n' blocks and get a score of n**2. When you no longer have any cases of 2 or more blocks of the same colour touching you then lose a number of 'lives' equal to the number of blocks remaining. If you get rid of all blocks on a level you get a bonus of 1000*(level) points (i.e. 5000 points for level 5).


The last thing to talk about is the 'Wild' blocks. You start with 3 and can work up to 9 (like above) as you get one for each 10,000 points. When you place a 'wild' block it joins the block you place it on with the others around it and allows you to build a large connected area with different colours. This is important because if you clear 3 areas of 5 blocks each (for example) you will get 3*(5*5)=75 points. If you clear 1 area of 15 blocks though, you will get 1*(15*15)=225 points. So it pays to develop large areas and then clear them!

I will modestly claim the World Record Block'd Marathon score (for my particular version of course, and if necessary, restricted to areas not including others who have a higher score). And the key tactics?

  • In the first 5 levels, work up to getting 9 wild blocks. Specifically, on levels 4 and 5, use the 'lightning' and 'multiplier' blocks (oh yeah, I forgot to mention them...lightning extends the number of blocks by 1 in each direction around the base area of blocks, and the multiplier multiplies your score by whatever value it has).and wild blocks to get a big score. See also this totally unrelated video by IanStig.
  • You shouldn't use wild blocks on levels 1-3 unless you need one to, say, finish the level or avoid a big penalty. On the early levels it's usually more important to keep the wild blocks for use on levels 5, 10, 15, etc (the levels where you also get 3 lightning and 3 multipliers)
  • The most difficult part to get through is probably around levels 25-30. Once you get past that you are getting 30,000+ points per level completed, which gets you 3 new wild blocks
  • Work on those fundamentals! (stand with your feet just more than shoulder-width apart, knees slightly flexed, etc - though that may be other sports)
So much more detail I could give...ask me about my upcoming book. (And possibly see part 2 of this post)

 

Friday 26 September 2014

Keeping Old Buildings?

On our recent trip to Montreal we were told that in Old Montreal they are not allowed to take down old buildings. It certainly makes for some great renovations...and also some 'interesting' ones:

Here's a restaurant behind a façade (after a fire I believe).


Edmonton could certainly have gained from not destroying the old courthouse in 1972, and the Tegler Building, and...and...and...  (see link here for some lost buildings in Edmonton).

Nice to see a 'bit' more saving of old buildings in Toronto, but it's a whole different (legislated) level in Montreal (or at least, in parts of Montreal).

Tuesday 23 September 2014

Conservative Government embarrasses us and disgraces itself

Perhaps I don't watch enough Question Period, and maybe this kind of thing goes on all the time, but this seems to take it to a new level.

See: http://www.earljwoods.com/2014/09/inartful-dodging.html

Mulcair asks 3 questions about Iraq, and gets 3 responses from Paul Calandra to do with an NDP fundraiser and his views on Israel. Is Calandra even going to pretend to participate in the democratic process? Is he going to write in his memoirs that it was dictated to him from Harper?

Monday 22 September 2014

Fine foods(?) and food pricing

I was naturally attracted to this food, and also found it interesting that:
a) the original price ends in the classic -,99 (so it's 'just a little more than $9')
b) the reduction amount is $1.21 (so it's 'much more than $1.00, and even more than $1.20')


Perspective

Found this photocopy from 27 years ago - as you can see from the scan. I really have to get all this useless stuff digitized so it can be saved forever.


Saturday 20 September 2014

'Drumming up Business'

We were going to the CAA at Lawrence and Don Mills and happened to walk by this:



Doesn't show up too well with my crappy cell phone camera, but there was one heck of a lot of noise by the person with the pneumatic drill, combined with the occasional noise from the 'Cat'.

(ps If you're actually looking for interesting comments on slightly bizarre things found in Toronto, I recommend Jim Arnott's blog. Features pictures taken with a cell phone camera - though a few zillion times better than mine)

Specific Solutions for the Broken Combination Lock problem

So how to come up with an actual solution for an n x n x n cube? (Assume n is odd, it's easier/symmetrical if even). At a high level:

  1. Pick a corner (let's say, starting at (1,1,1)) of a cube of size (n+1)/2 that is in a corner of the overall large cube), and solve according to below, then
  2. Pick the 'opposite' cube (the opposite corner of the overall large cube - say, starting at ((n+1)/2,(n+1)/2,(n+1)/2)) which will be a cube of size (n-1)/2), and solve it as below too.
  3. The combination is the total solution. 

So let's do it. Starting at one corner (for simplicity, assume (1,1,1) then keeping 'z' constant, for each guess add 1 to each of x and y a total of (n+1)/2 times (or (n-1)/2 times for the second cube...let's just call it 'N' for now).
Then add 1 to z and start x,y at x+1, y+0 from the starting point of your first guess at z=1. Continue adding 1 to each of x and y, 'rolling over' if you go over N.
Continue for each z until z= N, starting each level with x at 1 more than the previous level.
So for n=7, a solution is:
(1,1,1), (2,2,1), (3,3,1), (4,4,1),
(2,1,2), (3,2,2), (4,3,2), (1,4,2),
(3,1,3), (4,2,3), (1,3,3), (2,4,3),
(4,1,4), (1,2,4), (2,3,4), (3,4,4),
- the above handles the cube of size (n+1)/2
(5,5,5), (6,6,5), (7,7,5),
(6,5,6), (7,6,6), (5,7,6),
(7,5,7), (5,6,7), (6,7,7)
- handles the rest

Two notes initially:
1. The selection of an (x,y,z) covers all guesses (x,y,?), (x,?,z), and (?,y,z) where ? represents any value from 1 to n
2. The guess can be seen to be within a 'sub-cube' of m x m x m (where 'm' = max value of x,y,z).

(sidebar) To help viusalize, imagine initially that n is even, and you divide the cube into 8 equal 'sub-cubes' of size n/2 x n/2 x n/2 by cutting the larger cube along the lines of symmetry. (See below...also the second diagram in my previous post)

a) The selection of an (x,y,z) within a 'sub-cube' covers guesses in 4 of the 8 'sub-cubes' (the one in which the selection is made, plus the three others that contain the same 'x and y', 'x and z' and 'y and z'...in other words, the volume shown within the red lines above), but will never cover any guesses in the other 4 'sub-cubes' (symmetrical).
b) The minimum number of guesses to cover the selected 'sub-cube' (and the 3 other sub-cubes affected) must be equal to the area of one side of the 'sub-cube' (n/2)**2, since each guess can only cover one square in this cross-sectional area.
c) To complete the overall cube, you must also cover the other 4 'sub-cubes' that are 'opposite' from your first guesses. As noted, this can be done in (n**2 / 4) guesses by selecting the 'sub-cube' that contains (n/2+1,n/2+1,n/2+1) through (n,n,n). The selection of guesses in any other 'sub-cube' will, by definition, not complete the cube.

Now, back to the general proof. The 'sub-cube' selected (for your x,y,z guess) does not have to be of size n/2. In fact, the cube can be solved by solving any two 'sub-cubes' where one is of size 'i' (i<=n) (starting at 1,1,1 for simplicity) and the other of size n-i which is 'opposite' to the first 'sub-cube' within the large cube. In these cases, the same '3-dimensional L' visualization applies (although the big cube is not divided into 8 sub-cubes now, just 2 sub-cubes of different size plus the other volumes that get 'filled' as you solve each sub-cube). The solution is
S = solution for first sub-cube + solution for second sub-cube
 = i**2 + (n-i)**2
 = n**2 -2ni +2(i**2)
==> if n is even, this is optimal (minimum) at i=n/2

If n is odd (actually, even is just a special case of odd)
S = solution for first sub-cube + solution for second sub-cube
 = i**2 + (n-i)**2 (where i <> n-i)
 = n**2 -2ni +2(i**2)  (as before)
==> this is optimal (minimum) at |n-2i|=min, or in other words, when the two sub-cubes are closest in size.

This comes down to the familiar equations of
S = n**2 / 2   (for n=even)
S = (n**2+1) / 2  (for n=odd)

Thursday 18 September 2014

The Broken Combination Lock problem

(well...*one* of the broken bicycle lock problems)
(AKA rooks on a 3-D chessboard problem)

You have a combination bike lock of the type which has 3 rings, each with numbers 1 through 8. Normally with this kind of lock you have to line up 3 numbers in the right order to open it. The number of possible combinations is 8x8x8.

But, this lock is broken in such a way that you only have to match any 2 of the 3 numbers in order to open it. Obviously you could do it in 64 tries (8x8) by just using any 2 of the rings, but surely you can do better than that.

1. What is the minimum number of combinations you have to try to ensure that you can open the lock?

2. What is the general solution for a 3-ring lock 'broken' as above, but with 'n' numbers on each ring
 a) if 'n' is even?
 b) if 'n' is odd?

(This is the same type of problem as the 'rooks on a 3-dimensional chessboard'. It is known that N rooks may be placed on a 2-dimensional NxN chessboard so that every square is controled by at least one rook. What's the minimal number of rooks on 3-D chessboard NxNxN to meet this condition?)

One thing I found interesting was how to visualize this problem. Basically, you start with an 8 x 8 x 8 cube. Each guess at a combination 'cuts out' a line of 1 x 1 x 1 cubes in each of the 'x', 'y' and 'z' directions from the specific (x, y, z) cube selected. That is, if you select a cube - say (1,1,1) - then you are selecting all cubes that have the same x,y but a different z (the vertical bar in the diagram below), all cubes that have the same x,z but different y (the bar going into the page) and all cubes that have the same y,z but different x (the bar going left to right). Together, these make a '3-dimensional L' shape.

Here's a diagram (it's 4 x 4 x 4, but you get the idea).


In this case, you can see that all guesses where (say) x, y, z <= 2 will carve out a larger '3-dimensional L' shape.


So you only need to make guesses in the x, y, z <= 2, plus (from symmetry) guesses in the x, y, z >= 3 quadrant to complete the solution.

To help visualize, think of a 2 x 2 x 2 cube first. If you pick (1,1,1) and then (2,2,2) you make two '3-dimensional L' shapes that cover the entire cube.

Now looking at the 4 x 4 x 4 cube...the number of guesses you need to cover the x, y, z <= 2 quadrant cannot be less than 4 (the area of any 2 x 2 'end' to the 3-dimensional L). It's easy to see there are many solutions of 4 (more on this later), so the full solution is (2x2)x2 = 8. And for an 8 x 8 x 8 cube the answer is (4x4)x2 = 32.

For an n x n x n cube where n is even, this gives (n/2)(n/2)x2 = (n**2)/2.

If n is odd, a similar approach gives the solution (noting that the two quadrants you are selecting in should be as near to the median as possible, so for a 9 x 9 x 9 cube you could select 16 guesses in the x, y, z <= 4 quadrant, and 25 guesses in the x, y, z >4 quadrant.

For an n x n x n cube where n is odd, this gives ((n-1)/2)**2+((n+1)/2)**2 = (n**2+1) / 2

And finally, the reason that the two quadrants should be the same size (if n is even) and as close as possible to the same size (if n is odd) is simply because the (sum of the) products of the sides of the quadrant (i.e. the sum of the area of one side of each quadrant) is a minimum in that case. 'An exercise left to the reader' - though I can send you the math if you want. See also my next post.

Next post will look at how to generate specific solutions, and more on why you need to select these 3-dimensional L's as close in size as possible to each other to minimize the number of guesses needed in the solution.

And it is nowhere near to clear (to me) for n x n x n x n. More on that even later.

Wednesday 17 September 2014

Trees and Construction Damage

(Something I had put together when I saw our next door neighbour's house construction put a huge Norway Maple under a lot of stress)

Trees (especially in the urban environment) are a huge asset. Large trees are typically valued at $10K-$20K or more, but does that really reflect the enjoyment of the tree? Plus its air-conditioning effect on the street and houses? To say nothing of its climbability :-) Construction can obviously damage these trees and most municipalities have regulations as to the minimum allowed distance from the tree before allowing any construction, excavating, trenching, scraping, dumping or disturbance of any kind. One example of regulations are those for Toronto (see http://www.toronto.ca/trees/pdfs/TreeProtSpecs.pdf) which specify the 'tree protection zone' which is the zone within which there must be:
  • no construction;
  • no altering of grade by adding fill, excavating, trenching, scraping, dumping or disturbance of any kind.
  • no storage of construction materials, equipment, soil, construction waste or debris.
  • no disposal of any liquids e.g. concrete sleuth, gas, oil, paint.
  • no movement of vehicles, equipment or pedestrians.
  • no parking of vehicles or machinery.
  • directional micro-tunnelling and boring may be permitted within the limits of a TPZ subject to approval by Urban Forestry.
  • open face cuts outside a TPZ that are consistent with an approved plan and that require root pruning, require the services of a qualified arborist or approved tree professional. An exploratory dig, either by hand or using a low water pressure hydro vac method, must be completed prior to commencing with open face cuts outside the TPZ.
Certain types of trees are also more or less sensitive to root damage (see this link for info on tolerance of tree roots to damage) and may require additional distance and care. A tree's essential root system will be out to roughly the ‘dripline’ (the radius of the canopy of the tree) and ideally there is some protection out to this distance. Hope this helps those who have been wondering just how to quantify what protection needs to be given to our trees!

Tuesday 16 September 2014

1973/74 - Lots of Snow

Continuing with some old posts, the winter of 1973/74 had the most snow that I can recall in Fort Saskatchewan. I took a couple of photos - some carefully positioned so it appeared that the snow banks were up to the top of the first story of our house - and showed them to various English/Dutch (see also my Ft Sask School Band tour) to show how tough we Albertans were. I’d throw in an occasional reference to Edmonton’s record cold spell if they didn’t seem impressed...does anyone else still have the “I survived Edmonton’s Record Cold Spell” certificate from the Edmonton Journal?

Fort Band Tours England and Holland

(Second clarinets draw raves)

In 1974 the Fort Saskatchewan Senior High School Band (with some members from the Junior High, and a few ringers from elsewhere) took the trip of the Erv Miller (conductor) years – to England and Holland.
We started in London and experienced some pretty ‘basic’ accommodation the first night (and that’s putting it mildly - it was some kind of youth hostel place that used to be army barracks in the Kensington area…near where Mum used to live anyway) until my uncle managed to find a university residence that we stayed in and that was much better! We visited Chelmsford and Cambridge (and possibly other places) from our base in London, then went up to the north-east of England to Teesside (near Middlesbrough) and played in a festival there. Stayed with wonderful people in a beautiful house. Managed to forget some stuff there which they sent back to Canada for us!
Next up was Holland, and we went to both Soest and Purmerend (playing in the International Youth Music Festival there) and also made a record at a studio in (I think) Amsterdam. The part of the trip I remember vividly is visiting some Canadian war cemeteries and seeing how well kept they were. All the people we met were extremely friendly, open, and still thankful for all that Canada had done for Holland during the Second World War! I have had the best impression of the Dutch ever since – and have never been disappointed.