Difference between revisions of "Talk:2835: Factorial Numbers"
Line 59: | Line 59: | ||
If you have any ''real'' problems with it, it's probably going to be if you're hitting any recursion-depth limits (especially as it uses roughly twice as many recursive calls as the eventual notation-length it produces). I also have a 'stack-based' version (loops round as it shifts in enough 'slots', then works back down again assigning the place-values) which avoids such trouble, but that's coded in a slightly esoteric Perlish way that I'm not sure most of you'd appreciate. ;) [[Special:Contributions/141.101.76.77|141.101.76.77]] 20:25, 30 September 2023 (UTC) | If you have any ''real'' problems with it, it's probably going to be if you're hitting any recursion-depth limits (especially as it uses roughly twice as many recursive calls as the eventual notation-length it produces). I also have a 'stack-based' version (loops round as it shifts in enough 'slots', then works back down again assigning the place-values) which avoids such trouble, but that's coded in a slightly esoteric Perlish way that I'm not sure most of you'd appreciate. ;) [[Special:Contributions/141.101.76.77|141.101.76.77]] 20:25, 30 September 2023 (UTC) | ||
− | Factorial numbers is new to me... It sounds more like a coding system than a number system, LOL! "The door code is 4503 in factorial! Figure it out! (I'd write this on the bottom of the comments as usual, but I don't want to get mixed up with that I'll-thought out and unsigned coding sample Algorithm and table that I KNOW must be mangled when published because the wiki refuses to honour single Newlines. Clearly the author didn't take a peek at what it looks like when published) :) [[User:NiceGuy1|NiceGuy1]] ([[User talk:NiceGuy1|talk]]) 04:59, 1 October 2023 (UTC) | + | Factorial numbers is new to me... It sounds more like a coding system than a number system, LOL! "The door code is 4503 in factorial! Figure it out! (I'd write this on the bottom of the comments as usual, but I don't want to get mixed up with that I'll-thought out and unsigned coding sample Algorithm and table that I KNOW must be mangled when published because the wiki refuses to honour single Newlines. Clearly the author didn't take a peek at what it looks like when published EDIT: Correction, wow, the wiki spotted the code and marked it as such automatically (for now), wow!) :) [[User:NiceGuy1|NiceGuy1]] ([[User talk:NiceGuy1|talk]]) 04:59, 1 October 2023 (UTC) |
== Factoradic Algorithms == | == Factoradic Algorithms == |
Revision as of 05:02, 1 October 2023
Number systems aren't real math, at least not serious math. They're an affectation. 99.9% of math is number-system-independent, so nobody should care about them. 172.70.46.108 22:30, 29 September 2023 (UTC)
- Of course it's "real math." There aren't that many applications, but so what? Math isn't about applications. Besides, there are some. Maybe not specifically for factorial base, but for some place systems. The only thing "dirty" about decimal is the arbitrariness of ten. Considering place systems in general is just considering special kinds of sums. Certainly, "serious" mathematicians are interested in proving numbers normal in specific bases, or in every base. EebstertheGreat (talk) 01:55, 30 September 2023 (UTC)
- A great deal of interesting maths can be found in and around the various arrangements of digits in numbers systems, surely. AzureArmageddon 07:54, 30 September 2023 (UTC)
I thought this was a complete joke, until coming here. The "factorial number system" exists?! 162.158.90.249 22:38, 29 September 2023 (UTC)
- Yup, complete news to me too... What's REALLY weird: the night before this comic I was tutoring a friend's daughter in math, and I happened to teach her what factorials are! (News to me there's a number system, though)... NiceGuy1 (talk) 04:59, 1 October 2023 (UTC)
I wanted to add a link to a converter, but the one I found is https://www.dcode.fr/factorial-base which is quite ugly with lots of adds and a bit counter-intuitive.--Pere prlpz (talk) 23:42, 29 September 2023 (UTC)
This needs simplifying a bit. Came here because I had no idea what was going on, and after a quick scroll through the prose, the main thing I learned was "it's 'cause you're dumb". May be true but I still don't get what Randall's factorial system is....Alcatraz ii (talk) 01:25, 30 September 2023 (UTC)
Factorial base also allows to finitely represent all rational numbers - no constant base is capable of that! 172.68.238.76 01:55, 30 September 2023 (UTC)
- Unless you use a division sign. But yes, only radix numerals of a variable base with infinite series of factors of every prime can even theoretically finitely represent arbitrary rationals without invoking existential quantifiers. 172.71.147.26 06:43, 30 September 2023 (UTC)
I feel like Michael when Oscar is trying to explain what a “surplus” is.162.158.186.241 04:12, 30 September 2023 (UTC)
Contents
The warning is complete nonsense, just remove it
bots cant be escorted out of somewhere just remove the stupid warning 162.158.203.109 04:28, 30 September 2023 (UTC)
- you must be new here - 108.162.216.143 15:51, 30 September 2023 (UTC)
- The nonsense is part of the fun. AzureArmageddon 07:52, 30 September 2023 (UTC)
- im deleting it 162.158.203.80 (talk) 11:16, 30 September 2023 (please sign your comments with ~~~~)
- Premature elision. Still has a purpose (as does signing your contributions here). 172.71.178.208 14:58, 30 September 2023 (UTC)
- im deleting it 162.158.203.80 (talk) 11:16, 30 September 2023 (please sign your comments with ~~~~)
The "adic" part of factor-adic numbers
It's not explicitly mentioned in the comic but the "adic" in the name "Factoradic™" implies that the number system extends the factorial number system by being in some way "adic" as discussed in this YouTube video on the Veritasium channel and so negative numbers would have a truly wacky representation that violates the intent of the title text's pronouncement by requiring an infinitely long representation requiring infinite digits (1, 2, 3, 4, ..., 9, A, B, C, ..., infinite digits). AzureArmageddon 08:00, 30 September 2023 (UTC)
- The "adic" in factoradic doesn't actually relate to p-adic numbers of any kind. Rather, both factoradic and p-adic numbers use the suffix -adic to refer to the concept of adicity, which is "The number of arguments or operands a function or operation takes" according to Wiktionary. Each place value of a p-adic number had p possibilities, and each place value in the factoradic system has a number of possible arguments determined by the factorial of the place. Factoradic would be better called "factorary" since it's more similar to ordinary n-ary number systems, but I guess it just isn't. 172.69.205.130 20:43, 30 September 2023 (UTC)
Title text
The title text references that 10! = 3,628,800 (base 10), and so for numbers greater than or equal to that, you would have to add a tenth digit in order to display them in this system. The question is asking whether you would then proceed to using letters of the alphabet such as one does in hexadecimal to which the reply is that numbers above this amount are simply illegal. The trouble comes when you try to write down the number 10 * 10! = 36,288,000 (base 10) in this system. For 10!, the notation is 1000000000 , so 9 * 10! would be 9000000000, and then to get 10 * 10!, you would have to write A000000000 because 10 * 10! < 11!. In fact, since this is the first "illegal" number, you could "legally" allow up to 10 * 10! - 1 = 36,287,999 (base 10) in the system (which would be written as 9987654321 = 9 * 10! + 9 * 9! + 8 * 8! + ... + 2 * 1! + 1 * 1!) without the need to introduce any letters. I also want to point out that the reference in the comic to 9 being reserved for big numbers is due to no number needing a 9 to write it down in this system until 9 * 9! = 3265920 which is written 900000000. Since numbers above 10! are not allowed, this means that only the 9! digit is legally allowed to hold a 9, and it only applies to numbers in that high range of 3265920 to 3628799.172.71.166.230 15:01, 30 September 2023 (UTC)
- I feel the current in-Explanation explanation about that already covers this, with the addition of the validity that the digit that could need to be >9 could still be any digit 0..9 without needing to invoke the 11th digit. (Maybe a few tweaks, but not sure what you're trying to add here.) 172.70.86.148 15:13, 30 September 2023 (UTC)
Radix Economy
Someone got in there just before I did, about (from a quick scan of what's been added) "economical" use of Factorial-based variable radices. (I was planning both the test code and the explanation for this, whilst travelling.) My short way of putting it is that (apart from values of zero or one, which represent identically in Factorial-based notation to any other notation in base of 2+) the Factorialised method initially is using up 'places' quicker until the point at which it has reached a 'magnitude' equal to its base-normal 'original' (i.e. only when there are N glyphs made available under Factoradic notation does it not rush through the 'magnitude' quicker than the base-N number). And then, it needs to work up into the more 'efficient' higher-order digits in order to pull back the disadvantages of its lower-order ones and equal, then be shorter than, any given value's respective base-N form.
Now, I've done some very rough calculations (started hitting numbers for which I really need to convert everything into high-precision large-number data types, which needs me to rewrite one or two elements of my existing code) and looked at the successive changes of magnitude, in each base, and checked the calculated Factoradic length (with the assumption that there are enough extended glyphs to represent every digit singly, unlike the comic Title Text speculation).
By my reckoning, Base-2 is more efficient at 20fact (compare with 1002, =410); Base-3 breaks better at
3111fact (100003, =81); Base-4: 540220fact (10000004, =4096); Base-5: 533340021fact (10000000005, =1953125); Base-6: 90967344000fact(1000000000006, =362797056); Base-7: 7ABAA086002001fact(1000000000000007, =678223072849); Base-8: D73A256860540220fact(100000000000000008, =281474976710656); Base-9: B1HEA65678836651220fact(100000000000000008119, =1350851717672992000) ...but at this point, the conversion of decimal to its base-9 form (and that powers of 9 should never have trailing zeros!) shows I may very well have hit a limit to normal large-number precision, so I really can't trust the subsequently derived base-10 values.
But, in case anyone wants it, the following is my (Perl, but should be easily convertible into most medium-to-high level code dialevts) en-Factoriadialising function.
sub factadic { my ($n,$place)=(@_,1); return () unless $place; if ($n>=fact($place+1)) { return factadic($n,++$place) } my $digit=0; my $base=fact($place); while ($n>=$base) { $digit++; $n-=$base; } my @return=($digit,factadic($n,$place-1)); return @return; }
You call it as factadic(<value>)
. Or factadic(<value>,<minimum_digits>)
to start with the assumption of at least a minimum number of digits, but it'll start by shifting the default minimum of 1 into the <script>$place</script> variable if you don't give it that (there are other ways that you can/must do that, of course), and it will still always expand that to the degree necessary in the first phase of 'diving in' as far as it needs to in order to agree with the fact()
function (factorial calculator, a trivial coding issue that I only use here like this because I alreadu set it up for another bit of code).
It returns an array (@-variable, in Perl) of digits, in standard most-to-least-significance order, that you can convert to a glyphwise notation in any way that you wish (or do a string conversion within the function, at each stage of building it up). ...and I'm presenting a slightly less optimised version of it here (some of the Perl-tricks I originally used don't translate well into some non-Perl) and, yes, the while ($n>=$base)
loop could be done using modulus and integer-division, but it's a fairly trivial part of the looping process.
If you have any real problems with it, it's probably going to be if you're hitting any recursion-depth limits (especially as it uses roughly twice as many recursive calls as the eventual notation-length it produces). I also have a 'stack-based' version (loops round as it shifts in enough 'slots', then works back down again assigning the place-values) which avoids such trouble, but that's coded in a slightly esoteric Perlish way that I'm not sure most of you'd appreciate. ;) 141.101.76.77 20:25, 30 September 2023 (UTC)
Factorial numbers is new to me... It sounds more like a coding system than a number system, LOL! "The door code is 4503 in factorial! Figure it out! (I'd write this on the bottom of the comments as usual, but I don't want to get mixed up with that I'll-thought out and unsigned coding sample Algorithm and table that I KNOW must be mangled when published because the wiki refuses to honour single Newlines. Clearly the author didn't take a peek at what it looks like when published EDIT: Correction, wow, the wiki spotted the code and marked it as such automatically (for now), wow!) :) NiceGuy1 (talk) 04:59, 1 October 2023 (UTC)
Factoradic Algorithms
there are several ways to compute the factoradic of a base 10 number, depending on the choice of language the length of the program will be demonstrably bigger. Dynamically typed languages, like perl can likely perform this in one or two lines, where as a language like c++ will be longer.
The simplest algorithm is to generate the digits from right to left one at time by dividing the number by the radix until the quotient reaches zero:
#include <iostream> #include <algorithm> using namespace std; int factoradic(int num) { string digits; int radix = 1, quote = 0, remainder = 0; do { quote = num / radix; remainder = num % radix; num = quote; radix++; digits.push_back(to_string(remainder)[0]); } while (quote != 0); reverse(digits.begin(), digits.end()); digits.pop_back(); return atoi(digits.c_str()); }
Using Randall's values we can test that it's working:
max@laptop:~/$ ./factoradic 21 - 311 22 - 320 23 - 321 24 - 1000 25 - 1001 5038 - 654320 5039 - 654321 5040 - 1000000 5041 - 1000001 999998 - 266251210 999999 - 266251211 1000000 - 266251220 1000001 - 266251221