Can you solve 8÷2(2+2)?

Discussion in 'Other News' started by Chinatown, Aug 1, 2019.

  1. skellr

    skellr Road Train Member

    8,737
    12,187
    Jul 17, 2011
    The Village, Portmeirion
    0
    Even Perl with it's "Do what it thinks I meant to do" chokes on it. :D
    Code:
    skellr@omen ~ $ echo $((8/2(2+2)))
    bash: 8/2(2+2): syntax error in expression (error token is "(2+2)")
    
    skellr@omen ~ $ echo $((8/2*(2+2)))
    16
    
    skellr@omen ~ $ python
    Python 3.6.9 (default, Jul 15 2019, 22:55:00)
    [GCC 9.1.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> print(8/2(2+2))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: 'int' object is not callable
    
    >>> print(8/2*(2+2))
    16.0
    >>>
    
    skellr@omen ~ $ perl -e 'print 8/2(2+2) . "\n"'
    syntax error at -e line 1, near "2("
    Execution of -e aborted due to compilation errors.
    
    skellr@omen ~ $ perl -e 'print 8/2*(2+2) . "\n"'
    16
     
    Last edited: Aug 3, 2019
    Cattleman84, G13Tomcat and lilillill Thank this.
  2. Truckers Report Jobs

    Trucking Jobs in 30 seconds

    Every month 400 people find a job with the help of TruckersReport.

  3. Cattleman84

    Cattleman84 Road Train Member

    9,946
    70,938
    Nov 1, 2017
    The Sticks, Idaho
    0
    Yes this is exactly the point...

    8÷2(2+2)=

    Is not the same as

    8÷2×(2+2)=


    The first is solved as
    8÷((2×2)+(2×2))=

    8÷8=1


    The second is solved as

    8÷2×(4)=

    8÷2=4

    4×4=16

    If there is no sign between a variable and the parentheses then the distributive property applies and is considered part of the "Parentheses" step in the order of operations.
     
    Rocks and G13Tomcat Thank this.
  4. G13Tomcat

    G13Tomcat Road Train Member

    11,872
    42,142
    Jun 7, 2011
    Ohio
    0
    AMEN to that.. just like the one Martin posted. NOT the same. The presence of parentheses is NOT an implied symbol for multiplication .. it IS multiplication. ORDER. YESSIR~!!!

    THANK YOU.

    And you're half my age; I'm happy now, haha!
     
    Cattleman84 Thanks this.
  5. Cattleman84

    Cattleman84 Road Train Member

    9,946
    70,938
    Nov 1, 2017
    The Sticks, Idaho
    0
    Look at it another way

    The original equation is

    8÷2(2+2)=

    If the answer is 16... Or 1, it can be checked by removing a known variable and replacing it with an unknown like thus

    8÷x(2+2)=16

    Or

    8÷x(2+2)=1

    We already know that x=2 from the original equation... But only one of the above equations will solve as x=2


    Let's work them out

    8÷x(2+2)=16

    8÷(2x+2x)=16... Distributive Property used to get (2x+2x)

    8÷4x=16

    8=16×4x

    8÷16=4x

    2÷4=x

    .5=x

    This does not work out to the x=2 that we know it should be from the original equation. Therefor 16 is not the correct answer to the original equation.

    Lets try the same thing if we use 1 as the answer to the original equatio.

    8÷x(2+2)=1

    8÷(2x+2x)=1... Distributive Property used to get (2x+2x)

    8÷4x=1

    8=1×4x

    8=4x

    2=x


    As you can see using 1 as the answer to the original equation we can then solve x=2... Which we know is correct because x in the original equation was indeed a 2. Therefor 1 is the correct answer to the original equation.


    The answer to op is 1
     
    speedyk and G13Tomcat Thank this.
  6. G13Tomcat

    G13Tomcat Road Train Member

    11,872
    42,142
    Jun 7, 2011
    Ohio
    0
    Dang you're good. I remember 'breaking it down' like that for MY kids when they were in school.

    Thinking 'common core' has 'cored' some brain cells these days. EXCELLENT.
     
    Cattleman84 Thanks this.
  7. Cattleman84

    Cattleman84 Road Train Member

    9,946
    70,938
    Nov 1, 2017
    The Sticks, Idaho
    0
    Yes common core was the worst thing to ever come to mathematics education.

    Math is kinda my thing... Lol
     
    skellr, lilillill and G13Tomcat Thank this.
  8. G13Tomcat

    G13Tomcat Road Train Member

    11,872
    42,142
    Jun 7, 2011
    Ohio
    0
    I see that.. and considering you're kinda 'younger' it's amazing that you break it down like that. Kids today barely learn associative and distributive properties, if at all. Thinking you, China, and Dave are the only ones that get this, besides me.

    The 'barcode guys' (LiL too many times and skellr) are trying to replicate with code....and it's not possible. Sad but true.

    GOOD for you, man.
     
    Cattleman84 and skellr Thank this.
  9. lilillill

    lilillill Sarcasm... it's not just for breakfast

    5,642
    13,471
    Nov 7, 2007
    Possum Booger, Alabama
    0
    Speaking of common core, anyone remember when they tried to teach kids to read using I.T.A.? Somewhere around the early 70's I think.

    My younger brother had to learn it and when he showed it to me, I was like, "What the hell kind of alien #### is that?"
     
    G13Tomcat Thanks this.
  10. G13Tomcat

    G13Tomcat Road Train Member

    11,872
    42,142
    Jun 7, 2011
    Ohio
    0
    I remember hearing about that from my older brother. Anymore when I hear people talk about IFTA .. that phrase comes back to me. Never had a clue what it meant.

    Wife took son OUT of school and home schooled him when 'common core' kicked in' he'd come home with homework and had to group and color circles and squares to do his MATH homework. Wife tried to 'learn' it to help him and finally said 'hellnawh....' So there went that.

    Daughter graduated before it came into play, and she's scholarship bound, undecided. Thank Gawd, LoL.
     
    Cattleman84 and lilillill Thank this.
  11. 88 Alpha

    88 Alpha Trucker Forum STAFF Staff Member

    5,595
    18,181
    May 12, 2012
    SouthEast Alabama
    0
    This thread is why you can make numbers prove whatever you want them to prove. Each side (@Cattleman84 and @lilillill ) has presented empirical evidence they are correct.
     
    Cattleman84, lilillill and G13Tomcat Thank this.
  • Truckers Report Jobs

    Trucking Jobs in 30 seconds

    Every month 400 people find a job with the help of TruckersReport.