Author Topic: Theorycrafting! (Because I like competitive metagames too much)  (Read 133435 times)

SnowFire

  • DL
  • Denizen
  • *
  • Posts: 4964
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1000 on: December 01, 2023, 03:01:22 AM »
To quote Ciato: "Ya'll should argue about Aura vs. Abraxas"

Pretty good list overall.  On Aura vs. Abraxas, I agree that for your average random mage running Reason proficiency, Abraxas is probably a bit better (although still pretty terrible).  And this also assumes you've probably made a mistake in your build in going for A Reason / A Faith rather than just tunneling on S rank Reason.  Comes up with Annette as already noted - first time through the game I got an out-of-house Annette to Faith Rank A and was rewarded with a spell I'll never cast, great.  But Aura would have been even more never-cast.  But maybe once in a blue moon Abraxas is useful then.

I'd say that Aura > Abraxas comes largely from the idea that you are building a unit that just wants to use offensive White Magic for whatever reason despite the game really not supporting this that much (so an angry Bishop or a Holy Knight), and it's mostly from that 2 vs. 3 uses (+50% for Aura!).  Maybe you're doubling a slow monster with high HP and don't have Seraphim, which just eats up your non-Nosferatu WM charges really fast.  Aura holds out mildly better, and also has that 1 Wgt less.  And while crit-farming is generally a losing trade, I feel that at the low end of the spell pool, the rules change somewhat.  Abraxas is just almost always a worse option than high-rank Reason spells, and thus never gets used.  Aura might help if you're in some sort of desperate situation where you're willing to "spend" Divine Pulses to help arrange a key crit or something.

But yeah.  Black Magic being a bit bland is fine, and Dark Magic all has gimmicks, but White Magic probably needed more gimmicks than Nosferatu's healing and Seraphim's monster effectiveness.  I know that 3H intentionally depowered most weapon triangle mechanics as being a little too "gamey" for the feel they were going for, but having some sort of bonus vs. Dark Magic would have been the easiest thing to toss onto one of the two dreadful A-- white magic spells.  But just...  something.  Especially for Aura, as while enemies are equipped with Abraxas, Aura is really rare in enemy hands IIRC?  So players won't get "ambushed" by it doing something weird like applying a free Retribution effect or whatever.  And if they truly wanted to keep White Magic a tier below Reason to keep it from being overcentralizing, just toss a few extra uses out for the poor sods who at least try to build a WM-based mage anyway - Abraxas to 4 uses, Aura to 6 uses, say (which would then be 8/12 in Bishop / Gremory).

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1001 on: December 03, 2023, 05:10:59 PM »
Warcraft II

So apparently, this game (of all games) is having a small amount of resurgence lately.  And man, this game is pretty famously hilariously bad balance, let's analyze.

So...unlike later games, units by design just get outmoded.  Like...knights/ogres are just better than footmen/grunts.  How much better?  Let's analyze.

So Knights/Ogres cost about 50% more (600 gold vs 800 gold 100 lumber).

They have about 50% more HP (90 HP vs 60 HP).

They are faster (13 speed to 10 speed)

They have more armour (4 base instead of 2 base)

They have more damage (8 basic + 4 piercing, vs 6 basic + 3 piercing).

So to break this down a bit, a fully upgraded footman will deal 7 damage to a fully upgraded Knight, and a fully upgraded Knight will deal 10 back to a fully upgraded footman.  (Well, slightly less on both cause it's randomly between 50%-100% of that number).  But...also the numbers are even less favourable if they aren't fully upgraded (when this matchup is more likely to happen).  Then the footman is dealing 5 to the Knight, and the Knight is dealing 10 back to the Footman.

But even the 10 vs 7 damage ratio when paired with the 90 HP vs 60 HP ratio, ignoring the speed difference just makes the Knight better than the Footman.  This is about a 2.14:1 ratio.

Standard math for this kind of thing, if a unit costs N times as much, in general the maximum amount more its stats can be is N*(N+1)/2.  Which is to say, this assumes all the little enemies hit the big enemy at the same time, and there's no choke points that force one-on-ones or other surface area issues.  For what it's worth, the ratios in a more balanced game (like Starcraft) tend to be much lower than this value Like...zealots cost 4x as much as zerglings.  4*5/2 = 10.  Their stat ratio is more like 4:1 not 10:1.

Anyway, 1.5*2.5/2 = 1.875.  2.14 is over this value.  And there's also all sorts of added value (the extra move speed, the fact that they turn into spellcasters in tier 3).  Knights/Ogres are just designed to obsolete footmen.

---

OK, so moving onto what is one of the core imbalances of Warcraft 2, Bloodlust.  Ogres and Knights upgrade to Ogre Mages and Paladins.  And Ogre Mages get a spell called Bloodlust.  Warcraft 2 works on a (partially) subtraction defence system (the basic damage is subtraction defence, but the piercing damage does not care).  Without this spell, fully upgraded Knights and Ogres deal 8 to each other (8 basic - 8 armor) + 8 piercing = 8.  But this spell doubles the attack power (before armour subtraction, so that becomes (16 basic - 8 armor) + 16 piercing = 24.  So essentially this ends up with triple the damage in a Paladin vs Ogre Mage fight.

---

Another interesting thing is how little archers/axe throwers are used by players who know the game.  You might think...surely range would be valuable in some situations right?  But...these units have some serious problems.  They have significant AI problems, like if you put them next to a bunch of peons mining gold, they will fail to target without micro--they switch targets extremely slow.  But also they don't share any of the upgrades.  They don't get armour upgrades at all (their armour is always 0).  They do get two +attack upgrades unique to them, but unlike the melee upgrades these are +1 upgrades and not +2 upgrades.  The elven archers do also have one extra lategame upgrade which is a +3 upgrade, so they actually do end up getting a total of +5 total piercing damage (whereas melee units get +4 piercing/+4 armor).  However it's not really enough, and the orc equivalent doesn't get this anyway.  The other thing about these units is...yeah, range is good, but there's other units for that.  Ballistas/catapults.  Towers which you can build in the enemy bases or just outside enemy bases.  Battleships/juggernauts if it's a sea battle.

---

Anyway, just getting back into the basic math of this game, may have more thoughts later.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1002 on: December 06, 2023, 09:45:55 PM »
Warcraft 2.

OK, so following up, the Ogre Mage math is fairly well-known, but here's a few things that are maybe not obvious.

Every unit in Warcraft 2 has the same supply (of 1).  And this has a number of implications.

First, higher cost units are just inherently more supply efficient, and that's not negligible.  Farms cost about 750 in resources, so you can kind-of add 175 to the cost of every unit.  (Which, for example, makes the ratio between Knights and Footmen even worse--instead of a 1.5:1 ratio, it's a 1075:775 which is about 1.39:1).

But something else that has just been known for a long time is that, while the orc Ogres are better than the Human Knights, human mages are better than orc death knights.  And specifically, Blizzard is just a much better spell than Death and Decay.  So much so that humans are actually considered to have an advantage on sea maps, and to be competitive with Orcs on land maps at game speeds of slower than fastest speed.

(Mages do have one other really good spell as well, which is invisibility.  On sea maps they can cast invisibility on a transport unit, and since it never attacks or casts a spell it's basically just unhittable.  On land maps invisibility means that there's no way to stop a mage from getting to a key location in the enemy base, usually the gold mine, and dealing lots of damage).

Other spells from Death Knights/Mages I do see get used in the games I've watched include

* Haste (Death Knight--usually to do something similar to invisibility and get a death knight in range to cause damage to a base, just not as good)
* Slow (mage) -- halves attack speed and movement I believe?  Notably a bloodlusted and slowed ogre still beats a knight, so it's not a cure-all, but it's not terrible.
* Polymorph (mage) -- It's 200 mana, and that's just so much mana, but like...the effect is still pretty good; answer any unit.  In particular, I've noticed that while humans will go gryphon riders against orcs, orcs won't go dragons against humans, and polymorph is probably a big reason for that.  (Another big reason obviously would be that flying units at least enjoy some rock paper scissors advantage over ground units like ogres).
* Death Coil (Death Knight) -- seems to be an okay ranged option against one key target.


Paladins are considered quite bad, to the point that human players often won't invest in them at all, not even get a church even if they did invest in Knights in the middle game.  But Paladins do have one okay spell which is Exorcism.  Able to one-shot a Death Knight.  And it's not like an orc player won't build Death Knights just because they're worse than Mages--they're still worth making.  I'm still not sure Paladins are worth making in human games vs orcs, though--I have seen them made in one long game I found on youtube, but that player still lost.  Any time a paladin ends up in a scrap with Ogres it just seems quite bad.

I do wonder if the right answer to ogre mages from a human player is Dwarven Demolition Squads.  Slightly more expensive than an Ogre Mage, but can kill potentially multiple Ogre Mages at once, and I have seen Dwavrven Demolition Squads win such a game (although it's not clear if the replay I watched was just someone trolling their opponent due to a skill gap--might have been).

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1003 on: December 15, 2023, 04:47:11 AM »
Hearthstone.

So...saw a discussion on the best hearthstone card currently in wild.

Wanted to go into a bit more depth.

First, I want to break it down a bit by class.

Druid

It seems to me that the best druid card at the moment is Floop's Glorious Gloop (coincidentally the highest winrate card in the stats I'm looking at).  Just a card that tends to produce 10+ mana with the right combo.

Other standouts in the stats in the deck I'm looking at (Mill Druid) include Dew Process, which...is obviously specific to mill druid.

Stats from another Druid deck (Reno Druid) have the top four in stats being Astalor Bloodsworn, Reno Lone Ranger, Wildheart Guff, and Moonlit Guidance, with Floop's Gloop coming in 5th.

Paladin

Far and away the #1 card in the stats is Call to Arms, which seems like a pretty good candidate.

Crusader Aura is also showing up as monstrously good in the stats.  (Also a card likely to get nerfed soon thanks to standard).

What also shows up in the stats, is that the Holy Wrath combo is pretty good.  This is a three card 7 mana combo where you play Order in the Court to put Shirvallah the Tiger on top of the deck, then play Holy Wrath to deal 25 to the enemy hero.  But I don't think any one of these three cards can be really credited with this combo.

Priest

The deck I have stats for is shadow priest.  From this deck, Darkbishop Benedictus, Patches the Pirate, and Voidtouched Attendant are probably the most important.

But worth noting the stats are also very good for Ship's Chirurgeon and Shadowbomber as well.  (Technically both a bit higher than Voidtouched in the stats I'm looking at, though intuitively I suspect Voidtouched is still more important.  Obviously stats aren't really available for Benedictus or Patches due to how they work).

Shaman

So for Even Shaman, I think it has to be Genn Greymane.

(If you want a non-Genn card, best four for even shaman in the stats look like The Stonewright, Totemic Surge, Carving Chisel, and Trusty Companion).

Top cards from Reno Shaman decks by winrate include Reno Lone Ranger, Doctor Holl'idae, Astalor, Zephrys.

Golganeth interestingly is one of the few cards that show up as pretty good in the stats for both Reno decks and Even decks (not quite in the top 4 for either, but around 5th-6th for both).

Rogue

Looking at specifically pirate rogue...obviously Patches the Pirate must once again be given credit (even if his contribution is hard to measure with available stat tools).

The highest cards in the stats are Southsea Deckhand, Secret Passage, and Swordfish.  I think Secret Passage deserves some specific callout here, as it goes into basically every rogue deck and not just pirate rogue.

Stats from Kingsbane...highest winrate cards are Cavern Shinyfinder, Cutting Class, Deadly Poison, and Harmonic Hip Hop.  Cutting Class is certainly an interesting standout, being a 0 mana draw 2.  But like...let's be real, the most important card in Kingsbane Rogue is clearly Kingsbane.

Stats from Miracle Rogue...top 5 in the stats are like Mailbox Dancer, Swindle, Arcane Giant, Gear Shift, and Secret Passage.

Warlock

Warlock right now is almost exclusively quest, which means I basically have to pick The Demon Seed.  Once again obviously a card that won't show up in the stats.

Top three in the stats are The Solarium, Fracking, and Chamber of Viscidus.  I think The Solarium specifically does stand out a lot like Secret Passage as something that goes into a large variety of decks.

(Chamber of Viscidus still being in the conversation is funny, given how hard it was nerfed--from 2 mana with 3 uses to 3 mana with 2 uses).

Demon Hunter

It's Final Showdown.

Stats aren't worth too much in decks that tend to draw every card from their deck.  (Highest in the stats on drawn is Ill'gynoth, but I wouldn't read too much into that).

Mage

The relevant mage deck is obviously quest mage, and the two most important cards are clearly Open the Waygate and Grand Magister Rommath.

Warrior

The popular deck here is Even Warrior.  The key enabling card here is obviously Odyn Prime Designate.

Genn Greymane is in the conversation as an enabler, but there are non-even builds of warrior that are built more around Risky Skipper.

Top three drawn winrate in even warrior are Stoneskin Armorer, Craftsman Hammer, and Odyn.

(Non-even is fairly new and doesn't have signficiant stats yet)

---

So I think loosely this can be broken into....

1) cards you build your deck around on a fundamental level and usually don't need to draw them, or just have a ton of ways to tutor them (Genn Greymane, Quests from DH/Mage/Warlock, Darkbishop Benedictus, Kingsbane, Patches the Pirate).

2) Cards you build your deck around at least some and need to draw (Floop's Gloop, Call to Arms, Crusader Aura, Chamber of Viscidus, Cutting Class, Swordfish, Astalor, Reno Lone Ranger, Wildheart Guff, Grand Magister Rommath, Voidtouched Attendant, Odyn)

3) Generically good cards that kind of go into every deck (Secret Passage, The Solarium, Gear Shift)

