Author Topic: Math Question - One of Those Silly Ones From Article  (Read 4914 times)

0 Members and 1 Guest are viewing this topic.

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1828
  • Country: us
Re: Math Question - One of Those Silly Ones From Article
« Reply #25 on: August 23, 2023, 03:40:08 am »
I guess it basically comes down to the question of:

Would an engineer/mathematician/etc... or anyone with a decent understanding of math, write a problem like that?

I would think it would come down to the actual problem trying to be solved. As an example, if I wanted to calculate the square footage of my house (and let's say for whatever reason I wanted only half the square footage of one room), I may write (all units in feet): (10x12) + (15x20) + ((20x20)/2)

In this case, I guess BODMAS would apply, but the format clearly separates the steps rather than: 10x12+15x20+20x20/2
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7963
  • Country: us
  • Retired, now restoring antique test equipment
Re: Math Question - One of Those Silly Ones From Article
« Reply #26 on: August 23, 2023, 01:44:31 pm »
That calculation can be made a bit clearer by using brackets as well as parentheses:
(10x12) + (15x20) + [(20x20)/2]
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 8706
  • Country: gb
Re: Math Question - One of Those Silly Ones From Article
« Reply #27 on: August 23, 2023, 01:53:39 pm »
This is not to say that BODMAS doesn't apply in engineering.
But BODMAS doesn't apply in engineering. Its based on the use of a divide symbol, which nobody sane would ever use. Its hopelessly confusing. We always use a horizontal line or a slash character to approximate one. That's why these "puzzles" based on BODMAS fool mathematically literate people. The order it sets out makes no sense, unless your experience of maths is confined to the very simplest of arithmetic expressions.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3387
  • Country: nl
Re: Math Question - One of Those Silly Ones From Article
« Reply #28 on: August 23, 2023, 01:54:56 pm »
That calculation can be made a bit clearer by using brackets as well as parentheses:
(10x12) + (15x20) + [(20x20)/2]

I do not see how those brackets and braces make anything clearer. As long as it's just addtition, substraction, multiplication and division the normal rules are perfectly simple and straightforward. but when I see those brackets and parentheses, these have precedence, and I start searching for the difference from what it would have been otherwise. They do not add meaning as long as they do not change the order. A bit of whitespace helps sometimes. When I'm programming in C or C++ then I tend to put spaces around plusses, but not around multiplications and divisions (if they are on the same line). These do not change anything significant for the compiler, but it adds some extra suggestions to people reading the code.

In C / C++ precedence of operators is nicely defined, including pointer redirection, log and bitwise operations and more (I think there are about 12 levels of precedence in total). However, relying on those would make most normal humans go crazy. As a result, most programmers use the precedence rules for the simple things, and use parentheses for the more complicated rules. I also prefer to cut difficult formulas into pieces. First calculate some intermediate results and assign those to temporary variables, and then use the temporary variables to calculate the end result. Doing this makes code much easier to read. (For me that is, but I am of course also used to my own codestyle).

========================================

Time flies like an arrow.
Fruit flies like a banana.

 :popcorn:
« Last Edit: August 23, 2023, 02:12:53 pm by Doctorandus_P »
 

Online dietert1

  • Super Contributor
  • ***
  • Posts: 2094
  • Country: br
    • CADT Homepage
Re: Math Question - One of Those Silly Ones From Article
« Reply #29 on: August 23, 2023, 01:59:07 pm »
The result is 42.
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7963
  • Country: us
  • Retired, now restoring antique test equipment
Re: Math Question - One of Those Silly Ones From Article
« Reply #30 on: August 23, 2023, 02:36:55 pm »
That calculation can be made a bit clearer by using brackets as well as parentheses:
(10x12) + (15x20) + [(20x20)/2]

I do not see how those brackets and braces make anything clearer. As long as it's just addtition, substraction, multiplication and division the normal rules are perfectly simple and straightforward. but when I see those brackets and parentheses, these have precedence, and I start searching for the difference from what it would have been otherwise. They do not add meaning as long as they do not change the order. A bit of whitespace helps sometimes. When I'm programming in C or C++ then I tend to put spaces around plusses, but not around multiplications and divisions (if they are on the same line). These do not change anything significant for the compiler, but it adds some extra suggestions to people reading the code.

In C / C++ precedence of operators is nicely defined, including pointer redirection, log and bitwise operations and more (I think there are about 12 levels of precedence in total). However, relying on those would make most normal humans go crazy. As a result, most programmers use the precedence rules for the simple things, and use parentheses for the more complicated rules. I also prefer to cut difficult formulas into pieces. First calculate some intermediate results and assign those to temporary variables, and then use the temporary variables to calculate the end result. Doing this makes code much easier to read. (For me that is, but I am of course also used to my own codestyle).

========================================

Time flies like an arrow.
Fruit flies like a banana.

 :popcorn:

In most programming languages (including Excel), there is no hierarchy of bracket symbols.
That is a relatively new thing in mathematical history:  the equation under discussion is not complicated, but the [ ] brackets (and { }, the next step up) are common in type-set mathematics to make the groupings clear.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19636
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Math Question - One of Those Silly Ones From Article
« Reply #31 on: August 23, 2023, 03:59:30 pm »
This is not to say that BODMAS doesn't apply in engineering.
But BODMAS doesn't apply in engineering.

Standard school algebra and algebraic manipulations are based around commutativity, associativity, and distributivity properties[1]. Those go hand-in-hand with BEDMAS.

If you don't believe that engineering uses of such manipulations require the same properties, then you had better justify why not. After succeeding at that, you could proceed to claiming BEDMAS doesn't apply in engineering.

That's not to say that different properties aren't used; in one pioneering computer language "7 - 7 - 7" is numerically identical to  "7 - 7 - 7 -7 -7". In another absolutely seminal computer language, "5 + 3 * 2" is 16, not 11 i.e. just like those office calculators you were forbidden to use in maths and science classes (and exams!)

Of course not all maths has the same notation and rules, e.g. topology.

But none of that changes where and why BEDMAS is (or ought to be) used.

[1] https://www.mathsisfun.com/associative-commutative-distributive.html
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 8706
  • Country: gb
Re: Math Question - One of Those Silly Ones From Article
« Reply #32 on: August 23, 2023, 04:14:11 pm »
This is not to say that BODMAS doesn't apply in engineering.
But BODMAS doesn't apply in engineering.
Standard school algebra and algebraic manipulations are based around commutativity, associativity, and distributivity properties[1]. Those go hand-in-hand with BEDMAS.
Thanks for cutting off the more relevant part of what I wrote. Real scumbag move, that. Try watching some of the many videos of school teachers applying those rules to some of the funky looking equations you'll find on Youtube as puzzles for adults. The confusing ones revolve around the use of ÷ rather than /. What engineer writes equations with ÷ in them? Engineers and mathematians use rules similar to BEDMAS, but the exact procedure they are teaching in schools as BEDMAS, using ÷, is just weird.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19636
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Math Question - One of Those Silly Ones From Article
« Reply #33 on: August 23, 2023, 04:30:14 pm »
This is not to say that BODMAS doesn't apply in engineering.
But BODMAS doesn't apply in engineering.
Standard school algebra and algebraic manipulations are based around commutativity, associativity, and distributivity properties[1]. Those go hand-in-hand with BEDMAS.
Thanks for cutting off the more relevant part of what I wrote. Real scumbag move, that. Try watching some of the many videos of school teachers applying those rules to some of the funky looking equations you'll find on Youtube as puzzles for adults. The confusing ones revolve around the use of ÷ rather than /. What engineer writes equations with ÷ in them? Engineers and mathematians use rules similar to BEDMAS, but the exact procedure they are teaching in schools as BEDMAS, using ÷, is just weird.

My apologies. if you had written that out as fully in the first place, I might have understood the point you were trying to make.

I don't understand the difference between ÷ and /.

I certainly will not watch 99.99999% of yootoob vids, because they will simply waste my remaining life. It won't be long before I can add an extra trailing "9" to that :(
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6323
  • Country: fi
    • My home page and email address
Re: Math Question - One of Those Silly Ones From Article
« Reply #34 on: August 23, 2023, 06:34:10 pm »
Most common ambiquity is the order of precedence for implicit multiplication operation, for example as in 18/3(1+5).

If it is written as 18/3×(1+5), the most commonly accepted rules state it is equivalent to (18/3)×(1+5), as multiplication and division have the same precedence and are applied from left to right.  Many people disagree about the precedence of the implicit multiplication operation, because they may associate it as part of the parentheses.  This is ambiguous, because there is no universally agreed upon interpretation of this notation.

The ambiquity is more pronounced when the 3 is replaced by a variable, say y, and moved immediately after the parentheses, as in 18/(1+5)y.

I myself always treat implicit multiplication as explicit multiplication; or rather, essentially inserting all implicit operators first into the equation, before examining it.  This does avoid any precedence issues, but it is not –– as far as I know –– universally accepted interpretation of the notation.
I do not claim it is the correct one, either; it is just the simplest one that makes sense, among many.

This is why I feel questions that rely on this are dishonest.  Their authors definitely know this is a notation interpretation issue, and nothing to do with math per se.  For example, if we instead used RPN or postfix notation, no such ambiquity would be possible. (Instead, each valid expression could implement more than one sequence of operations, yielding more than one scalar result, so other ambiquities would be possible then.  Simply put, any notation we choose, we need to define and agree the rules for.  If we miss details or disagree on some rule, that's our fault, and nothing to do with the actual math the notation is supposed to express.)
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11926
  • Country: us
Re: Math Question - One of Those Silly Ones From Article
« Reply #35 on: August 23, 2023, 07:11:17 pm »
I think all ways of writing down expressions in some linear manner are forms of encoding used for brevity and convenience. Such encodings are a relatively modern innovation. In previous eras, mathematicians wrote everything down longhand in words and sentences. Brevity didn't happen until algebra was introduced. Algebra was like a Big Bang in the history of mathematics.

Nevertheless, encodings present their own challenges for human readers.

In a previous post, this expression was presented: EKKCprCqrKCpsCqsCApqKrs

Now, obviously as a human I know how to interpret this when told what the rules are, but at the same time, I cannot readily tell which two sub-expressions the leading "E" applies to without breaking it down into its elements. I have to say it is opaque if I need to visualize what it means.

On the other hand, if we graph it out, like this, then the structure becomes much clearer:
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2227
  • Country: pr
Re: Math Question - One of Those Silly Ones From Article
« Reply #36 on: August 23, 2023, 07:59:52 pm »
Prefix:  EKKCprCqrKCpsCqsCApqKrs
Postfix: srKqpACsqCspCKrqCrpCKKE

To perform the prefix calculation, I need a stack for the operators, with the actions triggered when there are sufficient operands.  My mind bends when I try to keep track of that.

To perform the postfix calculation, I only need a stack for the data.  Actions are triggered by the presence of the operators.  No need for a diagram.  The above postfix notation can be easily created from the typical equations. 

Why would anyone want to use prefix notation?
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19636
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Math Question - One of Those Silly Ones From Article
« Reply #37 on: August 23, 2023, 09:08:05 pm »
I think all ways of writing down expressions in some linear manner are forms of encoding used for brevity and convenience.

More than that. It enables manipulation and transformation.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: IanB

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7963
  • Country: us
  • Retired, now restoring antique test equipment
Re: Math Question - One of Those Silly Ones From Article
« Reply #38 on: August 23, 2023, 09:31:27 pm »
The two expressions shown in "postfix" and "prefix" notation look strange to those used to parenthetical notation, but are not impossible.
Again, I encountered this in symbolic logic class as an undergraduate, and learned to use the "prefix" version for predicate calculus, along with the rules for evaluating "WFFs".
That was over 50 years ago, so I am no longer an expert.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6323
  • Country: fi
    • My home page and email address
Re: Math Question - One of Those Silly Ones From Article
« Reply #39 on: August 23, 2023, 09:33:45 pm »
Why would anyone want to use prefix notation?
Why would anyone want to speak any other language but English?

I think all ways of writing down expressions in some linear manner are forms of encoding used for brevity and convenience.
More than that. It enables manipulation and transformation.
That's why it is called notation and not just encoding.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11926
  • Country: us
Re: Math Question - One of Those Silly Ones From Article
« Reply #40 on: August 23, 2023, 09:47:20 pm »
I think there is a considerable overlap between the meanings of notation and encoding.

Notation has a strong sense of human reading and manipulation, whereas encoding has a sense of machine reading and manipulation.

The overlap occurs because machines can obviously read human notations, and humans can read machine encodings. However, each of these takes more than minimal effort to accomplish (compare handwriting recognition by machines on the one hand, and reading hex dumps of machine code by humans on the other).
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19636
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Math Question - One of Those Silly Ones From Article
« Reply #41 on: August 23, 2023, 09:48:55 pm »
Why would anyone want to use prefix notation?
Why would anyone want to speak any other language but English?

I think all ways of writing down expressions in some linear manner are forms of encoding used for brevity and convenience.
More than that. It enables manipulation and transformation.
That's why it is called notation and not just encoding.

The difference between a notation and an encoding is indeed significant and important :)

I think https://en.wikipedia.org/wiki/Mathematical_notation is beneficially less terse. The first sentence is, with my emphasis, "Mathematical notation consists of using symbols for representing operations, unspecified numbers, relations, and any other mathematical objects and assembling them into expressions and formulas"
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11926
  • Country: us
Re: Math Question - One of Those Silly Ones From Article
« Reply #42 on: August 23, 2023, 09:54:31 pm »
The difference between a notation and an encoding is indeed significant and important :)

