<p>I wrote a small python script to enumerate all hands and count how many hands were successes. Here are the results:</p>
<pre><code>DECK:  AAABBBCCDEEEFFGGGHHHIIIJJJKKKLLLMM
SUCCESSES:  AB AC EF GL FED FB AJ EJ KJ FJ BJ CJ KHA KIA KHF KIF KHE KIE KHB KIB KHC LIC
N CARDS IN DECK:   34
N CARDS IN HAND:   5
HANDS SUCCESSFUL:  218223
TOTAL HANDS:       278256
PROBA OF SUCCESS:  0.7842526306710368
</code></pre>
<p>Importantly, note that there are 34 cards in the deck, not 44 as you claim.</p>
<p>Putting aside the part of the script I used to parse your question to build the deck and the reference list of successful combinations, here is the part of the code that makes the computations:</p>
<pre><code>from itertools import combinations
from collections import Counter
from math import comb

def is_success(hand, successes_ref):
    return (hand['M'] &lt; 2) and any(s &lt;= hand for s in successes_ref)

def count_successes(deck, n_cards_in_hand, successes_ref):
    return sum(
        is_success(Counter(hand_tuple), successes_ref)
        for hand_tuple in combinations(deck, n_cards_in_hand)
    )

def total_hands(deck, n_cards_in_hand):
    return comb(len(deck), n_cards_in_hand)
</code></pre>

CC BY-SA 4.0
2023-06-09T17:25:23.947Z
2023-06-09T17:30:49.077Z
2023-06-09T17:30:49.077Z
Stef
<p>Note: I know what a multivariate hypergeometric calculator is.</p>
<p>Game: Yugioh</p>
<p>The deck size/ population is 44 cards. The hand size is 5. For both of these, I'd like to also calculate the odds for different numbers.</p>
<p>The deck has the following variables:</p>
<p>A x 3</p>
<p>B x 3</p>
<p>C x 2</p>
<p>D x 1</p>
<p>E x 3</p>
<p>F x 2</p>
<p>G x 3</p>
<p>H x 3</p>
<p>I x 3</p>
<p>J x 3</p>
<p>K x 3</p>
<p>L x 3</p>
<p>M x 2</p>
<hr />
<p>Success combinations are as follows:</p>
<p>((A + B)), ((A + C)), ((E + F)), ((G + L)), ((F + E + D)), ((F + B)), ((A + J)), ((E + J)), ((K + J)), ((F + J)), ((B + J)), ((C + J)), ((K + H + A)), ((K + I + A)), ((K + H + F)), ((K + I + F)), ((K + H + E)), ((K + I + E)), ((K + H + B)), ((K + I + B)), ((K + H + C)), ((L + I + C))</p>
<p>Each of these are only successes if I do not draw both M samples</p>
<hr />
<p>My issue is that a hand can have multiple combo's with an overlapping card; i.e. a hand can have both ((A + B)) and ((A + C)), with either 1 A shared between them, or 2 or 3 A's, for example.</p>
<p>I believe I know exactly what I find out, but I'm unable to articulate it enough to search for it effectively it seems. This should be enough to answer, but if it's easier to know exactly what I'm playing, it's a Dino deck; Animadorned Archosaur x3, Babycerasaurus x3, Petiteranodon x2, Giant Rex x1, Miscellaneousaurus x3, Souleating Oviraptor x2, Scrap Raptor x3, Scrap Chimera x1, Maxx C x3, Ashe Blossom x3, Fossil Dig x3, Terraforming + Lost World x3 (total), and Small World x3. The card I can't draw exactly 2 of Double Evolution Pill, and along with other cards it's 44 total.</p>

CC BY-SA 4.0
2022-07-24T20:45:58.130Z
What does it mean to have both `((E + F))` and `((F + E + D))` listed in your success combinations?
Philip Kendall
CC BY-SA 4.0
2022-07-24T21:41:59.220Z
I'm not entirely sure if it is a meaningful difference to be honest
Christopher McCauley
CC BY-SA 4.0
2022-07-25T01:50:09.183Z
@ChristopherMcCauley: However, it most certainly ***will be*** a meaningful difference in the calculation if the specification is not precise and unambiguous.
Forget I was ever here
CC BY-SA 4.0
2022-07-25T10:07:17.063Z
If you are fine with an approximated chance, a simulation that draws your starting hand a few million times and compares against success combinations might work as well
Zibelas
CC BY-SA 4.0
2023-06-09T17:26:48.540Z
*"The deck size/ population is 44 cards."* No, it's not. It adds up to 34.
Stef
CC BY-SA 4.0
2023-06-09T17:32:36.710Z
@Zibelas The total number of hands is 44 choose 5 = 1 million, so drawing a few million random hands actually takes longer than enumerating all hands ;-)
Stef
CC BY-SA 4.0
2024-05-03T08:31:25.663Z
Hi. Can you confirm whether the number of cards is 44 or 34?
Stef
<yu-gi-oh><probability>
How do I calculate the odds of any one of several card combinations?
Christopher McCauley
# How do I calculate the odds of any one of several card combinations?

