minimum number of candies you can pick

hawk55732

New member
Joined
Jun 12, 2024
Messages
5
This isn't for homework but was on the first quiz I took for an online class on programing. I have not been able to get a sound explanation on why the answer they say is correct, is actually correct. The questions is,

There are 9 candies in a jar flavored strawberry, cherry, and blueberry, but you don't know the proportions of each. What is the minimum number of candies you can pick before you are certain there are no strawberry candies left?

The possibilities are, 3, 6, 8, 9 or it cannot be determined.

To me, the correct answer would be 7, even though that isn't a given possibility. The reasoning being that if we take it that there are at least one of each flavor, strawberry, cherry and blueberry, that will mean that at least 2 would be non-strawberry. So, 9-2 equals 7. If the first 7 are strawberry, then there is no need to pick the other two because we know that they are either cherry or blueberry. Since it asks for the MINIMUM number, the answer should be 7.

Am I missing something with this?
 
I have to repeat What if you only have 1 strawberry in the jar, and the first 8 picks are not strawberry?
 
What if you only have 1 strawberry in the jar, and the first 8 picks are not strawberry?
Except it says the minimum number of picks. So, if I pick 7 of them first, then I know the other two are not strawberry and dont have to pick them.
 
Last edited:
What if you only have 1 strawberry in the jar, and the first 8 picks are not strawberry?
The problem asks about "the minimum number of candies you can pick before you are certain there are no strawberry candies left". One can reasonably argue that 7 is the minimum among all possible situations. In the situation when there is only 1 strawberry in the jar then 7 does not work, i.e., the minimum is not achieved. But there is no situation where 6 picks would be enough.
 
There are 9 candies in a jar flavored strawberry, cherry, and blueberry, but you don't know the proportions of each. What is the minimum number of candies you can pick before you are certain there are no strawberry candies left?

The possibilities are, 3, 6, 8, 9 or it cannot be determined.
To me, this is a somewhat ambiguous problem.

It may mean that you pick candies without looking at what you get; in that case, the answer would be 9.

It could also be said that you aren't told for sure that there are at least one of each flavor, then the following argument would not hold, and again, I think, the answer would be 9, since, again, you could not be sure the last one wasn't strawberry.

If, as I suppose everyone is assuming, the idea is that you pick candies one at a time and look at them, deciding each time whether you are sure there are no strawberries left, then you can be sure of that when you have picked 7 strawberry candies; if you've picked anything else, then you can't be sure until 8 or 9.

Ultimately, you'll have to ask the instructor about the intent of the problem. (Are there any specific topics you've been taught that this might be intended to use?)
 
To me, this is a somewhat ambiguous problem.

It may mean that you pick candies without looking at what you get; in that case, the answer would be 9.

It could also be said that you aren't told for sure that there are at least one of each flavor, then the following argument would not hold, and again, I think, the answer would be 9, since, again, you could not be sure the last one wasn't strawberry.

If, as I suppose everyone is assuming, the idea is that you pick candies one at a time and look at them, deciding each time whether you are sure there are no strawberries left, then you can be sure of that when you have picked 7 strawberry candies; if you've picked anything else, then you can't be sure until 8 or 9.

Ultimately, you'll have to ask the instructor about the intent of the problem. (Are there any specific topics you've been taught that this might be intended to use?)

This is the first solution that anyone I have asked, has come up with that makes sense where 9 could be the correct answer.

This question was in the first quiz of the first lesson of the class on basic programing.
 
aren't told for sure that there are at least one of each flavor
I'd had that thought, but dismissed it after re-reading the op and seeing "There are 9 candies in a jar flavored strawberry, cherry, and blueberry".

If one of the flavors turns out to be missing, demand a refund! 😼 Seriously, though, I would ask the instructor for some credit.
 
I'd had that thought, but dismissed it after re-reading the op and seeing "There are 9 candies in a jar flavored strawberry, cherry, and blueberry".

If one of the flavors turns out to be missing, demand a refund! 😼 Seriously, though, I would ask the instructor for some credit.

The instructor is certain that she and the ones who set up the quiz are correct, she has emailed me back saying, "Yes. It's your interpretation of the question that is incorrect."

When I asked her to explain how I am interpretation incorrectly she replied back with, "Perhaps I should say your assumption is the issue."

Unfortunately, I do not think that I am going to get a straight answer on why she thinks the answer is correct.
 
The instructor is certain that she and the ones who set up the quiz are correct, she has emailed me back saying, "Yes. It's your interpretation of the question that is incorrect."

When I asked her to explain how I am interpretation incorrectly she replied back with, "Perhaps I should say your assumption is the issue."

Unfortunately, I do not think that I am going to get a straight answer on why she thinks the answer is correct.
I asked you what topics have been taught, and you implied that this quiz was given before teaching anything. If so, then I would expect the point to be that in programming, you have to make sure you understand the goal before solving a problem. And the main way you do that is to ask the "customer" enough questions to clarify what is intended.

So to my mind the "correct" answer is "I need more information, so I don't have to make any assumptions".

My software engineering mentor used to say all the time, "Never. Assume. Anything." Your instructor may not realize it, but you apparently just learned that lesson. (And I hope that she would have given you extra credit if you had raised your hand and asked before submitting your answer.)
 
The professor emailed me back,
They have updated the question so it reads, "There are 9 candies in a jar that could be flavored strawberry, cherry, or blueberry, but you don't know the proportions of each flavor. What is the minimum number of candies you can pick before you are certain there are no strawberry candies left?"

The COULD BE portion being the change.
 
Top