• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:34
CET 01:34
KST 09:34
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation12Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
Mech is the composition that needs teleportation t RotterdaM "Serral is the GOAT, and it's not close" RSL Season 3 - RO16 Groups C & D Preview [TLMC] Fall/Winter 2025 Ladder Map Rotation TL.net Map Contest #21: Winners
Tourneys
RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle What happened to TvZ on Retro? SnOw's ASL S20 Finals Review BW General Discussion Brood War web app to calculate unit interactions
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
PvZ map balance Current Meta Simple Questions, Simple Answers How to stay on top of macro?
Other Games
General Games
Should offensive tower rushing be viable in RTS games? Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread Clair Obscur - Expedition 33
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread Artificial Intelligence Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2011 users

[MTG] Statistics question

Blogs > Seth_
Post a Reply
Seth_
Profile Blog Joined July 2010
Belgium184 Posts
Last Edited: 2011-07-16 17:05:08
July 16 2011 16:31 GMT
#1
Hi Guys

Since there are a few good statisticians around here (and a bunch of really bad ones), I decided to post this question here.

Background:
I've decided to get started playing Magic: the Gathering again. I probably won't play tournaments so I don't need those expensive rares. A playset of commons and uncommons from M12 + the commons from the last block seems like a good way to get started (I still have some lands... from when I played during ravnica).

Data:
I've found an ebay deal for 700 random commons from the set.
There are 101 common cards in the set (all equally likely).
I want 4 of each card.

Statistics Questions:
What's the chance that I'll get at least 4 of every card with the 700 cards?
What's the expected amount of cards that I will have to buy later? (with this I can calculate if it's better to buy this and fill up to 4 at a local store, or to buy a 4 of every card deal on ebay)


I've thought about the problem already but I can't find a correct formula.
+ Show Spoiler [a good try] +

Prob of >=4 of everything = (Prob of >=4 of a certain card)^101
I'm assuming here this is all independent which it is not.
= (1- Prob(0) - Prob(1) - Prob(2) - Prob(3))^101
= + Show Spoiler [maple math] +
c:=101;
t:=700;
evalf(1 - ((c-1)/c)^t - t*1/c*((c-1)/c)^(t-1) - t*(t-1)/2 *(1/c)^2*((c-1)/c)^(t-2) - t*(t-1)*(t-2)/6 *(1/c)^3*((c-1)/c)^(t-3) )^c;
= 0.0136%

Actually now I have an idea to solve the second question.
> .00094 chance of getting 0 of a card (=Prob(0)) => 4 to buy
> .00660 chance of getting 1 of a card => 3 to buy
> .02309 chance of getting 2 of a card => 2 to buy
> .05374 chance of getting 3 of a card => 1 to buy
> = average * 101 = 12.5 cards on average. This is still based on the statistical independence though.

I'm not sure how accurate it is though since my very first assumption is already incorrect. You can clearly see this formula can give a solution for 400 instead of 700 although it should be impossible.



Ghin
Profile Blog Joined January 2005
United States2391 Posts
July 16 2011 16:34 GMT
#2
How much does what you want to buy cost? Keep in mind you could buy a booster box from a new set for 100$ and get more commons than you'll ever know what to do with, and also be type2. You'll have so many commons that you'll have to use them to start a fire.

You'd also get the rares if you bought a box.
Legalize drugs and murder.
iSTime
Profile Joined November 2006
1579 Posts
Last Edited: 2011-07-16 16:38:59
July 16 2011 16:37 GMT
#3
I'm pretty sure that would be incredibly tedious to compute by hand. Just write a program to simulate it and estimate the values you want that way imo.
www.infinityseven.net
Seth_
Profile Blog Joined July 2010
Belgium184 Posts
July 16 2011 17:17 GMT
#4
On July 17 2011 01:34 Ghin wrote:
How much does what you want to buy cost? Keep in mind you could buy a booster box from a new set for 100$ and get more commons than you'll ever know what to do with, and also be type2. You'll have so many commons that you'll have to use them to start a fire.

