Yes, you’re right—formulated slightly differently, but equivalent.
In case anyone is interested, I found that “clever way to get an exact value”:
First, factor out the common factor of \frac{20}{21} to get (\frac{20}{21}) \sum_{n=1}^{\infty} n(\frac{1}{21})^{n-1}.
To evaluate this infinite sum, note that the geometric series \sum_{n=0}^{\infty}x^n has sum \frac{1}{1-x} when |x| < 1.
If f(x) = \sum_{n=0}^{\infty}x^n = \frac{1}{1-x} then f'(x) = \sum_{n=0\text{ or }1}^{\infty}nx^{n-1} = \frac{1}{(1-x)^2}.
When x = \frac{1}{21} this evaluates to \frac{1}{(1-(\frac{1}{21}))^2} = \frac{1}{(\frac{20}{21})^2}.
So (\frac{20}{21}) \sum_{n=1}^{\infty} n(\frac{1}{21})^{n-1} = (\frac{20}{21})\frac{1}{(\frac{20}{21})^2} = \frac{1}{(\frac{20}{21})} = \frac{21}{20} = 1.05.
ETA: I realized my new idea was already rejected in the OP.
I think this works: It’s equivalent to having a Red Deck and a Black Deck, shuffling both, and then taking the top card of each. The only difference is that you merge the two decks so you can shuffle them both at the same time.
Note, of course, that though this meets the OP’s stated criteria, it is nonetheless less efficient than the multiple-shuffling solutions, because thoroughly shuffling a deck of 40 cards is more work than thoroughly shuffling two decks of 20 cards each.
Can you explain why, or provide a cite?
Basically, because a shuffled deck of 40 cards contains more information than two decks of 20 cards each. If I tell you what order the red cards are in relative to other red cards, and what order the black cards are in relative to other black cards, I still haven’t told you what the sequence of reds and blacks is. By shuffling the full 40 card deck, you need to randomize that last part, too, even though the problem doesn’t require it.
Okay, I see that, but what isn’t clear to me is how/whether the amount of information contained translates to the amount of work required.
Part of the problem is that “work” in this context isn’t well-defined. But what if we look at the number of shuffles required? It’s widely reported that 7 shuffles are required to thoroughly randomize a standard deck of 52 cards. I was able to find numerous cites of this, with explanations of why and caveats about the method of shuffling used. But I was less successful in finding the number of shuffles required for decks of other sizes. If 7 shuffles are required for a 52-card deck, how many shuffles are required for a 20-card deck and a 40-card deck?
I did find this cite that claims that “about ten riffle shuffles are usually necessary and sufficient to completely shuffle four decks” (208 cards). It looks to me like that means that it is more work to shuffle two separate decks of 52 cards than to shuffle one deck of 208 cards, let alone one deck of 104 cards. This would lead me to suspect that it takes more work to shuffle two decks of 20 cards than to shuffle one deck of 40 cards.
Can I ask one clarifying question - because it’s not completely clear to me exactly what you’re trying to find.
Do you want:
- a draw deck equivalent of two independent, ordered d20 rolls, where (for example) 7 followed by 12 is different from 12 followed by 7; or
- a draw deck equivalent of the sum of two independent d20 rolls (i.e. 2d20 in AD&D lingo)
I think the procedure you outlined in your first post will get you the second, but not the first.
Ok, thinking about this in another way: Is there an N and K such that N choose K is a multiple of 400 (or close to it) and N and K are relatively small?
If so, then is there a way to map the 400 choices onto the set of K cards in a way that doesn’t require some arcane lookup method to turn it into two numbers in [1,20]?
14 choose 5 is 2002, which gives you 5 encodings for each of the 400 possible dice rolls we want to encode, with only two NULLs.
So, make your deck of 14 cards, draw 5 of them, convert to your die roll, and you’re good. You’ll have to reshuffle 1 in every 1000 times, but you also only have to shuffle 14 cards, so think how many fewer cards you’ll have to shuffle!
The process of mapping 5 cards into 400 outputs is left as an exercise to the reader. So far I’ve thought of some dumb ways to do it, but there may be a clever way I’ve not yet thought of.
Have a twenty-one card deck; one through twenty plus a “duplicate” card.
Draw your first card and put it aside. Draw your second card.
If either of your cards is the duplicate then treat it as a copy of the other card you drew, which must be a number.
ETA: removed snark. Apologies.
That has been suggested and rejected above.
Odds of snake eyes is 2/420, not 1/400.
The second. I need two independent results, but order doesn’t matter.
Is that because you’re always using the sum, or the max of the two, or the min of the two, or something else?
No. Both values need be reserved for independent use at a later point.
So: if they are used independently, it sounds like the order does - or will - matter.
Or will you use (for example) the highest, followed by the lowest? Will there be some other ordering you use for these values that isn’t “this one was rolled first”?
The order isn’t relevant.
Basically, it’s for a game. Two d20s are rolled. At any time in the future, the player may substitute the value of either die for other rolls. It’s a two-value ‘bank’ of replacement values for future dice rolls.
I think it would work OK with the 20 red + 20 black cards. If you shuffle each stack separately, the player could even just pick one from each, without having to examine or reject any.
OK, I get it now. Plus, that’s a nice mechanic - just have the two cards out in the middle and a player can take the “duplicate” card first. As long as you exhaust the “bank” before replacing it, it works very elegantly.