STICKY 31s - /sci/ (#16714027) [Archived: 392 hours ago]

Anonymous
7/2/2025, 9:47:27 PM No.16714027
dancing-number-dancing-letter
dancing-number-dancing-letter
md5: 62e3544dfb6f8c2c09af727e310f8777🔍
Lets play a game /sci/:

You are given a set 13 cards from a 52 card deck.
Another deck draws cards 1 by 1.

After 31 cards have been drawn, what are the chances that your set matches theirs?

Order is not important.
For simplicity, you do not need to work out the odds after any other number of draws, just "at 31 cards".

Show your workings.

Its not 1/635 billion.
Replies: >>16714152 >>16714606 >>16715843 >>16717940
Anonymous
7/2/2025, 9:50:38 PM No.16714034
C(31,13)/C(52,31) = 256,215 / 238,499,147,744
or if you want to be a pedantic faggot, the chance my set (of 13) matches their set (of 31) is zero since 13 == 31.
Replies: >>16714088 >>16714152 >>16714998 >>16715720 >>16717855
Anonymous
7/2/2025, 10:47:43 PM No.16714088
>>16714034
Reduce it

And expand on how you got that
Replies: >>16714095
Anonymous
7/2/2025, 10:53:06 PM No.16714095
>>16714088
the fuck do you mean reduce it? it's already reduced.
out of 52 cards, 31 had to be chosen
out of 31 cards, 13 need to match yours
it's literally why the choose function was constructed.
Replies: >>16714162
Anonymous
7/2/2025, 11:50:50 PM No.16714152
>>16714027 (OP)
yeah i'm gonna have to agree with >>16714034 since a 13 card and a 31 card set cannot match completely
Anonymous
7/3/2025, 12:10:05 AM No.16714162
>>16714095
>numerator greater than 1
>reduced
Im2statisticalprobabilities
Anonymous
7/3/2025, 12:12:50 PM No.16714606
IMG_0802
IMG_0802
md5: b436b8551cf767c2e7d4aa7856aef019🔍
>>16714027 (OP)
I draw my cards using your hand as my deck. You are left with -18 cards.
Anonymous
7/3/2025, 5:59:20 PM No.16714998
>>16714034
I don't think this is correct.

If you model the problem as an urn with 52 marbles of which 13 are red and 52-13=39 are green it becomes easier (at least for me). The 13 cards from the first deck correspond to the 13 red marbles. The chance that you draw 31 marbles uniformly at random without replacement of which 13 are red can be calculated with the hypergeometric distribution.

The answer is [ C(13,13) * C(52-13,31-13) ] / C(52,31) = C(39,18) / C(52,31) which is approximately 0.0325%.

In the numerator
-from the 13 red marbles you need to pick all 13 of them and there is only one way to do so
-from the 39 green marbles you need to pick any 18 of them, resulting in 39 choose 18 combinations

Denominator
-You need to divide by all the possible ways you could have drawn 31 marbles out of 52.
Replies: >>16715003 >>16717855
Anonymous
7/3/2025, 6:02:14 PM No.16715003
>>16714998
Thanks ChatGPT.
Replies: >>16715019
Anonymous
7/3/2025, 6:21:59 PM No.16715019
screenshot
screenshot
md5: bffd6337b16636c55f338a1381ce9120🔍
>>16715003
First year first semester probability equals ChatGPT these days? Or is there something wrong with my reasoning you would care to share?

If you base your statement on my writing style I understand, ChatGPT often restates your question and says how it can be calculated such as in my sentence "The chance that you draw 31 marbles uniformly at random without replacement of which 13 are red can be calculated with the hypergeometric distribution."

The image is the actual answer you get when you do ask ChatGPT by the way.
Anonymous
7/4/2025, 1:49:50 PM No.16715720
>>16714034
Why is it not 52!/(13!×31!)?
Replies: >>16715727
Anonymous
7/4/2025, 2:05:50 PM No.16715727
>>16715720
because that's too excited for me!
Anonymous
7/4/2025, 4:35:49 PM No.16715843
>>16714027 (OP)
symmetry holds that it is the same as the odds of just drawing 13 cards. Drawing from the bottom or the top of the deck doesn't make any difference.
Replies: >>16715929
Anonymous
7/4/2025, 7:36:30 PM No.16715929
>>16715843
Drawing 13 cards is easy, I can do that every 5 seconds even with my fat hands weey heey
Anonymous
7/6/2025, 9:29:07 PM No.16717855
>>16714034
>>16714998
So whos right?
Is it ~1/900,000 or 0.0325%
Replies: >>16717939
Anonymous
7/6/2025, 11:31:00 PM No.16717939
>>16717855
0.0325% is correct. Intuitively, do you expect it to take around a million tries to draw 31 cards that contain the first 13? 31 is over half of the deck and you're just asking it to contain 13 cards.

Mathematically, it is a matter of counting. There are 52 choose 31 possible draws of 31 cards, this is the total configuration space so to speak. Within that space, you need to pick exactly the 13 cards that we want, there is only one way to do so. Furthermore, you need to pick any (31-13)=18 cards out of the (52-13)=39 cards that are not the 13 cards we want. So the answer is 39 choose 18 / 52 choose 31.

Experimentally, I coded up a dogshit slow simulation in python which confirms the answer:
[code] import random as rnd

rnd.seed(42)
itrs_max = int(1e6)

def sim(itrs_max):
deck = list(range(1,53))
count = 0
for i in range(itrs_max):
cards13 = {*rnd.sample(deck, 13)}
cards31 = {*rnd.sample(deck, 31)}
if len( cards13 & cards31) == 13:
count += 1
return (count/itrs_max)*100

print(sim(itrs_max))
[/code].
Replies: >>16717996
Anonymous
7/6/2025, 11:31:58 PM No.16717940
>>16714027 (OP)
How can my set of 13 cards match a set of 31 cards?
Anonymous
7/7/2025, 12:52:30 AM No.16717996
>>16717939
This can't be right. Suppose a deck of 16 cards still with 4 suits, 2^4. And there are four cards we want to draw in a row after drawing 12 cards.
From symmetry, the chance of those four cards appearing in order at the top of the deck is 12!4!/16! =>
1/[10(13•14)] = 0.0549%
There is obviously no way for the chance to only scale less than half given the same 1/4 restriction.
so, given 13/52
39!13!/52! = (39!)362880(11)/17(50!) < 4000000 / 17 P(50. . . 40)
P(50. . . 40) > 10^10
4•10^6/16•10^10 = 0.25 * 10^-4 < 3.25 * 10^-4
This is with drastically overestimating the odds.
Did you do something like comparing the ratios of win condition against miss condition or something?
Where its something like: P / (1 - P) instead of just P?
Replies: >>16718002 >>16718037
Anonymous
7/7/2025, 12:55:42 AM No.16718002
>>16717996
> 0.25 * 10^-4 < 3.25 * 10^-4
err 2.5 * 10^-4 < 3.25 * 10^-4
Anonymous
7/7/2025, 1:45:45 AM No.16718037
>>16717996
What? You have to structure your thoughts more clearly, this is incomprehensible up to the last two sentences. I did not compare wins against misses. My code, although bad, is quite clear I think.

What I did in the simulation is count how many times a draw of 13 cards is contained in another draw of 31 separate cards when I keep repeating this experiment, then I divided the ending total count by the number of experiments and converted to a percentage. This will converge to the true probability when the number of simulations goes to infinity.


If you want to convince yourself of the math, read up on https://en.wikipedia.org/wiki/Hypergeometric_distribution or google examples of that distribution in practice.

But there's no need to check the math if you don't understand it, just verify it empirically. As the true probability is quite small, you "need" quite a lot of simulations so here's faster code if you want to test it yourself, if your pc has more than 6 processors you need to change procs variable:

[code]from multiprocessing import Pool
import random as rnd

init_seed = rnd.randint(1,100)
total_iters = int(25e6)

def worker(seed_and_iters):
seed, its = seed_and_iters
rng = rnd.Random(seed)
deck = list(range(52))
count = 0
for _ in range(its):
a = set(rng.sample(deck, 13))
b = set(rng.sample(deck, 31))
if a <= b:
count += 1
return count

if __name__ == "__main__":
procs = 6
its_per = total_iters // procs
args = [( init_seed +i, its_per) for i in range(procs)]
with Pool(procs) as p:
counts = p.map(worker, args)
total = sum(counts)
print( (total/total_iters) * 100)[/code]
Replies: >>16720078
Anonymous
7/8/2025, 12:33:21 AM No.16718958
brd
brd
md5: 79225fdb923f9fef00498c46db41f04b🔍
OP we're waiting
Replies: >>16720094
Anonymous
7/9/2025, 4:07:09 AM No.16720078
>>16718037
This response gives me no reason to believe your algorithm when the math is basic and shows the conclusion is invalid.. Do you not understand how the ! operator works?
13 particular cards in any order at the top of the deck is equivalent to finding 13 particular cards in any order at the bottom of the deck, or in any particular place in the deck.
Replies: >>16720330
Anonymous
7/9/2025, 4:45:00 AM No.16720094
>>16718958
Who is this guy? Looks like a dumber Jeff Epstein.
Anonymous
7/9/2025, 2:13:54 PM No.16720330
>>16720078
>This response gives me no reason to believe your algorithm when the math is basic and shows the conclusion is invalid..
The first algorithm I posted is very transparant. There is no math involved in the algorithm, just draw 13 and 31 cards and check if the 13 are contained in the 31, rinse and repeat and calculate the frequency of containment which converges to the true probability.
Do you agree that that algorithm is correct and will converge to the true probability for the problem at hand if the number of iterations is increased? If you don't answer yes to this question, explain in detail why it is incorrect and how you would change the algorithm so that it is correct.
>Do you not understand how the ! operator works?
I think you don't understand what m choose n means for integers m,n. See https://en.wikipedia.org/wiki/Combination
In this problem, the order doesn't matter so we use combinations.
My mathematical derivation is straightforward and a simple python script confirms the answer.
>13 particular cards in any order at the top of the deck is equivalent to finding 13 particular cards in any order at the bottom of the deck, or in any particular place in the deck.
Yes, and? Show the exact place in my argument where this contradicts what I did.

As it stands, you have provided some ramblings that seem to misunderstand elementary probability. But that's okay, you can use my code or write a simple bit of code yourself to see what the answer should be.