You'd also get the rares if you bought a box.

A playset of commons is less than €10 (2.5 cent per card). Uncommons are a bit more expensive at ~€25-28. The 700 commons would be about €10 added to the €25. (not including shipping)
Even a box would only give me about 360 commons and 108 uncommons, not even enough for a playset (although I'd get 36 rares as well of course)

On July 17 2011 01:37 vVvTime wrote:
I'm pretty sure that would be incredibly tedious to compute by hand. Just write a program to simulate it and estimate the values you want that way imo.

That would be the next thing I'd to, to find out if my calculations were correct. There might be a simple way to calculate this though.
APurpleCow
Profile Blog Joined August 2008
United States1372 Posts
Last Edited: 2011-07-16 17:48:34
July 16 2011 17:39 GMT
#5
I'm absolutely terrible at programming, but I just wrote a quick program to do this. Says you'll have about 18 cards that you won't have four of.

Here's python program in case I did something really dumb [edit: I did, had <5 instead of <4]:
+ Show Spoiler +
import random

notfour = 0

for aa in range(1,1001):

cards = []

for nn in range(0,701):
cards.append(random.randint(1,101))

for ii in range(1,102):
if cards.count(ii) < 5:
notfour += 1

print(notfour/1000)


Ran it three times, output has been 17.869, 17.856, and 17.821.
McFortran
Profile Joined October 2010
United States79 Posts
Last Edited: 2011-07-16 17:48:37
July 16 2011 17:39 GMT
#6
Performed a million trials:
There's about a .0023% chance of not having to purchase another card.
On average, you will have to purchase a total of about 12.5 cards.

Below is my source code written in c++. It's poorly written and the formatting isn't working for whatever reason, but it should be valid.
+ Show Spoiler +

#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
int trials=1000000;
int totalcard=0;
int totalbuy=0;
for (int j=0;j<trials;j++)
{
int Card[101];
for (int i=0;i<101;i++)
{
Card[i]=0;
}
for (int i=0;i<700;i++)
{
Card[rand()%101]++;
}
int More[101],more=0;
bool buy=false;
for (int i=0;i<101;i++)
{
if (Card[i]-4<0)
{
More[i]=4-Card[i];
more+=More[i];
buy=true;
}
else
{
More[i]=0;
}
}
totalcard+=more;
if (buy) {totalbuy++;}
}
cout<<totalcard<<"\n"<<float(totalcard)/float(trials)<<"\n"<<trials-totalbuy;
cin.get();
}


Edit: @APurpleCow, you need to use <4 not <5. If the number of cards is less than 5 it can still equal 4 which is perfectly acceptable. Also when my program is changed to record the number of card types which have fewer than 4 elements, the answer then becomes 8.5. So you'll have 8.5 card types that you'll need to buy with a total of 12.5 cards needed, on average.
APurpleCow
Profile Blog Joined August 2008
United States1372 Posts
Last Edited: 2011-07-16 18:12:44
July 16 2011 17:46 GMT
#7
Oops.

I did do something really dumb. I had a <5 instead of a <4.

Except now I'm getting like 8.46 cards you'll have to rebuy, which is still not what mcfortran had...uh...

EDIT: Okay, now that mcfortran edited his post I see what I did wrong. My program gives card types, not cards.

new program:
+ Show Spoiler +
import random

notfour = 0

for aa in range(1,10001):

cards = []

for nn in range(0,701):
cards.append(random.randint(1,101))

for ii in range(1,102):
if cards.count(ii) < 4:
notfour += 4 - cards.count(ii)

print(notfour/10000)


Gives me ~12.4, which is pretty much what mcfortran had. Also, c++ looks a lot harder than python >_>

EDIT2: Don't know if this is useful for you, but assuming I didn't do anything stupid again you should have about 310 cards left over that you already have 4 of.

+ Show Spoiler +
import random

notfour = 0

for aa in range(1,10001):

cards = []

for nn in range(0,701):
cards.append(random.randint(1,101))

for ii in range(1,102):
if cards.count(ii) > 4:
notfour += cards.count(ii) - 4

print(notfour/10000)
AntiLegend
Profile Joined September 2010
Germany247 Posts
July 16 2011 19:18 GMT
#8
jesus christ, i've been thinking about this question about an hour now, but i can't wrap my head around how to calculate the odds.

so basically the problem could be rephrased as: if you roll a 101-sided die 700 times, what is the probability of rolling each side at least 4 times.

maybe i should draw a tree for a smaller die and less #rolls, and find a way to calculate from there, but i'd really appreciate if someone could present the proper way to solve that question.
McFortran
Profile Joined October 2010
United States79 Posts
Last Edited: 2011-07-16 23:12:38
July 16 2011 22:21 GMT
#9
On July 17 2011 04:18 AntiLegend wrote:
jesus christ, i've been thinking about this question about an hour now, but i can't wrap my head around how to calculate the odds.

so basically the problem could be rephrased as: if you roll a 101-sided die 700 times, what is the probability of rolling each side at least 4 times.

maybe i should draw a tree for a smaller die and less #rolls, and find a way to calculate from there, but i'd really appreciate if someone could present the proper way to solve that question.

The distribution of cards follows a Multinomial Distribution. Let X1,X2,...,X101 denote the number of each card with corresponding index that he receives. Then we need to calculate:

P(X1>4 n X2>4 n ... n X101>4) [n denotes intersection]

This can be solved using repeated Discrete Convolution.

