First things first. A number is not defined by its representation. What does that mean? All of the following objects represent the same number.

• one half
• 1/2
• 0.5
• 0.1 (in binary)
• `cat * dog` for `cat = 2` and `dog = 1/4`

A number retains its value regardless of how you write it. It is what it is.

# Decimal Treasure Hunt!

I've got it on good authority that some old nerd hid a bunch of treasures all over the real number line, right on top of some numbers. Lucky for us, I've got a fancy number detector that'll help us track them down. Ok it's not that fancy. It's actually pretty cheap but it works so back off.

My fancyish number detector can't take us directly to a number in one go. What it will do is take us to the general area of the number, then we recalibrate it and have it search again. This will give us a much smaller area to search. If we repeat this process for long enough, we'll find our number! Probably. Well, maybe. It depends on your definition of probably.

Anyway! Some of these treasures are supposed to be pretty huge and we're going to have to make multiple trips. The bad news is that it takes about an hour for each scan. The good news is that my fancyish number detector has a way for us to map out the path to the number so we only have to figure it out once. After that, we can just follow our trail right back to the number!

The detector splits the number line up into 10 equal chunks and assigns a number to each chunk. These chunks are closed intervals. "Closed" just means that the endpoints of each interval are included in the interval. For now, we'll be searching between 0 and 1.

For example, on the first scan, interval number 1 is [1/10, 2/10], and interval number 2 is [2/10, 3/10]. This means that 2/10 is in both interval 1 and interval 2. Yeah it's a little inefficient but that's what happens when you buy a cheap number detector from a shady guy behind the gas station.

So all we have to do is run the scan, go to the region that that the scanner pops out, write down the number of the region, and repeat until we find our treasure. Piece of cake, yeah? Let's try one!

# Treasure # 17/40

Since these are test runs, I've already found the numbers and marked them in red on the map so you can see where they are and how all of this works.

• At the top you'll find the map and the 10 different intervals with their associated numbers.
• Next is the map with just the number we're looking for.
• After that is the result from the first scan. This will take us to region 4 which is the interval [4/10, 5/10].
• We write down a 4, then zoom in on [4/10, 5/10]. Note that `4/10 = 40/100` and `5/10 = 50/100`
• We run the scan again and get 2, which takes us to the region [42/100, 43/100].
• We write down a 2 and zoom in on [42/100, 43/100].
• Next scan gives us 5. You know the drill.
• The next scan gives us 0. Oh hey! There's the number! It's right at 425/1000.
• So our map to 17/40 is 0.425. We'll worry about those 0's later.
• If you're confused about why the red 17/40 ends up where it does, remember that its position on a given line is the same as its position in the blue or purple interval on the previous line.

We can look at the map as a whole, but it gets tiny pretty fast. We'll stick with the funky zooming thing. (I'm going to animate this eventually)

# Treasure # 1/3

This one is a little trickier.

• Region 1: 3 -- [3/10, 4/10]
• Region 2: 3 -- [33/100, 34/100]
• Region 3: 3 -- [330/1000, 340/1000]
• We're getting nowhere. Remember how 17/40 eventually landed on the endpoint of some interval? It doesn't look like that's going to happen here.
• The map to 1/3 is 0.333..., where the ... means the 3's keep repeating forever.
• 0.333... is the only map to 1/3. We won't actually get there in finitie time, but it's still the correct map. That said, I'm not going to follow some neverending trail. I have to be back before April so I can see what happens to Jon Snow. Oh well. Next!

# Treasure # 1/2

• Region 1: 5 -- [5/10, 6/10]
• Region 2: 0 -- [50/100, 51/100]
• Well that was easy. The map is 0.5. Let's scan some more just to see what happens.
• Region 3: 0 -- [500/1000, 501/1000]
• Region 4: 0 -- [5000/10000, 5001/10000]
• So really, the map to 1/2 is 0.5000... where the 0's go on forever. We just cut it off at 0.5 because we already found our number. Why add information that doesn't tell us anything?

Wait a second. Why did we get region 5 on the first scan? Why didn't we get region 4 instead, since 1/2 is clearly in region 4 as well? Let's try starting with region 4 and see where it takes us.

# Treasure # 1/2 redux

• Region 1: 4 -- [4/10, 5/10]
• Region 2: 9 -- [49/100, 50/100]
• Region 3: 9 -- [499/1000, 500/1000]
• Region 4: 9 -- [4999/10000, 5000/1000]
• So 0.4999... also gets us to 1/2.
• It's much easier to follow the 0.5 trail so that's the one we usually take, but 0.4999... and 0.5000... both take us to 1/2.

Welp that was fun. I'm going to go take a nap. Feel free to take my detector and go find some more numbers on your own. There are a lot of them out there. Hundreds, at least.

Shout out to my real analysis professor Andrew Cotton-Clay for planting this lovely image in my brain