#Binary as a Human Base
1 messages · Page 2 of 1
(the test is running correctly, if I change the answer to be wrong it realizes it)
@fallow sundial
pub fn generate_binary_name(i: usize) -> String {
fn gen(x: usize) -> String {
if x == 0 { return String::new(); }
else if x == 1 { return "one".into(); }
let terms = [
"two", "four", "hex", "byte", "short", "int", "long", "overlong", "byteplex"
];
let n = find_n(x);
let middle_term = terms[n];
let left = x >> 2usize.pow(n as u32);
let right = x % 2usize.pow(2_u32.pow(n as u32));
let mut first_term = gen(left);
let last_term = gen(right);
surpress_redunant_one(&mut first_term);
format!("{first_term} {middle_term} {last_term}")
}
if i == 0 { return "zero".to_string(); }
else if i == 1 { return "one".to_string(); }
let mut r = gen(i);
r = r.replace("two one", "three");
r = r.replace(" ", " ");
r = r.trim().to_string();
r
}
fn surpress_redunant_one(s: &mut String) {
if s.len() < 3 { return; }
if &s[0..3] == "one" {
*s = s[3..].to_string()
}
}
fn find_n(x: usize) -> usize {
use std::f64::consts::LN_2;
(((x as f64).ln() / LN_2).ln()/LN_2).floor() as usize
}
Woo
VecDeque time
wait no
it's so much worse
aaaaaaaaa
I'm going to have to use a arrayvec aren't I
nvm
I found a way
fn gen(x: u64, vec: &mut Vec<Term>, front: bool) {
use Term as T;
if x == 0 {
vec.push(T::Zero);
return;
} else if x == 1 {
if !front {
vec.push(T::One);
}
return;
}
let n = find_n(x);
let middle_term = [T::Two, T::Four, T::Hex, T::Byte, T::Short, T::Int, T::Long][n as usize];
gen(x >> 2_u64.pow(n as u32), vec, true);
vec.push(middle_term);
gen(x % 2_u64.pow(2_u32.pow(n as u32)), vec, false)
}
just realized I don't need Zero
I can just return zero if it's a empty vec
not even that
god
if it's 0
you get it
we can probably get rid of the floating point operations here too
well in find_n
you'd just need a match statement with the superpowers and some comparison checks
is it faster to do floating point operations or 8 ordering comparison 🤔
one l
two lı
three ll
four lıı
four one lıl
four two llı
four three lll
two four lııı
two four one lııl
two four two lılı
two four three lıll
three four llıı
three four one llıl
three four two lllı
three four three llll
hex lıııı
oh
looks right to me now!
and then you can multiply by hex to get the next four digits :D
and then byte (and hex) to get the following 8
it's great
ı
oh coool
sorry just figured out how to write that character with compose key on my keyboard
cool!
i just have this ahk script i use to speak a language i'm learning
the problem is that if i'm writing lists like the one i just wrote i have to go back and forth because w -> ꝡ
ah, yeah been there, but I'm on linux now
:0
How?
What?
to find the biggest 2^2^n you can just compare them in order with <=
No I mean, I have a physical compose key
I'm asking how you added it
my settings has an option to set a key for it
That's what I tried in the beginning! But it was way simpler to plug the formula into a calculator and let it spit out an inverse for it
Here's how I'm using mine
I can benchmark it :3
if you wanna
...is that vi?
I do wanna
It's bat
It's my XCompose file
it'd just be like a bunch of superpower.. in a match statement
idk where to customize mine
also your shell is pretty love the blue
wait hm?
well you can't do >= in a match statement
ok wait
or actually ..superpower
I don't understand how rust tests work
I have a function marked with #[test]
I have no clue how to run it
and also cargo t
what
i just tried that
it only ran the ones in tests/
dkjhfakshf
this one works
time for one with match
and then it's criterion time
make sure to only include the ones that fit in a u64
hm?
well some of them aren't going to fit for the array implementation
array implementation?
i don't understand what you mean
...right
hmm
should I be using u128? Does it even fit in a u128?
just using a u64 lol
aight
i don't think it matters too much
though it benefits the match case the most
Exactly
Also helps with .pow() because it takes u32, so less conversions
well no it benefits the while loop the most
oh btw @floral plover your glyph to words test can't display over 21 bits... apparently
if match is better then floating point then a u64 could be tried to see if it changes anything
the glyph displayer?
damn it
yee
i was hoping i wouldn't have to look at it again
it might just be that the canvas is too thin
yeah probably
you can't use methods or indexing in a match statement
that is very annoying
fn main() {
let y = 81;
const x: i32 = 3_i32.pow(4_u32);
match y {
x => println!("woah!"),
_ => println!("boo")
}
}
woah!
wait what
that is cool as heck I've been looking for that
only works for const funcs and const lookups but wowzers
aw man
make SUPERPOWERS[0] a constant right above the match
right, of course
it's short
I guess int
so up to n = 4
The loop is absolutely awful
can I see the loop?
I sent all three at the same time, I love how loop got sent last
oh my
they're neck and neck for large n
and for small ones too
l m a o
ö
i need better inputs
i'll do 1e7 1.5e7 2e7 2.5e7 ...
Delta of about 10ps max
I think it's reasonable to say that they perform the exact same
Actually, hold on
Is the switch one even programmed correctly?
( @fallow sundial )
Black box?
Does this need a black box?
Doesn't hurt to try
But I think my switch function is wrong
Could you double check, pretty please?
They look fine
Check godbolt?
Maybe they just compile they similarly
I was doubting that could happen
Couldn't you test this by just running a range other over the switch and the floaties
@fallow sundial ...huh
I did it for 1e7, 2e7, ... and it came out right
but the exponents get large and manual testing didn't feel perfect
Blackboxing seems to have made quite the difference
The compiler is a tricky fiddle
here's the violin ones
I have added many more points (43 per line), I love how absolutely consistent it is
what is this chart?
Two algorithms for finding which superpower of two is needed to name a binary number: using the floats function (direct math) and the match statement (essentially about 10 comparisons)
(these ones, the loop turned out to be really awful for some reason (i've probably coded it wrong or smth))
x axis is input value, y axis is nanos
Iirc match is pretty much maximally efficent
Like the compiler is supoused to really rack it's optimizations to do as little work as possible, so if this can be done with nonconditional logic to pick the branch it will do so
Now I'm wondering if it's close to the speeds that indexing has
How much faster would it be to get an array that's 100000000 elements long and just to index into it?
I'm still in awe at how comparatively abysmal float operations are compared to a single match
I'm not at computer rn
And I did try to gold bolt but only one of the functions compiled into assembly
The other didn't make any assembly at all
I gave up very quickly after exhausting my exhaustive list of troubleshooting steps (which is a single step: make them pub)
The other didn't make any assembly at all
what
also that if check is really not helping
It's in both functions exactly the same ¯\_(ツ)_/¯
How should I handle 0 and 1?
i mean for the match statement you can just return them
wait no you can't
well
for godbolt and benchmarking better to just pretend they can't happen
cuz they won't in normal code
I could always fuck up the code around it
I like it when the compiler/runtime crashes hard and goes "STOP. YOU IMBECILE AND MORON, YOU DID AN OOPS"
I'll try without the if
In a sec
do provide a copy when you are on the pc because copying this into godbolt is painful
Floats aren't known for therr speed, never even const lol
Omg good idea
So I need to
- try with f32
- send code
- remove ifs
(Writing down because i will forget)
yes
const INPUTS: [u32; 43] = [
1000,
5000,
30000,
2501000,
5001000,
7501000,
10001000,
12501000,
15001000,
17501000,
20001000,
22501000,
25001000,
27501000,
30001000,
32501000,
35001000,
37501000,
40001000,
42501000,
45001000,
47501000,
50001000,
52501000,
55001000,
57501000,
60001000,
62501000,
65001000,
67501000,
70001000,
72501000,
75001000,
77501000,
80001000,
82501000,
85001000,
87501000,
90001000,
92501000,
95001000,
97501000,
100001000,
];
fn find_n_f64(x: u32) -> u32 {
use std::f64::consts::LN_2;
(((x as f64).ln() / LN_2).ln()/LN_2).floor() as u32
}
fn find_n_f32(x: u32) -> u32 {
use std::f32::consts::LN_2;
(((x as f32).ln() / LN_2).ln()/LN_2).floor() as u32
}
fn find_n_switch(x: u32) -> u32 {
const SUPERPOWERS: [usize; 6] = [
2_usize.pow(2_u32.pow(0)) - 1,
2_usize.pow(2_u32.pow(1)) - 1,
2_usize.pow(2_u32.pow(2)) - 1,
2_usize.pow(2_u32.pow(3)) - 1,
2_usize.pow(2_u32.pow(4)) - 1,
2_usize.pow(2_u32.pow(5)) - 1,
];
const SUPER_1: usize = SUPERPOWERS[1];
const SUPER_2: usize = SUPERPOWERS[2];
const SUPER_3: usize = SUPERPOWERS[3];
const SUPER_4: usize = SUPERPOWERS[4];
const SUPER_5: usize = SUPERPOWERS[5];
match x as usize {
..=SUPER_1 => 0,
..=SUPER_2 => 1,
..=SUPER_3 => 2,
..=SUPER_4 => 3,
..=SUPER_5 => 4,
_ => 5,
}
}
I think that's all the code
look at how short the switch is compared to the f32 one
it is so much more shrimple at the assembly level
I like how you can see the superpowers embedded directly in it
It feels cute :3
why are you turning it into a usize?
Why is LBB1_4 just a single ret?
idk man
...very good question
remnants of old code
shouldn't alter the assembly, though, no?
it shoudn't
oh, right
i do it because the superpowers are usizes too, and they're usizes because I can't math and got worried I was missing the higher numbers
the 5 isn't even in the assembly you sent
i think it's already done it for me
So it wasn't me being dumb
phew
anyway graph!
it optimizes it so hard it doesn't exist
yes
how even
since it's a basic match statement it can do magic ig
This took like 20 minutes of benchmarking
so it just doesn't compile anything because it knows it can do a better job later
very nice improvement
also u64 output is a bit more complex then just the u32 one
u32
wild
there is fucking shr and xors in there for god knows reasons
it's incredible how unable i am to read assembly
I can't do it either I just guess
I should remove the number of datapoints
This is getting to, like, 40 minutes of benching (made up number but it feels long)
The data looks so pretty though 😭
I wish I both had a GPU and could run this on a GPU
Yee
Like here
so, like this?
perfect perfect
@fallow sundial
mhuaha
any other ideas before i leave this running and go to bed? /gen
apart from doing the floats with u64/u128, no
oh?
you need more superpowers don't you
i didn't change the test inputs
either way
doesn't make sense to go beyond it if some of the tests just die
My tests are
const INPUTS: [u32; 43] = [
1000,
5000,
30000,
2501000,
5001000,
7501000,
10001000,
12501000,
15001000,
17501000,
20001000,
22501000,
25001000,
27501000,
30001000,
32501000,
35001000,
37501000,
40001000,
42501000,
45001000,
47501000,
50001000,
52501000,
55001000,
57501000,
60001000,
62501000,
65001000,
67501000,
70001000,
72501000,
75001000,
77501000,
80001000,
82501000,
85001000,
87501000,
90001000,
92501000,
95001000,
97501000,
100001000,
];
but like it should be getting penalized for allowing a higher set of numbers
you'd have to cast them
i should just need to add an extra arm to the match, no?
yes
sigh
I've been awake for 24h
Should I make a const for each function or share and cast?
probably better not share
i weep
you can always use u64::MAX!
hm?
superpowers are the same as the unsigned integers MAX size
340_282_366_920_938_463_463_374_607_431_768_211_455u128
looks fine
ig the biggest issue is that you are returning a the type number and not the index usize
i'm always casting back to usize regardless
welp, time to run it
7 benchmarks
43 datapoints each
3 seconds of warm up + 5 seconds of testing each
= 40 minutes of straight benching
*barrel rolls into bed*
This is unlocking things in my brain in such a clunky manner
I love it
@fallow sundial
I have done pretty much nothing but read about pure math since this. Like, I'm just peeling back my brains layers of assumptions about how math work. All because someone told me to count in base 2 lol.
oh pure math is fun
u128 is very punishing
and yet more powerful
freaking universe with its tradeoffs >:(
in any system optimizing for X~
I really was digging base 2 until the counting part, brain hort
I can barely keep track counting by 1s in base 10 😭
it actually makes way too much sense once it clicks
example for this number:
llllll
if the number is one, two or three, then its name is one, two or three
if not
grab the first digit
lllll l
can you grab double that amount? if so, do it
llll ll
repeat until you can't
ll llll
in that split, put the name of that power of 2. this is 2^4 which is a hex
ll hex llll
name both sides with the same method
two hex llll
two hex ll four ll
two hex two four two
in that split, put the name of that power of 2. this is 2^4 which is a hex
this step is confusing
The video explains it graphically but really fast
I recommend watching the 10 second clip a couple times
since you'd want it to be one power after
"what is the smallest power of 2 that can fit the number"
i guess it's not "repeat until you can't"
it's repeat until you have the whole number
because you can't double the grab for ll llll
it's because you grabbed 4 digits
[Reply to:](#1200152161858896012 message) > in that split, put the name of that power of 2. this is 2^4 which is a hex
2^4 is called a hex
so it's not how many times you grabbed it's what you grabbed
and repeat until you can't is repeat you reached a 0?
repeat until you can't double grab, or until double grabbing means you grab the entire number
so here
lılı
you stop at lı lı because double grabbing means you grab the entire number
and here lııllı you stop at lı ıllı because there aren't enough digits to double grab
pain
ngl i quickly got good at visually doing it
Isn't that the same thing but with padding
Padding?
It's binary but with redundant zeros
Hmm, well
Kinda technically redundant yeah? But like, the units make it easier to track
It's featural symbols for 0-15
Why not just use the ones for 0 and 1
It's the exact same but without redundancy
little gaps, same reason it's easier to read 139,482,093,809 than 139482093809
The underbars do that job, no?
And you can group in as much as your brain can handle, not limited to four
In a vacuum yes
Mentally, you can chunk better
You can chunk in any amount of grouping
Even irregular amounts
You need not restrict yourself to hex
Sure - the same applies to large decimal numbers though, there's no strict reason to group it in chunks of 3
You could also go 1234,5678,9012
Cursed
grouping them by 4 is a nice middle ground for my eyes
Sorry, I meant the binary symbols
The Japanese numerals are the number names used in Japanese. In writing, they are the same as the Chinese numerals, and large numbers follow the Chinese style of grouping by 10,000. Two pronunciations are used: the Sino-Japanese (on'yomi) readings of the Chinese characters and the Japanese yamato kotoba (native words, kun'yomi readings).
Ah
We would if our naming system wasn't base three
The naming system we're settling on for binary is also binary, so grouping isn't restricted like in decimal
I mean, you could make your binary naming system like anything
Power of two would be the most natural
zero
one
onezero
oneone
onezerozero
Yeah, because 2024 is two zero two four, right?
(in some languages it is but that's besides the point)
It's two thousand, twenty four
And 1010 is "two four two" in our system
thousand and twenty being larger base placeholders
We have unique words for
1 - 20
100
1000
1000000
1000000000
And we group them accordingly for smaller stuff
And we have unique words for
0
1
10
100
10000
100000000
...
In binary?
Yes
The ones proposed in The Video were good
Zero, one, two, four, eight, hex, byte, short, int, long, overlong, byteplex
We name
2^2^0
2^2^1
2^2^2
...
It's most efficient
Each new word unlocks a shitton of numbers
The decimal system is kind of shit for naming ngl
It's a sort of base 11, which is cringe
Because 11 isn't 1010
So like
0 = zero
1 = one
10 = duo
11 = duo-one
100 = quad
101 = quad-one
110 = quad-duo
111 = quad-duo-one
1000 = oct
Etc?
no yes my bad i said that for another reason and realized i was wrong
Oh lmao
It do happen
Yes, basically
We also do some simple search and replace to compact numbers a bit by reducing very common patterns
Like "two one" is changed to "three"
So 1100 is "three four"
And 11_0000 is three hex
(I think I prefer the English words tbh, but that's just preference)
Sure that's fine
How?
There's no proper name dor "two four"
Wdym how
10 four 00
two four zero
two four
1000 = (single number) 000
(Well, we could introduce 'eight', but I personally haven't)
Yes
That gets a bit weird though, because
So take that for example
Nine is two (x) four (+) one
The operations vary according to the positions
What is this, French???
Like in decimal lmao
Two thousand twenty four
Two (*) thousand (+) two (*) ten (+) four
Digits having different values is the entire foundation of using a positional number system
yeah literally
what is this french no its the numeric system that has dominated math for centuries by now
Exactly lmao
except optimized to its maximum potential
I'm confident saying it's the best one
(if there's another one, two four hex perstack ping me, I would genuinely love to learn)
Using perstack instead of percent is rattling my brain
Why is relearning elementary and deeply ingrained concepts so difficult 😔
For this to be equivalent you'd need to introduce "two four" or whatever as an actual placeholder
one eight, two eight, three eight, four eight
Oh wait hang on, you alraedy did that with four itself smh
so we have
one
two
three
four
four one
four two
four three
two four
two four one
two four two
two four three
three four?
Yep
All seems right
Ehh, just for ease of parsing, I'd like at least up to 8 to have unique numbers
Having more unique numbers slows parsing down, no?
zero
one
two
three
four
five
six
seven
eight
eight one
eight two
...
eight seven
two eight
two eight one
...
two eight seven
three eight
...
seven eight seven
eightwo
Marginally, I guess
It's not as blindingly obvious what the name is from the digits
On the one hand yes, but from the number scheme you'd have the association of
six = II_
Or more specifically, six = ++++++
What
Sorry hang on, what the name is from the digits?
So how would you name 110_0000?
What's the missing number?
It's a separator
Rust syntax, number is 1100000
Hmm
I guess if you stop at eight, that's always six hex
I think I can see it
But getting to grips with only naming three and the superpowers is better for learning, so I'm sticking with it
Isn't it 6 hex if you stop at 16?
Which I'm all for huh
Hex is always named
I like the idea of throwing hands to count
Like binary finger counting? Yeah definitely, it's very neat
If only I didn't have ring fingers
FF: if you can only use up to the middle finger, you can sacrifice your thumb to gain access to the other two
So you can use 100 digits per hand
It's very useful
Explain?
So uhh
The objective is to not have to go all the way up and down with the fingers
So you can make a bar with your thumb
Finger resting on your thumb := 0
Finger kind of elevated := 1
You only need a cm of two of movement, because the binaryness only depends on contact with the thumb
i think this would be four two hex
[Reply to:](#1200152161858896012 message) So how would you name 110_0000?
What do you call the like, flat skin on the inside of your knuckles?
Like, the fingerprint of the proximal and middle knuckles
I realized the problem with this system too late
You don't have enough pointer fingers between your thumb and other hand 😢
Better install neural LEDs on every finger patch and make them glow independently
Of course, but I meant with their system of naming up to eight
I thought there might be more than one way to name a number, but I'm not sure now
What
Depends on if you actually still introduce hex, I guess
If you keep hex and eight, wouldn't that just be six hex?
The standard idea is that you have a digit for each palmar
But I was like "have a power of 2 for each palmar"
Yeah that's what I said
Which is why I'm not sure
And once I was posting, I only then had the thought of "waaait, how will you point at them?"
@amber spruce
Behold
I forgot to send the practicer i made, but it's basically finished :3
mood
square algorithm being a breeze? I am sold
universal divisibility test? no words
and this universal disibility algorithm doubles down as the digital representation of recurring fractions?
damn again
I am still shocked how this method of the magic sequence to derive the representation of a fraction works at any number
Can you explain the step that you do after the magic sequence, I keep getting lost at that point
so, you check the in between, if it is an increase (then put 0) or a decrease (then put 1)
if the sequence ends at 1, it is recurring, if it ends at 0, it is terminating
That's easy af wow
Part of it feela really intuitive for that fact
Given it's modulos of powers of two and our bits are powers of two
trying to figure out how the square root algorithm goes on when the number is not a perfect square
I actually knew an algorithm to derive square roots by hand before this video, that didnt involve converting to binary in some way or another
babylonian method iirc, you consider a square with area equal the number, then divide it in tens and units, and solve some kinda straightforward area algebra to get the sides, which is the result
obviously nothing that can beat the simplicity of doing it in binary but, in there I knew how to keep going when the number wasnt a perfect square
Remember that after a number there is an infinite sequence of implied zeros
So when you keep going just bring two zeros down
after the radix point
yeah that makes sense
its fun to play with it with pixels
you surely cant be more compact than that lol
meanwhile I made mine huge because I didn't want to do anti aliasing
discord seems to be compressing it >:#
does anyone know how to make borrowing more intuitive at a digit level in subtraction?
I more than once found myself in the situation of "hmm, 8 - 5... thats just 3", but totally lost in how to actually perform the borrow between multiple digits
hehe
I feel in that meme of 18 - 9, borrow the 1 from 8, now you get 18 - 9
I don't really bother carrying in subtraction
If i have
.
10000
- 10
=01110
```I just write ones rightward until a one on either number I guess?
... that makes sense
yeah half of the cool usability of binary comes from the fact that 1 is both the first after zero and the last digit as well xD
hydrogen moment
1/(b-1) is r1, 1/(b+1) is r0Z, and in binary Z is also 1, for example
I chuckled with a comment saying "thats probably the video with most Little Fermat Theorem applications that has nothing to do with Fermat or Fermat Theorems"
so, without having a font to write with, how yall are handling writing binary without 0 and 1?
I think some of them are using dotless i
But I'm mostly sticking to 101010 because keyboard
I saw vertical pipe with dots as well
|.|.
unfortunatelly its not underlineable looks like
|.|.
not sure why
But then no radix point ;_;
What abt repeating?
also a comma is more consistent with it being a line going down the baseline
Fair
good question
using a standard keyboard I guess I would just throw an r like they did on the video
|.|r.|
not terrible I guess
strange, but not sure how else to go about it
trying out converting to and from quaternary spoken form
... hold up
this is on itself a convenient way to write up the binary numbers without access to a cool font
2H41 or 2x41
2x343
my mind is kinda annoyed about how you can reduce "two one" to "three" but you simply cant reduce "two four" to "eight" without creating big hiccups in usability
Two four is very different from two one
took me a while to understand what is the actual logic, even though I am used to mess around with bases
Shit
two one four two one sounds so annoying lel
I guess it would be understandable to just skip the magnitude when there is no gaps in daily usage
i.e. saying "three three" instead of "three four three"
both inform you how to write the same way
probably more intuitive to do that when it isnt an amount
This is intiruiging
now I am imagining spelling large chains lol
"hex hex... oh four... three oh two"
(10000 10000 000 11 0 10)
Those aren't hex
actually it looks ambiguous if oh two is 0 10 or 00
Hex is 10000
true
Three three goes there ig
actually no... there is never a multiplier on the left of two, right?
Except one.. yeah
I think this is just saying bit strings but slightly more compact tho
yeah
just thinking on that because phone numbers tbh
nobody speaks them as amounts
id numbers in general
also there is the issue of how to speak fractionary numbers
the video didnt even touch that lol
but in general its either speak the fraction itself or spell the number after the radix point
on the foot notes they mention how "perstack" sounds a feasible version of percentage on binary
not sure how intuitive it would actually be, a stack being four hex
the footnote:
[6.k] jokes aside, perstack works well as the equivalent of percentages in binary, because
many common simple fractions can be expanded to a denominator of 63, 64, or 65. [...]
a third can be expanded to 21/63 but I am not sure how to use this to reach the approximated value using "perstack"
would it just be 21 in binary recurring?
Not sure but i found this pretty pattern in n×1/n
It's always really clearly 0r1
Which is basically one
Err, at least for 5 and 9
I mean, matematically, nx1/n should always be 1
Yeah
so this pattern should hold
But i found the infinte sequences have a very nice pattern
The bits multiply out and sum really cleanly ig
They bitwise or into place, i wonder if this holds
to 3 is pretty neat as well
15 works beautifully
You could prolly reverse engineer a fraction representation like this pretty easily
random observations
Four, Hexa, Byte, Short, Int, Long, Over(long), Peta(byte)
all have an unique initial letter
so you could use just 0, 1, 2, 3 and the initial letter to write binary the same way you would say them in a compact manner
Four is better as a distinct symbol than as a digit, so perhaps could even replace it by Nibble for less confusion
wait, Hexa would be the equivalent of Nibble, nvm
Got curious if there was a method to calculate logarithm that becomes easy peasy on binary
Yep there is
For a number n in base b
Divide n by the nearest power of b that is less or equal than n, the exponent is the integer part of the result
Take the result and raise it by the base (m^b)
Repeat
Do you have an example, pretty please?
Gonna just copy the post
This is a method I found a year ago. This method takes a lot of time but it will give an accurate answer.
To calculate log(25):
- Divide 25 by the nearest power of 10. The condition must be 25 ≥ 10^n.
- The value of n is 1 because 25 ≥ 10^1. So the initial answer is 1.xxxxxx.
- Divide 25 by 10^1. The result is 2.5.
- Raise 2.5 by 10. So 2.5^10 ≈ 9536.7
(Note: The number is raised to 10 because we are already looking for the digits after the decimal point.) - For the next values, the same process will be used.
- Divide 9536.7 by the nearest power of 10.
- 9536.7 ≥ 10^3 so n=3. The answer is now 1.3xxxxx.
- 9536.7 / 10^3 = 9.5367
- Raise 9.5367 to 10. 9.536710 = 6222733625
- 6222733625 ≥ 10^n so n=9. The answer is now 1.39xxxx.
- Repeat the same process until you get the desired precision.
- So log (25) ≈ 1.39794.
Lmao of course it wasnt a single line
And discord fucked the powers...
Fixed the exponents
And apparently it is guaranteed to produce a single digit after the first step when the base of the log and the base you are writing on coincide
Cant answer why
👀
That looks way easier in binary
gonna try to run a test on |..| (9)
- divide |..| by the nearest power of |. such that |..| >= |.^n;
- this would be n = ||, and thus the initial answer is ||.xxx
- divide |..| by |.^||; the result is ...
I dont know if I am doing that right lol, but it looks like it is .r||...
long division still sucks in binary
anyway
forth step, raise by the base so... just a product by itself
why am I doing long division when I could use fractions
I can't read binary without the sticks notation 😔
I can help that; does |..| work for you?
I am working on the fractions here, because I have way more trust on them than on long division
Oooh binary fractions! I didn't consider they could exist for binary!
yeah and you know what? I didnt consider that it is impossible to get a recurring fraction dividing by powers of the base...
Oop, true!
all done, now we can go on lol
actually I have the sharp feeling I messed something when converting fraction to radix
now for the next digit of the log we repeat
which would give us 0, since the whole part is 1
Ngl I lost the process a bit
first step: find the largest power that is smaller than the number you are on
smaller or equal
or, in another words, you can just match the number of digits
the power then is your integer part
then, divide the original number by such power, and raise the result by the power (we are just squaring because yay, binary)
that math is this step
now, having the result of this squaring in hands, we repeat to get the next digit
but right now, the number being |,.|...|, the largest power is simply |
lmao a comma is way too small for that to be a good ascii notation
the exponent being 0, we now know the answer is approx. ||,. so far
dividing by 1 keep the number the same...
huh
discovered another point this algo becomes simpler in binary
we can just keep raising until it becomes larger than 1
that will be the sequence of zeroes
and when it reaches 2, it is a 1 in the approximation
yeah lb(|..|) is approx ||,.. and I will not keep going this calculation
I mean
Goddamn
The numbers lines mason
What do theh mean
is this a meme happening in real time or I just didnt understand the question?
Well you see, there comes a time in every orange's life where they must ask themselves
should I be doing remedial math in my late twenties???
(1001/1000)^10 = (1010001/1000000) = 1.010001
1001 * 1001 = 1001 + 100100 = 1010001
(They didn't square it, they multiplied it by itself but im typing on phone)
Tall is one, short is zero
Wait hang on, I think I get it
I mean not having them split into fours kinda defeats the purpose
Idk, good for keeping it straight
Like a notebook
on pixel art?
Oooooh now i get why they were lost lol
No wait, I don't get it
So I get that it's like long division and stuff right? But how do the steps work here
Run me through this segment
I think they explain it here?
I don't know how the weird part in the last img works yet either lol
Oh
That's two things
Oh wait hang on
Is the multiplicatoin thing a completely unrelated second thing?
Is that what's going on here?
Partly unrelated
9x9, so
They use it to find the numerator of the equal fraction
They say (9/8)^2 is equal to (81/64), but i think that's just incorrect?
Yes, but that's not (9/8)^2
Is it?
Brain meltyyy
Unless I'm veeeery brainfoggy, isn't the multiplication commutative?
It is
I am incredibly dense rn lol
(9/8)^2 != 9/8 therefore i thought it was wrong
That's not solid logic though :/
(It's almost like division being complicated makes me bad at math or something (silly))
(9/8)^2 != 9/8
(a/b)^2 = a/b
=> (9/8)^2 must equal 9/8
=> contradiction
(was the chain of reasoning)
Its easier to parse than a sequence of sticks
Without the line my mind kinda mangles them idk why, so for me at least, a single line is still better than no line
Also, I didnt have any particular reason to go for a particular group so, there is no purpose being defeat methinks
These are two operations, the two fractions above, and below I am multiplying the... numerator? Idk, anyway
The two lonely short sticks is me skipping the multiplication by 0
Then in the end I sum
Which is why I gave up on doing it and used fractions
Which then thr result is the product of the top on top of the product of the bottom
And then, since it is dividing by a power of 2, just move the radix point
it just occured to me, you're way more likely to have easy divisions like this
2^n grows slower than 10^n, so you're far more likely to run into powers (assuming you're less likely to see a number as it gets larger) of two than ten, and since multiplying and dividing those becomes trivial, binary has a huge advantage
Random thing I discovered is, that spoken framework is so fucking usefuk
Like
Its way easier to determine the spoken form than converting it to decimal
nd then
The spoken form informs what is the value
Two fours two for example, you directly knows its eight plus 2, thus its 10 in decimal
Way better than sum digit by digit
oh that makes sense
So if you finger count in binary, the spoken form makes very easy to work out the decimal value as well
it's basically summing combinations of bits instead, so as you memorize those combo's equivilence in base-10 it gets way faster
And as the cryptic math shows at the end, it is literally the most information dense way
does that work for two hex byte though? that number is a bit odder than just two four or something
ah, your doing the multiplication in decimal then?
Funny how "4" technically is not a number, but a magnitude in this system
Yep
it is a number
If keeping in binary you dont need to convert
each word is both a magnitude and a number, it's brilliant
It is a number as much as hex is
yes
But yeah you could say that
I just think of hex as 10000
In binary or decimal?
The number of 0s is off lol
Or not
Nah my vision is bad
But yeah
Its just that in english, "hundred" isnt usually parsed as a number on itself, but "one hundred" is
Same deal with four and hex in this system by what I understood
it's as the hard-to-parse part of the video toward the end said, the exponents are binary too
it's the same
I mean, I would use hex and four as numbers in any case
took me a while to understand what on earth they were on about ngl
Its just fun how four is not just a number, despite being called four
yeah
also I love how the system describes numbers as equations, it's simple ones, but they also help you memorize them
I just said "its not a number" because the spoken form is quaternary, so the higher digit is 3
Thats not really different on what we do in natural languages, but in binary feels more natural to do that somehow
two four being 8 or 1000 is really intutive once you learn the system, but it's also literally saying 10* 100 = 1000
"one hex" is redundant in this system, "one hundred" isn't
the correct way to say "one hex" is "hex"
yeah one is only used to represent the state of the last bit of a two bit set, it's kinda annoying, but it's also the most reasonable way
I see more like "its tecnically more correct to say one hex, but its also redundant"
damn mathmatical indentities saying x*1 = x lol
but I guess you have a solid point here
in my brain, there are effectively no "places" (ones place, tens place, etc etc) in this spoken system
but also it's kinda only places?
it's funky lol
which made comprehending the explaination at the end of the video damned difficult ngl
cause you had the tens place of the thousands places, the ten thousands place, but in binary, there are N places for each word, defined recursively... and you get it, but it's really cool to me lol
Yeah tbh I prefer the recursive approach than theoretically internalizing the pattern
I would get a brainmelt if the gigantic sequence on how to speak numbers was the only resource on this framework
That just sounds like summing and multiplication
division is so much better in binary
you can even do it without knowing what the numbers are
And..? I am confused what is the point you are making
I'm speaking in memea
Or well, in this instance it wasn't even speaking so much as "referencing the thing that's similar to this"
lmao I searched "binary as a human base" on google directly to see if I could find any more resources to feed this hyperfocus
found a bunch of pyschological, medicinal and sociological papers about gender binary and non binary people
*googling how many bits needed to count all gemders*
Atleast 1
Im gonna say the same number of bits as their are real numbers
fuck you, transcedentals your gender
in the more extreme case, and considering just humans...
the same number needed to count all humans
Do there exist genders unexpressed by people?
wait does agender count as void and thus not count and multigender are counted more than once?
probably yes
also there is a considerable chunk of the queer community that just goes by "unlabeled"
gender: undefined
Impl Into<Option<Gender>>
javascript makes undefined and null different because its gender lel
okay I may see myself out
exactly 83886080
(twitter -> tumblr -> reddit -> pinterest -> discord, outstanding)
This is the research spirit we love to see
having 8 and 12 used in spoken form is as no cost as having 3 so, why not
Also stack sounds fun
It does
4 hex right
I am still cooking in my mind how exactly it works using as an analogue of percentage as suggested in the footnotes
honestly, I guess its easier to just eyeball the proportion by knowing a stack is 4 hex, than try to workout a fraction number
it does sound fun to simply say "I have a stack of this stuff" lol
Totally don't already say that, what kind of nerd would say that... (silly)
thinking a lot about logs
you could simplify the algorithm to successive squarings up to the precision, and then moving the log of that result n decimal places
like, if you want 3 digits of precision, take the number n, square, square and square again
so... lb n = lb (((n²)²)²)/8 for example
and... taking a square of a number in binary, is almost guaranteed to double the number of digits, which just adds a 0 in the log result
so the only way for a log to have a 1, is when the squaring results in a carry in the last digit, making the length of the result the double plus 1
only then you would get a 1 in the fractional part of the log approximation
and the only way to have it to carry in the last digit in a squaring, is if it is all ones
is it possible to, from a binary number that is not all ones, to reach a number that is all ones?
I got that wrong
it will get a carry digit if there is a sequence of zeroes smaller than a sequence of ones
like in |.||, the two occupy more space than the one zero, so it carries in the end
I wonder if binary simplifies the 'resistances in parallel' operator
x • y = 1/(1/x+1/y)
(I did not follow the sqrt one at all)
I can do sqrt but get lost on div ;_;
it is simple, but many steps, if you take any of them in the wrong order you mess it lol
Looks like a lot of recipricals, I wouldn't bet on it being too hard, but the third would be modulo of a fraction @_@
put 1 on the result and subtract 1 of the most significant pair of digits; this is your working value
then, loop:
is the value higher or equal than the result appended 01?
- if yes, append 1 on the result and subtract the previous result with 01 appended from the working value
- otherwise, append 0 on the result
join the next pair on the working value
Modulo?
I guess the sqrt algo is annoying because it has a boilerplate
gAsp
Remainder from division
In *this* server??
But it doesn't have any, no?
...I'm not sure my brain is lost gimmie a minute
it's power of two % n, so there is one, and it's awful I think?
I'm confused now
this is the magic sequence for 7, right?
yep
I assume this doesnt try to do integer division with fractions
1/3 goes into power of two, that power of two * three times
that's okay for us though, since the magic sequence is gonna be over 1/x+1/y, which likely won't go into 1 perfectly?
hmmm
yeah that's pretty cursed
(N is 1/15 + 1/17 here)
it has to be rational, if fed rational inputs at least
so I think the magic sequence can work for us here
Does it work for factions?
thats a pretty cursed operator lel
well this sequence ends, idk what that means yet though
or if it's a floating point error here @_@
It's relatively common I think : shrug :
literally never even heard it mentioned in passing afaik, so idk about that
Does desmos use floats or fixed point?
does seem like a decently useful expression though
floats, it's.. problematic
iirc at least
the other format of it is much more usable in binary
I needed a lot of brainpower to figure out it lel
I think it works
so, yeah, binary makes the other format more usable than the reduced form
it gets 7.75 before quiting which feels close?
though idk how to know where to put the radix point or if there is a floating point problem here making it quit early
I assume it's a floating point problem, I doubt 1/15+1/17 goes into 32 evenly
nvm it definitely doesn't
oh wait it does?
that makes sense I picked a number above and below 16, so they add to 32, and they multiply to a whole number
massively important for anything electrical
[Reply to:](#1200152161858896012 message) It's relatively common I think : shrug :
makes sense, given it's name
ah lmao
well its not only for resistances
induction in series and capacitance in parallel too
I'm guessing no, given my results, maybe if we start from a negative power of two though?
ugh
can't even quite explain my steps here but this did work when I started from 2^-5
still I feel like finding the magic sequence of 0.125490196 isn't quite easy....
I wonder if it's faster to just do the division lol
I am still obsessed with logs and squaring
it has to be a better way to squaring, which would make the log algorithm more straightforward
I just realized you can divide to conquer...
|.| * |.| = |.| * (|.. + |) = |.|.. + |.| = | |..|
and squaring again
| |..| * | |..| = | |..| * (| .... + |... + |) = | |..| .... + ||.. |... + | |..| = |. .||| ...|
I may not have found a better way to squaring, but I found that I could have been doing multiplication as a whole a lot simpler
I maybe will start using little endian in my notes to make it easier to align and do math 😵💫
call me crazy but little endian does make things much more smoother
Little endian by hand? Goddamn
so I dont lose time right-align the numbers
much much better
updates on my quest
https://www.youtube.com/watch?v=_FoONg5Meyc
found a fancy method of squaring
Mathemagician Art Benjamin demonstrates and explains the mathematics underlying a mental arithmetic technique for quickly squaring numbers.
still watching, gonna think later of the implications of using binary with this
... yeah this method runs way faster on binary
||.
|.| -> ||.*|..+| -> ||..|
|..
||..
|.|. -> ||..*|...+|.. -> ||. .|..
|...
Oh I bet this is easy in binary
Given that "easy number" could be a power of two, the multiplication becomes a bitshift operation effectively
So just find the farthest right bit, multiply by that and add the square of that power of two?
Gonna try it that sounds fun
nope I'm wrong somewhere, hmm
right I have to multiply by number with that bit added in again
I am dumb, gonna think through this again lol
Edited a little to be a lil more clear what is happening
The formatting had gone fucked on mobile
You add the square of the difference between the original and the other 2 numbers
23^2 = (23 - 3)(23 + 3) + 3^2
this was a r/programmerhumor trend like, last year but i had to
wth is |_||_| |_|_||
It's a number
the representation of one, if you wanna be pedantic
Gender real
| i
male | female
|----------------------|
|
| -i
imaginary genders when
Genderfluids
Using a concept of complex rotation, sexuality of a genderfluid person can be expressed as
New pronoun set
Complex pronoun set!
Pull out the texx
Yeah idk tex
me when
bleh
Is there a github link to the project in here?
don't think so
Oh that would be handy
DM me and I can send the source/binary if you want
Do you think you are going to keep updating your repo? If not would you be okay with someone else posting a public version just in case anyone finds this forum in the future?
I can upload the repo if @daring vapor doesn't want to. How would you want to indicate your authorship of the code?
The cargo.toml has a author field? That might work
I figured that would work, just a matter if you have a username people can look you up by that won't link you to a name or something personal.
silly bits: binary counting helping me mindlessly set up a collision function
Literally
computer cocde found in dna 😭
Wish my dna was programmable. I would add rust if going_to_procrastinate || going_to_do_any_of(BAD_HABITS) { dont(); }
To my source code
Also I would write an usb driver https://xkcd.com/644/
dont() is such a clear function name
And so easy to implement
Make it an unhygienic macro
the exclamation mark adds needed emphasis--
A summary of neuralink/j
seriously they basically made a driver that converts the signals that say "move arm" into "move mouse"
Its basically only usable for paralyzed people where the signals wont conflict with body movements
sounds phenomenal when you describe it like that
Yea meanwhile everyone who heard about neurolink is going "cant wait to get ads streamed into my brain ugh!"
Its incredibly annoying how new tech is getting framed and effectively fearmongering people into killing progress on that tech
Nuerolink isnt even the first thing to do this
The biggest leaps it made were
- shrink the hardware down to be minimally invasive and minimally cumbersome to have
Thats it. That's the big achievement.
Making it small enough it doesn't look like they have a billion wires strapped to their head.
justdont();
its extremely understandable as a "this is scary" , the ads thing is most likely ironic with a grain of truth for most peope
also, depends on who is running it, and focus is on neuralink cuz musk
also, capitalism, need i say less.
Its literally incapable of sending signals to the brain.
Only receiving.
We are well over 50 years away from a usable 2 way brain/tech interface.
trve...
but recieving signals still also sparks a privacy fear, and you have to see that "ads in my brain" are just quippy lines
They put ads on the main menu of my tv, no doubt they would stream them to my head if they could
But they obvs can't, it's just a great indicator of corprate greed and why I don't trust them
Wouldn't feel comfortable that i have propertiary software in my head, unless if eu enforced the software to be foss
Pacemakers already have proprietary stuff :/ you probably sol
Computers suck
Even the most low level linux people agree
You cant escape proprietary.
It exists even in the hardware micro code level and you'll never be able to replace everything.
foss pacemakers when
Since no alternative actions were specified, this causes the janTatesa process to hang