(Asked by: username_0 on 2022-07-24)

Note: I know what a multivariate hypergeometric calculator is.

Game: Yugioh

The deck size/ population is 44 cards. The hand size is 5. For both of these, I'd like to also calculate the odds for different numbers.

The deck has the following variables:

A x 3

B x 3

C x 2

D x 1

E x 3

F x 2

G x 3

H x 3

I x 3

J x 3

K x 3

L x 3

M x 2

---

Success combinations are as follows:

((A + B)), ((A + C)), ((E + F)), ((G + L)), ((F + E + D)), ((F + B)), ((A + J)), ((E + J)), ((K + J)), ((F + J)), ((B + J)), ((C + J)), ((K + H + A)), ((K + I + A)), ((K + H + F)), ((K + I + F)), ((K + H + E)), ((K + I + E)), ((K + H + B)), ((K + I + B)), ((K + H + C)), ((L + I + C))

Each of these are only successes if I do not draw both M samples

---

My issue is that a hand can have multiple combo's with an overlapping card; i.e. a hand can have both ((A + B)) and ((A + C)), with either 1 A shared between them, or 2 or 3 A's, for example.

I believe I know exactly what I find out, but I'm unable to articulate it enough to search for it effectively it seems. This should be enough to answer, but if it's easier to know exactly what I'm playing, it's a Dino deck; Animadorned Archosaur x3, Babycerasaurus x3, Petiteranodon x2, Giant Rex x1, Miscellaneousaurus x3, Souleating Oviraptor x2, Scrap Raptor x3, Scrap Chimera x1, Maxx C x3, Ashe Blossom x3, Fossil Dig x3, Terraforming + Lost World x3 (total), and Small World x3. The card I can't draw exactly 2 of Double Evolution Pill, and along with other cards it's 44 total.

**Tags:** yu-gi-oh, probability

> **Comments:**
> **username_1**: What does it mean to have both `((E + F))` and `((F + E + D))` listed in your success combinations?  
> **username_0**: I'm not entirely sure if it is a meaningful difference to be honest  
> **username_2**: @ChristopherMcCauley: However, it most certainly ***will be*** a meaningful difference in the calculation if the specification is not precise and unambiguous.  
> **username_3**: If you are fine with an approximated chance, a simulation that draws your starting hand a few million times and compares against success combinations might work as well  
> **username_4**: *"The deck size/ population is 44 cards."* No, it's not. It adds up to 34.  
> **username_4**: @username_3 The total number of hands is 44 choose 5 = 1 million, so drawing a few million random hands actually takes longer than enumerating all hands ;-)  
> **username_4**: Hi. Can you confirm whether the number of cards is 44 or 34?  

---

## 1 answers

### Answer by username_4 on 2023-06-09. Score: 2

I wrote a small python script to enumerate all hands and count how many hands were successes. Here are the results:
DECK:  AAABBBCCDEEEFFGGGHHHIIIJJJKKKLLLMM
SUCCESSES:  AB AC EF GL FED FB AJ EJ KJ FJ BJ CJ KHA KIA KHF KIF KHE KIE KHB KIB KHC LIC
N CARDS IN DECK:   34
N CARDS IN HAND:   5
HANDS SUCCESSFUL:  218223
TOTAL HANDS:       278256
PROBA OF SUCCESS:  0.7842526306710368

Importantly, note that there are 34 cards in the deck, not 44 as you claim.
Putting aside the part of the script I used to parse your question to build the deck and the reference list of successful combinations, here is the part of the code that makes the computations:
from itertools import combinations
from collections import Counter
from math import comb

def is_success(hand, successes_ref):
    return (hand['M'] < 2) and any(s <= hand for s in successes_ref)

def count_successes(deck, n_cards_in_hand, successes_ref):
    return sum(
        is_success(Counter(hand_tuple), successes_ref)
        for hand_tuple in combinations(deck, n_cards_in_hand)
    )

def total_hands(deck, n_cards_in_hand):
    return comb(len(deck), n_cards_in_hand)


---

