I want to simulate rolling a 20-sided die twice using a deck of cards numbered 1-20, where each card is removed from the deck and put aside once drawn. I can think of two ways which should preserve the 1/400 odds of getting any duplicate value.
Method 1) Draw one card each from two decks of 20 cards. I don’t want to do this because it’s too many cards.
Method 2) Draw one card from a deck of 20 cards. After the draw, insert a card marked “duplicate” (D) into the deck. If D is drawn, it has the value of the first draw.
This method is a bit slow for my liking because it would necessitate reshuffling the deck after inserting the duplicate card.
So what happens if D is in the deck from the beginning? Now there’s a 1/21 chance of drawing D on the first draw but, if you do, a 100% chance of the next draw forming the duplicate. There’s a 20/21 chance of not drawing D on the first result, and then a 1/20 chance of getting it on the second.
How does this work out relative to the simple dice rolls?
Feel free to show your work, but I am unlikely to grok any of it.
are 1/20, not 1/400, because out of 400 possible outcomes you can get 1–1, 2–2, …, 20—20.
Now, if you have a deck of cards 1–20, you shuffle the deck, and pick a random card, that seems more or less equivalent to a roll of the die. I’m not sure what the difference is between repeating the procedure, versus destroying that card but replacing it with a new card labelled “D”.
But you say you want to make this happen using a single shuffle. A deck of 400 cards would obviously work. Your description of a 21-card deck sounds different, though. Could you please clarify what is the set of all possible outcomes, and what probability distribution you want on them?
Step 1) Prepare 20 card deck
Step 2) Shuffle
Step 3) Select 1 card by your preferred random method (off the top or randomly selected in the middle or whatever)
Step 4) Record the result
Step 5) Shuffle the 20 cards again
Step 6) Select 1 card by your preferred random method
Step 7) Record the result
You now have 2 simulated rolls of a single D20 die.
The shuffle is equivalent to rolling the die. If you want a single shuffle, you only have a single die roll. There’s no way to have an equivalent situation without the additional randomization.
You can also have 2 sets of 20 cards, as you mentioned, which would be equivalent (there’s a separate shuffle for each, i.e. 2 rolls).
Yes, but I want to set the cards aside. When the process is over, I want two physical cards which have been drawn from the deck.
I know the process is convoluted. But I also only want to know the odds for the situation I described. Or, really, I just want to know if my idea is equivalent or not. Like Han Solo, I don’t actually need to know the odds.
Well, for starters, if you have a deck of 21 cards and randomly choose 2, note that there are only (21*20)/2 = 210 ways to do that, not 400. You are correct that 20 of them would feature a “D”, though.
There are only 210 physical combinations of cards, but still 400 numerical combinations, yes? Since D’s value is a variable of 1-20 which isn’t set until a second card is revealed?
The thing is - forget simulating 2 D20 dice. That’s no longer the case here. The distribution won’t be too close, either.
The question now is: how different is this method? Pretty different.
You can take a simple example to see how.
There are 400 possible outcomes of rolling 2 D20 dice. There are C(21,2) = 210 ways of picking 2 cards out of 21.
What are the chances of rolling 2 natural 20s with the dice? It’s (1/20)*(1/20) = 1/400 or 0.25%. That’s simple enough.
With the 21 cards, there you can draw the 20 first and then the D. Or you can draw the D first and then the 20. But both count the same out of the 210. That’s 1 way out of 210, or ~0.48% or nearly 2 times as likely as with the dice.
Other combinations will also come out pretty different as well. For example, you can roll a 9 and a 10. If you don’t care which die shows which, there are 2/400 = 0.5% chance of doing this.
With the 21 cards, there are still one way 1 to do this where order doesn’t matter but out of 210 rather than 400, so 1/210 or ~0.48% as with the 2 “20s”, or nearly the same likelihood.
Note: edited my original post - I got permutations and combinations mixed up.
But like I said above - there are 210 physical combinations but still 400 possible outcomes due to the addition of a variable. That doesn’t affect anything?
So I guess I’m asking whether the odds of any particular combination of values are the same as the odds of any particular combination of cards.
If there isn’t a solution that allows shuffle → draw → draw I’m not going to bother and I’ll just roll two dice instead.
That’s where I was going with my example. The number of results may be the same but the likelihood of each result is not. As I showed, 2 natural 20s are nearly twice as likely with this card scheme compared to rolling 2 dice.
If you just want a method that is capable of generating the same set of outputs, this works. But if you also want the probabilities to match up, this does not work, and can be significantly different in some cases.
By and large, you need the randomizations to line up to have a good chance that the probabilities line up. Two dice = two randomizations. One shuffle = one randomization.
Of course, another way of doing this that would work better with 1 shuffle (still a bit different) is doubling the number of cards (this was mentioned above but dismissed for some reason?). Take 40 cards (two each of 1-20), shuffle once, and pick the top two cards off the deck.
The only way to match exactly with one shuffle is have 400 cards, each of which correspond to a single throw of the 2 dice.
Your 400 dice outcomes take order into account (i.e. rolling first 7, then 8 is counted separately from rolling first 8, then 7), but your 210 ways of picking two cards does not.
The way I analyzed it, when you roll two dice, you have a 1/20 chance of rolling doubles.
When you pick two cards from 21, you “roll doubles” if and only if one of the two cards you pick is the D card. There are 20 sets of two cards that include the D card, out of 210 in all, so your probability of “rolling” doubles with cards is 20/210 = 2/21, which is not equal to 1/20.
I broke it down above to the specific case of double 20s (~2x as likely with the 21 cards than dice - 1/210 vs 1/400) but the ratio of odds is not all that different if you want to consider all 20 possible doubles collectively. Still works out to not quite twice as likely with the 21 cards.
Yeah, both analyses work to show that this particular card-picking method is not equivalent to rolling dice. Mine was just the first that came to my mind.