The end result is the sum of approximately 101^2*300=3million numbers (maybe significantly more, I'm not sure)**, each of which requires the calculation of P(X1,X2,X4,...,X101), which involves taking 102 factorials and the product of 101 integers***.

Here's one way to apply this:

with 1 degree of freedom (my own term, it seems to fit here)

P(4,4,4,4,...,300) is a way to satisfy the condition (X1>4 n X2>4,..., X101>4) where X1,X2,...,X100 are all fixed
Similarly, P(4,4,4,4,...,300,4) also works where X1,X2,...,X99,X101 are all fixed.
In general we have 101C1=101 ways to rearrange this, so, due to the uniform distribution we have
P(4,4,4,4,...,300)*(101C1)
is the sum of all solutions with 1 degree of freedom (that is, the intersection of all X1,X2,...,X101 that satisfy (X1>4,X2>4,...,X101>4) where 100 of the variables are fixed at Xj=4)

With 2 degrees of freedom

P(4,4,4,4,...,5,300-(4*99+5))+P(4,4,4,4,...,6,300-(4*99+6))+...+P(4,4,4,4,...,300-(4*99+5),5) satisfies the condition
By similar argument,
P(4,4,4,4,...,5,300-(4*99+5))+P(4,4,4,4,...,6,300-(4*99+6))+...+P(4,4,4,4,...,300-(4*99+5),5)*(101C2)
is the sum of all solutions with 2 degrees of freedom...

with n degrees of freedom

[P(4,4,4,...,5,...,5,300-(4*(100-n)+5n))+P(4,4,4,...,5,...,5,6,300-(4*(100-n)+5(n-1)+6))+...
+P(4,4,4,...,5,...,300-(4*(100-n)+5n),5)+...
+P(4,4,4,...,300-(4*(100-n)+5n),5,...,5)]*(101Cn)
is the sum of all solutions with n degrees of freedom... ****

The sum of all 101 of these sums would then be equal to P(X1>4,X2>4,...,X101>4). Note that there is no overlap in these due to the fact that the degrees of freedom with k>1 start with free variables set at 5 and 101*5<700.

**Notice that 101C0+101C1+101C2+...+101C101 is 2^101 (It's the size of all subsets of a set with 101 elements). So this is actually way larger than my initial 3 million assessment (I did 101^2 by accident), but we don't need to directly sum these. As is apparent from the above, however, it's pretty much impossible to do this problem by hand.

***The product of 101 integers is actually quite trivial since it's the same each time [101^(-101)], but the factorials are different in general.

****I think my brain just exploded. In practice I have no way of testing if this is true because even if I were to program this the precision of anything I have access to would be too low and would fail, and even if I could there's a good chance it would still take an unreasonably long amount of time to compute.*****

*****My annotation system doesn't seem to be very efficient.
McFortran
Profile Joined October 2010
United States79 Posts
July 16 2011 23:23 GMT
#10
It appears that symmetry could significantly help here as well.

Not that P(4,4,4,...,5,300-(4*99+5))=P(4,4,4,...,300-(4*99+5),5).
So with 2 degrees of freedom, we can use half as many calculations by only going half way.

With n degrees of freedom I believe you can divide the number of computations by n, but I've done too much math today to verify this. Time to study some more abstract algebra .
Kiarip
Profile Joined August 2008
United States1835 Posts
Last Edited: 2011-07-17 05:31:43
July 17 2011 05:27 GMT
#11
Well the probability that you get 4 of each of the 101 cards is easily represented arithmetically.


First you need total amount of ways that you can get 4 of each cards.

so 404 of the cards needs to be the 101 quadruples, so you can arrange that (404!)/((4!)^101)

Then you have 296 cards left over.

you don't care what they are but they also needs to be arranged in some way with the first 404 cards so that's.

700!/((404!)*(296!)) * (404!)/((4!)^101) = (700!)/((296!)*((4!)^101)

then you have the total number of arrangements in total: (101)^(700)

so you have ((700!)/((296!)*((4!)^101) / (101)^(700))

Now good luck getting a calculator that will actually compute this for you lol.

simulation would prolly be best >_>.


edit:

now that I think about it, this may not be right, but this is definitely solvable using generating functions, the question is it calculable?
Please log in or register to reply.
Live Events Refresh
The PiG Daily
20:30
Best Games of SC
Serral vs Clem
Solar vs Cure
Serral vs Clem
Reynor vs GuMiho
herO vs Cure
PiGStarcraft348
LiquipediaDiscussion
BSL 21
20:00
ProLeague - RO32 Group C
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
ZZZero.O207
LiquipediaDiscussion
OSC
19:00
Masters Cup #150: Group B
davetesta47
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft379
ProTech109
Nathanias 108
UpATreeSC 75
StarCraft: Brood War
ZZZero.O 207
NaDa 94
Sexy 7
Other Games
summit1g13205
tarik_tv8187
gofns6330
Grubby5587
DeMusliM641
Fuzer 148
ViBE64
Mew2King39
fpsfer 3
Organizations
Other Games
gamesdonequick641
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• HeavenSC 32
• musti20045 32
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21225
Other Games
• imaqtpie1363
• WagamamaTV397
Upcoming Events
Sparkling Tuna Cup
9h 26m
RSL Revival
9h 26m
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
11h 26m
Cure vs herO
Reynor vs TBD
WardiTV Korean Royale
11h 26m
BSL 21
19h 26m
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
19h 26m
Dewalt vs WolFix
eOnzErG vs Bonyth
Replay Cast
22h 26m
Wardi Open
1d 11h
Monday Night Weeklies
1d 16h
WardiTV Korean Royale
2 days
[ Show More ]
BSL: GosuLeague
2 days
The PondCast
3 days
Replay Cast
3 days
RSL Revival
4 days
BSL: GosuLeague
4 days
RSL Revival
5 days
WardiTV Korean Royale
5 days
RSL Revival
6 days
WardiTV Korean Royale
6 days
IPSL
6 days
Julia vs Artosis
JDConan vs DragOn
Liquipedia Results

Completed

Proleague 2025-11-14
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.