3rd category...Obviously there are more cards that can be filed into any of these categories (like generically good cards that slot into lots of decks, you could add Ice Block and Aquatic Form, as well as druid ramp cards like Breath of Dreams and Invigorate).  I'm inclined to go with the best two being Secret Passage and the Solarium based on the stats, and probably Secret Passage being the overall best.

2nd category...pretty long list here.  Just based on the stats there are definitely standouts, however.  Call to Arms and Crusader's Aura are standouts in Paladin.  Floop's Gloop is standout in mill druid.  And various cards are standouts in reno decks.

1st category...almost impossible to compare these, though I am tempted to give the nod to Genn Greymane at the moment as being in the most high tier decks right now.
« Last Edit: December 15, 2023, 04:52:31 AM by metroid composite »

SnowFire

  • DL
  • Denizen
  • *
  • Posts: 4964
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1004 on: December 18, 2023, 02:41:55 AM »
On WarCraft II: Are sea maps a thing in multiplayer?  On one hand, if you want to do a sea map, I guess you're stuck doing WC2 since WC3 doesn't support that.  But it seems like such a swingy mechanic, due to the way oil works where warships need oil and oil is found at sea.  If you get behind even a little at the warship race, then your oil patch gets camped by enemy warships and you can't build any more warships while your opponent can.  I guess you can use fliers to maybe get back in the game, but once you start winning the ship race, you can just mix in destroyers that can shoot up. And...  that will be that, as while you could hypothetically defend yourself from shelling with catapults, presumably your opponent just takes the map and locks you in.  (In the campaign, the enemy ship AI is nicely not very aggressive, so it's not a thing there, of course.)  But this is just theorycraft - maybe people found a way to make sea maps work?  Or maybe have some optional sea component on the side?

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1005 on: December 20, 2023, 09:18:18 AM »
Yes, sea maps in WC2 1v1 are a thing.

Just anecdotally based on games I've watched on youtube, humans can lose sea control, and just make a panic transport in response, load in 6 peasants, and drop them at random gold mine islands all over the map, and often win from there, because they will have a gold advantage for making griffins and mages, and can basically ignore oil for a long time.

They do eventually need to take an oil well, not because they need to take back sea control (they can keep casting invisibility on their transport units) but because transports cost oil.  But when they need oil they can either ninja an oil well, or wait until they have mages to defend from land.

I suspect when playing orc rather than human losing sea control might be a lot more disastrous, however.  The strength of orcs in sea maps is loading ogre mages into transports, and they can't do invisible transports so they need at least enough sea control to get their transport through.

Quote
I guess you can use fliers to maybe get back in the game, but once you start winning the ship race, you can just mix in destroyers that can shoot up.

