Anyone want to help me write a math function?

User avatar
3drinks
Kaalia's Personal Liaison
Posts: 4832
Joined: 4 years ago
Pronoun: he / him
Location: Ruined City of Drannith, Ikoria

Post by 3drinks » 2 years ago

In evaluating Kaalia, Zenith Seeker, I'm trying to find the optimal creature count to proc her trigger the most reliably. Clearly I'm over thinking and it's affecting my critical thinking skills, so lem'me come here and get back on track.

Assuming no special conditions, i.e. no ramp, no multi purpose cards, if I just land, go, I play Kaalia and "spin the top" for a random six. At this point, there's 89 cards in the deck and I wanna hit at least one threat, but ideally let's do the math to see what my numbers need to be to hit two and three threats too. Finding the stats at these points will allow me to extrapolate as my odds of finding a threat will only go up. But I need those first numbers.

Since I'm looking at the top six of 89 cards, a simple 6/89= ~6.7% doesn't sound correct, so...before I overthink this even more, what's the missing quality I'm lacking here?

Modern
R{R/W} 87guide Burn
Commander
WRKellan, the Fae-Blooded // Birthright Boon (local secret santa gift)
RTorbran, Thane of Red Fell (Red Deck Wins)
WBRAlesha, Who Smiles at Death (Slivers)
WBRKaalia HQ

Sharpened
Posts: 193
Joined: 4 years ago
Pronoun: he / him

Post by Sharpened » 2 years ago

So here's an article by Frank Karsten that discusses what you want: Hypergeometric Probability

Unfortunately, that article is old and it looks like the calculator in it is broken. The article is worth a read, but here are links to working calculators:

Calculator

Magic Calculator

Sharpened
Posts: 193
Joined: 4 years ago
Pronoun: he / him

Post by Sharpened » 2 years ago

Here's some numbers more specific to your problem

# of creatures remaining in your 89 cards - Probability of Hitting at least 1 with Kaalia

28 - 90.4%
29 - 91.4%
30 - 92.2%
31 - 93.0%
32 - 93.8%
33 - 94.4%
34 - 95.0%
35 - 95.6%
36 - 96.0%
37 - 96.5%
38 - 96.9%

Keep in mind you've probably already drawn 2 - 4 of your Successes before you get that first spin.

User avatar
TheAmericanSpirit
Supreme Dumb Guy
Posts: 2194
Joined: 4 years ago
Answers: 1
Pronoun: he / him
Location: IGMCULSL Papal Palace

Post by TheAmericanSpirit » 2 years ago

I love these math topics, even though anything beyond common accounting is beyond me. How was I supposed to know hypergeometric probability was even a thing? Math is wild, man. Simply wild.
There's no biscuits and gravy in New Zealand.
(Except when DirkGently makes them!)

User avatar
3drinks
Kaalia's Personal Liaison
Posts: 4832
Joined: 4 years ago
Pronoun: he / him
Location: Ruined City of Drannith, Ikoria

Post by 3drinks » 2 years ago

Sharpened wrote:
2 years ago
Here's some numbers more specific to your problem

# of creatures remaining in your 89 cards - Probability of Hitting at least 1 with Kaalia

28 - 90.4%
29 - 91.4%
30 - 92.2%
31 - 93.0%
32 - 93.8%
33 - 94.4%
34 - 95.0%
35 - 95.6%
36 - 96.0%
37 - 96.5%
38 - 96.9%

Keep in mind you've probably already drawn 2 - 4 of your Successes before you get that first spin.
Okay, this works...but how would I configure it to hit each of the three types of cards? Assuming no changelings cause they can go in any category so they'd make the math different. (But yes there's changelings jn here).

Modern
R{R/W} 87guide Burn
Commander
WRKellan, the Fae-Blooded // Birthright Boon (local secret santa gift)
RTorbran, Thane of Red Fell (Red Deck Wins)
WBRAlesha, Who Smiles at Death (Slivers)
WBRKaalia HQ

User avatar
pokken
Posts: 6279
Joined: 4 years ago
Answers: 2
Pronoun: he / him

