S of {Sue, Arron, Pete, Dan, Calvin}.
I pick a subsetYou make a guess of any subset T , and I will then tell you how many elements there are in T ∩ S .
You continue making different choices of T until you are able to exactly determine S . What is the minimum number of guesses that are necessary?
Note: You do not need to pick S as one of your choices.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Oh wow! I wasn't expecting a fixed list of guesses to work. My approach was conditional on the results to the answers, hence the way the question was written up.
The entries for {Sue, Calvin} and {Sue, Dan} should be interchanged.
Log in to reply
Thanks for pointing out the error.
(I still do not know what was the bug in my code)
How do I prove that it cannot be done in less than 4 guesses?
Log in to reply
I don't have a proper proof that it cannot be done in less than 4 guesses. Ultimately, such a proof would likely be exhaustive case checking.
This question actually arose from complexity analysis in computing. It is interesting to study what the big O bound is for subsets of [ n ] elements.
Log in to reply
@Calvin Lin – What is the G that you are reffering to in the Note included in the question?
Hello can you pls insert
\\
between your latex for new line, I am unable to read on mobile i will have to read on computer
Log in to reply
Fixed my latex. You should see a table now
Could you please explain the though process behind choosing the subsets this way?
According to the table, if the response to the query is (1,1,1,1), S will not be unique. So, even with this procedure, don't you need more than 4 guesses ?
Log in to reply
I think the table is slightly off
I agree. But Robert's choice will work imo: "Let S, A, P, D, and C represent Sue, Arron, Pete, Dan, and Calvin. We can get enough information to know who all is in the subset by guessing (S,A,P,D,C), (P,D), (A,D), (S,D), which is four guesses."
Let S, A, P, D, and C represent Sue, Arron, Pete, Dan, and Calvin. We can get enough information to know who all is in the subset by guessing (S,A,P,D,C), (P,D), (A,D), (S,D), which is four guesses.
To prove that this works, consider 3 cases: if there are 5 people in the subset, if there are 4 people in the subset, and if there are 3 people in the subset. The 0, 1 and 2 people in the subset will all be inverses of the 5, 4, or 3 cases, so we can ignore those without loss of generality.
If there are 5 people in the subset, your first guess will tell you such, and you will know the exact subset.
If there are 4 people in the subset, of the (P,D), (A,D) and (S,D) guesses, we will have one of the following responses (not necessarily in order of guesses):
-All 3 guesses coming up 1 person, in which case we know that everyone but Dan is in the subset.
-2 guesses coming up with 2 people, the 3rd coming up with 1 person, in which case we know that the person in the guess that only had 1 person in the subset who isn't Dan is the only one not in the subset.
-All 3 guesses coming up as 2 people, in which case we know that Calvin is the only person not in the subset.
If there are 3 people in the subset, we have 2 cases, either:
The last 3 guesses all come up with 1 person, in which case we know that Dan and Calvin are the only ones not in the subset.
At least one of the 3 guesses comes up either 2 people or 0 people, in which case we can derive the status of Dan, and thus derive the status of Sue, Arron, and Pete, and Calvin would be whatever is left over.
Proving that we cannot do it in 3 guesses is a bit trickier, but here is how (i think, if i haven't made any mistakes, which i very well might have): firstly, look at people as if they are divided into groups with known total (a group being defined as a set of people who we know how many of them are in the initial subset). We want to get all of these groups into groups of size 1. Note that this does not imply that you need 5 guesses: by guessing (S,A,P) followed by (P,D,C) we have divided the people into 3 groups since we know what the group consisting of P's total is.
Firstly, we start by knowing that we need to guess everyone at least once to put everyone in a group. This leads to two cases: you guess everyone as your first guess, or it takes two guesses to put everyone into a group.
In the first case, we have everyone in one group to start with. We need to divide these people into groups of size 1. However, this is impossible in two guesses, as everyone will be divided into one of these groups: -in both the second and third guess -in the second, but not third guess -in the third, but not second guess -in neither the second or third guess Leaving aside the issue that the last group isn't necessarily guaranteed to have a known total, this is still only 4 groups, and we need 5, so guessing all 5 people at the start will not let know for sure who is in the subset.
If we use two guesses to group everyone, we are left with the possibilities of 3 groups of size 1,2,2 or 3 groups of size 1,1,3. We could divide the people into 2 groups, but having one person of intersection between your first two guesses is always better because you can then know wether or not that person is in the initial subset. For example, a guess of (S,A) followed by (A,P,D,C) is always better than (S) followed by (A,P,D,C) since they both provide the same information, except that the first one tells you wether or not Arron is in the initial subset.
Now, if the groups are 1,1,3, there is no way to divide the group of 3 into 3 groups of 1. If the groups are of sizes 1,2,2, then you would need to divide both groups of 2 into two groups of 1. The only way to possibly do this would be to guess one person from each group of 2. However, this does not tell you the answer in the case that both groups have 1 person in the initial subset and the third guess tells you that one of the people you guessed was in the initial subset.
Let be A = { a 1 , a 2 , a 3 , a 4 , a 5 } . Let be T the 'set of decision' such that T = { T 1 , T 2 , T 3 , T 4 } I choose at first T 1 = { a 1 , a 2 } . Than
1 a . ∣ T 1 ∩ S ∣ = 0 ⟹ a 1 ∈ / S A N D a 2 ∈ / S
2 a . ∣ T 1 ∩ S ∣ = 1 ⟹ a 1 ∈ S X O R a 2 ∈ S
3 a . ∣ T 1 ∩ S ∣ = 2 ⟹ a 1 ∈ S A N D a 2 ∈ S
1 a . and 2 a . tell us whether { a 1 , a 2 } ∈ S or not. Regarding 2 a . we don't know which one between a 1 and a 2 is in S , so we choose T 2 = { a 2 , a 3 } :
1 b . ∣ T 2 ∩ S ∣ = 1 ⟹ a 1 ∈ S X O R a 2 ∈ S X O R a 3 ∈ S
2 b . ∣ T 2 ∩ S ∣ = 2 ⟹ a 2 ∈ S X O R a 3 ∈ S
2 b . tells us that { a 2 , a 3 } ∈ S and a 1 ∈ / S . Regarding 1 b . we don't know which one among a 1 , a 2 , a 3 is in S , so we choose T 3 = { a 3 , a 4 } :
1 c . ∣ T 3 ∩ S ∣ = 1 ⟹ a 1 ∈ S X O R a 2 ∈ S X O R a 3 ∈ S X O R a 4 ∈ S
2 c . ∣ T 3 ∩ S ∣ = 2 ⟹ a 3 ∈ S X O R a 4 ∈ S
3 c . ∣ T 3 ∩ S ∣ = 0 ⟹ a 3 ∈ / S A N D a 4 ∈ / S
2 c . tells us that { a 1 , a 3 , a 4 } ∈ S , and a 2 ∈ / S . 3 c . tells us that a 2 ∈ S . Regarding 1 c . we don't know which one among a 1 , a 2 , a 3 , a 4 is in S , so we choose T 4 = { a 4 , a 5 } :
1 d . ∣ T 4 ∩ S ∣ = 1 ⟹ a 1 ∈ S X O R a 2 ∈ S X O R a 3 ∈ S X O R a 4 ∈ S a 5 ∈ S
2 d . ∣ T 4 ∩ S ∣ = 2 ⟹ a 4 ∈ S A N D a 5 ∈ S
3 d . ∣ T 4 ∩ S ∣ = 0 ⟹ a 4 ∈ / S A N D a 5 ∈ / S
1 d . tells us that S = { a 1 , a 3 , a 5 } . 2 d . tells us that { a 2 , a 4 , a 5 } ∈ S and { a 1 , a 2 } ∈ / S . 3 d . tells us that { a 3 , a 1 } ∈ S and { a 2 , a 4 , a 5 } ∈ / S . I didn't list all possible 2 5 sets S , but just the { 1 , 1 , 1 , 1 , } situation that leads to S = { a 1 , a 3 , a 5 } . Each S , infact, could be see as a sequence of { d 1 , d 2 , d 3 , d 4 } where d i = d i m ( T i ∩ S ) , i = 1 , . . . , 4 .
Note: Instead of "dim" which refers to the dimension (of a vector space), you actually want ∣ ⋅ ∣ , which counts the number of elements in the set.
Nice algorithmic setup, but it would be easier to read if you broke down the cases into explicit steps. Currently, it is hard to visually trace through what you are doing, e.g. the "Regarding 1" could refer to several 1's>
Log in to reply
I just fixed both the 'dim' problem and the cases notation, hope it'll be a bit clearer now. Thank you for your reporting!
There are 5 elements in the set. Any time you guess, he´ll tell you if you are right or wrong. As there are 5 elements, if you guess 4 times, you already know how many elements are in T. That´s the minimum, anymore than that and you are already guessing all the elements, and there´s no game. Less than that, and you could still leave any other combination.
Example please?
Log in to reply
You already solved the question, why do you want an example?
Log in to reply
If you have three elements on a set S, and you´re gonna make a subset T of them - I would only have to guess twice to know all the elements of subset T. Number of elements of the set - 1.
Because i do not understand it
I'm afraid I do not understand your solution.
Can you explain what your subsets T are? Note that all you know is the number of elements in the intersection, as opposed to knowing exactly who is in the intersection.
Log in to reply
Calvin, why do I have to explain it to you? You are the creator of the question. It is already solved, and lots of people provided explanation. I´m just appending a footnote here. If you don´t like the solution, perhaps it is useful for someone else.
"Any time you guess, he will tell you if you are right or wrong"
Not true. I only know about those specific people which i guessed.
"As there are 5 elements, if you guess 4 times, you already know how many elements are in T."
No, not all four guesses tell you how many elements are in T. I could guess as my first 4 guesses Sue, then Arron, then Pete, then Dan, and i wouldn't know about calvin.
"That's the minimum,"
This is unsubstantiated. You haven't proven this.
"less than that, and you could still leave any other combination."
Again, this is an unproven assertion.
[This is not a solution.]
Clearly, at most 5 guesses are needed, where you make the guesses of {Sue}, {Arron}, {Pete}, {Dan}, {Calvin}. This would tell you which people are in S , and who are not in S , thereby determining S .
However, we can actually do slightly better, and need at most 4 guesses. (See Agnishom's solution)
I'm not sure why 3 guesses is insufficient, and that has yet to be demonstrated.
I am unsure how to prove, but i took all five elements as my first guess, then i would thus get an analysis of number of people in subset then, i manually checked cases if you relied 4 or 3 or 2 or 1 i would have to take subset of 3 people to get minimum of 3 extra guesses.
Log in to reply
My approach was similar to yours. I like @Agnishom Chattopadhyay 's solution better :)
I've found an exhaustive proof, I will post it
Problem Loading...
Note Loading...
Set Loading...
Here is an algorithm which can guess any subset in 4 guesses.
You should be able to reason out the chosen subset.
Now here is a list of the answers you can get for every possible subset.
⎝ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎛ ( A , B , C , D ) ( 0 , 0 , 0 , 0 ) ( 1 , 0 , 1 , 0 ) ( 1 , 0 , 0 , 0 ) ( 1 , 1 , 1 , 1 ) ( 0 , 1 , 0 , 1 ) ( 0 , 1 , 0 , 0 ) ( 2 , 0 , 1 , 0 ) ( 2 , 1 , 2 , 1 ) ( 1 , 1 , 1 , 1 ) ( 1 , 1 , 1 , 0 ) ( 2 , 1 , 1 , 1 ) ( 1 , 1 , 0 , 1 ) ( 1 , 1 , 0 , 0 ) ( 1 , 2 , 1 , 2 ) ( 1 , 2 , 1 , 1 ) ( 0 , 2 , 0 , 1 ) ( 3 , 1 , 2 , 1 ) ( 2 , 1 , 1 , 1 ) ( 2 , 1 , 1 , 0 ) ( 2 , 2 , 2 , 2 ) ( 2 , 2 , 2 , 1 ) ( 1 , 2 , 1 , 1 ) ( 2 , 2 , 1 , 2 ) ( 2 , 2 , 1 , 1 ) ( 1 , 2 , 0 , 1 ) ( 1 , 3 , 1 , 2 ) ( 3 , 2 , 2 , 2 ) ( 3 , 2 , 2 , 1 ) ( 2 , 2 , 1 , 1 ) ( 2 , 3 , 2 , 2 ) ( 2 , 3 , 1 , 2 ) ( 3 , 3 , 2 , 2 ) S { } { Sue } { Arron } { Pete } { Dan } { Calvin } { Sue , Arron } { Sue , Pete } { Sue , Dan } { Sue , Calvin } { Arron , Pete } { Arron , Dan } { Arron , Calvin } { Pete , Dan } { Pete , Calvin } { Dan , Calvin } { Sue , Arron , Pete } { Sue , Arron , Dan } { Sue , Arron , Calvin } { Sue , Pete , Dan } { Sue , Pete , Calvin } { Sue , Dan , Calvin } { Arron , Pete , Dan } { Arron , Pete , Calvin } { Arron , Dan , Calvin } { Pete , Dan , Calvin } { Sue , Arron , Pete , Dan } { Sue , Arron , Pete , Calvin } { Sue , Arron , Dan , Calvin } { Sue , Pete , Dan , Calvin } { Arron , Pete , Dan , Calvin } { Sue , Arron , Pete , Dan , Calvin } ⎠ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎞
Since, for every possible subset, (A,B,C,D) is unique as in the list, the algorithm works