Adding parentheses to an expression to get a desired result

tchntm43

New member
Joined
Jan 8, 2020
Messages
36
Assume an expression of the form n = a + b * c + d * e + f...

If a value is specified for n, add parentheses to the expression to make it true.

What is the correct procedure to solve this? I am looking for something other than repeated trial and error. I've deliberated omitted the values of a, b, c etc because I don't want to be given the answer, I want the procedure to find the answer.
 
It's basically trial and error.

The only procedure I can see, in general, is to make your trials orderly and systematic, and to attempt to bias it toward more likely arrangements based on the particular numbers. For example, if n is very large compared to the given numbers, I'd want to try to make the multiplications count for as much as possible, by doing something like (a + b) * (c + d) * (e + f) . But if n is small, I'd avoid that.

Ultimately, this is a test of number sense combined with patience. And I suspect you'll get some negative appraisals of this sort of problem, because the specific skill here is useless, and many people just lose patience rather than gaining anything.
 
Assume an expression of the form n = a + b * c + d * e + f...

If a value is specified for n, add parentheses to the expression to make it true.

What is the correct procedure to solve this? I am looking for something other than repeated trial and error. I've deliberated omitted the values of a, b, c etc because I don't want to be given the answer, I want the procedure to find the answer.
I would classify it as a puzzle - in general they don't have standard solution procedures. You'll need to use you knowledge of arithmetic, trial and error and, of course, logic.
 
Ultimately, this is a test of number sense combined with patience. And I suspect you'll get some negative appraisals of this sort of problem, because the specific skill here is useless, and many people just lose patience rather than gaining anything.
It's not useless to me, I have to do it as part of an online Java programming course, and the only thing I'm allowed to do is add parentheses to make it work.
 
It's not useless to me, I have to do it as part of an online Java programming course, and the only thing I'm allowed to do is add parentheses to make it work.
Have you read any links on order of operations ? It has been years since I did any programming. But it is my impression that there is a consensus on order of operations but there are many slight variations. That means that you need to follow the manual.
If I were presented \(a+b\cdot c+d\cdot e+f\), I would based on my programming experience see \(a+(b\cdot c)+(d\cdot e)+f\) .
 
By calling these useless, our tutors mean that in the arena of "practical application" (like designing a software for moon-rover landing, or making steel out of iron-ore) - these skills (of solving these problems) are useless. Of course these are useful to pass an academic course, as needed.
 
It's not useless to me, I have to do it as part of an online Java programming course, and the only thing I'm allowed to do is add parentheses to make it work.
Don't you think it matters which course this problem is from? You should read posting guidelines before posting. Programming exercise is a different story - here you are supposed to use mostly trial and error. The main difficulty is to organize your "trials" in such a way that you don't miss any cases.
 
Yes, when you program this, all you can do is "orderly, systematic trial and error" as I said. You can't give a program "number sense"! And the computer already has patience ...

And the goal of the exercise is to help you learn to think carefully about that "systematic" part. Like many programming exercises (or math problems, for that matter), there is no real use for it beyond that, but that is enough.
 
I wouldn't say such puzzles are useless even if it was given in a math course and not programming. It shows students that not all problems they may encounter are of "Jimmy has 5 apples and Tommy has 3" type and that sometimes they need to actually think outside the box of the neat categories of text book chapters.
Of course, for a "manual" solution it should not be too difficult.
And for a programmer it's even more useful. Such exercises are a good way to introduce various data structures (trees?), recursion, optimization, etc. And for "real life" applications - I haven't seen similar problems in my area (CAD software), but I'm sure NSA programmers have a use for trial and error algorithms.
 
Last edited:
I wouldn't say such puzzles are useless even if it was given in a math course and not programming. It shows students that not all problems they may encounter are of "Jimmy has 5 apples and Tommy has 3" type and that sometimes they need to actually think outside the box of the neat categories of text book chapters.

Let me clarify. What I initially said was not about my own opinion, but about others':
I suspect you'll get some negative appraisals of this sort of problem, because the specific skill here is useless, and many people just lose patience rather than gaining anything.

More recently, I said,
And the goal of the exercise is to help you learn to think carefully about that "systematic" part. Like many programming exercises (or math problems, for that matter), there is no real use for it beyond that, but that is enough.
When I say "useless", I am not talking about the value as an exercise, programming or otherwise. I'm talking about the problem as a specific task. No one is ever going to have a need in real life to fill in parentheses to make an equation true, though they may need to do similar things.

I have never said, myself, that such exercises are useless as exercises. On the other hand, I will admit that I have seen many students who are worried that they can't figure out one of these, who think it means they are dumb. They apparently weren't told that this is a different kind of problem, without a routine "procedure", and they should just enjoy it as a puzzle and stop if they waste too much time on it. When students are given difficult versions of such a problem without any instruction, that can be malpractice. But some easier forms are definitely good exercise for the mind, and harder ones can be good challenges.
 
Let me clarify. What I initially said was not about my own opinion, but about others':


More recently, I said,

When I say "useless", I am not talking about the value as an exercise, programming or otherwise. I'm talking about the problem as a specific task. No one is ever going to have a need in real life to fill in parentheses to make an equation true, though they may need to do similar things.

I have never said, myself, that such exercises are useless as exercises. On the other hand, I will admit that I have seen many students who are worried that they can't figure out one of these, who think it means they are dumb. They apparently weren't told that this is a different kind of problem, without a routine "procedure", and they should just enjoy it as a puzzle and stop if they waste too much time on it. When students are given difficult versions of such a problem without any instruction, that can be malpractice. But some easier forms are definitely good exercise for the mind, and harder ones can be good challenges.
Dr.Peterson,
I wasn't replying to you specifically. Just voicing my opinions. My son takes algebra and geometry classes at the Russian School of Mathematics, and even there they are rarely given puzzle type problems. Obviously there is nothing like that at his public school (in a good district). Therefore, for most students these days the concept of "enjoy it as a puzzle" is utterly foreign.
 
Top