felix-link-of-the-day
felix-link-of-the-day
Felix Jankowski: My links of the day
414 posts
Interesting stuff that I like to read
Don't wanna be here? Send us removal request.
felix-link-of-the-day · 6 months ago
Text
0 notes
felix-link-of-the-day · 2 years ago
Text
PEMDAS or what?
Great comment by Chris McLeod
In this case, it's about whether the implied multiplication of the bracket is higher or equal priority to regular multiplication.
Here's a breakdown
Let's look at all the premises that may affect the parsing and computation of this problem and related problems
A: multiplication comes before division
A': division comes before multiplication
A*: division and multiplication have equal precedence
B: operations occur left to right when equal precedence
B': operations occur right to left when equal precedence
B*: operations without explicit precedence are malformed
C: grouping by adjacency occurs before operator substitution
C': operator substitution occurs before grouping by adjacency
C*: grouping by adjacency is not permitted
D: pronumerals are grouped before operator substitution
D': pronumerals are grouped after operator substitution
D*: pronumerals are not permitted
E: addition comes before subtraction
E': subtraction comes before addition
E*: subtraction and addition have equal precedence
So let's see how these are used in conventions:
most countries use {B}
but when we do matrix arithmetic or functional algebra we use {B'} (although even in those cases japan uses {B})
also hebrew and arabic computations will use {B'} where we would use {B} and vice versa
literal interpretation of BODMAS or BEDMAS is {A',E}
literal interpretation of PEMDAS is {A,E}
the interpretation you are intended to recieve from them is {A*,E*}. Note that neither of them explicitly refers to {C}
notice, that so far no claim has been made on B C or D
schools almost never directly deal with these, I think this is probably an oversight.
As for programming languages
LISP uses {A*,B*,C*,D*,E*}
Python uses {A*,B,C*,D*,E*}
CASIO uses {A*,B,C,D,E*}
TX uses {A*,B,C',D,E*}
MATLAB uses {A*,B,C',D,E*}
Personally, I'm {A*,B,C',D,E*}
So what result do we get depending on these propositions?
the problem is 8/2(2+2)
right away we can say that D and E are irrelevant
we can also turn (2+2) into (4)
giving us 8/2(4)
before we do anything we have to decide what to do with the adjacency between 2 and the bracketed term
{C*} will tell us to reject this expression and not attempt to compute it
if {C} then the expression becomes 8/(2(4)) = 8/(2*4)
which regardless of propositions gives 8/8 = 1
if {C'} then the expression becomes 8/2*4
then if {B*} we reject the expression and not attempt to compute it
otherwise if {A} or {A*,B} it becomes 4*4 = 16
otherwise if {A'} or {A*,B'} it becomes 8/(2*4) = 8/8 = 1
The main takeaway is that there is no universal standard
We have seen that B varies tremendously
We can arguably say that {A*,E*} is a universal standard, supposing that schools properly taught it instead of doing it in a confusing way that leads people to take {A',E} or {A,E}
I would also say that {D} is a reasonable standard that I think most professionals hold, even if they haven't thought about it explicitly.
Languages may implement {D*} to enforce symbolic tokens on variable names
{C} is contested however. This is the main reason why languages will implement {C*} instead to avoid the ambiguity and force people to frame it in an unambiguous form. Almost all of these memes rely on this contention for traffic.
Here's an interesting article on the evolving usage of C vs C'
0 notes
felix-link-of-the-day · 2 years ago
Text
0 notes
felix-link-of-the-day · 2 years ago
Text
0 notes
felix-link-of-the-day · 2 years ago
Link
Being poor - counterintuitively - means, that the price for everything is higher 
0 notes
felix-link-of-the-day · 3 years ago
Link
0 notes
felix-link-of-the-day · 3 years ago
Link
0 notes
felix-link-of-the-day · 3 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes
felix-link-of-the-day · 4 years ago
Link
0 notes