I think https://en.wikipedia.org/wiki/Mathematical_notation is beneficially less terse. The first sentence is, with my emphasis, "Mathematical notation consists of using symbols for representing operations, unspecified numbers, relations, and any other mathematical objects and assembling them into expressions and formulas"

So does an APL program contain notation or encoding?
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19636
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Math Question - One of Those Silly Ones From Article
« Reply #43 on: August 23, 2023, 09:57:39 pm »
I think there is a considerable overlap between the meanings of notation and encoding.

Notation has a strong sense of human reading and manipulation, whereas encoding has a sense of machine reading and manipulation.

The overlap occurs because machines can obviously read human notations, and humans can read machine encodings. However, each of these takes more than minimal effort to accomplish (compare handwriting recognition by machines on the one hand, and reading hex dumps of machine code by humans on the other).

Encodings have existed for millenia, and have nothing to do with machines.

In general encodings do not enable operations on the encoded information and do not allow the information to be transformed into something different. Notations do enable such operations and transformations.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19636
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Math Question - One of Those Silly Ones From Article
« Reply #44 on: August 23, 2023, 09:59:20 pm »
The difference between a notation and an encoding is indeed significant and important :)

I think https://en.wikipedia.org/wiki/Mathematical_notation is beneficially less terse. The first sentence is, with my emphasis, "Mathematical notation consists of using symbols for representing operations, unspecified numbers, relations, and any other mathematical objects and assembling them into expressions and formulas"

