• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:29
CEST 06:29
KST 13:29
  • 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
Maestros of the Game: Week 1/Play-in Preview9[ASL20] Ro24 Preview Pt2: Take-Off7[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy10
Community News
Weekly Cups (August 25-31): Clem's Last Straw?32Weekly Cups (Aug 18-24): herO dethrones MaxPax6Maestros of The Game—$20k event w/ live finals in Paris46Weekly Cups (Aug 11-17): MaxPax triples again!15Weekly Cups (Aug 4-10): MaxPax wins a triple6
StarCraft 2
General
Geoff 'iNcontroL' Robinson has passed away Team Liquid Map Contest #21 - Presented by Monster Energy Heaven's Balance Suggestions (roast me) Speculation of future Wardii series Weekly Cups (August 25-31): Clem's Last Straw?
Tourneys
LiuLi Cup - September 2025 Tournaments Sea Duckling Open (Global, Bronze-Diamond) Sparkling Tuna Cup - Weekly Open Tournament Maestros of The Game—$20k event w/ live finals in Paris Monday Nights Weeklies
Strategy
Custom Maps
External Content
Mutation # 489 Bannable Offense Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Simple editing of Brood War save files? (.mlx) ASL20 General Discussion Starcraft at lower levels TvP BW General Discussion
Tourneys
[Megathread] Daily Proleagues Is there English video for group selection for ASL [ASL20] Ro24 Group F [IPSL] CSLAN Review and CSLPRO Reimagined!
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread General RTS Discussion Thread Warcraft III: The Frozen Throne Nintendo Switch Thread Mechabellum
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread YouTube Thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s) Gtx660 graphics card replacement
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
A very expensive lesson on ma…
Garnet
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
How Culture and Conflict Imp…
TrAiDoS
RTS Design in Hypercoven
a11
Evil Gacha Games and the…
ffswowsucks
INDEPENDIENTE LA CTM
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2099 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
Replay Cast
00:00
SEL S2 Championship: Playoffs
CranKy Ducklings160
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 118
StarCraft: Brood War
Britney 17706
Leta 195
PianO 86
sSak 85
NaDa 32
yabsab 19
Icarus 11
Dota 2
NeuroSwarm124
LuMiX1
League of Legends
JimRising 664
Counter-Strike
m0e_tv680
Stewie2K361
Super Smash Bros
C9.Mang01004
hungrybox393
Other Games
summit1g6472
shahzam843
WinterStarcraft511
crisheroes361
ViBE167
Sick118
Livibee83
Maynarde82
Mew2King62
Organizations
Other Games
gamesdonequick880
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH234
• practicex 27
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1057
• Stunt191
Other Games
• Scarra1076
Upcoming Events
The PondCast
5h 31m
RSL Revival
5h 31m
Maru vs SHIN
MaNa vs MaxPax
Maestros of the Game
12h 31m
Classic vs TriGGeR
Reynor vs SHIN
OSC
22h 31m
MaNa vs SHIN
SKillous vs ShoWTimE
Bunny vs TBD
Cham vs TBD
RSL Revival
1d 5h
Reynor vs Astrea
Classic vs sOs
Maestros of the Game
1d 12h
Serral vs Ryung
ByuN vs Zoun
BSL Team Wars
1d 14h
Team Bonyth vs Team Dewalt
CranKy Ducklings
2 days
RSL Revival
2 days
GuMiho vs Cham
ByuN vs TriGGeR
Cosmonarchy
2 days
TriGGeR vs YoungYakov
YoungYakov vs HonMonO
HonMonO vs TriGGeR
[ Show More ]
Maestros of the Game
2 days
Solar vs Bunny
Clem vs Rogue
[BSL 2025] Weekly
2 days
RSL Revival
3 days
Cure vs Bunny
Creator vs Zoun
Maestros of the Game
3 days
Maru vs Lambo
herO vs ShoWTimE
BSL Team Wars
3 days
Team Hawk vs Team Sziky
Sparkling Tuna Cup
4 days
Monday Night Weeklies
4 days
Liquipedia Results

Completed

CSL Season 18: Qualifier 2
SEL Season 2 Championship
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL 2025 AUTUMN (S18)
RSL Revival: Season 2
Maestros of the Game
Sisters' Call Cup
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

LASL Season 20
2025 Chongqing Offline CUP
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
EC S1
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 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.