Post by pokken » 2 years ago

It's very similar to collected company math :). https://strategy.channelfireball.com/al ... of-tarkir/

Basically in a 60 card deck to have a 95% chance of hitting one in top 6 you want 22, so easy to extrapolate that from 60 cards to 100 you multiply by 1.667 getting 36 or so.

Which lines really closely to Sharpened's hypogeometric calculations too :)

--
You want about 36 total angel/demon/dragons.

For kaalia if you're trying to get one of each that's basically impossible since you'd need 36 of each :P

My suggestion would be to, because of the power level of dragon/demon/angel cards, to try to get about 36 total so you almost always hit, and then sprinkle in some changelings.

Getting 36 creatures in a deck period is already a tall order though :) i think my heaviest ever was about 40.

I think if you count changelings as about 2/3rds of each card type it'll be pretty close (so 3 changelings counts as 2 angels/2 demons/2 dragons) -- I can't be arsed to do the detailed math on that but it's close enough.

--

I'd aim to run something like 9 changelings and then 9-10 of each other type, which is a really tall order but probably close.

which should give you something like a (ballpark) 50% chance to hit one of each give or take, which is I think about as close is feasible. (70, what was I thinking?)
Last edited by pokken 2 years ago, edited 1 time in total.

Sharpened
Posts: 193
Joined: 4 years ago
Pronoun: he / him

Post by Sharpened » 2 years ago

3drinks wrote:
2 years ago
Okay, this works...but how would I configure it to hit each of the three types of cards? Assuming no changelings cause they can go in any category so they'd make the math different. (But yes there's changelings jn here).
Example:

For simplicities sake:
89 cards
10 Dragons
7 Demons
13 Angels

No changelings, because I haven't worked it out.

Per the calculator
52.2% Hitting a Dragon
39.7% Hitting a Demon
62.4% Hitting an Angel

Multiply the Decimals together to get the "and" probabilities.
20.7% Hitting a Dragon and a Demon
32.6% Hitting a Dragon and an Angel
24.7% Hitting a Demon and an Angel

12.9% Hitting all 3

User avatar
3drinks
Kaalia's Personal Liaison
Posts: 4832
Joined: 4 years ago
Pronoun: he / him
Location: Ruined City of Drannith, Ikoria

Post by 3drinks » 2 years ago

There's the missing qualities I needed, thanks so much. Knew this place would be able to help me get to thid point, we got a bunch of geniuses around here.

Modern
R{R/W} 87guide Burn
Commander
WRKellan, the Fae-Blooded // Birthright Boon (local secret santa gift)
RTorbran, Thane of Red Fell (Red Deck Wins)
WBRAlesha, Who Smiles at Death (Slivers)
WBRKaalia HQ

User avatar
pokken
Posts: 6279
Joined: 4 years ago
Answers: 2
Pronoun: he / him

Post by pokken » 2 years ago

I attempted to do some changeling math. It's...naive but probably not that far from reality?

Assumes 10 of each card type (changeling, angel, demon, dragon).



(the reason for the 1/0.12 in the 2x changeling rows is that 2 changelings in 6 cards is 0.12, 89 cards, 10 successes, 6 sample, successes = 2.)

I think if you simulated it with a program you could get more accurate cumulative odds as things change, like once 2 out of 6 of your cards are changelings, you only have 4 hits now to hit 1 angel, for say, scenario changeling changeling angel.

Other error in this approach is I didn't allow for >= 1 for each item, some of them you could have extras and it'd be OK :P Most likely the reduction of hit chances as you have one of each type counteracts that and my two major errors are a wash.

User avatar
3drinks
Kaalia's Personal Liaison
Posts: 4832
Joined: 4 years ago
Pronoun: he / him
Location: Ruined City of Drannith, Ikoria

Post by 3drinks » 2 years ago

Who knew it'd be Kaalia that would bring math and commander together in such a fundamental way

Modern
R{R/W} 87guide Burn
Commander
WRKellan, the Fae-Blooded // Birthright Boon (local secret santa gift)
RTorbran, Thane of Red Fell (Red Deck Wins)
WBRAlesha, Who Smiles at Death (Slivers)
WBRKaalia HQ

User avatar
3drinks
Kaalia's Personal Liaison
Posts: 4832
Joined: 4 years ago
Pronoun: he / him
Location: Ruined City of Drannith, Ikoria

Post by 3drinks » 2 years ago

Wow after getting home and putting this together with these numbers, I'm finding myself light on interaction slots. That's at the 36 mark. I'm a bit uncomfortable with numbers so low, I wanted to play it and see anyway but it's all rainy and crap now. I'm not getting out in that mess.

Modern
R{R/W} 87guide Burn
Commander
WRKellan, the Fae-Blooded // Birthright Boon (local secret santa gift)
RTorbran, Thane of Red Fell (Red Deck Wins)
WBRAlesha, Who Smiles at Death (Slivers)
WBRKaalia HQ

User avatar
pokken
Posts: 6279
Joined: 4 years ago
Answers: 2
Pronoun: he / him

Post by pokken » 2 years ago

3drinks wrote:
2 years ago
Wow after getting home and putting this together with these numbers, I'm finding myself light on interaction slots. That's at the 36 mark. I'm a bit uncomfortable with numbers so low, I wanted to play it and see anyway but it's all rainy and crap now. I'm not getting out in that mess.
I think the only way this works is if you can jam as much of your interaction as possible in the angel/demon/dragon slots. Angel of Condemnation and Admonition Angel type stuff.

User avatar
3drinks
Kaalia's Personal Liaison
Posts: 4832
Joined: 4 years ago
Pronoun: he / him
Location: Ruined City of Drannith, Ikoria

Post by 3drinks » 2 years ago

pokken wrote:
2 years ago
3drinks wrote:
2 years ago
Wow after getting home and putting this together with these numbers, I'm finding myself light on interaction slots. That's at the 36 mark. I'm a bit uncomfortable with numbers so low, I wanted to play it and see anyway but it's all rainy and crap now. I'm not getting out in that mess.
I think the only way this works is if you can jam as much of your interaction as possible in the angel/demon/dragon slots. Angel of Condemnation and Admonition Angel type stuff.
Yeah, I'm pretty high up there in angels that also interact. Hey admonition is back to $2 so there's something. Serenity too. It's still a bit light but if I can get my hands on a terror of the peaks I can cut the glory's rise combo out and free up some other slots.

Modern
R{R/W} 87guide Burn
Commander
WRKellan, the Fae-Blooded // Birthright Boon (local secret santa gift)
RTorbran, Thane of Red Fell (Red Deck Wins)
WBRAlesha, Who Smiles at Death (Slivers)
WBRKaalia HQ

User avatar
Sinis
Posts: 2034
Joined: 4 years ago
Pronoun: Unlisted
Location: Toronto, Canada

Post by Sinis » 2 years ago

TheAmericanSpirit wrote:
2 years ago
I love these math topics, even though anything beyond common accounting is beyond me. How was I supposed to know hypergeometric probability was even a thing? Math is wild, man. Simply wild.
It's really just very complicated counting. Like, drawing a single card from a 100 unique cards is a 1% chance. That's intuitive.

Hypergeometric distributions are just similar intuitive counts piled together where they account for each other in their probabilities.

User avatar
3drinks
Kaalia's Personal Liaison
Posts: 4832
Joined: 4 years ago
Pronoun: he / him
Location: Ruined City of Drannith, Ikoria

Post by 3drinks » 2 years ago

So we jammed some games. Like three or four. No wins from me but man did it run so smoother with these counts. Across those games I must have made eighteen or so triggers. Exactly one whiffed trigger, ~50% of the time I got at least two hits. A few one hits, and a single three hit. Changelings help fill the gap a lot, especially the champion ones.

I'm spread too thin with the revel in riches strat, and a bit awkward with glory's rise combo and changelings. Life matters was smooth and natural in what I'm playing anyway (lot of low mana value angels that interact with it), so doing away with the chaff, and getting say, Angel of Destiny in there helps the deck stream line without weakening the commander's ability.

