Given Leo’s love of large numbers, it’ not surprising that he is fascinated by what’s called The Farlands, at the edges of the Minecraft world. Basically, The Farlands are some combination of (a) the limits of the internal Minecraft representation, (b) places where, presumably for the sake of speed, the engineers just populated the world with random numbers instead of bothering to create topography where most players will never see it, and (c) bugs. The bugs are likewise in places where most players will never get to, so who cares, right? Answer: Pretty much every young nerd like Leo cares!
So, per my usual theory of making everything a math or science lesson, we use the Farlands as a way into a lesson about computer math. Here’s our whiteboard:
Without trying to annotate everything on the board, we were calculating how many bits it would take to represent the XZ coordinate limits for Minecraft. (Minecraft uses Y for the vertical access, which seems slightly weird if you’re trying to navigate the map because you’re looking down on it, but it’s this is way that it’s usually done in physics.)
We imagined maps of various sizes, for example: 128×128 (on the left about the middle of the board), and then tried to figure out how many bits we’d need to represent these, which led to a short lesson in base 2 logarithms. The interesting thing that Leo noticed, and which was what initiated this lesson, was this seemingly weird factoid from the Farlands web page:
Leo thought that that number was really funny and weird, but I thought that I knew why that number was like it was — specifically, that’s 2^64th. So we talked about binary representation of number (which Leo already knew from long ago) and logarithms as a way to figure out what power of 2 you needed to make a given value, and did some examples, and then used Wolfram Alpha to test my hypothesis that 9,223,372,036,etc is 2^64th:
Um….oops! I forgot that that’s actually the positive limit, but the world is actually TWICE that, positive AND negative!
This led to more lesson on binary representation of positive and negative numbers, and how you could do it with a single sign bit, and the “correct” representation where (in three bits) -1 = 111, -2=110, and so on. This is the stuff on the upper left of the whiteboard. Leo himself noticed that it would wrap around at 4 = -4, and asked why Minecraft didn’t wrap around at 2^63+1…Good question. That would be cool!