packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (Default)
2024-01-21 05:36 pm

a partial list of xdle starting guesses

xdle is a game in the Wordle vein, but about guessing three-digit integers based on number theory facts like greatest common divisors.

Short post, but I guess might be spoilers, so it's under the cut. Also there's that one weed joke.

some possible xdle starting guesses )
packbat: An anthro copper dragon playing music on a small MIDI controller keyboard. (packdragon midi)
2023-08-04 02:01 am

Casting out nines after the decimal point (Blaugust #3)

Another last-minute one, so, you're getting something short and mostly inconsequential.

In our post about our plans for hand calculations of π, we mentioned casting out nines and elevens. If you're not familiar with these methods, you might theoretically be interested in what they are. If you are familiar, you might not have given any thought to a pretty fundamental question for our application: how do you do it on a fraction?

This math probably won't be terribly readable, but we still want to give it a go.

A quick summary of what casting out nines even is... ) ...and the bit about how to do it on decimals. )
packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (nanowrimo09)
2023-08-02 03:37 am
Entry tags:

Pi hand calculation ramble (Blaugust #1)

So apparently there's a thing about making a blog post every day in August? We're a little unwell, but heck with it, why not.

One of our recurring preoccupations is arithmetic in different bases/radices. (Heck, there's a post from our old Livejournal arguing for base 6 in 2007.) Recently, we rewatched part of a stream vod of ours in which we were calculating the golden ratio using Fibonacci numbers in a bunch of bases, and we felt like we could do it better now than we did then...

...so we've been plotting. And scheming. And refining our strategies. Because we're aiming our sights on π.

Maths geekery )

In contrast to our Fibonacci experiments, this will have four divisions instead of one. However, it is all still doable, and if we remember to do the equivalent of casting out nines and elevens, we might even get the right answer!

packbat: A headshot of an anthro bat-eared fox - large ears, tan fur, brown dreadlocks - with a shiny textured face visor curving down from zir forehead to a rounded snout. The visor is mostly black, but has large orange-brown ovals on its surface representing zir eyes. (batfox visor)
2023-03-29 04:01 pm

weirder.earth repost: 0.999...=1

(This explanation assumes you are confidently capable of long division. We can add an appendix about that if one is needed.)

If you want to divide one by three, you have a problem: either you can't because 1 < 3, or you can't because the long division never ends - you just keep getting more 3s. So, we make a convention: when we have a repeating part that never ends, we just indicate what repeats and let that stand for what we would get if we could write infinity decimal places. And the nice thing is that this works - you can do addition, subtraction, multiplication, and division the same way you did before, you just have to figure out what the result and its new recurring decimal will look like.

But a weird thing happens sometimes. If you multiply one-third by three, you get one. But if you multiply 0.333... by 3, all those threes become nines and you have 0.999.... So either our nice new strategy just broke ... or we have to declare that 0.999... equals 1. But in math, you can't just declare it, you have to show that it works to do it that way.

So, this is important. All of elementary school mathematics is riding on this. Can we prove 0.999... equals 1? We know it should - a third times three is one - but can we prove it?

Here's two arguments, and I think you can make both hold up in court.

First: can 0.999... be anything else? ) Second proof: let's do a little algebra. )
(closing thoughts) )
packbat: A headshot of an anthro bat-eared fox - large ears, tan fur, brown dreadlocks - with a shiny textured face visor curving down from zir forehead to a rounded snout. The visor is mostly black, but has large orange-brown ovals on its surface representing zir eyes. (batfox visor)
2022-03-25 12:19 pm

TTRPGs, die rolls, and how often things happen

There's this great joke d20-based tabletop roleplaying game that we do not know the name or author of, but which has very simple mechanics:

  • If you do something, then roll a 20-sided die.
  • If you roll 2 or better, you succeed; if you get a 1 on a die roll, then you die.

So, your character wakes up (die roll), gets out of bed (die roll), puts on clothes (die roll), opens their bedroom door (die roll), walks down the stairs (die roll) ... you see where this is going. And where this is going is approximately a twenty-minute life expectancy. This character is gonna die.

And that doesn't really make sense, right? Your typical person has a lifespan of at least half an hour, and often much longer. However generous the checks look on paper, the frequency of the checks tells a different story.

...so in the name of not beating around the bush, lemme put a formula in front of you:

If consequence rate is how often (times per day, week, year, whatever) you want a given thing to happen, check rate is how often you want someone to make one or more die rolls that could cause that thing, and check probability is the chance that any given check will lead to the consequence, then:

consequence rate divided by check rate equals check probability.

If you want to tell a story in which something has a chance to happen, and you want to defer that chance onto random luck, it's very easy to make that chance way too high or way too low. And that's kind of why we want to talk about it, because it felt like that came up in an actual-play we were listening to today.

What happened was: ... )

Like, it's easy to miss this in the language of rulebooks, but numbers tell stories. And when players and GMs know what stories they want to tell, it can help them to know what stories their numbers would tell.

So, consequence rate divided by check rate equals check probability.

(Oh, and something like AnyDice to do the arithmetic to find check probabilities, if you don't know them already.)

packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (Default)
2021-02-11 11:33 pm

Comparing bases of arithmetic with a pair of calipers

Looking at the links in the description of this YouTube video about measuring tools in machining, good calipers typically can measure between 0 and 8 inches/200 mm to a precision of 0.001 inch/0.02 mm. So, over the course of the full travel, a caliper has about 8000-10 000 possible measurements, more or less, which takes four or five decimal figures to display.

So, let's use 8000 as our benchmark. Imagine for some reason that we were converting to a new numbering system and needed to build new instruments. How many figures will our calipers need to display in any given base?

  • At the bottom end of the scale is binary, naturally. These calipers would have 1 1111 0100 0000 divisions and therefore 13 figures.
  • Ternary calipers are already an enormous improvement - 101 222 022 divisions, 9 figures.
  • Quaternary brings us to 1 331 000, 7 figures.
  • Quinary and senary (a.k.a. seximal), 224 000 and 101 012, are one step better and use 6 figures.
  • Septimal (32 216) through nonary (11 868) use 5 figures.
  • Decimal (8000) through vigesimal (base twenty, 1000) use 4 figures.
  • ...and then it's 3 figures until you get to base ninety.

So, what does this say to me?

I would argue that, for most terrestrial purposes, this degree of precision is a good proxy for how many figures a person doing manual calculations would need to be able to process to complete their tasks. Some calculations are more precise than this, naturally, but outside of fields like accounting or astronomy, they are unlikely to be grossly more precise than this. Therefore, a pragmatic comparison of how difficult manual calculations are should be focused on calculations using this many figures - comparing four figures of long division in decimal to seven in quaternary, or four in decimal to six in senary, or four in decimal to ... four in dozenal. Or hexadecimal. Or vigesimal.

Look, numbers being longer might be a good reason to not go for a small base, but numbers being shorter is a poor reason to go for a big base because the numbers are barely shorter. Returns diminish after decimal, and I think that's really the most important takeaway.


Edit 2021-02-12: Because it feels a little bit unfair to choose a number so ideally suited to decimal, if we instead bump it up to 15 000 divisions (as would be for a 300mm (~12") metric caliper), this ... adds one figure each to binary, decimal, and bases 21 and 22. And the most significant digit is 1 in all of those cases.

So yes, there's not nothing in it between decimal and vigesimal, but in this range there's still not much.

packbat: A selfie shot of a light-skinned black plural system from above, with grass behind zir. (from above)
2021-01-14 04:34 pm

Summarizing our impressions of eleven bases of arithmetic

Here are the conditions of the experiment:

  1. Starting with F0 = 0 and F1 = 1, calculate all Fibonacci numbers up to F[ten] via addition.
  2. Using long division, calcuate the ratio of F[ten] and F[nine] to estimate ϕ (the golden ratio).
  3. Repeat for every positional system base that has a Wikipedia page: 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, and 60.
And here are some thoughts. (425 words) )

I think as far as practical utility of bases of arithmetic, there is a lot we didn't test by doing this operation, but the stuff we did test was very informative.

Edit 2021-02-12: Here is a Twitch highlight of the stream where we did the experiment, for people who want to watch nearly two and a half hours of arithmetic by hand.

packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (hat)
2009-09-17 12:56 am

Easy Hard Problems

"What's the easiest unsolved math problem to explain?" I asked my dad tonight, just out of curiosity. I asked because the two obvious, famous answers - Fermat's last theorem and the four-color problem - are both (probably) solved.

Well, I can't guarantee the actual answer is here, but a few candidates he pointed me to:

  • The P = NP problem: if the answer to a computational yes-no question can be checked quickly (in polynomial time), does that imply it may be answered quickly (in polynomial time)? This is a marginal case, as a lot of people don't know what "polynomial time" is, so two better candidates are...
  • Goldbach's conjecture: that every even integer greater than 2 can be written as the sum of two primes, and...
  • The twin prime conjecture: that there exist an infinite number of twin primes - primes separated by two (like 3 and 5). (Bonus: this is a special case of Polignac's conjecture.) However, there are a pair which do not even require understanding primes...
  • The existence of (a) an infinite number of even perfect numbers and/or (b) the existence of any odd perfect number. Perfect numbers being, in these examples, those which equal the sum of all the divisors smaller than themselves - such as 6, equal to 1+2+3, and 28, equal to 1+2+4+7+14.


(Now, one could argue that an even easier hard problem to state is "how come things fall", but that's physics!)
packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (twisty little passages)
2008-12-28 09:55 pm

A Question to the Internet Oracle, With Reply

This is why I love The Internet Oracle.


The Internet Oracle has pondered your question deeply.
Your question was:

Oh most canny Oracle, to whom every function is integrable analytically,

If fifteen people get on a bus, and then twelve more people get on a bus, how old is the driver?


And in response, thus spake the Oracle:

Twenty-seven.^H^H^H^H^H^H^H^H^H^H^H^H^H
Aha! Trick question. It depends how many people were on the bus to begin with.

You owe the oracle more information.
packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (twisty little passages)
2008-01-27 12:45 pm

Square-F#%&

Remember my entry last Monday? Did you know my house is just about 4° off compass?

Yeah, I didn't either. Can I get a "not cool"?

Let's start with my door, shall we? Bedroom door, closed at night because the light on the corner of the industrial park shines right down the hallway, and it's aligned just about like this:
           ,.
     ___---\ ,
\*---       '
'
(The asterisk is the hinge, the dashes and underscores are the door, the backslashes and periods and commas and primes are the frame. Yeah, I'm no ASCII master.)

Now, during rotation, the door remains constant length, right? And length is measured by max(x,y), right? Therefore, rotation goes like:
|......./
|      /:
|...../ :
|    /: :
|.../ : :
|  /: : :
| / : : :
|/  : : :
*--------
...with the end sliding north first, then west.

Now look at the diagram of my door again. Think about it for a second. Odds are you'll draw the right conclusion.

Welcome to my day.

Now, if you'll excuse me, I'm going to see if my digestive system is less pooched than the plumbing. Oh, and mop the bathroom floor.

Wish me luck.
packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (twisty little passages)
2008-01-21 09:14 am
Entry tags:

Self-Noncontradiction

Something occurred to me a few days ago you might find interesting. You know how a lot of people, when naming impossibilities, will say "square circles"? They're wrong.

Now, I'm going to do this right, so watch.

1. Circle: the locus of points of a fixed distance (called the radius) from a specified point (called the center).

2. Square: a polygon (closed plane figure bound by straight lines) with four sides of equal length separated by equal angles.

You got that? All right. Now consider a chessboard with a king on it - somewhere near the middle, say, so the edges don't interfere.

Now, distance on a chessboard can be defined as "the minimum number of king-steps between two points". This has all the properties of a metric in mathematics - it's a valid definition. In addition, two kinds of squares can be clearly seen on a chessboard - the kind bound by four diagonals and the kind bound by two ranks and two files.

The locus of points one square away from a king - that is, a circle of radius one - is identical to a rank-and-file square with side length two. (Yes, it's three-by-three, but lengths must be measured from center to center if we're going to be reasonable about this.) Continuing, it is clear that a circle of radius two is a square of side length four, a circle of radius three is a square of side length six, and indeed in general a circle of radius r is a square of side length 2r.

Furthermore, there is no reason why a space could not be conceived of that is the differential limit of a chessboard - a continuous plane in which distance was measured by max(Δxy). You could even do a 'slow-rook' variation, where diagonal moves were not permissible and only one step could be taken along the ranks and files - in such a plane, distance would be measured by Δxy and the squares would be diagonal (but still of side length 2r).

Extending the concept to three or more dimensions is left as an exercise for the reader.

Oh, and by the way: if you need a self-contradictory term, feel free to try "married bachelor". I believe that one's still good.
packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (Default)
2007-12-21 10:42 pm
Entry tags:

Because I haven't done it yet: 0.999... = ?

Point nines recurring[1] equals one.

I understand that this claim is intuitively displeasing to many intelligent people. "Point nine recurring doesn't equal one!", they say, and give various reasonable accounts of why the two should be distinguished. However, as an engineer, I submit to the reader that we should equate them, however displeasing it should appear, on the following practical grounds.

Decimal notation is an incredibly effective way of describing numbers. (Or, more accurately, positional notation is. We use decimal specifically because we have ten fingers. I think senary or quarternary notation would be a superior substitute, but I'm not in charge.) Using a small set of symbols and a few characters, we can represent in a very close-grained fashion numbers of a huge span of orders of magnitude - and even larger if we permit exponential notation (e.g. 6.022 * 1023). Further, in decimal notation, comparison of the magnitudes of numbers is dead simple. (Is 14/25 larger than 9/16? 14/25 = .56 and 9/16 = .5625, so no. Compare that with performing the fraction subtraction!) However, it pays for these advantages in the corresponding flaw: there are many[2] numbers which cannot be written in standard decimal notation. Included among these are the majority of fractions. A good example of this is 1/3.

1/3 = 10/30
    = 9/30 + 1/30
    = 9/3 * 1/10 + 1/3 * 1/10
    = 3 * 1/10 + 1/3 * 1/10
    = 3 * 1/10 + 3 * 1/10 * 1/10 + 1/3 * 1/10 * 1/10
    = 3 * 1/10 + 3 * 1/102 + 3 * 1/103 + ...

As is obvious, there's no way to write this completely out as a decimal, like you could with 14/25 and 9/16. So, what do you do? You make up a new notation. Instead of trying to hit the end, you go until you've got the pattern, and then...

1/3 = 3 * 1/10 + 3 * 1/102 + 3 * 1/103 + ...
    = .3 + .03 + .003 + ...
    = .333...

Now, recall, there's no requirement that this notation exist. If, for example, you were programming a digital computer, you might choose not to bother with this notation, as you would never store an infinite decimal. However, it is convenient, defined this way. One especially convenient thing about it, for example, is that one can perform the regular arithmetic operations without trouble:

2/3 = 2 * 1/3
    = 2 * .333...
    = .666...

4/3 = 4 * 1/3
    = 4 * .333...
    = 1.2
     + .12
      +.012
       +...
    = 1.333...

Et cetera.

However, the other consequence is the following.

3/3 = 3 * 1/3
    = 3 * .333...
    = .999...
 and
3/3 = 1
 thus
 1  = .999...

So, one is left with the dilemma. Preserve this useful notation, or throw it out to avoid this (to some) distasteful equality? And, looking at it like that, is it really any sort of choice?

Thus, point nine recurring equals one. Q.E.D.

1. Some may say, for example, "repeating", rather than "recurring". (Google suggests the terms are approximately equal in popularity.) Naturally, the specific term is irrelevant. ^
2. "Many", in this case, meaning "an infinite number of" - specifically, 2 raised to the (infinite) number of counting numbers. What aleph infinity this is depends on whether you accept the continuum hypothesis. ^

packbat: A bat wearing a big asexual-flag (black-gray-white-purple) backpack. (efw O.P.)
2007-02-09 03:04 pm

Base Thoughts

I was lying in bed the other night thinking about bases of arithmetic....

You know, it's kinda odd that insomnia due to math isn't that rare, for me.

Anyway, I was thinking about bases of arithmetic, and Hal Clement's throwaway gag in Still River* about an ancient academic controversy over octal versus duodecimal at the School in his story, and the problem of factoring, and how weak the theoretic justifications for all those specific bases are.

You may be surprised at this claim. "But octal is clearly the most rational," you might be saying. "Binary is the most fundamental base of arithmetic, and octal is a logical extension of that."

Uh-huh. Logical extension how, exactly? If you've got an old 24-bit mainframe?

"That just implies hexadecimal is even better."

Yeah, okay, but that's still just one advantage – convenient relation to binary. Besides, larger bases get more and more inconvenient as you have to memorize more and more figures and (more importantly) bigger and bigger multiplication tables. So hex is great for computer scientists, and octal used to be great for computer scientists, but that doesn't translate to their being the best day-to-day radices. They've got one advantage – one huge advantage – but it's only a useful advantage in a few contexts.

And when we turn to duodecimal, base 12 (and its cousin, sexagesimal, base 60), we find a similar sole advantage: the base has many factors. Yeah, that's great if you're writing fractions – 1/3 becomes 0.4duodecimal, 4/15 becomes [00].[16]sexagesimal (each bracket is a decimal representation of one figure), etc. – but how often do you need to?

Actually, that gets to the key point: what do you need to do regularly with a number system? Really, it comes down to:

  • Write.
  • Add.
  • Subtract.
  • Multiply.
  • Divide.

...pretty much in that order. I mention "write" because while messing with the basic principle of positional notation may be fun, standard positional notation is a pretty solid, intuitive way to write down how many books you have on the second shelf of your bookcase.** And while binary may be logically the simplest radix, 10101 takes up a lot more space than 21†. (Oh, and just coming up with symbols for a sexagesimal system is horrid, forgetting all its other disadvantages.)

So, what about these others? Well, we're only looking at standard positional systems, so whatever advantages balanced ternary systems have, we're ignoring them. Anyway, in standard positional systems, 'add' and 'subtract' pretty much make only one contribution to complexity: how many digits are in your basic addition tables. And since we humans have shown that we can handle base 10 pretty well, anything up to around that size is probably fine. Multiplication is almost the same, but there's an advantage for highly composite (and not-quite-highly composite) radices – all the rows with divisors of the base are simpler. (I guess that means duodecimal isn't quite as pointless as I thought.) Division – well, you're doing long division, so have to come up with a compromise between having fewer digits (higher radix) and fewer multiples of the denominator (lower radix). Oh, and having lots of divisors means fewer recurring 'decimals'.

This sounds like it's building up to sell duodecimal after all. No, it isn't.

I'm saying we should use senary. Base six.

The actual inspiration for this came that night, when I was comparing duodecimal and octal to decimal. Duodecimal, I had decided, had the advantage of many factors. Octal, of being a power of 2. But what about decimal?

Well, as it happens, I had already realized that decimal was unusually good at testing divisibility. As it happens, there are two types of numbers that are very easy to check divisibility of in a given base: factors of the base, and adjacent natural numbers to the base. In decimal, the first group consists of 2, 5, and 10. The latter group consists of 9 and 11. Divisibility by the first set can be checked through examining the final digit – an even digit means multiple of 2, 5 or 0 mean multiple of 5, 0 means multiple of 10. This is really easy – in big O notation, it's O(1), meaning it takes a constant length of time for any number. As for 9 and 11, it's easy to prove from modulo arithmetic that you need merely add all the digits (for 9 – 'casting out nines', basically) or alternately add and subtract (for 11) to check divisibility. These are both O(log n) – the time they take is proportional to the length of the number, written out.‡

Now, all bases get the benefits of these two effects. But because 9 is a power of 3, in base 10 this means that testing divisibility by 2, 3, 5, and 11 is easy. Four of the first five prime factors, accounting for 75.76% of all numbers. That's pretty good – only missing the seven. Duodecimal only gets 2 and 3 from its factors, and 11 and 13 from the casting-out methods, so it misses five and seven. Octal would get seven, of course (one less than the base), but it only has two as a prime factor and nine = three squared as one over the base, so it misses five.

But six doesn't. It misses eleven, but with seven it gets 77.14%, better than base 10, which beat bases 8 and 12. It's smaller than 10, which means only six symbols and 21 unique entries each on the addition and multiplication tables. (It would be 36, but since 2+3 = 3+2 and 2*3 = 3*2, a large fraction drop out.) Being smaller also makes long division easier – you need only write 5 multiples of the divisor, instead of 9. Against that, you've got longer numbers, but even when you get pretty large (e.g. the age of the universe, 13.7 billion years), it's not a big difference (13 senary figures as opposed to 11 decimal figures). Being divisible by 2 and 3 means 1/2, 1/3, and 1/4 are all easy (1/4 = 0.13senary), and adds extra simplicity to two rows of the multiplication table (which has only six to start with, including the ones row).

Add these factors together, and I think that makes 6 the perfect base.§


But hey, who cares what I think!

[Poll #924107]




* Which is actually a pretty lame book, on rereading, but I still like it.
** Not that bijective numerations are that hard to count in – I just didn't want every link to be to Wikipedia.
† I'm not counting the Adobe Photoshop manual in this count.
‡ Which, you must note, is often much less than the number itself.
§ Yes, I did in fact spent seven hours writing a long, technical discussion of the relative merits of five different systems of positional notation, combined with an a priori enumeration of the most important principles of a number system, just so I could conclude with that sentence. I regret nothing!