So does an APL program contain notation or encoding?

Yes, repeat no.

Can a submarine swim?
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2227
  • Country: pr
Re: Math Question - One of Those Silly Ones From Article
« Reply #45 on: August 23, 2023, 10:11:51 pm »
Why would anyone want to use prefix notation?
Why would anyone want to speak any other language but English?

Your question does not answer my question.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2227
  • Country: pr
Re: Math Question - One of Those Silly Ones From Article
« Reply #46 on: August 23, 2023, 10:13:19 pm »
The two expressions shown in "postfix" and "prefix" notation look strange to those used to parenthetical notation, but are not impossible.
Again, I encountered this in symbolic logic class as an undergraduate, and learned to use the "prefix" version for predicate calculus, along with the rules for evaluating "WFFs".
That was over 50 years ago, so I am no longer an expert.

I use postfix virtually every day.  It is simple to understand and apply.  Prefix, not so much.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7963
  • Country: us
  • Retired, now restoring antique test equipment
Re: Math Question - One of Those Silly Ones From Article
« Reply #47 on: August 23, 2023, 10:24:26 pm »
In college, I was adept at prefix for symbolic logic.
I still am adept in RPN, a form of postfix, for calculators.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11694
  • Country: my
  • reassessing directives...
Re: Math Question - One of Those Silly Ones From Article
« Reply #48 on: August 23, 2023, 11:25:48 pm »
While this isn't an exact example from a recent news article, is "BODMAS" an actual method in the engineering world or just math playing?
"BODMAS" is an actual method in mathematics and hence whatever field (subsets) using it including engineering.. its a protocol (or precedence) laid out by experience people to avoid confusion/ambiguity/different semantics outcome. unaware of BODMAS protocol, one can use left to right precedence and get different answer. this is where the fool try to exploit/trick/fool others in their stupid math puzzles, between who knows and who dont the BODMAS is. how do write in math...

