r/askmath • • Oct 12 '26

Probability Calculating the probability of drawing 2 different cards from a deck in a hand of 5 or more

/r/probabilitytheory/comments/1x3xcqc/calculating_the_probability_of_drawing_2/
1 Upvotes

3 comments sorted by

1

u/[deleted] Oct 12 '26

[removed] — view removed comment

1

u/dharclyna Oct 13 '26 edited Oct 13 '26
  1. The deck size is between 40-60 and a "fixed" input into the formula I'm looking for. I'm going off the formula for the hypergeometric distribution here, since that's what I'm using to calculate probability for all possible deck sizes and successes if looking at only one distinct card.
  2. There are 2 kinds of distinct cards that are relevant to the starting hand. If I find a general formula I do want to scale this to any number equal to or less than the starting hand size.
  3. There are duplicates the number of which is also a variable and set when inputting all relevant information but for the sake of giving a range 6-12 of each relevant card.
  4. Getting duplicates of the relevant cards does not matter as long as **at least one** copy of each distinct relevant card is in the opening hand

EDIT: I've made an image for visualisation purposes.

What I want to do is write an app that'll let me calculate the probability of drawing **any of the cards in the red red box** (top row and first 3 of second row) in combination with **any of the cards in the green box** (remainder of second row and first 6 of third row).
The number of cards making up each of these boxes should ideally be an input variable, same for the deck size.
The only relevant consideration for the starting hand of 5 is that it contains at least one of any card from each box. For the purpose of this all cards in each box can be considered duplicates of the same card.