What is the task in this programming exercise?

  • Thread starter Thread starter Jerbearrrrrr
  • Start date Start date
  • Tags Tags
    Mean
AI Thread Summary
The discussion revolves around interpreting a programming exercise that asks for the positive weights measurable with 9, 3, and 1 pound measures using addition and subtraction. Participants debate whether the task requires using all three weights or if combinations can include just one or two. There is a consensus that the phrase "different combinations" suggests flexibility in using the weights. Some argue that the exercise is poorly worded, leading to confusion about the inclusion of the number 1 in the range of weights from 1 to 13. The conversation highlights the challenge of understanding the problem's requirements, with some participants expressing frustration over the clarity of the question and its educational value. Ultimately, the exercise is confirmed to be a programming task, focusing on generating all possible weights within the specified range.
Jerbearrrrrr
Messages
124
Reaction score
0
This isn't even my homework, but I'm disagreeing on a friend on what it's asking.
Dunno what forum to ask it in lol, sorry.

"Using only different combinations of those variables and the addition and subtraction operators, print all the positive weights that can be measured with 9, 3, and 1 pound measures (1-13). "

Do you think it means necessarily use all 3, or can you just pick (for example) one of the weights by itself and count that as a combination?

(don't need help doing the actual question, whichever it turns out to be)
 
Physics news on Phys.org
Jerbearrrrrr said:
This isn't even my homework, but I'm disagreeing on a friend on what it's asking.
Dunno what forum to ask it in lol, sorry.

"Using only different combinations of those variables and the addition and subtraction operators, print all the positive weights that can be measured with 9, 3, and 1 pound measures (1-13). "

Do you think it means necessarily use all 3, or can you just pick (for example) one of the weights by itself and count that as a combination?

I think it just means 9x + 3y + z, 9x-3y-z, 9x-3y+z, 9x+3y-z, z-9x-3y, 3y-9x-z, etc where x,y,z are any positive integers. Since it says combinations I guess you need to use at least 2, but using all 3 is obviously the most optimal combination given the set

Or does it mean only 9 +/- 3 +/- 1 ?? Seriously, who teaches English to these math book writers
 
Last edited:
"(1-13)" is a big hint, i think
 
Good point, Proton Soup.
But it's hard to say for sure if the 1 is like...precisely "inclusive".

Also I think only one of each weight can be used.

Also, a good mathematician would make it clear >:
(using the most dull and possibly repetitive language possible)
 
Proton Soup said:
"(1-13)" is a big hint, i think

Ok so 9-3-1 is only 5lbs.

9+3+1 is 13 pounds. So you can't use all 3 to get minimum weight.

What was the point of this exercise?
 
9+3+1
9+3-1
9-3+1
9-3-1

Think that's all of them. Is this really a math problem? Christ no wonder our public school fails this is a friggin word game. I'm assuming the 9, 3, and the 1 are the "variables", unless you skipped a part of the question?
 
cronxeh said:
What was the point of this exercise?

enumeration?
 
Proton Soup said:
enumeration?

The wha?

Thats like 'find x. There it is! ---> x'


You give me 1, 3, and 9 and ask me to find (1-13). And I must say.. THERE IS 1! Oh wait it gets better. 1+3 = 13!
 
talk2glenn said:
9+3+1
9+3-1
9-3+1
9-3-1

Think that's all of them. Is this really a math problem? Christ no wonder our public school fails this is a friggin word game. I'm assuming the 9, 3, and the 1 are the "variables", unless you skipped a part of the question?

i don't think that's what it's asking.

1 = 1
2 = 3-1
3 = 3
4 = 3+1
5 = 9-3-1
6 = 9-3
7 = 9-3+1
8 = 9-1
9 = 9
10 = 9+1
11 = 9+3-1
12 = 9+3
13 = 9+3+1

so, with those three values, you can represent every integer weight between 1 and 13
 
  • #10
cronxeh said:
The wha?

Thats like 'find x. There it is! ---> x'


You give me 1, 3, and 9 and ask me to find (1-13). And I must say.. THERE IS 1! Oh wait it gets better. 1+3 = 13!

actually, i think a lot of graph theory proofs are solved by enumeration. not very proofy, but proof is proof.
 
  • #11
Jerbearrrrrr said:
This isn't even my homework, but I'm disagreeing on a friend on what it's asking.
Dunno what forum to ask it in lol, sorry.

"Using only different combinations of those variables and the addition and subtraction operators, print all the positive weights that can be measured with 9, 3, and 1 pound measures (1-13). "

Do you think it means necessarily use all 3, or can you just pick (for example) one of the weights by itself and count that as a combination?

(don't need help doing the actual question, whichever it turns out to be)

I think the question means you can use any combination of the 9lb, 3lb and 1lb measure (including not using one or two of them).
 
  • #12
I think it means that too.

Btw, it was a programming exercise. So it's "Write a program that ___".
 
Back
Top