a) add 2 apples to 6 apples in a bin and then divide them between 2 person
b) add 2 apples to each person after dividing 6 apples in a bin to 2 of them
how much apples each person get?

its a simple problem but it will get messy when there are long chains of problems. long story short, anybody who thinks protocol synchronization such as BODMAS is not applicable in one field using math problem, means he havent shoot his own feet yet... good luck! i shot mine when entering a simple formula in a code that caused semantically incorrect program. btw there are "subjective" kind of person who dont care about the rest, the truth or the fact, what they know is they always right. they havent look big or deep enough, fwiw...
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11926
  • Country: us
Re: Math Question - One of Those Silly Ones From Article
« Reply #49 on: August 23, 2023, 11:47:08 pm »
In general encodings do not enable operations on the encoded information and do not allow the information to be transformed into something different. Notations do enable such operations and transformations.

Yeah, I'm just gonna have to say bullshit.

Computer programs are an encoding of information, and tools like compilers readily transform them by translations and optimizations into quite different outputs.

Image files and audio files are an encoding of information, and they also are transformed into compressed forms and different formats.

This was made real to me years ago when I compared the source code and the compiled output of a benchmark program I wrote on a DEC Alpha machine. The compiled output was cryptic and bore no resemblance to the program I wrote. It was transformed beyond recognition. Yet it gave the correct results.
 
The following users thanked this post: Mechatrommer


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf