Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: 1 2 [All]

Author Topic: Riddle I heard, and came up with a solution for  (Read 10588 times)

0 Members and 1 Guest are viewing this topic.

-Stef-

  • 2012 & 2016 DS Champion
  • *
  • Offline Offline
  • Posts: 1574
  • Respect: +4419
    • View Profile
Riddle I heard, and came up with a solution for
« on: September 12, 2012, 08:23:39 am »
0

Suppose you're in a group of 200 people in a room. Everyone is handed out a random unique dominion card (yes they just bought DA).
In the next room, someone put another copy of the same 200 dominion cards in 200 envelopes, one in each.
Now one by one, a person is selected to go to the next room. In that room, he's allowed to look in 100 enveloppes. His task is to find the enveloppe containing his own card.
After looking at cards in enveloppes, this person will always put the cards back, leave the room in exactly the same state as it was before he came in, and leave the scene through the back door. No communication back to the group is allowed whatsoever.

You win if everyone in the group finds his own card. Your goal is to make a plan that maximizes this chance.

You are allowed to make a plan for all of the 200 people before the first one starts, and everyone else will do whatever you suggest. In this plan, you can assume some order on the enveloppes, so your instructions could include something like "open up the first enveloppe", "open up enveloppe 32 - 132" or "open up the first enveloppe, and if it's a card that costs $4 or more continue with enveloppe 67".

The solution has a theoretical upper limit of 50% because the first person has a 50% chance of failing no matter what you come up with. If everyone has a chance of 50%, your total score would only be 0.0000000000000000000000000000000000000000000000000000000000062%, rather disappointing. How high can you go?
Logged
Join the Dominion League!

Qvist

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2400
  • Shuffle iT Username: Qvist
  • Respect: +4085
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #1 on: September 12, 2012, 08:41:17 am »
0

Yeah, a rip-off of my thread. Just to be sure: "leave the room in exactly the same state as it was before he came in" means that no clues are allowed like putting a card in the envelope in a specific state.?
« Last Edit: September 12, 2012, 08:51:43 am by Qvist »
Logged

sitnaltax

  • Apprentice
  • *****
  • Offline Offline
  • Posts: 284
  • Respect: +490
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #2 on: September 12, 2012, 08:50:38 am »
0

Hints below.

Hint 1: Number the cards.
Hint 2: The chance of success can be brought surprisingly high.
Hint 3: Solve for a small number of cards, like 2 and then say 6. If you can solve it for 10, you can figure out the pattern.
Hint 4: Remember, you're not trying to maximize the number of correct guesses. You're trying to maximize the chance that everyone guesses correctly. You need to find a way to put all your eggs into fewer baskets.
Logged

nomnomnom

  • Swindler
  • ***
  • Offline Offline
  • Posts: 17
  • Respect: +2
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #3 on: September 12, 2012, 11:22:24 am »
0

Hint:
A person should assume that all previous persons guessed correctly because if one of them did not it is a failed attempt no matter what is done next.

Solution:
Let's say the first player took all the odd numbers. Then the second player should only choose even numbers because all of those are still possibly where his card is whereas one of the odd numbers is definitely a blank. It is the card of the first person after all.
For the third player it doesn't matter which card he chooses because 99 out of 100 odd numbers and 99 out of 100 even numbers could still be the right guess for him. The fourth player should act similarly to the second player and choose the cards that were not chosen by the third player. And so on.

Success rate=100/200 * 100/199 * 99/198 * 99/197 * 98/196 * 98/195 * ... * 2/4 * 2/3 * 1/2 * 1/1
                  = 1.1 * 10^-59

That is almost 20 times the success rate if all players choose randomly.

PS Of course it does not matter in which order the players are in or which subsets exactly are chosen. As long as there are 100 pairs of players so that the two players of each pair collectively look at all 200 cards it should work.
Logged

jeb56

  • Herbalist
  • **
  • Offline Offline
  • Posts: 6
  • Respect: +2
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #4 on: September 12, 2012, 01:30:37 pm »
0

I believe the chance of success is
<span style="color: #000000; background: #000000;" onmouseover="this.style.color='#FFFFFF';" onmouseout="this.style.color='#000000';"> removed</span>.

I apparently failed to copy the roll-over un-hiding accurately,  so I have removed my estimate. 

How should I format it, so that things are properly hidden?
« Last Edit: September 12, 2012, 01:37:45 pm by jeb56 »
Logged

Grujah

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2237
  • Respect: +1177
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #5 on: September 12, 2012, 01:41:02 pm »
0

[ spoiler][ /spoiler]

without the space.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9707
  • Respect: +10765
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #6 on: September 12, 2012, 01:45:18 pm »
0

Wait, if someone finds his own card, does he still put it back?
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

shMerker

  • Duke
  • *****
  • Offline Offline
  • Posts: 357
  • Respect: +389
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #7 on: September 12, 2012, 01:46:12 pm »
0

I apparently failed to copy the roll-over un-hiding accurately,  so I have removed my estimate. 

How should I format it, so that things are properly hidden?

Most forums strip out HTML so just use board code.

Code: [Select]
[spoiler]like this[/spoiler]
like this

Also there's a button that looks like this: that will make the spoiler tags for you.

[ spoiler][ /spoiler]

without the space.

The code tag is your friend.

It would be pretty slick if this board had a tag that could generate dominion costs like the ones on cards and in the rulebooks. Or at least coin and potion emotes.
« Last Edit: September 12, 2012, 01:49:18 pm by shMerker »
Logged
"I take no responsibility whatsoever for those who get dizzy and pass out from running around this post."

jeb56

  • Herbalist
  • **
  • Offline Offline
  • Posts: 6
  • Respect: +2
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #8 on: September 12, 2012, 01:47:26 pm »
0

I believe the chance of success is just over 30%.
Logged

shMerker

  • Duke
  • *****
  • Offline Offline
  • Posts: 357
  • Respect: +389
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #9 on: September 12, 2012, 01:50:25 pm »
0

Wait, if someone finds his own card, does he still put it back?

Does it matter? He leaves behind the envelope and doesn't tell anyone if he found it.
Logged
"I take no responsibility whatsoever for those who get dizzy and pass out from running around this post."

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9707
  • Respect: +10765
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #10 on: September 12, 2012, 01:57:19 pm »
0

Wait, if someone finds his own card, does he still put it back?

Does it matter? He leaves behind the envelope and doesn't tell anyone if he found it.

Well for one I was making sure he does leave the envelope behind... also, if someone opens an envelope and it is empty, this could theoretically be used as an instruction to look in a certain different envelope next...
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9707
  • Respect: +10765
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #11 on: September 12, 2012, 02:02:15 pm »
0

It would be pretty slick if this board had a tag that could generate dominion costs like the ones on cards and in the rulebooks. Or at least coin and potion emotes.

Yeah, that would be awesome. The Draw3Cards StackExchange site for Magic has that for Mana symbols and other things; it's awesome. We could always post these images inline:



Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Davio

  • 2012 Dutch Champion
  • *
  • Offline Offline
  • Posts: 4787
  • Respect: +3413
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #12 on: September 12, 2012, 04:52:29 pm »
0

It would be pretty slick if this board had a tag that could generate dominion costs like the ones on cards and in the rulebooks. Or at least coin and potion emotes.

Yeah, that would be awesome. The Draw3Cards StackExchange site for Magic has that for Mana symbols and other things; it's awesome. We could always post these images inline:




It makes a lot of the fan card descriptions a lot nicer to look at.

When I used to run a Poker forum, I included all the card and suit symbols.  :D
Logged

BSG: Cagprezimal Adama
Mage Knight: Arythea

Grujah

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2237
  • Respect: +1177
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #13 on: September 12, 2012, 04:59:20 pm »
0

It would be pretty slick if this board had a tag that could generate dominion costs like the ones on cards and in the rulebooks. Or at least coin and potion emotes.

Yeah, that would be awesome. The Draw3Cards StackExchange site for Magic has that for Mana symbols and other things; it's awesome. We could always post these images inline:




It makes a lot of the fan card descriptions a lot nicer to look at.

When I used to run a Poker forum, I included all the card and suit symbols.  :D

You've got those in unicode already, no?
Logged

Davio

  • 2012 Dutch Champion
  • *
  • Offline Offline
  • Posts: 4787
  • Respect: +3413
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #14 on: September 12, 2012, 05:03:39 pm »
0

Just the suits, but I had small images for each card.
Logged

BSG: Cagprezimal Adama
Mage Knight: Arythea

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9707
  • Respect: +10765
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #15 on: September 14, 2012, 09:06:49 am »
0

So..... solution?
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

SwitchedFromStarcraft

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1088
  • Respect: +856
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #16 on: September 14, 2012, 09:22:56 am »
0

It would be pretty slick if this board had a tag that could generate dominion costs like the ones on cards and in the rulebooks. Or at least coin and potion emotes.

Yeah, that would be awesome. The Draw3Cards StackExchange site for Magic has that for Mana symbols and other things; it's awesome. We could always post these images inline:





It makes a lot of the fan card descriptions a lot nicer to look at.

When I used to run a Poker forum, I included all the card and suit symbols.  :D
What poker forum did you use to run?
Logged
Quote from: Donald X.
Posting begets posting.

Quote from: Asper
Donald X made me a design snob.

There is a sucker born every minute.

Captain_Frisk

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1257
  • Respect: +1263
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #17 on: September 14, 2012, 10:17:46 am »
0

Wait, if someone finds his own card, does he still put it back?

Does it matter? He leaves behind the envelope and doesn't tell anyone if he found it.

Well for one I was making sure he does leave the envelope behind... also, if someone opens an envelope and it is empty, this could theoretically be used as an instruction to look in a certain different envelope next...

It makes a big difference.  Taking the envelope, or taking the card in the envelope is extra information that can be passed back.

Take a 4 player game for example: (Players can open 2 envelopes)


Before entering, agree on a number mapping system, so each card has a #

Player 1 opens the first envelope.  If it isn't his envelope, then he opens the envelope # corresponding to the card # he found in the first envelope.

If he loses - game over.

Assuming that he wins, Player 2 enters the room with 2 possibilities

1 - envelope 1 is missing
In this case player 2 does the same plan with envelope 2.  (only a 33% chance of being wrong)

2 - Another envelope is missing
If its envelope 2 - then player 2 knows that his card is in envelope 1
If its 3 or 4, then player 1 knows that E1 contains that #, and his card resides in one of the other 2, so he gets his card

Players 3 and 4 win by default.

So - with the ability to pass this information back, The team wins almost 46% of the time.  I started working out what that limit drops off to as N approaches 200, but got bored, and saw that it might be illegal.

If you don't have this ability - then the solution is different, and I'm curious to see what it is.
Logged
I support funsockets.... taking as much time as they need to get it right.

ehunt

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1528
  • Shuffle iT Username: ehunt
  • Respect: +1856
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #18 on: September 14, 2012, 01:27:53 pm »
0

With no information sharing I can get probability "number of permutations in Sn with no cycles of length greater than n/2" over n factorial, don't know a closed formula for that number though.
Logged

ehunt

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1528
  • Shuffle iT Username: ehunt
  • Respect: +1856
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #19 on: September 14, 2012, 01:28:48 pm »
0

(the method is a minor modification of frisk's, will type it when not phone posting.)
Logged

tyr10n

  • Pearl Diver
  • **
  • Offline Offline
  • Posts: 10
  • Respect: +1
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #20 on: September 14, 2012, 01:35:22 pm »
0

This was my favorite homework problem in the randomized algorithms class I took. The hint on the homework had us first solve a seemingly unrelated math problem:

What is the probability that a random permutation of 2n elements has be no cycle of length greater than n ?  The answer to this is 1 - 1/(n+1) - 1/(n+2) ... - 1/(2n) which is approximately 1 - log(2) or 31%

If the players use the right strategy this is the same as the probability of success.
« Last Edit: September 14, 2012, 01:36:45 pm by tyr10n »
Logged

Watno

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2745
  • Shuffle iT Username: Watno
  • Respect: +2983
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #21 on: September 14, 2012, 01:39:42 pm »
0

Taking the envelope provides additional information, taking the card out doesn't, because you know what card the people before you had to find and what envelopes they looked at (since they're all following the plan). So if you look into an envelope and see someone's card in there, and know that person looked at it, it's the same as the card missing. Don't see that helps though
Logged

Captain_Frisk

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1257
  • Respect: +1263
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #22 on: September 14, 2012, 01:43:20 pm »
0

If you want to be a jerk, it should be noticeable whether an envelope has or does not have a card in it. 
Logged
I support funsockets.... taking as much time as they need to get it right.

eHalcyon

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8689
  • Respect: +9187
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #23 on: September 14, 2012, 02:34:00 pm »
0

Taking the envelope provides additional information, taking the card out doesn't, because you know what card the people before you had to find and what envelopes they looked at (since they're all following the plan). So if you look into an envelope and see someone's card in there, and know that person looked at it, it's the same as the card missing. Don't see that helps though

No, taking the card out still provides info.  I don't have an idea of how it might be helpful, but the info is there.  Say player 1 looks in envelope 1, finds his card and removes it.  Then player 2 comes in and also looks in envelop 1 and sees that the card has been removed.  Now he knows that player 1's card was in that envelope, rather than some envelope down the line.  If the card was left there, player 2 would not have this info.  Again, I don't know how it could be helpful, but taking out the card can indeed provide additional information.
Logged

Captain_Frisk

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1257
  • Respect: +1263
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #24 on: September 14, 2012, 02:37:39 pm »
0

Taking the envelope provides additional information, taking the card out doesn't, because you know what card the people before you had to find and what envelopes they looked at (since they're all following the plan). So if you look into an envelope and see someone's card in there, and know that person looked at it, it's the same as the card missing. Don't see that helps though

No, taking the card out still provides info.  I don't have an idea of how it might be helpful, but the info is there.  Say player 1 looks in envelope 1, finds his card and removes it.  Then player 2 comes in and also looks in envelop 1 and sees that the card has been removed.  Now he knows that player 1's card was in that envelope, rather than some envelope down the line.  If the card was left there, player 2 would not have this info.  Again, I don't know how it could be helpful, but taking out the card can indeed provide additional information.

Whether the envelope contains card#1 or empty - its the same.  Actually leaving the card in provides more information, as player 3 would know which card it was, vs just 2 empty envelopes.

Each new player needs to assume that everyone before them has already won... otherwise its a waste of his time.
Logged
I support funsockets.... taking as much time as they need to get it right.

Insomniac

  • Jester
  • *****
  • Offline Offline
  • Posts: 785
  • Respect: +392
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #25 on: September 14, 2012, 02:51:16 pm »
0

Before selecting envelopes hold the envelope up to the light to see inside the envelope.

100% success rate.
Logged
"It is one of [Insomniacs] badges of pride that he will bus anyone, at any time, and he has done it over and over on day 1. I am completely serious, it is like the biggest part of his meta." - Dsell

eHalcyon

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8689
  • Respect: +9187
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #26 on: September 14, 2012, 02:52:29 pm »
0

Taking the envelope provides additional information, taking the card out doesn't, because you know what card the people before you had to find and what envelopes they looked at (since they're all following the plan). So if you look into an envelope and see someone's card in there, and know that person looked at it, it's the same as the card missing. Don't see that helps though

No, taking the card out still provides info.  I don't have an idea of how it might be helpful, but the info is there.  Say player 1 looks in envelope 1, finds his card and removes it.  Then player 2 comes in and also looks in envelop 1 and sees that the card has been removed.  Now he knows that player 1's card was in that envelope, rather than some envelope down the line.  If the card was left there, player 2 would not have this info.  Again, I don't know how it could be helpful, but taking out the card can indeed provide additional information.

Whether the envelope contains card#1 or empty - its the same.  Actually leaving the card in provides more information, as player 3 would know which card it was, vs just 2 empty envelopes.

Each new player needs to assume that everyone before them has already won... otherwise its a waste of his time.

But I've kept that assumption.  Finding an empty envelope gives you the info that a previous player found their card in that envelope, rather than a different envelope down the line.

Eh, maybe it's not giving more info, but just different info.
Logged

ehunt

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1528
  • Shuffle iT Username: ehunt
  • Respect: +1856
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #27 on: September 14, 2012, 03:34:26 pm »
+3

Full solution (assuming cards aren't removed). My write-up assumes familiarity with the symmetric group. I also don't know a proof that this is the theoretically best-possible solution.

The participants agree on an explicit ordering on the envelopes and cards (equivalently, the envelopes and the participants) ahead of time. The strategy will be: participant number j waltzes straight to the envelope marked j and looks for her card. If she finds card k in envelope j, she opens envelope k next. She proceeds in this way until she finds her card (or loses the game for the team).

That's it. The reason the odds that this succeeds are approximately 30% is as follows: we have a permutation f of the set {1, 2, ..., 200} given by the rule "if envelope number j contains card number k, then f(j) = k." Notice that the participants succeed using the given strategy if and only if this permutation does not contain a cycle of length greater than 100, since the strategy just has the participant loop in order through the cycle containing her number. So we just need to count these permutations. If a permutation in S_{2k} has a cycle of length greater than k, then it only has one such cycle. So the number of permutations of length m, where m > k, is given by the following formula (explained below):

(2k choose m)(m!/m)(2k-m)!

(Explanation of formula: we choose m elements to be "in" the cycle. We can order them in m! different ways, but two orderings are the same cycle if they differ by the n trivial reorderings which "cycle" the elements (couldn't think of a better verb there, sorry), so we divide by n. The (2k - m) elements that are "out" of the cycle can be grouped in any permutation in S_{2k - m}.

This formula simplifies to the much nicer looking

(2k)!/m.

So the probability that a permutation contains an m-cycle (i.e. is bad for our participants) is just 1/m, since there are (2k)! total permutations.

Thus our participants have probability 1/(k+1) + 1/(k+2) + ... + 1/(2k) of failing. This is a right-hand Riemann sum approximating the integral from k to 2k of dx/x, so is close to log(2k) - log(k) = log(2), which is where the 30% comes from (there are other ways to connect this sum to log(2) as well).


 
« Last Edit: September 14, 2012, 03:38:00 pm by ehunt »
Logged

Schneau

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1174
  • Shuffle iT Username: Schneau
  • Respect: +1461
    • View Profile
    • Rainwave
Re: Riddle I heard, and came up with a solution for
« Reply #28 on: September 14, 2012, 08:29:43 pm »
0

Full solution...

This is so cool. At first I was "what" and then I was "how does that work" and then I was "I get it, that's awesome!".

The thing that you didn't explicitly say that I was having trouble with was: What if you finish a cycle - how do you choose which envelope to pick next? After thinking about it, I realized that if you finish the cycle, you have found your card, since your card is j and the first envelope you chose was j, meaning to cycle you have to find your card! You did say this, but in fewer and less explicit words. Great job, I'm convinced!
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Riddle I heard, and came up with a solution for
« Reply #29 on: September 15, 2012, 04:53:21 am »
0

Why do. I loop through a cycle containing my number and not through any other cycle?
Edit: got it. It's almost magic.
Edit2:to explain. By construction, the last card of the cycle is the one you are looking for.
« Last Edit: September 15, 2012, 05:00:33 am by DStu »
Logged
Pages: 1 2 [All]
 

Page created in 0.155 seconds with 20 queries.