Destroyers, like several WC2 units, you can literally dodge their shots; they shoot where the unit previously was.   They also have friendly fire.  (I've seen someone try to take out two destroyers by flying back and forth over them with a gnomish flying machine and trying to get them to shoot each other to death).

Destroyers are also just...kinda garbage in general.  4 range, lol.  They get outranged by archers.  Juggernauts are better, because they are 6 range with a lot more splash, so while you can dodge their shots too you usually still take some splash.  And they can actually harass land targets if the land doesn't have catapults or spellcasters defending.  (Catapults also having dodgeable AoE shots, but 8 range).

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1006 on: December 20, 2023, 10:23:08 AM »
Competitive NES Tetris.

Apparently this is a thing now, like actually an esport with live events, prize pools, and 13 year old hardcore competitors and has been a thing for the last...6-7 years or so.  And there are player stats:

https://docs.google.com/spreadsheets/d/11EVjpP3bq1Q5zZJqZI23dmiYIsfcKcJBO376BTR6bBI/edit#gid=441377961

So okay, a few basics.

Players play on the same setting, starting games at the same time on their own console, and whoever scores higher wins the match (usually best of 3 or best of 5).

Speed is an interesting part of the discussion.  Now, the NES Tetris (and I believe original GB is the same here) has a speed progression where it only tracks number of frames between pieces dropping.  Normally between levels 0 to 10 the speed increases every level by some number of frames (like it's 8 frames per descent at level 8, 6 frames per descent at level 9, 5 frames per descent at level 10) but that's irrelevant for our purposes, because most competitive matches have a level 18 start (and sometimes a level 19 start).

At level 18 the speed is 3 frames between each time a piece descends.

From level 19-28 the speed is 2 frames between each time a piece descends.

From level 29+ the speed is 1 frame between each time a piece descends.  And the speed never increases after that on the base console.

Level 29 was called the "kill screen", because until about 2 years ago the game was thought to be impossible at this speed--using normal methods it was impossible to get a piece all the way to the left hand side of the screen.  So this is just where matches would end.  But then due to innovative ways of holding controller (sometimes involving feet), people got really good at the level 29 speed, and have reached like...level 140.

Level 39 super kill screen: For the sake of not muddying the competitive scene in ultra long matches, they ROMhacked the game to have another speed increase at level 39.  EDIT: this is confirmed just double the descent rate of the killscreen, so 2 rows of descent for every 1 frame.  There is definitely still some chance to move--I've seen someone land a center well tetris at this speed, but that needed to be set up in advance before the speed increase.

Scoring:

So the scoring is:

Single: 40

Double: 100

Triple: 300

Tetris: 1200

(And then you multiply by the level+1, so a tetris on level 19 is 24000.  A tetris on level 39 is worth 48000).

Tetrises are so much more efficient than everything else.  Like you need four triples to equal the score of one tetris.  And there is essentially a limit to the number of lines you can clear (set by the kill screen initially, and now by the super kill screen) so there is a lot of aiming to get nothing but tetrises, especially before the game speeds up.

So first question, what would a perfect score going into the level 19 speed change be?

When you start on level 18, there are 130 lines before the level 19 transition.  (No, I don't know why it's 130).  This allows for a theoretical maximum of 33 tetrises.  And tetrises on level 18 are worth 22800.  So a perfect score transitioning into level 19 would be 752,400.  As it happens, one player got very close to this theoretical cap in a competitive game.  Sidnev once got 713,321 in a competitive match, so like...she was two tetrises short of a flawless level 19 transition.

What about the level 29 transition?  If you got nothing but tetrises the whole time from level 18 to 29, what would that look like?  This is a bit more complicated to calculate, cause points go up every level, and we alternate between getting 2 and 3 tetrises per level.  But plugging into a spreadsheet, I've got a theoretical max of 1,490,400.  Again, people have gotten surprisingly close--dogplayingtetris got a 1,390,540 transition into level 29.  Which is like...probably something like four or five tetrises short of perfection.

What about the level 39 super killscreen?  Now, this is much more theoretical, because while a lot of people can survive the level 29 speed, and while the cap was added at 39 to encourage people to go big and go for tetrises on this speed, people do still play at least somewhat safe.  But...still, what's the theoretical cap?  The theoretical cap is 2,528,400.  (Not counting the possibility of scoring anything on 39, which, granted, people have scored one last tetris on 39).  Are people close to 2.5 million going into level 39?  No.  In the spreadsheet there's a 1,705,168 from Alex T.  Although...there was technically a game from a no-cap tournament that got higher Game 3 here, being a no-cap tournament there was no super kill screen at level 39, but Fractal after hearing that his round 1 opponent had topped out and the match was over, started playing ultra-aggressive, going for all tetrises at the level 29 speed, and got a 1,899,740 going into level 39.  In particular, he entered 29 at 1,230,880, which means in level 29-38 he got an additional 668,860 points.  The theoretical maximum gain in those levels is something like an additional 1,038,000.  So that's still 64% of the available points between levels 29-38.
« Last Edit: December 21, 2023, 12:41:48 AM by metroid composite »

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1007 on: December 20, 2023, 10:25:42 PM »
Competitive NES Tetris.

I guess there's one more statistic that people care about that I might as well calculate, which is "earliest maxout".

See, with an unmodified cartride, Tetris has a maximum score of 999,999.  The community fixed this with modifications to accommodate higher scores, but before that happened a tradition formed around a leaderboard for who hit 999,999 in the fewest lines.

When's the earliest you could hit 999,999 with a level 18 start?  By my calculations looks like 43 tetrises, 172 lines, so like the end of level 22.

It has apparently been done in 175 lines.  The interesting thing here is that this run had 7 burns, not 3 like you might expect.  A few reasons for that.  First, 172 lines, (43 tetrises with no burns) overshoots the target by about half a tetris, so there's wiggle room to lose some points.  Next, those 7 burn lines do give some points.  Not a lot, but like...1/4 of a Tetris.  Finally, because the tetrises are pushed into slightly later levels as most of the burns were on earlier levels, the level multiplier also adds a few points.  My spreadsheet is still off of the actual score by about 3000 points, though...trying to figure out why...

OK, I think I've figured it out.  When you get a line on level 18 that progresses you to level 19, it gets scored with level 19 points.  I suspect there's no game design reason for this, more that just in the code the level counter got incremented before the score got added.  Anyway, this means that several of my estimates in the previous post above are wrong.

level 19 transition...my previous estimate 752,400 is wrong, one of the tetrises will be 1200 points more, so 753,600.  And additionally, I suppose you could squeeze in one burn line worth 19*40 = 760.  So the cap is more like 754,360.

level 29 transition...my previous estimate 1,490,400 is wrong.  11 of the tetrises (the last one at level 18, 19, 20, 21, 22, 23 24, 25, 26, 27, and 28) will be worth 1200 more points.  So that's an additional 13,200 for a total of 1,503,600.  And on top of that, I guess you could squeeze in a one-line burn on level 28 for 29*40 = 1160 for a total of 1,504,760.

level 39 transition...my previous estimate 2,528,400 is wrong.  21 of those tetrises will be worth 1200 more points for 25,200 additional points.  This brings the total to 2,553,600.  In addition, you could burn one line on level 38 for 40*39=1,560 points for a total of 2,555,160 points.

---

Anyway, getting back to the theoretically earliest maxout--assuming all tetrises it still seems to be line 172 with 43 tetrises.  But now with substantial overshoot with a score of 1,017,600.  The record linked above with 7 burns and 175 lines, has 42 tetrises worth 998,400 points, and 7 burn lines worth slightly over 5,320, which gives predicted points of 1,003,720.

Actual points were 1,003,880.  Can I account for the 160 point discrepancy? Yes, 5,320 assumed all the burn lines were on level 18, but one of the line burns was at level 22, which gets us up to 1,003,880.  Fantastic.

So overall, the additional points are 5,480 from individual line clears, and 9,600 from level multiplier increases over the theoretical just 43 consecutive tetrises.

OK, I wonder if a lower theoretical maximum is possible, by clearing exactly two or three lines to bump up the tetris level multipliers.  Hmm...No, not quite.  I'm getting 998100 as the maximum score for 171 lines, so 172 is still looking like the minimum number of lines for a maxout.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1008 on: December 20, 2023, 11:25:14 PM »
Competitive NES Tetris

So...I got on to thinking about starting level.

The starting level of 18 is often the starting level of choice for tournaments.  The starting level of 19 is sometimes chosen for some top end leagues.  Starting at level 19 is on paper just a benefit for theoretical max points (you get 140 lines until you transition to level 20, so it's the same number of total lines, but 5% higher score multiplier, woohoo).  In general the increased difficulty of 50% higher speed is not considered worth the 5% points increase.  Mostly when it does get picked, it gets picked either to challenge top level players a bit more, or to reduce playtime.

But what about starting at a lower level?  If you start at level 9, for example, you could have 190 levels before transitioning to level 19, instead of 130 levels.  Now, I mean, I imagine this wouldn't be allowed, but hypothetically if it was would it result in more points?

And the answer is no.

Theoretical level 19 transition assuming all tetrises starting at level...

9: 726,000 (100 lines to first transition)
10: 710,400 (100 lines to first transition)
11: 715,200 (100 lines to first transition)
12: 693,600 (100 lines to first transition)
13: 692,400 (100 lines to first transition)
14: 664,800 (100 lines to first transition)
15: 657,600 (100 lines to first transition)
16: 686,400 (110 lines to first transition)
17: 718,800 (120 lines to first transition)
18: 753,600 (130 lines to first transition)

And then for comparison, 132 lines, 33 tetrises starting on level 19 is 792,000 (which doesn't get you to level 20 of course, but it's the equivalent time of the level 19 transition).

What's interesting about this is the game design--seems like the developers on purpose tried to keep the total score of any starting level level 9 or above...not exactly the same but similar.

Anyway, I can certainly see why level 18 was picked historically.  Second highest theoretical max score, and considerably easier than starting at level 19.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1009 on: December 21, 2023, 11:11:09 PM »
Competitive NES Tetris

So a few records I found on the current state of 29 play and 39+ play.  Both done in a practice mode that sets you straight into that speed, and not done in an actual match.  But maybe these show where the game might be heading.  Both set by Alex T.

First, 941,060 in the levels between 29-38 at "killscreen" speed:

https://www.youtube.com/watch?v=haceJKaSGNM

For comparison, the score you get by doing nothing but tetrises theoretically is 1,044,000, so like 90% of the theoretical max.  Someone in the comments mentioned only 14 burn lines out of 100 (everything else was tetrises).

Meanwhile, super killscreen play (again, in a practice environment not in a match) both setting up and getting one tetris, and (on a different run) surviving at the super killscreen speed for 20 lines:

https://www.youtube.com/watch?v=y7x1WTYJ7Pc

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1010 on: December 25, 2023, 11:59:18 PM »
Competitive NES Tetris

So...up to this point, a lot of the calculations are the theoretical score peak.

But we have these nice stats, so what is the score average?  And what does this actually mean for what percentage of line clears are Tetrises?

On level 18 speed (one descent every 3 frames)

The top 10 players going into level 19 have an average of 560k.

If we assume the average non-tetris line clear is a single, this corresponds most closely to a 71% tetris rate.

On level 19 speed (one descent every 2 frames)

The spreadsheet doesn't have specifically this stat (it has total score going into level 29).  But subtracting player's score going into level 29 from that same player's score going into 19 gives an average of 496k.  This corresponds most closely with a 60% tetris rate.

On level 29 speed (one descent every 1 frame)

Stats on this are very messy, but anecdotally I have heard people toss around stats like 30% tetris rate being considered currently very hittable.  And anecdotally if people successfully play aggressive successfully all the way till level 39, I expect them to gain somewhere in the ballpark of 500k from this level range.  A 35% tetris rate corresponds to 478k.  A 30% tetris rate corresponds to 435k.  Obviously people have hit much higher than this as a top score (Alex T hitting a 941k in a practice environment.  Fractal hitting 685k in a match).

But there are also some people hitting much lower--people getting all the way to 39 with a score of like 179k between 29-39.  (That's almost certainly 0% Tetris rate).  But the thing is, the scores of 179k are not necessarily because the player is incapable of hitting tetrises at this speed.  What often happens in the level 39 range is a "chasedown" situation, where one player dies early while they still have the score lead, and the other player has a "chase down situation".  If the player trying to catch up is close enough in score, the safest way to beat their score is to keep the board extremely low, clear single lines, not even attempting tetrises at the level 29 speed.

So people intentionally doing low scoring but safe clears in certain situations makes it hard to gauge where the skill level really is on average.

Anecdotally just looking through actual recent matches for games that went to 39, I think I see more games close to 400k than games at 500k+.  (400k is very likely not safe chasedown play).  400k would be like a 26% tetris rate.  There are also people who have a 500k score but don't even make it to level 39, top out at like...level 36 instead of level 39.  So playing presumably very aggressively but not in a way that will reliably use all the levels available.

So...my best guess for a sustainable tetris rate for top players in general at this speed is probably around 25% of line clears being tetrises, with maybe a few specific players being able to hit higher tetris rates without like...playing super high risk trying to swing for the fences.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1011 on: December 26, 2023, 06:47:46 AM »
Math.  Specifically bases of number systems.

Now, to be clear, most of this is theoretical, because getting people to switch to another base in practical usage is even more obnoxious than teaching people the metric system who don't already know it.  It's more work than switching to metric, for frankly less benefit.

But I have just watched a relatively compelling video that argues that binary, with some proper adjustments for human use, is straight up the most efficient including for human calculation.

https://www.youtube.com/watch?v=rDDaEVcwIJM

OK, one thing I'd like to go over here is this equation:

floor(log(base b)(n))*log(base b)(n) + log(b-1)

This is essentially an equation for how wasteful a number system is.  How much information needs to be parsed relative to how much information is conveyed by the number system.  So e.g. when you read the number 11, you need to parse two digits with 90 possible configurations, so that's somewhat inefficient given how small the number is.

By this measure, if we take this equation literally, basically smaller base is better across the board.

---

The key base that this compares base 2 to is base 6, and sometimes base 12, because apparently there's a notable base 6 movement on the internet (and also a base 12 movement on the internet).

But I would like to dive into base 6 for a moment, cause while a reasonable argument is presented that base 6 is not as good as binary, base 6 does have some neat properties.

Obviously a reason to pick base 6 is that 2 and 3 are the most important prime numbers, and you can divide by them easily in base 6.  But number system bases have this interesting property that they also deal with b+1 and b-1 well.

Just to use base 10 as an example, b-1 in base 10 is 9.  1/9 is a very simple repeating fraction 0.1111....  You can tell easily if something is divisible by 9 by adding up the digits and if they are divisible by 9 then the original number is divisible by nine.  Great.

And likewise, 11 is b+1 in base 10, and has some nice properties.  If the alternating sum (which is to say, add the first digit, subtract the second digit, add the third digit) etc is divisible by 11, then the original number is divisible by 11.  Take, for example 583.  3 - 8 + 5 = 0.  That's divisible by 11.  And 1/11 is also a reasonably well behaved repeating fraction.  0.090909....

This is true for any base.  In base n, you can tell whether something is divisible by n-1 by adding up the digits.  If the sum is divisible by n-1, then the original is divisible by n-1.  And the expansion of 1/(n-1) = 0.11111... (base n).  And likewise for n+1, the alternating sum trick works, and if k=n-1, the expansion of 1/(n+1) = 0.0k0k0k0k....

Well, for base 6, n-1 happens to land on 5, and n+1 happens to land on 7, the two most important primes.  So 5 base six, if you add up the digits and that's divisible by 5, the original number is divisible by 5, and 1/5 is 0.1111....  And likewise, 7 has the alternating sum property that 11 does in decimal, and has an expansion that 1/7 = 0.05050505....

That is actually a remarkably nice coincidence.

Base 6 does handle 11 quite poorly, however.  1/11 in base 6 is 0.03134524210313452421...  So a 10 digit repeating cycle.

Base 6 also handles 13 quite poorly.  1/13 in base 6 is 0.0243405312150243405312150...  So a 12 digit repeating cycle.

The base 2 video does make one argument I mildly disagree with though--that calculating 1/8 in base 6 requires figuring out stuff with 216.  Ehh...only if you're calculating in decimal first and then translating it to base 6.  If you were hypothetically thinking in base 6 already, it's pretty similar to calculating 1/8 in decimal.  Which is to say, you (probably) already know in decimal that 1/4 is 0.25, so you divide that by 2 and get 0.125.  Likewise, 1/8 in base 6, you probably would already know that 1/2 is 3, 1/4 is 0.13, and you divide that by 2 and get 0.03 + 0.013 = 0.043.  Just like 5^3 is 125 base 5, 3^3 is 43 base 6, so 0.043 represents 27/216, but at no point do you need to be thinking about 216.

---

I'd now like to take a little bit of time looking at base 12, which admittedly is less discussed in the video.

So the same properties for b+1 and b-1 are going to apply, which is to say that the numbers surrounding 12, 11 and 13, end up reasonably well behaved.  11 behaves like 9 in base 10.  13 behaves like 11 in base 10.  And that's decently good news because these are two relatively small primes.

But this comes at the cost of 5 and 7, which ends up behaving quite poorly.  1/5 in base 12 is 0.24972497....  Likewise, 1/7 in base 12 is 0.186A35186A35....  This is...not great, especially when you consider the higher informational density of base 12 digits.  If you're trying to memorize these, there's more possible values for each digit.  If you're trying to add or multiply these, the digits are harder to work with.

Now, obviously, 2, 3, and 4, very well behaved numbers in base 12.  But I'm curious, what happens if you take 1/9?  1/3 is 0.4, so 1/9 is 0.14.  1/27 is 0.054.  1/81 is 0.0194.  Obviously it's not a repeating decimal, but...also this feels kinda hard, like...harder than dividing by 5 in decimal.  In a way, dividing by 5 is like multiplying by 2, but here, dividing by 3 is like multiplying by 4 (base 12) and that's...my brain is chugging a little on something that should be pretty easy.

I guess for comparison, I should try the same thing with base 6 cause I'm equally unfamiliar with it.  1/3 = 0.2.  1/9 = 0.04.  1/27 = 0.012.  1/81 = 0.0024.  Yeah, ok, no, that feels a lot easier than in base 12.

Just based on which numbers it handles well, I'm not actually convinced that base 12 is better than base 10.  Base 12 certainly handles 3 better than base 10, but not enormously better.  Because 10 is adjacent to 9, and 9 = 3*3, base 10 handles 3 not like...that bad.  The repeating decimal is 0.333....  If you sum the digits and the result is divisible by 3, the original number was divisible by 3 etc.  Base 10 obviously handles 5 miles better.  Base 12 is way better at handling 13, and also better at handling dividing by powers of 2, but like...I'm not awestruck by base 12 at a glance.

---

So ok, the last point is less about actual pen and paper math, and more about spoken words and mental math (since mental math is often verbal, or at least it is for me).  This is a bit more in the realm of linguistics.

As good as binary is, nobody is going to say "one zero zero one" to say nine.  And they certainly aren't going to say the naming convention proposed in the binary video--like... "two one four two one" to represent fifteen?  Absolutely not.  I think the video takes a step in the right direction for a verbal version of this by having the verbal version being base 4, but I'm pretty sure base 4 is still going to be more syllables than humans want at least for short numbers like nine ("two four one" is three syllables, "nine" is one).

Worth noting that there have been scientific studies done that suggest people do mental math faster when the number of syllables in their number words are shorter.

So like...if your core number system is binary, I think having your verbal base be a power of that makes sense.  I think the answer is probably to go either base 8 or base 16, and I would lean base 16.

Conveniently, between English and French there are single syllable words for every number (except 14) from 1 to 16 already, so that might be a good starting point.

one, two, three, four, five, six, (sept), eight, nine, ten, (onze), twelve, (treze), ???, quinze, seize

But honestly I wonder if something a bit more like floating point arithmetic might work linguistically.

Like...you have a number representing a power of two exponent.  And then you have another number representing one hexadecimal digit in the fractional component.  So like...if the exponent digit is X, and the fractional hex digit is H, then you're looking at 2^X * 1.H as the approximation of the number.  And you would just say X and H.  This could in two syllables (assuming that in the language X and H are the only things vocalized) approximate a lot of numbers fairly accurately (within about a 5% error).  And obviously if you need more precision or bigger numbers you could go there.  Obviously for numbers 16 and below, you have names for those numbers, just say those.

Exponents might initially sound too advanced for language, but there's a lot of evidence that this is closer to how people think about numbers.  Like...babies can tell some numbers apart, they can tell 8 and 16 apart, but 7 and 8 look like the same number to them.  Human brains seem to be more inherently wired exponential than linear.  People in decimal will often just say the leading digit and the power of ten.  Like nine hundred chariots, two hundred donkeys.  Which is a form of this, although it doesn't work great, cause if the leading digit is a 1 you could be off by a huge amount and probably want to give two digits.

But if society already worked in binary, I think a linguistic version of "scientific notation"/"floating point arithmetic" might actually work quite well.

The accuracy issues of only using one digit name are basically entirely gone, cause the leading digit is always 1, and so you'd just give the digit after the period.  Certainly there is still some accuracy magnification for low values of H.  If your 1.H value is between 1.0 and 1.1 in hex, you do have a bigger error (0.031%) than if your 1.H value is between 1.E and 1.F (like a 0.017% error).  But these are all in the ballpark of the two sigma value that gets used a lot in scientific results--there aren't a lot of contexts where you'd need more precision than that.

And yeah, binary would be doing a lot of heavy lifting there.  Both by making order of magnitude a more precise tool, and also the fact that the leading digit is always 1 has obvious linguistic advantages cause you typically need to vocalize one less digit.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1012 on: December 26, 2023, 07:56:40 AM »
Okay, so like...followup thoughts.

Thinking about doing floating point or scientific notation got me thinking...would it be all that different if you went fully logarithmic?

So like...instead of 2^X * 1.H, what if just 2^(X.H)?

Same total amount of information, but like...if you happened to think in binary, would it be easy to take a precise number and express it this way?  After all, that video was hyping up how square roots were not too bad to do by hand in binary.  Maybe logarithms get benefits like that too?  Or am I wishful thinking here.

One immediate benefit, of course, is that the error values between our digits are now exactly the same, definitionally due to the logarithmic scale.

So okay, I guess the first question is that if you just...can't figure out at all how to transform from a string of digits to the logarithm, and you're just lazy and pretend that both of these Hs are identical...how far off will you be?  And the answer is they're furthest off in the middle, and they're by about the lowest binary digit (so 1).  So an H of 6 in the float/scientific notation, so like...2^X * 1.6, is pretty close to H of 7, so 2^(X.7) in the fully logarithmic notation.  And then around 1.1 and 1.F you basically don't even need an adjustment, the linear and the logarithmic aren't perfectly lined up, but closest to each other.

So like...that's really not bad eh?  If someone is too lazy to convert, they're only inaccurate in the last binary digit

Obviously, obviously this is something that only works because binary.  Because we're just trying to get logarithms of numbers between 1 and 2, which makes the logarithm a much closer to linear function.  Don't try this on the leading digit in scientific base 10 notation.

Assuming we're thinking in hex, what do these numbers actually look like?  I'll provide two hex digits of accuracy to give a feel for the amount of error/adjustment, and I'll round to the nearest.

H values, going from a digit string to an exponential, values in hexadecimal of course, so like 8 is half.

1.1 -> 1.16
1.2 -> 1.2C
1.3 -> 1.3F
1.4 -> 1.52
1.5 -> 1.64
1.6 -> 1.76
1.7 -> 1.86
1.8 -> 1.96
1.9 -> 1.A5
1.A -> 1.B3
1.B -> 1.C1
1.C -> 1.CF
1.D -> 1.DC
1.E -> 1.E8
1.F -> 1.F4

So like...just as a quick and dirty conversion, just subtract 0.1 unless you are one away from the very edges (0.1 or 0.F) and bam, you've got a pretty good approximate conversion for going from an approximate float scientific notation to a full logarithm.

What about the other way around, starting with the logarithm and working back to get the binary digits?

1.1 -> 1.0B
1.2 -> 1.17
1.3 -> 1.23
1.4 -> 1.30
1.5 -> 1.3E
1.6 -> 1.3C
1.7 -> 1.4B
1.8 -> 1.6A
1.9 -> 1.7A
1.A -> 1.8B
1.B -> 1.9C
1.C -> 1.AF
1.D -> 1.C2
1.E -> 1.D5
1.F -> 1.EA

Yeah, unsurprisingly, the same approximation works pretty well in reverse.  -0.1 on the H value, unless you have an H value right at the edge (1 or F).

So...okay, that seems like relatively a success at least as a mathematical idea that might be translatable into language.

This all jumped out of a linguistic tangent, so I mean, the one thing I wonder about is whether full logarithmic notation would ever be sufficiently intuitive for common language used by common people.  But the fact that the float/scientific notation language would be so similar means I guess it's fine either way.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1013 on: December 26, 2023, 11:00:45 AM »
More number bases.

OK so...base 3.

For some reason, people who think they can measure the value of a base with equations a bunch of them seem to have zeroed in on 3 as maybe on paper the best base.  Nobody seems to actually believe that, and I think that moreso just points out a flaw with their calculations.

But...what does base 3 look like?  Is it as bad as I'm assuming?

OK so...first observation, b+1 and b-1, in this case they are 2 and 4.  This...isn't great.  Ideally you would like to have an easy time with two different primes, the way base 6 gets 5 and 7, or base 10 gets 3 and 11, or base 12 gets 11 and 13.  But 4 being 2 squared this is kinda just...redundant.

Now I mean, you also get information on the square.  Like...base 2 has a hidden base 4 inside of it, meaning it gets information on 5 being 4+1.  And also has a hidden base 8 inside of it, meaning it gets information on 7.

And 3 is small enough that this is actually relevant.  So 3^2 is 9.  The adjacent numbers are...8, which is once again not useful, and...10.  Which is maybe useful?  At least it's not another power of 2.  Maybe this translates into divisors of 5?

Let's see, so the rule is, thinking about it in base 9, the alternating sum if it's divisible by 10 the original number is divisible by 10.  Does this mean the same thing for 5?  Umm...hmm...

So here's basically the proof behind this functionality

(b+1) = k

b = k-1

xb^2 + yb + z

x(k^2 - 2k +1) + y(k-1) + z

And all of that is divisible by k except a remaining x - y + z.

OK cool.

So what if it's instead

(b +1) = 2k

b = 2k-1

x(4k^2 - 4k +1) + y(2k-1) + z

Yeah, the same logic still works.  All the stuff divisible by k is still divisible by k here, and so the remaining alternating sum if that is divisible by 5, the overall number is divisible by 5.

So this probably does mean there is some value too in 3^3 being 27 (gets us access to 28 and 26, which should give us maybe mildly useful information on the primes 7 and 13).

OK, lets look at some decimal expansions

Starting with the ones that will be painful of course.

1/2 = 0.11111...

1/4 = 0.020202...

I mean, they're not terrible being 3-1 and 3+1, and like binary just counting number of digits is a bit misleading, cause you could easily mentally clump these into base 9, where 1/2 would be 0.44444... and 1/4 would be 0.2222....  But you know, still a bit jarring seeing 2 not being the easiest possible divisor.

1/5 = 0.012101210...

So yeah, I mean, caveats about this being easily digestable small digits and thinking about base 9 this would be 0.171717....  But this still is not ideal.  I kind of thought that since there was a somewhat nice divisibility test that this would be a non maximal repeating sequence.

I guess it's a bit more clear when we look at 1/10

1/10 = 0.002200220022...

And it's not too hard to see how 22+22 becomes 121 base 3.

Alright next up...

1/7 = 0.010212010212....

So...once again there's a divisibility test using 27.  You would think about it in base 27, and then do alternating sums.  But once again this isn't really all that nice as a decimal expansion.  So let's again look at 1/28 to figure out what's going on here...

1/28 = 0.000222000222....

OK, that is fairly nice.  And then...how does this work...11 * 222 (base 3) = 2220 + 222 = 10212.  Yeah, ok, sure, I guess?

Alright, next prime...

1/11 = 0.0021100211...

OK, huh, that's kind of not as bad as I thought?  Ohh, ok, I see what's going on here.  3^5 = 243.  242 is divisible by 11.  (Divisible by 11 squared in fact).  So that's why it repeats after 5 digits and not 10.

1/13 = 0.002002002002...

Nice, ok, this is actually pretty solid.  Obviously because 26 is 27-1.  I'm definitely noticing that the b-1 identity seems to lead to a bit nicer at least in terms of repeat length than the b+1 identity.

---

Mmm...like...I think being a small number is doing some heavy lifting here, but there's very few coincidences that jump out where I really think "oh that's unexpectedly nice".

Obviously it's excellent at dealing with 3.  It's not awful at dealing with 2, just due to being 3-1 (and 4 being 3+1, and 8 being 9-1) but most serious base suggestions are divisible by 2 so it's still probably at a disadvantage with the most used prime.  Both 5 and 7 having a relatively friendly divisibility tests is fairly nice, but their decimal expansions are fairly meh.  13 is handled surprisingly well, both in terms of a fairly nice divisibility test, and a fairly short repeat pattern.  11...I'm not overly impressed with the interaction with 3^5=243 being one more than 242, just seems like 5 is a fairly large exponent, but it does keep the repeat pattern nicer than it could have been.

Longest repeat of a prime up through 13 is 6 long (for the expression of 1/7).  6 long in base 3 being the equivalent in terms of information of something like a 4 long repeat in decimal.

I mean, ok, yeah, it's like...probably fine.  Other than 3s there's not a lot of numbers it handles fantastically, but there's also not a lot of just huge misses.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1014 on: December 26, 2023, 06:55:57 PM »
More number bases.

OK, so let's try to deliberately pick a bad number base.  Let's go with base 7, everyone says that'll be bad, cause it's prime!  And not small like 3!

7-1 is 6, so it has fairly easy divisibility tests for both 2 and 3.  (Add up the digits, see if it's divisible).

7+1 is 8, so you can check divisibility by up to 8 in terms of powers of 2 fairly easily.

1/2 = 0.3333...

1/3 = 0.2222...

1/4 = 0.1515...

1/5 = 0.12541254...

1/6 = 0.1111...

So I mean, yeah, 5 isn't great.  There is a divisibility test cause 7^2 = 49, and 49+1 = 50, which also means that 50 has a fairly nice repeat, and 1/25 is not nightmarish or anything.

1/50 = 0.00660066...

1/25 = 0.01650165...

No obvious divisibility test jumping out at me.  I mean, technically we can jerry rig the b-1 formula a bit

n = (b-2)

b = (n+2)

xb^2 + yb + z

Which is going to simplify down to stuff that divides into 5, and then a remainder that is 4x + 2y + z.  So like...instead of adding the digits, you first multiply the higher digits by powers of 2 relative to their place value, and then you add them.  Is that actually helpful or convenient?  Ehh...nobody I've talked to does the equivalent with 7 in base 10, like nobody for digits x,y,z does 9x+3y+z.  Like...take a random number divisible by 7, 924.  I could do that, or I could just divide cause I know 91 = 7*13, so I can subtract 910, and hey look 14 is left over.  Whereas this trick is like...81+6+4, which gets me to 91, which...yeah, ok, that didn't really save me anything.

However, powers of 2 are a lot nicer than powers of 3--it's just that the 10-2 number is 8, so no help is needed.  And notably in base 7, you can go up to at least 2^3=8 quite comfortably, because of the nice properties of being adjacent to 7.  So like...maybe checking divisibility by 5 in base 7 is a bit nicer than checking divisibility by 7 in base 10?  That's not like...super high praise or anything, but maybe 5 isn't the worst in base 7.

What about the next few primes?

1/11 = 0.04311623550431162355...

1/13 = 0.035245631421035245631421...

Well, these look pretty bad.  Any divisibility tests?  Um...not up through 3 digits.

And then obviously 7 is handled well.

---

So ok, yeah, I mean, it's kinda bad.  But it doesn't look ultra miserable or anything.  It looks like you can't realistically make a base where dealing with 2 or 3 is actually super messy--even if you don't divide b directly, you will divide b-1 or b+1 (or both if you are 2).

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1015 on: December 26, 2023, 09:42:33 PM »
You know, I might be underselling base 7.

7^2 is 49.  49-1 is 48.

This means 1/48 is actually surprisingly nice under base 7.

1/48 = 0.01010101...

making dividing by up to 48 or any of its divisors like 12, 24 surprisingly not really all that bad.  And remarkably arguably nicer than doing it in decimal

Likewise, I already knew that dividing by 8 would be easy because it's 7+1, but dividing by 16 is pretty nice as well.

1/16 = 0.03030303...

But the other interesting thing is b+1.  See, while dividing b+1 is not as nice, multiplying by it is a bit nicer than b-1.  You can see this in base 10.  Multiplying by 9 isn't too nice, but multiplying by 11 is reasonably nice.  22, 33, 44, 55, 66, 77, 88, 99.

And in base 7 what is b+1?  It's 8.

So the powers of 2 in base 7 are...

1
2
4
11
22
44
121
242
514
1331
2662
5654
14641

This is kind of surprisingly nice, like...if you're paying attention you'll recognize 1, 11, 121, 1331, 14641 as the first five rows of pascal's triangle.  Which, of course, is true of powers of 11 in base 10, but nobody really cares about powers of 11.  But people do care about powers of 2, and unironically powers of 2 here have a nicer pattern in base 7 than base 10, at least up to 2^12 (14641 base 7 is 4096 base 10).

How about base 12, like...man, that's a base divisible by 4, does that make powers of 2 nice in the base?

1
2
4
8
14
28
54
A8
194
368
714
1228
2454

And stopping at the same point (2^12)

Hmm...I mean, there is one nice thing here, which is that the last digit cycles between 4 and 8.  This is a 2 cycle, compared to the 4 cycle in base 10 (2 4 8 6) and the 3 cycle in base 7 (2 4 1).  But otherwise there isn't a particularly pretty pattern that jumps out to me about these; it would probably just be memorization like in decimal.

What about base 6, how do powers of 2 look there?

1
2
4
12
24
52
144
332
1104
2212
4424
13252
30544

And once again stopping in the same place (2^12).

Like...yeah, I mean, the same way in base 7 multiples of 8 look a lot like multiples of 11 in base 10, likewise these look a bit more like multiples of 12, but the pattern is just noised out much earlier--the last number that looks like it's following the pattern of 12 is 144.  Like base 12 it does have a nice pattern of the final digit alternating between 2 and 4, which is a 2-cycle.

So...huh, like...base 7 surprisingly is like...actually maybe kinda not that bad.  Like...not a super top tier base or anything, but probably not too bad compared to, let's say base 10.  Like...nicer powers of 2, and an easier time dividing by 48, and obviously deals with 7 way better in exchange for being worse at dealing with 5 and 11.  That...might not even be that bad of a tradeoff.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1016 on: December 27, 2023, 12:55:51 AM »
OK, well, with base 7 not being too bad, how about base 5?

Well...no 5^2-1 is going to be 24, so like base 7 it's able to relatively easily deal with stuff like 1/24 = 0.010101....

1/7 unsurprisingly is kinda meh.

1/7 = 0.032412032412...

But overall probably going to be fairly solid.

What about base 11?

Well, guess what, it's got easy divisibility tests for 2, 3, and 5, and 11^2 - 1 = 120, so 1/120 in base 11 is 0.010101....  This also means any divisors of 120 also have reasonably comfortable repeat patterns.

And...7, surprisingly is not as bad as you might think in base 11.

1/7 = 0.136136...

This can be traced back to 11^3-1, which is 1330, which is 2x5x7x19

Alright, so...13?  Is this actually the first truly bad base?

Well, 13-1 is 12.  So like...

1/12 = 0.111...

1/2 = 0.666...

1/3 = 0.444...

1/4 = 0.333...

And guess what, 13+1 = 14.  So base 13 handles 7 reasonably well as well.

1/7 = 0.1B1B1B...

5 is pretty bad in base 13 though.

1/5 = 0.27A527A5

11 is pretty bad in base 13 as well.

1/11 = 0.12495BA83712495BA837...

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1017 on: December 28, 2023, 12:03:09 AM »
More thinking about number bases.

So...ok, I was reacting with surprise that all these prime numbers, when you square them and subtract 1 you get a number divisible by 24, so dividing by 24 is fairly easy in every prime base so far.

Turns out that's just a rule  That's true for every prime (other than 2 and 3).  Consider...

p^2 - 1 = (p+1)(p-1)

Since there is a number divisible by 3 once every 3, and since p is not divisible by 3, one of p+1 or p-1 is divisible by 3.

Both p+1 and p-1 by definition are divisible by 2.  Because they are two consecutive even numbers, this ALSO means one of them is divisible by 4.

Therefore (p+1)(p-1) will always be divisible by 2*4*3 = 24.

---

OK, so there's one other interesting observation I had.

I started looking at factorials, and how factorials look in various bases.  This is actually the first time I've been impressed with base 12, cause, take 10 factorial, for example, it's got 2 * 4 * 2 * 8 * 2 (from 2, 4, 6, 8, and 10) = 2^8.  And it's got 3 * 3 * 9 (from 3, 6 and 9) which is 2^4.  So we end up with four leading zeroes, and then just 5*5*7.  (Which in base 12 is like...127

And I started wondering if this is a general property.  Like if you take factorial(x) will you in general have roughly twice as many 2s and 3s in the divisor.  And......the answer is actually yes.  Let's go through a proof.

So...every second number is divisible by 2.  So that's one two for every 2 numbers, 1/2.

But also, every fourth number is divisible by 4, which means divisible by an extra 2.  So there's an extra 2 for every 4 numbers, add 1/4 density.

And so on and so forth.  divisible by 8 numbers add another two in every 1/8 numbers.

Which gives us...

1/2 + 1/4 + 1/8 ....

But we know the formula for

1 + a + a^2 ... = 1/(1-a)

Therefore on average the density of 2s is

1/2 * (1/(1-1/2) = 1

There is on average 1 two divisor in every number.

And in general for any number this will be

1/n * (1/(1-1/n)) = 1/n * (n/(n-1)) = 1/(n-1)

So for example, for 3 we get a density of 1/2

On average the density of 3 prime factors is once every two numbers.

For 5 we get 1/4.  There is a 5 prime factor once every four numbers

For 7 we get 1/6.  There is a 7 prime factor once every six numbers.

So the next base up that would get all the ratios right for factorials after base 12 would be 2^4 * 3^2 * 5^1 = 720.  Yep, base 720, that would be uhh...large.  Incidentially 720 is also 6 factorial.

---

OK, one last observation.

I've been discussing how b+1 has special properties, the number expressed as "11" in any base, and this stems partially from the fact that (b+1)*(b-1) = b^2 - 1.

But there's another equation like that.

b^3 - 1 = (b-1)*(b^2+b+1)

So like "111" should have some special properties too.  Only going to be relevant for smaller bases, but lets see if I can figure this out.

Um...yeah, so divisibility test...just replace your b^3 with b^3 - 1 right?  So we have 999, which we know is divisible by 111, so we're left with a +1 three digits over.

So for a six digit number cdefgh, we can reduce this to a three digit number (f+c)(g+d)(h+e), and then if that is divisible by 111 then you are good.  And then for digits 7-9 you end up adding.

Hmm...this is still a bit disappointing, though as a trick, cause we need to do 3 digit addition and subtraction.  With 11 we got to do single digit addition.  Can I not reduce this at least to double digit somehow?

k = b^2 + b + 1

b^2 = k - b - 1

xb^2 + yb + z = k + (y-x)b + (z-x)

OK, so we take the leading digit, and subtract it from the first two digits.

Um...is this even useful?  OK, let me try a base 10 example, just multiply a random number by 111, get 264573717

So 9 digit number, let's reduce this to a 3 digit number

front digit: 2+5+7 = 14
middle digit: 6+7+1 = 14
final digit: 4+3+7 = 14

And then...well yeah, that's divisible by 111.  And if you subtract the front digit from the other two, you get 00.

OK, I mean, that actually doesn't seem so bad as a divisibility test.

And obviously 1/111 has a reasonably nice repeat pattern.  0.009009...

OK, I guess for small bases at least we should take a look at the "111" number to see if it's anything highly useful.

2: 111 is 7.  But it's also 8-1 so yeah, already knew binary handled 7 well.
3: 111 is 13.  OK yes, we did previously establish that 13 divides fairly nice in base 3.
4: 111 is 21.  I mean, 21 not a super important number, but an additional freebie for base 2 essentially.  Base 2 already handles 3 and 7 reasonably nicely, but I guess it wasn't guaranteed to combine them nicely, so yeah, there you go, 1/21 has a nice simple pattern too.
5: 111 is 31.  Eh, it's a prime.  Not a very useful prime.
6: 111 is 43.  Also a prime.  Also not a very useful prime.
7: 111 is 57.  19*3.  Also not very nice or useful.
8: 111 is 73.  Again, mostly just some free bonuses for base 2.  But...not the most useful prime.
9: 111 is 91.  7*13.  Nothing really new.  Base 3 already handles 13 well, and this is so large compared to 7 so it's not even that big of a help.  Although I guess it does let you reduce the divisibilty test of 7 to a...two digit number base 9 (four digit number base 3).  Eh...better than nothing I guess.
10: 111 is 111.  3*37.  Meh.  Base 10 is already decent at handling 3, and handling 37 is just not that helpful.
11: 111 is 133.  7*19.  Well, ok, this is probably one of the reasons why 1/7 is not so bad in base 11.  This should also mean that 1/19 is not so bad in base 11.
12: 111 is 157.  A mediocre prime.
13: 111 is 183.  3*61.  Eh, nah, 13 already has much easier ways to test for 3.
14: 111 is 211.  Not a very useful prime.

Wow, ok, well, the identity exists, but it's mostly not very useful because 111 is always odd in every base, and often just a large rarely used prime, or something the base can already handle some easier way.

And it's a bit redundant looking at 1111, because 1111 in every base = 101*11.  Numbers I typically already do look at.

Actually, something that's jumping out at me as a little weird is that none of these are divisible by 5.  In fact, let me check...yeah, out to 40 none of these are divisible by 5.  None of these are divisible by 11 either.  We see 3, 7, 13, 19.  None of these are divisible by 17.  None of these are divisible by 23.  What the heck?  What is this pattern?

---

OK, let's look at 5, and specifically mod 5.

1^2 = 1

2^2 = 4

3^2 = 4

4^2 = 1

f(x) = x^2 + x + 1

f(1) = 3

f(2) = 2

f(3) = 3

f(4) = 1

Well that proves that it will never happen for 5, but what's the pattern here?  Let's look at mod(11).

1^2 = 1

2^2 = 4

3^2 = 9

4^2 = 5

5^2 = 3

6^2 = 3

7^2 = 5

8^2 = 9

9^2 = 4

10^2 = 1

Mmm...well I can see that none of these work, but I'm not seeing the pattern.  Maybe try reframing this as f(x) = x*(x+1)

f(0) = 0

f(1) = 2

f(2) = 6

f(3) = 1

f(4) = 9

f(5) = 8

f(6) = 9

f(7) = 1

f(8) = 6

f(9) = 2

f(10) = 0

So I mean, hmm, I notice it's symmetrical.  Every number happens twice.  f(1) = f(11-2).  f(2) = f(11-3).  Is this always true?

f(x) = f(k-x) mod(k)?

x(x+1) = (k-x)(k-x-1)?

We can cancel out the k stuff since that will disappear out the modulo.  So we're left with

x^2 + x = x^2 + x

So ok yes, only half of the values will get used up.

OK, let's look at some primes where this does work.

3 works cause 1*2+1 = 3

7 works cause 2*3+1 = 7

13 works cause 3*4+1 = 13

19 works...why does 19 work?  Hmm...let's look at the modulo.

f(1) = 2

f(2) = 6

f(3) = 12

f(4) = 1

f(5) = 11

f(6) = 4

f(7) = 18

19 works because 7*8 = 56.  and 57 = 19*3.

23 doesn't work.

29 doesn't work.

31 works cause 5*6+1 = 31.

37 works because of 10*11+1.

43 works because of 6*7+1 = 43.

What the hell is this sequence?  It's not alternating every second prime or anything?  Hmm...searching for this sequence specifically, it seems to be this sequence:

https://oeis.org/A007645

"Generalized cuban primes: primes of the form x^2 + xy + y^2"

or primes == 0 or 1 (mod 3)

So...yes "primes of the form x^2 + xy + y^2", that's basically my equation there, just with y=1, so this very much looks like the right track.

3, 7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97, 103

Testing up to 103, yes, all of these work.

On them being 1 mod 3...so...other than 2 and 3, all primes are of the form 6m+1 or 6m-1.  Somehow all of the 6m+1 primes work for this, and all of the 6m-1 primes do not.  Can I figure out why...?

Hmm...well anecdotally I do notice that x(x+1) is often divisible by 6.  2*3 = 6.  3*4 = 12.  5*6 = 30.  6*7 = 42.

OK, so for starters, the ones in this sequence that aren't divisible by 6, like 4*5 = 20.  1*2 = 2.  7*8 = 56.  I notice that when you add one to these they seem to be divisible by 3.  (3, 21, 57).  Is this always true?  (3k+1)(3k+2)+1 = (3k)^2 + 3(3k) + 3.  Yes, this is always true.  n^2 + n will always either be divisible by 6, or when it's not divisible by 6, n^2+n+1 is divisible by 3 (and thus not prime unless it's 3).

So that explains why n^2+n+1 can sometimes be a prime of the form 6m+1 and never be a prime of the form 6m-1.  But how do we handle the cases where we need modulo rollover like 19?

n^2+n needs to be 18 (mod 19)

We find our answer in the form of 7*8 = 56 = 18 (mod 19).

Hmm...ok, so we roll over twice mod 19, and every time we roll over, we take -1 relative to if we just rolled with 18.  So in this case we end up with -2.  Since we're in a funny case of n where n is not divisible by 3, that means n^2+n+1 is divisible by 3, which by extension means n^2+n-2 is divisible by 6.

So ok, in the case where one of our multipliers is 3, and the modulo prime is of the form 6m+1, we will get n^2+n lining up with 6m+1.  And all multipliers higher than this that we know of so far are of the form 6m+1, so you would roll all the way around.

What about an opposite case, a prime of the form 6m-1.  Let's just take 17.  We know that n^2+n+1 will never be 17, and we can similarly show that there will never be a multiple like 7 which allows 17 to work, as we will roll the modulo function exactly 6 times and be back to numbers that are only divisible by 3 or 6, and you can't add one to those to get a number of the form 6m-1.  But what about the case of 3 being the only other divisor?

So we're looking for a reason why 3*(6m-1) can never be equal to n(n+1)+1 with 6m-1 being prime

We obviously need n(n+1) to not be divisible by 3 so that adding 1 to it will make it divisible by 3.  So we've got n(n+1) = (3k+1)(3k+2) = 9k^2 + 9k + 2.  And then we add 1 to get n(n+1)+1.

Divide both sides by 3.

Which leaves us with 6m-1 = 3k^2+3k + 1

Moving the -1 to the other side we have

6m = 3k^2+3k +2

But that right side is definitely not divisible by 3.

OK cool, well, I don't know how to prove that all primes 6m+1 have a solution, but I am at least convinced primes of the form 6m-1 can never be one of the divisors.

Anyway, so yeah, longwinded way of showing 111 in every base will often be kinda not very useful, and can only have prime factors in the form of 3 and 6m+1.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1018 on: December 28, 2023, 02:01:55 AM »
Number bases.

You know, a few things occur to me.

I'll just use base 10 for familiarity.  Which is to say 9 is the highest digit, but replace 9 with the appropriate largest digit for any other base and the same thing holds true.

The 1/11 having a repeating decimal of 2 and having a divisibility test is in some ways just an extension of these properties on 99.

1/99 = 0.010101...

Therefore 1/11 = 0.090909...

Divisibility tests of 11 work in large part because divisibility tests of 99 work.

Likewise for 111, 1/111 = 0.009009009... because 1/999 = 0.001001001...

Divisibility tests for 111 are largely enabled by divisibility tests of 999.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1019 on: December 28, 2023, 10:48:44 PM »
So...I was coming up with a list of tests to do on bases.  A few of the tests I was going to do is 1/24 (dividing by number of hours in a day) 1/60 (dividing by minutes in hour or seconds in minute).  I kind of wrote-off doing 1/365, though.  Like...what base is going to handle that well?  That's like...5*73.  Are there any bases that are going to handle dividing by 73 well?

Well, guess what?  73 is a prime of the form 6m+1.  Base 8 unironically hanldes dividing by 73 quite well, cause 111 in base 8 is 73.  365 in base 8 is 555.

1/73 = 0.007007007... (base 8)

Although sure, we still have to divide that by 5, and dividing by 5 might be an adventure.

And like look, 365 is one of the few numbers we can't change.  60 and 24, like honestly, if we can imagine a world where humans switch to a different number base, we could also imagine a world where humans come up with metric time.  (Or I guess "new metric" using the new number base).  But 365?  That's pretty close to a fundamental constant if you live on earth.

So okay, is 1/365 nice in...octal or binary or quaternary or one of those?

Ehh...not particularly.

Here it is in base 4.

1/365 = 0.000023032030332123000023032030332123...

So it repeats every...36 binary digits, 18 quaternary digits, should be 12 octal digits, let's glance at that.

1/365 = 0.001316147633001316147633...

And sure, let's look at the hexadecimal repeating every 9 digits.

1/365 = 0.00B38CF9B00B38CF9B...

I'll be honest, this didn't turn out as nice as I hoped.

1/73 repeats every 9 binary digits, 1/5 repeats every 4 binary digits, so I think the maximum the two of them combined can repeat is 36, but we hit the max.

BUT, the good news is if you have to divide a number by 365 AND your number happens to be divisible by 5, you've got a relatively pretty expansion.

Are there any other number bases with a good handling of 1/365?

Let's try base 3.

0.000001222221000001222221...

What the heck?  That's so nice.  Way nicer than the binary.  What's going on?

Oh I see.

3^6 = 729

729+1 = 730.  730 = 365*2.

1/730 in base 3 of course would be

0.000000111111000000111111

Beautiful.

In fact, let's take a look at this in base 9.

1/730 = 0.000888000888...

1/365 = 0.001887001887...

Wow, ok, that's probably the winner.

In fact that's almost certainly the winner, cause it's very very approximateable.

In base 9 you can just write 1/365 ~= 0.002, and you'll be very close to right.  (You're approximating 1/730 ~= 1/729).

Alright base 5...got anything?  Doesn't look like it.  Obviously base 5 can handle divided by 5 just fine, but at a glance 1/73 looks like trash in the base (Looks like my spreadsheet runs out of precision before it repeats).

Base 6...again, doesn't look like 73 is nicely behaved.

Base 7...73 looks to be misbehaving.

base 10...seems like one of the better ones...relatively speaking?

1/73 = 0.0136986301369863...

Ah yep 10001 = 137*73.

1/365 = 0.00273972602739726

It's an 8 digit repeat, which is technically a "bit better" than base 2/4/8/16.  Unless of course the number you are dividing by 365 happens to be divisible by 5, in which case you get a relatively nice repeat.  I would call this third overall.

Base 11...1/73 doesn't seem to have a nice repeat.

Base 12...1/73 doesn't seem to have a nice repeat.

Base 13...1/73 doesn't seem to have a nice repeat.

Base 14...1/73 doesn't seem to have a nice repeat.

Base 15...1/73 doesn't seem to have a nice repeat.

Well, there you go.  An operation where base 10 is objectively the third best base.  Better than base 6, better than base 12.

In summary:


metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1020 on: December 29, 2023, 01:32:52 AM »
So...I was thinking about...

I find myself thinking about 1/7 pretty often, and almost never find myself thinking about 1/11, say.  Is there a reason for that?  And yeah, there is, of course there is.  It's pi.  3+1/7 is a very well known approximation for pi.

And that got me thinking...using pi in base 7 is probably awesome.  You can approximate it as 3.1 and be very accurate.

So...what other bases approximate pi well?

So the binary base family...It's fairly nice in base 8, actually.

3.1103755

You could do 3.1 as an approximation, and obviously it's not as good as 3.1 in base 7, but it's pretty good.  And if you want to do more accuracy you can do 3.11, and you end up with...about as much accuracy as 1/7.  Both are slightly under a 1% error  Technically 9/64 is a 0.69% error, and 1/7 is a 0.89% error, so 9/64 is a bit closer.  But like...you do need an extra digit to get there.

In Base 3

It's...

10.01021101222

So I mean, yeah, the first obvious cutoff approximation would be 10.01.  So approximating the tail as 1/9.  Unsurprisingly this isn't great, like a 27% error on the tail, and worse than 1/8.  But the second cutoff is not super appealing either.  10.010211.  So approximating the tail as uh...103/729.  Which is accurate to 0.2%, but you're using 6 digits to get there (or 3 digits base 9) that's not very impressive.  I guess you could try rounding up  the 211 sequence to 1000, so like approximating it as 10.011.  This gives it to within a 4.6% error, which is ehh still not impressive.

In Base 5

3.0323221430

LMAO.  Yeah, ok all these 2s and 3s, almost precisely in the middle of the base; can't easily round up or truncate.  But what if...what if we look at 2 pi?  That should cancel out a bunch of 2s and 3s surely.

11.120144

OK, that is not bad, we could truncate after the .12.  That gets us to a 1.14% error on the tail.  OK, not too bad.

In Base 6

3.05033

Oh that looks pretty nice actually.  Truncate at the five and...1.9% error.  Error's a bit higher, but dealing with a 0 is fairly nice for multiplication.

In Base 7

3.0663651

Yeah, everyone act surprised, base 7 is good at handling pi.  0.89% accuracy with one digit!  The one thing I will say is that it's only particularly good at the 3.1 approximation.  The next approximation down worth considering would be like .0664, which is four digits instead of 1, and gives an accuracy you would expect out of four digits 0.01%.

In Base 10

3.14159

I mean, yeah, you truncate it to 3.14.  It's accurate to about 1.14% on the tail.  Basically the same error as base 5, but base 10 digits being bigger end up a bit harder to multiply and contain more info.

In Base 11

3.161507

Yeah, you would take 3.16 obviously.  It's mildly more accurate than base 10, 0.78% error.  But still not great for two digits of this size.

In Base 12

3.184809

Gross.  I mean, if you're happy with taking a four digit approximation, sure, but...otherwise 4 and 8 are very middle digits for base 12.  Well...I guess I should try the thing I did with base 5, right?  Look at the 2pi.

6.349417

Nope.  There's just nothing here.  Pi seems fairly hopeless in base 12.

In Base 13

3.1AC10

Ok obviously you round that up to 3.1B.  Which is...honestly pretty solid (0.29% error; I believe lowest we've gotten with two digits, though digits are getting larger now so that's not a super fair comparison).  If you really wanted to be lazy, 3.2 is about an 8.6% error, but it's one digit of course.

In Base 14

3.1DA75CD

I mean, yeah, act surprised, Base 14 can do the same thing base 7 can.  You approximate it as 3.2, which gives you an accuracy to 0.89%, and if you want more accuracy than that bust out a calculator cause there's no other good cutoff points.

In Base 15

3.21CD1DC

I mean, you would just use 3.2 surely.  One digit, accurate to about 6%.  If you needed more than that you'd use 3.22.  Accurate to about 0.44%.

---

So okay, I wondered if we would hit any other good approximations, but it doesn't seem like it.  Looking at the continuing fraction, the best approximations are 3, 22/7, 333/106, 355/113, 103993/33102, and yeah, 106 has 53 as a factor, none of these bases are good at handling that.  113 is a prime. 

So anyway:

Coming up with a formula where I take the log base 2 of the base, multiply by number of digits, and compare to the log base 2 of the error

#1: base 7 (score: 4.0)

#2: base 14 (score: 3.0)

#3: base 5* (score: 1.8)

#4: base 2** family: (score: 1.2)

#5: base 13: (score: 1.0)

#6: base 6: (score: 0.5)

#7: base 11: (score: 0.1)

#8: base 15: (score: 0)

#9: base 10: (score: -0.2)

#10: base 3 family: (score: -0.3)

#11: base 12***: (score: -1)

*Obviously base 5 does have the problem that it only represents 2pi particularly well, and struggles a lot with representing pi.  You can divide by 2 of course, but dividing by 2 is not completely trivial base 5.

**The best performing one in the base 2 family was two digits of base 8.  One digit of base 8...well no it turns out 3+1/8 is not a particularly special approximation of pi; that got a score of roughly 0.  Which admittedly is still a better score than some bases can drum up.

***The best performing one in base 12 without using more than 2 digits was to just suck it up use one digit and approximate it as 3.2.  Which admittedly is not as bad as approximating pi as 3.1 in base 10 (score of -2).

A few random observations.

Base 7 and 14 are monstrously good.  Base 2 (and it's family, specifically base 8) are the best among the popular bases.  And if you're lazy and just want to approximate it as 3.1 (base 8) that's also honestly not even bad, some bases actually do worse.  Base 12 being the literal worst base is very funny (remember, I'm not doing base 1, and I'm counting base 2, 4, 8, 16 together, and counting bases 3 and 9 together, so #11 is the lowest possible rank).  I don't quite know how to process base 5, has the third best approximation, but only of 2pi, don't ask it to divide by 2.  Base 6 is pretty good, which I guess should be expected since it is good at dividing 7.  1/7 base 6 = 0.0505....  That's probably also why base 13 is good, because 1/14 base 13 = 0.0C0C, and similarly for base 15.  And also explains why base 8 works so well, of course, because 1/7 is also easy base 8.  Are there any other bases good at dividing by 7?  Hmm...none that immediately jump to mind.  Base 3 being as bad as it is is a bit of a surprise--I would expect lower bases because they have more stopping points to be able to pick better cutoff points, but I guess it just doesn't really work out well in base 3.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1021 on: December 29, 2023, 08:12:00 AM »
Alright, lets rate basses on how they handle 1/60.  Seems like the more interesting one than 1/24, since base 6 and base 12 don't automatically pass it, and all the prime bases don't automatically handle it well either.

Base 2 (family)

1/60 = 0.000001000100010001...

I guess probably hexadecimal will show this most clearly

1/60 = 0.04444444...

Obviously what's going on here is that 15 = 16-1, so it divides very cleanly, and then you divide by 4, which is trivial in binary.

But there's also a nice bonus here, in that if you are very lazy you can just do 1/64 as an approximation, and that's just completely free in binary.

Base 3

1/60 = 0.0001100110011...

This is certainly a case where being base 3 over base 9 is helpful, despite the obvious base 9 pattern.

What you're seeing here is that in base 9:

1/20 = 0.040404....

But divide that by 3 and it's a bit less clear what's going on, once again in base 9:

1/60 = 0.013131313...

And obviously this all comes from 9^2 = 81.  81-1 = 80.  So 80 divides relatively nicely in base 9, plus 3 divides for free.

Base 5

0.002020202...

Alright, actually quite good honestly.  Base 5 gets 1/24 fairly cheaply being a prime base, and then also gets 1/5 for free.  Not as good as binary, but pretty good.

Base 6

0.00333333

Alright, yep, divide by 5 is a single repeat in base 6, and it can cleanly accomodate an extra divide by 2 while still being a single repeat.

On the one hand, this is probably easier to remember than the binary version.  On the other hand there are no good approximations or rounding opportunities.

Base 7

0.00550055...

Wait really?  Huh, yeah, I guess 49+1 = 50, and 49-1 = 48.  So base 7 can relatively cleanly divide 2400.  (7^4 = 2401).  That said...2400 isn't too useful.  3600 would be useful, cause you divide by an hour into seconds, but unfortunately base 7 can't handle a second divide by 3 operation cleanly without ending up with a longer repeat.

While still quite nice and understandable, this is still one of the weaker ones so far.

Base 10

0.01666...

I mean, honestly, it's fine.  Worth noting that I just kind of know this one, whereas I don't know 1/24 in base 10.

Base 11

0.020202...

Um...yep, I guess 11^2-1 = 120.  This is pretty nice too.  Actually this is very, very nice, since 2/121 is a monster approximation, so you can probably just think of this as 0.02 most of the time.

Base 12

0.024972497...

Yep, point and laugh, this is base 12 being worse than literally every base below it at dividing by 60.

Base 13

0.02A802A8

I was going to say that at least base 12 can claim to handle this nicer than base 13, but I'm starting to wonder if that's true, actually.  Base 12 has an opening non-repeating digit.  Base 13 has a 0 in the repeat followed by a 2, so you could truncate it at 0.02A8 and you would have a quite solid approximation.

Base 14

0.033A3A3A3A

Meh.  I mean, it's about as bad as a 2 repeat could get TBH.  I mean, what's going on here is...

1/15 = 0.0D0D0D...

Which is pretty nice.  But then you need to divide by 2 twice and things get a bit messy.  And I do notice that composite bases while they're ok at dividing with any of their divisors, they aren't great at it.

I guess, however, you could do a two step process.  Multiply by 0.0D as an approximation.  Then divide by 4, which like...it's a base divisible by 2, dividing by 4 isn't so bad.

Base 15

0.03B3B3B3B...

I...expected more, TBH?  But yeah, I guess dividing by 4 just has a repeat of 2.  The nice thing about base 15 is that dividing by up to 16 only has a repeat of 2.  But yeah, I'm underwhelmed.  The one thing I will say is that if you do have an even number you end up with the fairly clean

1/30 = 0.077777...

---

I'm going a bit more on feel on this one, and how good I feel certain approximations are, but I think I'll go


#1 Base 11

#2 Base 2

#3 Base 3

#4 Base 5

#5 Base 10

#6 Base 7

#7 Base 6

#8 Base 15

#9 Base 14

#10 Base 12

#11 Base 13

Top ones are mostly there because they also pick up very good approximations.  2/121 is monster good.  2/125 is obviously about 5x less accurate.  1/64 is...about 8x worse than 2/121, but also so ultra easy to do, you just shift everything over, no multiplication by a digit required.  4/243 is quite good, a better approximation than 2/125, and multiplying by 11 (base 3) is probably about as annoying as multiplying by 2 (base 5).  I also docked points when extra stuff at the front would knock you out of a nice alignment (e.g. the base 3 one doesn't show up well in base 9.  Base 2 also a little scuffed, like to the point that I initially copied down the wrong number of leading 0s).  I'm not sure quite how to feel about base 7, I feel like multiplying by 55 is going to be obnoxious in base 7.  But BUT it does have a monster approximation.  40/2401.  Like...wow, that's a good approximation.  There's some argument for that over single repeats like .3333; like...what do you even do with single repeats--are you really going to multiply those into a number?  Nah, right?  Single repeats just look pretty, but they aren't actually useful.  Similarly with base 14's approximation.  First you would multiply by 0.0D.  Then you would divide by 4 in a base that has 2 as a divisor.  Or...maybe the other way around.  That's...probably a little more obnoxious than the base 7 calculation?  But still probably something I would do.

That said, I will also give some credit to the fact that if you have a number divisible by 3, then 10 is great, like actually no decimal at all; if you happen to be working with integers should happen 33% of the time.  And if you have a number divisible by 5 then 6 and 12 are great.  And a number divisible by 4 makes 15 great.  I think this convinces me to slide all of these up, sliding 10 up the most because its condition is substantially more common.

The base 13 approximation that exists that uses three digits...look, it's 476/28561.  It's obviously very precise accurate to 5 digits base 13.  But I did not calculate any of the base 13 numbers by hand, and I think that's a pretty good sign that it's roughly at the point that people would just let the calculator do it, at which point the base doesn't matter.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1022 on: December 29, 2023, 08:29:01 AM »
Well, since I did 365, I figured I should try 1461 (4 years, with the extra +1 day for the leap year).

There's no nice repeats, but 11 has a pretty nice approximation

0.000A026

Just truncate after the A.

That's really the only thing I spotted.  Other than 1461 factoring to 3*487.  Presumably 487 is just not well handled by any of the bases--it is a pretty large prime.

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1023 on: December 30, 2023, 08:49:41 AM »
I guess I should do 1/24.  A lot of bases will be quite good at this obviously, but let's see.

Binary family

base 4 probably demonstrates this the clearest

0.00222222...

It's, well it's 1/3, but shifted over by a couple of bits.  As clean as this is I expect a lot of bases to beat it.

Base 3

0.0010101....

As it happens, base 3 can handle 1/8 just fine.  And 1/3 obviously.  Approximating by 0.001 is a 1/27 approximation, which isn't all that accurate, but it is very easy (just shift the number over).

Base 5

0.010101....

Yeah, this handles it better than base 3 TBH.  1/25 is a better approximation than 1/27.

Base 6

0.013

On the one hand it can be done with perfect precision, with roughly the equivalent difficulty of dividing by 4 or multiplying by 25 in base 10.  On the other hand, base 3 and base 5 have approximations that just involve shifting bits.

base 7

0.020202....

So like...first up, the one digit approximation is a bit better than the base 5 one digit approximation in terms of accuracy.  Like...half the error (2/49 to approximate 2/48, whereas base 5's approximation is 2/50).  But...on the other hand, it's not just a shift, you do actually have to multiply by 2.  That makes it a bit worse

base 10

0.0416666...

This for sure is going to be towards the bottom.  Just ugly.  I guess you do have the option of approximating it as "divide by 25", which I mean, isn't bad.  Harder to do than in base 5 though.

base 11

0.050505...

Again, accuracy for the one digit approximation is decent, but multiplying by 5 base 11 is not actually a joke.  Like...I think I'd rather use the two digit approximations for base 3 or base 5 (instead of approximating as 0.01 approximating as 0.0101--that looks nicer than multiplying by 5 base 11).  And those are more accurate than the one digit approximation in base 11.

Base 12

0.06

Absolutely what base 12 was born to do.  Just a divide by 2 and a bit shift.

Base 13

0.070707....

Yeah, it's another one like base 11.  The approximation is good but we're spoiled for choice.

Base 14

0.08249494949...

Wow, this has to be the most obvious last place.  Just trash.

Although...we do know that 2/49 is a pretty good approximation.  This is less nice than base 10, though, cause divide by 25 base 10 is a bit like multiplying by 4, likewise divide by 49 is a bit like multiplying by 4, but we end up needing to multiply by 8 total due to the extra 2 in the 2/49.

Base 15

0.095959595....

Wow, unexpectedly disappointing.  The thing is, base 15 handles dividing by 16 quite cleanly.  But toss in an extra divide by 3 (an operation you would think base 15 would be good at) and it ends up messy and not very approximatable.

Well, maybe this could be a 2 step process?

1/8 = 0.1C1C...

So you could multiply by 0.1C, and then divide by 3 for a solid approximation?  Ehh...uglier than base 14 has it, at least multiply by 8 and shift some bits is just a one digit multiply.

---

#1: Base 12.  Just straight up what it was built to do.

#2: Base 5.

#3: Base 3.

#4: Base 7.  (I think multiplying by 2 base 7 is probably no easier than multiplying by "101" in bases 3/5, and those approximations are better, with base 3 and base 5 also having the option of less accurate but much faster approximations).

#5: Base 6. (100% accuracy obviously, but also a two digit multiply or a divide by 4 where the digits are not both 1.  Nontrivial enough that I think I am willing to give some very nice approximations the nod over it.  After all, if you have a calculator, it kinda doesn't matter anyway, so approximations are nice, and there's no good simplification in base 6 where you do a 1 digit multiplication).

#6: Base 11

#7: Base 13 (below base 11 I think.  Multiply by 7 in a larger base is sufficiently harder, and the accuracy gain is mild, like 0.6% error instead of 0.8% error)

#8: Binary family: At least it's a simple repeat.  And approximating it as 0.0022 base 4 is like...approximating it as 25.6, which is...pretty low accuracy.  But the multiplication is quite easy--in binary it's 0.0000101, so it's a "101" multiplication in binary, so fairly easy.  The "10101" multiplication is also probably fine, though again not like amazingly accurate.

#9: Base 10 (Multiplying by 4 base 10 is probably harder than multiplying by 5 (101) in binary. I think the thing that makes me mark it down is like...I live in base 10, and I didn't even know the opening digits.  0.0416?  Ok.  Whereas binary, all you need to know is 1/3, and you'll also know 1/24).

#10: Base 14 (Worse base 10.  They both try to ride on the coattails of base 5 and base 7 respectively, while being worse at dividing by 5 and 7).

#11: Base 15

metroid composite

  • m_ACac
  • Administrator
  • Denizen
  • *
  • Posts: 4375
    • View Profile
Re: Theorycrafting! (Because I like competitive metagames too much)
« Reply #1024 on: December 31, 2023, 06:18:30 PM »
Number bases

I feel like I should do 1/2, 1/4, 1/8, 1/16.  Why these specifically?  Well, inch rulers tend to show down to a 16th of an inch.  I've seen people talk about a quarter of an hour but never a third of an hour or a sixth of an hour or a fifth of an hour.  I just heard one of my nieces say the phrase "a quarter of a quarter".  Dividing things in half just seems like the default go-to at least in the culture I'm familiar with.

Base 2

Obviously a clean first place.

Base 3

1/2 = 0.1111...

1/4 = 0.0202...

1/8 = 0.0101...

1/16 = 0.00120012...

Eh, doesn't seem great.

Base 5

1/2 = 0.2222...

1/4 = 0.1111...

1/8 = 0.0303...

1/16 = 0.01240124...

less clean than base 3 TBH

Base 6

1/2 = 0.3

1/4 = 0.13

1/8 = 0.043

1/16 = 0.0213

So obviously 100% accurate.  Might find a base easier to approximate though.

Base 7

1/2 = 0.3333...

1/4 = 0.1515...

1/8 = 0.0606...

1/16 = 0.0303...

Approximating 1/8 and 1/16 are pretty nice, but calculating 1/2 looks like something you wouldn't approximate through multiplication.

Base 10

1/2 = 0.5

1/4 = 0.25

1/8 = 0.125

1/16 = 0.0625

I mean, it's fine.

Base 11

1/2 = 0.5555

1/4 = 0.2828...

1/8 = 0.1414...

1/16 = 0.07620762...

Meh.

Base 12

1/2 = 0.6

1/4 = 0.3

1/8 = 0.16

1/16 = 0.09

Obviously this is fairly nice

base 13

1/2 = 0.6666...

1/4 = 0.3333...

1/8 = 0.1818...

1/16 = 0.0A740A74...

Ugly.

Base 14

1/2 = 0.7

1/4 = 0.37

1/8 = 0.1A7

1/16 = 0.0C37

I mean, I was able to do these manually, which I didn't do for 4 long repeat sequences.

Base 15

1/2 = 0.7777...

1/4 = 0.3B3B...

1/8 = 0.1D1D...

1.16 = 0.0E0E...

---

OK, well, I want to penalize the prime ones that have 4 long repeat digits for 1/16, so 5, 11, and 13.  But at the same time I'm inclined to give credit to the ones that handle 1/2 and 1/4 better, than bases like 7 and 15 which have good approximations for 1/16 but don't necessarily handle 1/2 all that well.  So...all the even bases will end up floating to the top.

#1 Base 2 family (with a huge lead)

#2 Base 12 (with a huge lead over everything below it)

#3 Base 6

#4 Base 10

#5 Base 14

#6 Base 3 (technically has a "4 long" repeat for 1/16, but if you rephrase it as base 9 it turns into 0.0505... which is honestly nicer than the base 7 approximation of 1/16).

#7 Base 7

#8 Base 5 (I'll give it credit for just smaller digits in general than base 15, looks like 1/2 and 1/4 should be notably easier, and 1/16 not being much harder).

#9 Base 15

#10 Base 11

#11 Base 13