Based on my analysis, this is a strong tempo creator that always has a threat on hand (naturally an invaluable trait). Based on what I've experienced, I believe there is legs to this. Oh, and having resolved a Kardur, Doomscourge tells me I believe this would be an absolute blast to play as commander. A happy accident, I had written that off but he was incredible fun, at least for me.

Modern
R{R/W} 87guide Burn
Commander
WRKellan, the Fae-Blooded // Birthright Boon (local secret santa gift)
RTorbran, Thane of Red Fell (Red Deck Wins)
WBRAlesha, Who Smiles at Death (Slivers)
WBRKaalia HQ

User avatar
TheAmericanSpirit
Supreme Dumb Guy
Posts: 2194
Joined: 4 years ago
Answers: 1
Pronoun: he / him
Location: IGMCULSL Papal Palace

Post by TheAmericanSpirit » 2 years ago

3drinks wrote:
2 years ago
So we jammed some games. Like three or four. No wins from me but man did it run so smoother with these counts. Across those games I must have made eighteen or so triggers. Exactly one whiffed trigger, ~50% of the time I got at least two hits. A few one hits, and a single three hit. Changelings help fill the gap a lot, especially the champion ones.

I'm spread too thin with the revel in riches strat, and a bit awkward with glory's rise combo and changelings. Life matters was smooth and natural in what I'm playing anyway (lot of low mana value angels that interact with it), so doing away with the chaff, and getting say, Angel of Destiny in there helps the deck stream line without weakening the commander's ability.

Based on my analysis, this is a strong tempo creator that always has a threat on hand (naturally an invaluable trait). Based on what I've experienced, I believe there is legs to this. Oh, and having resolved a Kardur, Doomscourge tells me I believe this would be an absolute blast to play as commander. A happy accident, I had written that off but he was incredible fun, at least for me.
The masters of math have done it again. I swear, we could send a mtgn rocket to the moon with all this collective genius.
There's no biscuits and gravy in New Zealand.
(Except when DirkGently makes them!)

User avatar
pokken
Posts: 6279
Joined: 4 years ago
Answers: 2
Pronoun: he / him

Post by pokken » 2 years ago

TheAmericanSpirit wrote:
2 years ago
The masters of math have done it again. I swear, we could send a mtgn rocket to the moon with all this collective genius.
lol. I refuse to take any credit at all for plugging numbers into a hypergeometric calculator and making a spreadsheet :)

https://stattrek.com/online-calculator/ ... etric.aspx

User avatar
TheAmericanSpirit
Supreme Dumb Guy
Posts: 2194
Joined: 4 years ago
Answers: 1
Pronoun: he / him
Location: IGMCULSL Papal Palace

Post by TheAmericanSpirit » 2 years ago

pokken wrote:
2 years ago
TheAmericanSpirit wrote:
2 years ago
The masters of math have done it again. I swear, we could send a mtgn rocket to the moon with all this collective genius.
lol. I refuse to take any credit at all for plugging numbers into a hypergeometric calculator and making a spreadsheet :)

https://stattrek.com/online-calculator/ ... etric.aspx
Whatever, man. It's all still Greek to me, so don't diminish my wonder with your humility and facts and such. Allow me to be impressed.
There's no biscuits and gravy in New Zealand.
(Except when DirkGently makes them!)

User avatar
pokken
Posts: 6279
Joined: 4 years ago
Answers: 2
Pronoun: he / him

Post by pokken » 2 years ago

TheAmericanSpirit wrote:
2 years ago
Whatever, man. It's all still Greek to me, so don't diminish my wonder with your humility and facts and such. Allow me to be impressed.
put the number of cards in population size (99 cards)
put the number of things that do what you want in "number of successes" (say 36 lands)
put the number of cards you see in sample size (say 10 cards to hit your third land drop)
put the number of successes you need (e.g. 3 lands)
>=3 = 78%

Post Reply Previous topicNext topic

Return to “Commander”