programming.dev

ExLisper, to memes in 6÷2(1+2)

The fuck? I’m getting 15.

wischi,

If you are not kidding, can you show your steps I can try to help you, but I can’t currently think of a way how you’d end up with 15.

crackajack, to programmer_humor in Manager: This task only takes 30 minutes. Why did it take you the whole day?

That’s in any bloody workplace! Especially if there is o synergy between different teams.

MrMobius, to memes in 6÷2(1+2)

Interesting, I didn’t know about strong implicit multiplication. So I would have said the result is 9. All along my studies in France, up to my physics courses at University, all my teachers used weak implicit multiplication. Could be it’s the norm in France, or they only use it in math studies at University.

sailingbythelee,

I didn’t know until now that I unconsciously use strong implicit multiplication (meaning that I get the answer “1”). I believe it happens more or less as a consequence of starting inside the parentheses and then working my way out.

It is a funny little bit of notational ambiguity, so it is funny that people get riled up about it.

wischi,

In a scientific context it’s actually very rare to run into that issue because divisions are mostly written as fractions which will completely mitigate the issue.

The strong implicit multiplication will only cause ambiguity after a division with inline notation. Once you use fractions the ambiguity vanishes.

In practice you also rarely see implicit multiplications between numbers but mostly between variables or variables and their coefficients.

MrMobius,

Yes of course, we always used fractions so there was no ambiguity. Last time I saw the division symbol must have been in primary school!

DRx, (edited )
@DRx@lemmy.world avatar

Def not a math major (BS/PharmD), but your explanation was like seeing through a visual illusion for the first time! lol

I was always taught PEMDAS growing up, and that the MD and the AS was read left to right in an equation like above. But stating the division as a fraction completely changes my mind now about how this calculation works. I think what would happen in a calculation I use every day if the former was used.

Example: Cockcroft-Gault Equation (estimation of renal function)

(140-age)(kg) / 72(SCr) vs (140-age) X kg ➗72 X SCr

In the first eq (correct one) an 80yo patient who weighs 65kg and has an SCr ~ 1.5 = 36.11

In the latter it = 81.25 (waaay too high for an 80yo lol)

edit: calculation variable

Rustmilian, to memes in 6÷2(1+2)
@Rustmilian@lemmy.world avatar

The only correct answer is 8008135.

ignotum,

Oh i get it, if you flip that upside down it says “seiboob”

Rustmilian, (edited )
@Rustmilian@lemmy.world avatar

1337 5|*34X 15 [)34[) |V0// 83(4()53 0|= 70().

ralakus,

Leet speak is dead now because of you.

Aremel, (edited )

It sure is. 13 year old me would have no trouble deciphering this, but I only got up to [)34[).

Edit: I still got it. L337 H4xor PhoR L1F3

Waldowal,
@Waldowal@lemmy.world avatar

Which is French for “the boob”.

youngalfred, to memes in 6÷2(1+2)

Typo in article:

If you are however willing to except the possibility that you are wrong.

Except should be ‘accept’.

Not trying to be annoying, but I know people will often find that as a reason to disregard academic arguments.

wischi,

Thank you very much 🫶. No it’s not annoying at all. I’m very grateful not only for the fact that you read the post but also that you took the time to point out issues.

I just fixed it, should be live in a few minutes.

Iamdanno,

A person not knowing the difference in usage between except and accept sounds like a perfectly reasonable reason to disregard their math skills.

aes, to programmer_humor in Manager: This task only takes 30 minutes. Why did it take you the whole day?

Psst,

git add -p

dukk, (edited )

Better yet, git commit -p

sip,

uuuuuuuu. and you could do -m to describe the commit.

next they’ll add --push/-P.

perhaps add -r for fetch/rebase then commit.

one command to rule them all! 😈

Johanno,

What does this?

foxymulder,
@foxymulder@lemmy.ml avatar

“patch mode” - Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history.

AnarchistArtificer,

