Solved

How do I solve this expression?

Posted on 2013-11-13
8
352 Views
Last Modified: 2013-11-14
I have the following expression:
6a/(2x+8)3+a

My problem is that I don't know if I should solve it as :
        6a                                6a
_____________    or     _______________ * 3+a
  (2x+8)3+a                      (2x+8)

How am I supposed to know which one is correct?
0
Comment
Question by:NevSoFly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39646983
Operator precedence. /* comes before +-

HTH,
Dan
0
 
LVL 27

Accepted Solution

by:
aburr earned 500 total points
ID: 39646990
I think that neither of your suggestions is correct. The expression is ambiguous.
I would try
   (6a/(6x +24))+a
0
 

Author Closing Comment

by:NevSoFly
ID: 39647004
your right there is no way to know with just the straight text.  Thx!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:ThomasMcA2
ID: 39647779
There is a way to know "with just the straight text" because every math expression has an order of operations that defines the order that each sub-expression gets processed.

Because of those "ordering rules" your example gets processed like this:
    6a
__________ + a
 (2x+8)3

Open in new window

0
 

Author Comment

by:NevSoFly
ID: 39648610
ThomasMcA2,

could you please explain to me exactly how you came up with the expression that you did given the order of operations?
0
 
LVL 14

Expert Comment

by:ThomasMcA2
ID: 39648734
In the United States the acronym PEMDAS is a common mnemonic to help remember the order. It stands for Parentheses, Exponents, Multiplication, Division, Addition, Subtraction.

Following that order for your problem { 6a/(2x+8)3+a }, the parentheses must be evaluated first. Since there is nothing inside the parentheses that can be simplified, the "times 3" that is outside the parentheses comes next, which simplifies to this: { 6a/(6x+24)+a }.
0
 

Author Comment

by:NevSoFly
ID: 39648886
I see where I started to go wrong.  After I couldn't simply what was in the Parentheses I restarted at the beginning of the expression, basically I did PEDMAS instead of PEMDAS.  But how do you determine if it should be :
        6a                                6a
_____________    or     _______________ +a
  (6x+24)+a                      (6x+24)
0
 
LVL 14

Expert Comment

by:ThomasMcA2
ID: 39649354
Because addition and subtraction are always last. So when you do the multiplication and division first, you get "something plus 'a'."

In other words, trying to change the problem to "6a over something" is merely adding to the confusion. If you do it in-line, you get this: { 6a/(6x+24)+a } which clearly does not have "+a" in the divisor.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
Have you ever thought of installing a power system that generates solar electricity to power your house? Some may say yes, while others may tell me no. But have you noticed that people around you are now considering installing such systems in their …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question