The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

34

I'm going to assume Alice looked at the cards and chose which one to give back to you. The key to the puzzle is then to encode a single card's suit and value in 4 cards without the luxury of choosing those 4 cards arbitrarily from the whole deck. The suit is easy. In 5 cards there must be a double of at least one suit. So the first (or last, but I'll choose ...


25

It changes...


20

The probability is If you


18

This game is actually... Therefore,


17

If we take the IDs to be and the result to be then you can find the card IDs by and the number will be at most We can actually do better than this while using the same basic idea: A little better: The crude information-theoretic lower bound for the maximum hand ID is so there is quite a lot of scope for improvement here.


17

Bonus:


16

Here is my answer: Key Item 1: Key Item 2: Key Item 3: Key Item 4: Key Item 5:


16

If cards are not prearranged then it is impossible to do this trick. It is so simple arrangement that you wouldn't notice. Because Lan got your card by This way


13

The final answer is: The clue "listen" pertains to audio files embedded in the images. The legend for the blue layer is four cards. The file is an OGG Opus file. The audio is someone saying "If you haven't found any clues yet, here's what you should be looking for" followed by what sounds like a dial up modem (yes I'm that old). The blue layer ...


12

Use a random source to pick a number from 2 to 13. If it is equal or less than the value of the card you picked, keep the card. If it is greater, switch. Thus, if you turned over a 1, you always switch; and a 13, you never switch. If the card numbers are $a$ and $b$, with $a > b$, then you win if you flip $a$ ($50\%$ chance) and don't switch (...


12

Here is a permutation that works upto n=12: 1 6 11 4 5 10 15 8 9 14 19 12 13 18 23 16 17 22 27 20 21 26 31 24 25 30 35 28 29 34 39 32 33 38 43 36 37 42 47 40 41 46 51 44 45 50 3 48 49 2 7 52 Essentially, keep the first and fourth cards with same rank in its place. And permute the second cards of all ranks cyclically, and the third cards of all ranks ...


12

Strategy without the Joker Say you take any five cards from a deck. Since there are only 4 suits, there must be at least two of them which have the same suit. One of these will be our chosen card that we will get the magician to guess. If you pretend the cards are the numbers on a clock (with an extra number since there are 13 values), then the most ...


12

Assuming each player wants to maximize their personal win probability for the single game... The reason I chose this approach is


11

This is a great card trick known as Fitch Cheney's Five Card trick. Alice selects the fifth card to be identified and arranges the remaining four cards in a specific sequence. Then Bob interprets the four card sequence and identifies the fifth card. Here are a few references that describe how to sequence the four cards: Batman on wordpress Gray Matters ...


11

Assuming he respects his friends, he assumes they play just as he will. In order for him to have the highest chance of victory, he needs to be able to select each card with a random probability. The probability of victory after selecting each card, therefore, is dependent on the probability he will select the other cards. The probability of victory if he ...


10

Answer: The strategy:


10

The criterion was: Note:


10

Let us begin with this observation: with 13 pair of cards in play, that accounts for every card in the half-deck. There are no cards remaining out of play. So let's construct a scenario in which the game would never stop. To make that happen, each player must have one high card (say, above a 7) and one low card (7 or below). Since each player has a high ...


10

6 rounds have been played and no-one has any voids before you sit down. There are therefore at most 1 round of spades and hearts (if there were 2 then 8 cards are played + 4 visible + 2 with the opponents =14), and 2 rounds of diamonds and clubs. The only way to get to 6 is if exactly those were played, meaning that before you sat down there had been 1 ...


9

Here's a proof that 26 right answers is optimal for the worst case. The adversary splits the deck into 13 packets of four cards of different suits, and stacks them on top of each other. Houdini, of course, knows this, and this restriction can only help Houdini. Without loss of generality for the worst case, Houdini's strategy is deterministic, and the ...


9

Assuming the cards aren't replaced, you would need to take In order to be sure that you have three cards where the digits add up to the same number. Explanation:


9

Stealing from 2012rcampion's answer, we need to create a one-to-one mapping from five-card hands to four-card messages (four cards plus permutation). By symmetry, each four-card message can be mapped to an equal number of five-card hands, so by the regular version of Hall's Theorem there must exist such a one-to-one mapping (this is laid out in more detail ...


9

If your "Statistics intuition" is broken (like mine), here's a simpler example that might make it more clear. I have a deck of 5 cards, numbered 1-5. My single opponent and I each draw a card, and the higher card wins. I've draw a 4! My odds of winning, with a normal deck, are 75%, since the only card my opponent can win with is the 5. Buuuut one of the ...


8

With $M$ stacks we can sort $F_M$ numbers (where $F_M$ is the $M$-th Fibonacci Number) This is an answer for the call for generalization in OP's answer, by generalizing his/her method. For comparison with other answers, the asymptotic $N$ as $M$ goes to infinity is $C\varphi^N$ (where $\varphi$ is the golden ratio: $1.61803398875\ldots$) for some constant ...


8

The best strategy I have found in terms of maximizing average number of tricks is as follows but I believe there is likely a better one: I assigned each turn a value $N$ such that for turn $n$, $N=n*14 \mod 52$. Simularly each card was assigned a number $C$ such that (for instance) a 5 of hearts is $C=0*13+5-1=4$ while a Jack of spades is $C=3*13+11-1=49$. ...


8

No amount of in-shuffles and out-shuffles will approach a random shuffle. Let's say that two cards mirror each other if they are the same distance from the middle of the deck. This means that the $i$th and $j$th cards from the top mirror each other if and only if $i+j=53$. If two cards mirror each other, then after the deck is either in-shuffled or out-...


8

She knows your card because The key moment is at


7

Constraint 1 leaves 10 possibilities: red A, red K, red Q, blue A, blue Q, orange A, orange K, green A, green K, green J. Among these 10, 4 are aces, 3 are kings, 2 are queens, and 1 is a jack. If I'm interpreting the meaning of 'more likely' correctly, this means the card is 'more likely' to be an ace (than anything else), so constraint 2 means it's a ...


7

Solitaire games that are entirely deductive like you mentioned will usually have all their cards exposed at the beginning. Games like that are called perfect information games – a term usually used in two-player game theory, but in the case of Solitaire applies to games where the position of all the cards is known. However, it's not always the case ...


7

Most patience games, as you've noted, require logical deduction, but most still require a degree of luck. Spider Solitaire and Mrs. Mopp come close to being solely skill-based, but are both still vulnerable. FreeCell is another game for which almost all games are thought to be playable, though the proportion has not yet been calculated. A rough estimate of ...


Only top voted, non community-wiki answers of a minimum length are eligible