Yay, learning!

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Highly recommend throwing –patch on any git commands you’re used to using. You will have the prettiest, most atomic fkn commit, I’m serious people will love you for it.

I mean many people won’t care, but the quality folk will notice and approve.

Johanno,

We make a singular commit per feature.

KairuByte,
@KairuByte@lemmy.dbzer0.com avatar

I always find this hard to follow personally.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Trunk based, eh? Yeah, we do that on a couple teams where I’m at, too. I like the philosophy, but force pushing the same commit over and over as you’re incorporating review feedback is antisocial, especially when you’ve got devs trying to test your changes out on their machines.

Omgpwnies,

eh, just squash and merge. Feature branch can be messy as long as main is clean

Johanno,

Yep. You have to make sure your feature branch works.

oce, (edited )
@oce@jlai.lu avatar

Or just use a good IDE that makes doing atomic commits pretty natural.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

I’ve only tried the VS code hunk stager thing, and found it cumbersome compared to command line, but if you can make a GUI work for you ya go for it. I’ve never found it worth the trouble personally

dukk,

Shout out to Lazygit for letting me stage individual lines

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Looks pretty neat. I like that it shows the commands it’s issuing!

oce,
@oce@jlai.lu avatar

You should try the JetBrains IDEs, as the other said, you can pick changes line by line graphically, when you commit, when you do a diff with another branch or when you fix conflicts. It’s much more convenient than commands and terminal text editors.

syd, to programmer_humor in Manager: This task only takes 30 minutes. Why did it take you the whole day?
@syd@lemy.lol avatar

I’m using Copilot for it right now. It works on half of the cases.

mdurell,

That’s about 300% better than my average!

ConfusedPossum, to memes in 6÷2(1+2)

Who gives a shit about order of operations. In a real world scenario you'll know what to do

MrVilliam,

This is why you’re a confused possum.

Tartas1995, (edited ) to memes in 6÷2(1+2)

I feel like if a blog post presents 2 options and labels one as the “scientific” one… And it is a deserved Label. Then there is probably a easy case to be made that we should teach children how to understand scientific papers and solve the equation in it themselves.

Honestly I feel like it reads better too but that is just me

wischi,

I’m not sure if I’d call it the “scientific” one. I’d actually say that the weak juxtaposition is just the simple one schools use because they don’t want to confuse everyone. Scientist actually use both and make sure to prevent ambiguity. IMHO the main takeaway is that there is no consensus and one has to be careful to not write ambiguous expressions.

Tartas1995,

I mean the blog post says

“If you are a student at university, a scientist, engineer, or mathematician you should really try to ask the original author what they meant because strong juxtaposition is pretty common in academic circles, especially if variables are involved like in $a/bc$ instead of numbers.”

It doesn’t say scientific but…

atomicorange,

I’m a scientist and I’ve only ever encountered strong juxtaposition in quick scribbles where everyone knows the equation already. Normally we’re very careful to use fraction notation (or parentheses) when there’s any possibility of ambiguity. I read the equation and was shocked that anyone would get an answer other than 9.

Tartas1995,

My comment was directed to the blog post and the claims contained in it.

The blog post claims it is popular in academy, if that is a deserved label, then I don’t understand how the author of the post lands on “there is no good or bad way, they are all valid”. I am in favor of strong juxtaposition but that is not the case that I am making here. Sorry for the confusion.

Flyberius, (edited ) to programmer_humor in Manager: This task only takes 30 minutes. Why did it take you the whole day?
@Flyberius@hexbear.net avatar

Me trying to find ways around using the word “and” in the commit message.

aes, (edited )

git commit -m “directory_x:file_i.so: did x, y, and z; directory_x:file_ii.so: fixed t”

bouh, to memes in 6÷2(1+2)

This is not a math problem but a calculator engineering problem. Some solve the sub operations from right to left while other do it from left to right.

wischi, (edited )

It’s not really a calculator engineering problem. If you don’t have time to read the entire blog you should definitely check out the section “But my calculator says…”. It’s actually about order of operations regarding implicit multiplication.

amio, (edited ) to memes in 6÷2(1+2)

Forgot the algebra using fruit emoji or whatever the fuck.

Bonus points for the stuff where suddenly one of the symbols has changed and it's "supposedly" 1/2 or 2/3 etc. of a banana now, without that symbol having been defined.

wischi, (edited )

This meme is specifically about the implicit multiplication because the article it links to is about that too.

But you are right there are a lot more “viral math” things than just the implicit multiplication problems 🤣

dgmib, to memes in 6÷2(1+2)

You state that the ambiguity comes from the implicit multiplication and not the use of the obelus.

I.e. That 6 ÷ 2 x 3 is not ambiguous

What is your source for your statement that there is an accepted convention for the priority of the iinline obelus or solidus symbol?

As far as I’m aware, every style guide states that a fraction bar (preferably) or parentheses should be used to resolve the ambiguity when there are additional operators to the right of a solidus, and that an obelus should never be used.

Which therefore would make it the division expressed with an obelus that creates the ambiguity, and not the implicit multiplication.

(Rest of the post is great)

wischi, (edited )

In this case it’s actually the absence of sources. I couldn’t find a single credible source that states that ÷ has somehow a different operator priority than / or that :

The only things there are a lot of are social media comments claiming that without any source.

My guess is that this comes from a misunderstanding that the obelus sign is forbidden in a lot of standards. But that’s because it can be confused with other symbols and operations and not because the order of operations is somehow unclear.

dgmib,

What is your source for the priority of the / operator?

i.e. why do you say 6 / 2 * 3 is unambiguous?

Every source I’ve seen states that multiplication and division are equal priority operations. And one should clarify, either with a fraction bar (preferably) or parentheses if the order would make a difference.

wischi, (edited )

Same priority operations are solved from left to right. There is not a single credible calculator that would evaluate “6 / 2 * 3” to anything else but 9.

But I challenge you to show me a calculator that says otherwise. In the blog are about 2 or 3 dozend calculators referenced by name all of them say the same thing. Instead of a calculator you can also name a single expert in the field who would say that 6 / 2 * 3 is anything but 9.

dgmib,

Will you accept wolfram alpha as credible source?

mathworld.wolfram.com/Solidus.html

Special care is needed when interpreting the meaning of a solidus in in-line math because of the notational ambiguity in expressions such as a/bc. Whereas in many textbooks, “a/bc” is intended to denote a/(bc), taken literally or evaluated in a symbolic mathematics languages such as the Wolfram Language, it means (a/b)×c. For clarity, parentheses should therefore always be used when delineating compound denominators.

wischi,

Did you read the blog post? I also quoted the exact same thing.

baggins, to memes in 6÷2(1+2)

That’s cool and Imma let you finish but I’m not a mathematician and the answer is 9.

wischi,

That’s the correct answer if you follow one of the conventions. There are actually two conflicting but equally valid conventions. The blog explains the full story but this math problem is really ambiguous.

baggins, (edited )

I read it. And I’m not a mathematician, so the answer is 9.

E: The salty mathematicians down-voting this can get fucked lmfao

wischi, (edited )

Ooh now I get you, sry. True. But sadly you now know the truth and you have to be careful with the implicit multiplications on your tax forms from now on ;-)

original_reader, to memes in 6÷2(1+2)

I read the whole article. I don’t agree with the notation of the American Physical Society, but who am I to argue that? 😄

I started out thinking I knew how the order of operations worked and ended up with a broader view of the subject. Thank you for opening my mind a bit today. I will be more explicit in my notations from now on.

wischi, (edited )

Thank you so much for taking the time. I’m also not convinced that APS’s notation is a very good choice but I’m neither american nor a physisist 🤣

I’d love to see how the exceptions work that the APS added, like allowing explicit multiplications on line-breaks, if they still would do the multiplication first, but I couldn’t find a single instance where somebody following the APS notation had line-break inside an expression.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #