• 0 Posts
  • 184 Comments
Joined 1 year ago
cake
Cake day: June 29th, 2023

help-circle
  • That pruning is indeed goal. As for benchmarking, I did not implement a brute force solution; I might try it if I finish one of the next few days quickly (lol fat chance). I did bench math vs string cat but did not record numbers. IIRC it made no measurable difference in Clojure, where input parsing with my crappy parser/combinator lib dominated, but math was something like a factor of three faster than string cat for Chez Scheme.


  • Inverse concat isn’t too heavy if you implement with logs and such. Certainly still heavier than integer add/mul (or sub/div in my case), but arithmetic is usually faster than memory allocation. However, predicting the performance hit due to branching a priori is tricky on modern hardware, which implements sophisticated branch prediction and speculative execution. Furthermore, branching happens anyway between terms to select the right operation, though a misprediction there is likely less significant unless you are doing string manipulation.

    “Overall number of checks” is a bit ambiguous; if taken to mean the number of times I check against the target for early escape, plus the final check on success, the figure is 15% relative to the average 3(n-1) / 2 checks required by brute force (n = number of terms in the equation, giving n-1 operators). That’s still almost a 7-fold decrease. If we instead look at the number of operator evaluations relative to the (n-1)/2 * 3(n-1) evaluations expected from an average brute force search (3(n-1) / 2 combinations with (n-1) operations conducted per combination), the figure is only 7.0%. In both cases, there is a significant amount of work not being done.


  • I am not sure how much the formal complexity changes, but the pruning that occurs when working from right to left and bailing early when inverse multiplication or concatenation fails seriously cuts down on the number of combinations that you need to explore. With this pruning, the average fraction of the times (relative to the average 3^(n-1) / 2 times necessary for a naive brute force) that my code actually ended up checking whether the full inverted equation was equal to the target, was only 2.0% for equations that did not have solutions. Interestingly, the figure rose for equations that did have solutions to 6.6%.






  • ornery_chemisttoScience MemesProblem?
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 months ago

    Good rule of thumb: if someone else hasn’t solved the problem yet, it’s more complicated than you’re assuming. If the problem is worth solving, other people smarter than you have almost certainly attempted the easy “solutions” already, and they were inadequate to solve the problem. Heck, even if it’s not worth solving, there’s a non-zero chance that some pre-Reagan weirdos took a crack at it with bonus mercury and thallium compounds for the lulz and published it all in a vague 200-word comm in a now-defunct journal.


  • ornery_chemisttoScience MemesThis feels wrong. I love it.
    link
    fedilink
    English
    arrow-up
    35
    ·
    2 months ago

    Isn’t the squaring actually multiplication by the complex conjugate when working in the complex plane? i.e., √((1 - 0 i) (1 + 0 i) + (0 - i) (0 + i)) = √(1 + - i2) = √(1 + 1) = √2. I could be totally off base here and could be confusing with something else…




  • In fluent speech, the conjunction (the first “that”) is unstressed, and as a result some speakers reduce the vowel a bit toward schwa. However, if you told those speakers to carefully pronounce each word, I bet they would pronounce the conjunction and the pronoun the exact same same. A more common example of this kind of reduction is the word “to”, which is almost always reduced to /tə/ ([tə] ~ [tʊ] ~ [ɾə] depending on dialect and surrounding words) in everyday speech when unstressed.

    Fun fact, you can reduce just about every unstressed vowel in English to schwa (if it’s not already a schwa) and still be largely understood.






  • ornery_chemisttoAtheist Memes@lemmy.worldEat lead
    link
    fedilink
    arrow-up
    22
    ·
    edit-2
    2 months ago

    That’s not the gotcha OOP seems to think it is. If the world was magicked into existence by a supreme being 4000 years ago, there’s no reason it couldn’t have been magicked into existence with heavy elements having decayed by an arbitrary amount or with Pb by itself. 'Tis the problem with invoking appeals to magic. And anyway a quick look on wiki says that primordial Pb was mostly created by neutron capture of lighter elements, not radioactove decay of heavier ones, so the mere existence of Pb proves nothing wrt the timeline of U decay anyway… but at that point if you’re bringing nucleosynthesis into it, you may as well point to anything higher than lithium or even atoms as a concept as “proof” rather than picking anything as exotic as uranium decay.


  • ornery_chemisttoScience MemesDrink it, I dare ya
    link
    fedilink
    English
    arrow-up
    23
    ·
    2 months ago

    Alternatively for a full octet on every atom, oxiryne, which does not exist and does not have a wiki page. It’s basically acetylene with its arms chopped off and the stumps dislocated, bent back, and stapled together with an oxygen atom.


  • ornery_chemisttoScience MemesPublishers Always Innovating
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    Fair, but certain corporate-mandated client-side PDF viewers are… bloatier. Though, I do like not having another window to manage when I open in browser, particularly when doing web searches. It pairs well with tab grouping extensions, and I generally don’t use markup, so no loss for me there.