

04242012, 10:54 AM

#1

Murphy's Law
Join Date: Jul 2010
Age: 19
Posts: 30,036

Math, Probability and YuGiOh!
Warning: Math thread impending, some of it is advanced
Notes:
• I will be using "·" as a radix point instead of "." or ",". It's what I'm accustomed to. I also made this up on the spot, so some of the things posted may already have been calculated in the past.
• n is the number of cards drawn.
• d is the size of the deck.
• s is the group size.
• P(A) is the probability of drawing at least 1 copy of a card from group s.
• P(B) is the probability of drawing all cards from group s.
This thread is basically here to help people understand how probability works. I've seen similar things in the past, but they only give direct probabilities as opposed to the actual methods used.
I'd also greatly appreciate any help, errors or additions people have to offer.
TL;DR Useful things
The probability of opening with a card that you run one copy of: 15%
The probability of opening with a card that you run two copies of: 28·077%
The probability of opening with a card that you run three copies of: 39·433%
Formula for the probability of drawing a card from s:
Quote:
http://i.imgur.com/3Ge8e.jpg
P(A) = 1  ∏((dsr+1)÷(dr+1))
n over ∏, r = 1 under ∏ and r as a subscript for ((dsr+1)÷(dr+1))
n is the number of cards drawn
r is the starting number and has to be 1
d is the number of cards being ran in the deck
s is the size of the group you are trying to find

Formula for the probability of opening with all cards from s: (IN TESTING: MAY NOT WORK)
Quote:
P(B) = (n1)! ÷ dCs
or
P(B) = [s! × (n1)! × (ds)!] ÷ d!

(NOTE: this formula stops working once the samples are disrupted, e.g. something like Pot of Duality or RotA is used.)
Number of opening hand combinations (assuming one copy of every card) : 3,383,380
Permutations
This is the most common way of handling probabilities in this game. It would help if I had a tree diagram to help explain this, but I guess I'll improvise. I'll throw in some P() notation for those who are inquisitive, but you don't need to know that.
First an example with a fair twosided coin toss. We're going to throw the coin twice.
I'll give you the results first and then show how it's calculated.
2 heads: 25%
1 head and 1 tail: 50%
2 tails: 25%
This is because:
The chance of getting a head is 0·5 and the chance of getting a tail is also 0·5.
⠀⠀P(H) = 0·5
⠀⠀P(T) = 0·5
⠀⠀P(H₁∩H₂) = 0·5 × 0·5 = 0·25
∩ means that the two events are intersected. You could read P(H₁∩H₂) as "The probability of getting a head on the first throw and then getting a head on the second throw".
This basically means that the chance of getting a head and then another head is 0·25 or 25%.
The same is also true for tails: P(T₁∩T₂) = 0·5 × 0·5 = 0·25
All the possible options must add up to 1, hence
⠀⠀1(0·25 + 0·25) = 0·5
⠀⠀∴ P(H∩T) = 0·5
You can also calculate this by doing:
⠀⠀P(H₁∩T₂) = 0·5 × 0·5 = 0·25
⠀⠀P(T₁∩H₂) = 0·5 × 0·5 = 0·25
but this takes more time than the previous calculation.
Which give you the other two possibilities on the tree diagram. Added together, they make 0·5, which is what we got through our calculations.
Now we're going to apply this working to YuGiOh!.
Say you have 1 copy of a card in your deck and you run 40 cards. Something like Monster Reborn; or whatever you like. Calculating the chance of drawing it in an opening hand confuses a lot of people.
The probability of the first card in your hand being Monster Reborn is 1/40, or 2·5%.
The first reaction you may have is to simply Multiply it by 1/40 5 more times, but this is incorrect. The sample sizes change because we're handling something that does not replace itself like a coin does. A coin will always have a 1/2 chance of landing on heads or tails, but a deck changes for every card removed.
You also have to rule out drawing Monster Reborn twice (which is impossible because you're using 1 copy).
You could calculate every single permutation on a tree diagram and add them together to get P(A), but that is extremely long winded and hideously inefficient. Like before, the fastest way to calculate this is to calculate P(A′) (the probability of drawing 0 cards of the group) and then doing 1  P(A′) to get P(A).
This is done by:
⠀⠀P(A) = 1  ((39/40) × (38/39) × (37/38) × (36/37) × (35/36) × (34/35))
Which is exactly 15%.
The good thing about this method is that it shows the chance of drawing at least 1 Monster Reborn instead of simply the probability of drawing Monster Reborn. Assuming we run 2 Solemn Warning, this method shows the chance of drawing 1 SW or 2 SW.
This is done by:
⠀⠀P(A) = 1  ((38/40) × (37/39) × (36/38) × (35/37) × (34/36) × (33/35))
Which is 28·077% to three decimal places.
And finally there's the chance of opening with a card that you're using 3 copies of.
This is done by:
⠀⠀P(A) = 1  ((37/40) × (36/39) × (35/38) × (34/37) × (33/36) × (32/35))
Which is 39·433% to three decimal places
If you also run cards like Reinforcement of the Army, you can consider those cards to be additional copies of the card you're trying to find the probability of opening with. Also, you can adapt this to find groups of cards too.
The general form of the above calculation:
⠀⠀P(A) = 1  (((ds)/d) × (((d1)s)/(d1)) × (((d2)s)/(d2)) × (((d3)s)/(d3)) × (((d4)s)/(d4)) × (((d5)s)/(d5)))
Which I conveniently converted to this formula:
⠀⠀P(A) = 1  ∏((dsr+1)÷(dr+1))
n over ∏, r = 1 under ∏ and r as a subscript for ((dsr+1)÷(dr+1)).
n is the number of cards drawn
r is the starting number and has to be 1
d is the number of cards being ran in the deck
s is the size of the group you are trying to find
Here's a better laid out version of the working: http://i.imgur.com/hGAtz.jpg
(NOTE: this formula stops working once the samples are disrupted, e.g. something like Pot of Duality or RotA is used.)
Tutorial for my formula
Formula: http://i.imgur.com/3Ge8e.jpg
We have the formula P(A) = 1  ∏((dsr+1)÷(dr+1))
I'll explain this using a standard playing card deck. I'll go through all the variables.
We're going to find the chance of opening with at least 1 ace given that we open with 3 cards and are running a standard 52 card deck. We define this probability as P(A) as always. The A is technically irrelevant, any letter or symbol can be substituted. I chose A just because I lacked a better symbol and A is the first letter of the alphabet.
First we have n. n is the number of cards drawn, specifically n is the size of our opening hand. We're going to use a 3 card opening hand here. In YuGiOh!, you would typically have n = 6. The n above the ∏ means that we will be repeating the bracket up to n times.
Secondly, r is the same as with ∑ notation. r is our starting number when working our way towards n. I have set the formula out so that r = 1.
d is the deck size. In a standard playing card deck, this is 52. Adjust this to YuGiOh! by setting it to 40 (or however many cards you're using).
s is the group size, or the number of copies of a card you are using. In this case, we are using 4 aces. Adjust this to whatever number you require. For YuGiOh!, this will be 1, 2 or 3.
The ∏ means we will be multiplying each quotient together starting at r and working our way to n.
Note: r=1, n∈ℕ, d∈ℕ, s∈ℕ, d>s, d≠0, d≥n, n≥1
Working:
➊: Worked Example 1
http://i.imgur.com/VYDCZ.jpg
①: Substitute the n in ∏ as well as d and s.
⠀⠀P(A) = 1  ∏((524r+1)÷(52r+1))
3 over ∏, r = 1 under ∏ and r as a subscript for ((524r+1)÷(52r+1)).
②: Simplify.
⠀⠀P(A) = 1  ∏((49r)÷(53r))
3 over ∏, r = 1 under ∏ and r as a subscript for ((49r)÷(53r)).
③: Convert ∏.
⠀⠀P(A) = 1  [ ((491)÷(531))₁ × ((492)÷(532))₂ × ((493)÷(533))₃ ]
Note how r starts at 1 and increases until r=n.
④: Simplify and convert to fractions.
⠀⠀P(A) = 1  [ 48/52 × 47/51 × 46/50 ]
Note how this is the same function as in the YuGiOh! permutation example.
⑤: Solve.
⠀⠀P(A) = 1  [ 0·78262 ] to five decimal places
⠀⠀P(A) = 0·21738 to five decimal places
⑥: Convert to a percentage.
⠀⠀P(A) = 21·738%
Hence the chance of opening with at least one ace is 21·738%.
➋: Worked example 2
http://i.imgur.com/X5WIE.jpg
Binomial Coefficients
This is something I stumbled across that works nicely here.
nCr can be used to calculate combinations.
⁴⁰C₆ = 3,383,380 opening hand combinations (assuming 1 of each card or that each card is treated as being different).
⠀⠀⁴⁰C₆ = 40!/6!(406)! = 3,383,380
You can also use this to find out things such as the probability of all 5 of your immediate hand being Exodia pieces.
⠀⠀1/(⁴⁰C₅) = (5/40) × (4/39) × (3/38) × (2/37) × (1/36) = 1/658,008
Which is 0·000152% to three significant figures. Note that 0·000152% ≠ 0%, so don't call your opponent a cheater if they instawin; it can happen.
Last edited by Valafar123 : 04272012 at 11:45 AM.



04242012, 11:15 AM

#2

Luke.L.
Join Date: Sep 2009
Location: Brighton, England
Posts: 21,923

*Rates five stars*



04242012, 11:46 AM

#3

Murphy's Law
Join Date: Jul 2010
Age: 19
Posts: 30,036

Quote:
Originally Posted by yoshi777
*Rates five stars*

Who would have thought that ALevel maths has a use.



04242012, 11:47 AM

#4

Luke.L.
Join Date: Sep 2009
Location: Brighton, England
Posts: 21,923

You can do that without ALevel maths.



04242012, 11:57 AM

#5

Murphy's Law
Join Date: Jul 2010
Age: 19
Posts: 30,036

God damn, Tapatalk undid the sigmas. .



04242012, 12:02 PM

#6

Dark Acceptance
Join Date: May 2011
Location: The shadow of a shadow (UK)
Age: 19
Posts: 7,186

I'm gonna have to start redirecting people here when they get their probabilities wrong. Nicely laid out and easy to understand (although I am doing A Level Maths so that could have something to do with it.) Definitely useful stuff if you want to go into that much detail.
Additional Comment:
Quote:
Originally Posted by Valafar123
God damn, Tapatalk undid the sigmas. .

And the not equal to in the last line.
Last edited by AcselOfDarkness : 04242012 at 12:02 PM.
Reason: Automerged Doublepost



04242012, 01:35 PM

#7

Murphy's Law
Join Date: Jul 2010
Age: 19
Posts: 30,036

Quote:
Originally Posted by AcselOfDarkness
I'm gonna have to start redirecting people here when they get their probabilities wrong. Nicely laid out and easy to understand (although I am doing A Level Maths so that could have something to do with it.) Definitely useful stuff if you want to go into that much detail.
Additional Comment:
And the not equal to in the last line.

Thanks.
Yeah, you'd need a good understanding of maths to get this.
And it undid the intersections. .



04242012, 01:42 PM

#8

Dark Acceptance
Join Date: May 2011
Location: The shadow of a shadow (UK)
Age: 19
Posts: 7,186

Yay, Valafar said I have a good understanding of Maths. And damn Tapatalk, undoing all the special characters (just seen the &there4 halfway through), luckily it's still understandable.
I think from now on when I'm in Maths I'll just work on YuGiOh related maths, rather than the actual stuff. As much as I enjoy Maths, this is a different level of interesting (not to mention relevant to my real world scenarios )



04242012, 01:44 PM

#9

The Jewish PikaG!
Join Date: Jan 2006
Location: Rocky Top
Posts: 10,786

Love this. Good job here sir
Additional Comment:
Quote:
Originally Posted by AcselOfDarkness
Yay, Valafar said I have a good understanding of Maths. And damn Tapatalk, undoing all the special characters (just seen the &there4 halfway through), luckily it's still understandable.
I think from now on when I'm in Maths I'll just work on YuGiOh related maths, rather than the actual stuff. As much as I enjoy Maths, this is a different level of interesting (not to mention relevant to my real world scenarios )

On topic with this... I am actually using some of the stuff I am learning in stats to calculate some Yugioh statistics. Its fun to apply your knowledge to something you love
Last edited by Bleakdragon55 : 04242012 at 01:44 PM.
Reason: Automerged Doublepost



04242012, 01:51 PM

#10

Dark Acceptance
Join Date: May 2011
Location: The shadow of a shadow (UK)
Age: 19
Posts: 7,186

Quote:
Originally Posted by Bleakdragon55
On topic with this... I am actually using some of the stuff I am learning in stats to calculate some Yugioh statistics. Its fun to apply your knowledge to something you love

Nice. I did some Statistics at GCSE level, the teaching was rubbish and I was ill at the time so I didn't really like it. I don't do any Statistics no until next academic year, at least this gives me something to look forward to.
A friend of mine (also a YuGiOh player) is debating whether to take Maths next year, I might show him this and see if it helps him make a decision. I expect it's a bit off putting if you don't like Maths or just don't understand.



04242012, 01:58 PM

#11

The Jewish PikaG!
Join Date: Jan 2006
Location: Rocky Top
Posts: 10,786

Quote:
Originally Posted by AcselOfDarkness
Nice. I did some Statistics at GCSE level, the teaching was rubbish and I was ill at the time so I didn't really like it. I don't do any Statistics no until next academic year, at least this gives me something to look forward to.
A friend of mine (also a YuGiOh player) is debating whether to take Maths next year, I might show him this and see if it helps him make a decision. I expect it's a bit off putting if you don't like Maths or just don't understand.

That's the big thing with, you need to have a good teacher, or else it doesn't matter. I am lucky to have had an amazing calc teacher and stats teacher.
What math is he planning on taking?



04242012, 02:04 PM

#12

Dark Acceptance
Join Date: May 2011
Location: The shadow of a shadow (UK)
Age: 19
Posts: 7,186

Quote:
Originally Posted by Bleakdragon55
That's the big thing with, you need to have a good teacher, or else it doesn't matter. I am lucky to have had an amazing calc teacher and stats teacher.
What math is he planning on taking?

Yeah, back then the teacher was [censored] at teaching. Currently though, it isn't nearly as bad, I pick things up and understand it easily, partly because I have good teachers. Hell, they asked me to start mentoring other students in the class so I and they must be doing something right.
As far as I can tell, he was planning on taking AS Maths for a year (Core 1, Core 2 and Decision 1 Modules). I don't think he was going to go into year 2 though since it would be his third year at college.



04242012, 02:11 PM

#13

The Jewish PikaG!
Join Date: Jan 2006
Location: Rocky Top
Posts: 10,786

Quote:
Originally Posted by AcselOfDarkness
Yeah, back then the teacher was [censored] at teaching. Currently though, it isn't nearly as bad, I pick things up and understand it easily, partly because I have good teachers. Hell, they asked me to start mentoring other students in the class so I and they must be doing something right.
As far as I can tell, he was planning on taking AS Maths for a year (Core 1, Core 2 and Decision 1 Modules). I don't think he was going to go into year 2 though since it would be his third year at college.

I'm not that advanced at math :P. Though I would love to be, just a simple freshman at college.
HE should do it though if he loves math. And if it fulfills his passion for card games, then it should be obvious to do it.



04242012, 02:19 PM

#14

Dark Acceptance
Join Date: May 2011
Location: The shadow of a shadow (UK)
Age: 19
Posts: 7,186

Quote:
Originally Posted by Bleakdragon55
I'm not that advanced at math :P. Though I would love to be, just a simple freshman at college.
HE should do it though if he loves math. And if it fulfills his passion for card games, then it should be obvious to do it.

I remember back in September when I was knew at college, everything was so different from school and it was comprehensively the best time of my learning career so far. To think that was only 8 months ago and I'm nearly halfway through my entire college life.
The thing is, I don't think he loves Maths, not in the same way I do. He's more taking it as an extra subject, at the moment we are doing a huge IT course that counts as 3 A levels but I'm doing Maths as well. It's a useful subject to have, even if you don't like it and can be applied to so many basic scenarios in life (as this thread proves). If he loved it, he'd probably have taken Maths and/or Further Maths at the beginning of term. As a far as taking an extra subject goes though, Maths seems like the logical choice. The card games is just a bonus.



04242012, 03:18 PM

#15

Murphy's Law
Join Date: Jul 2010
Age: 19
Posts: 30,036

Tell him not to do maths. ._.
I used to think I was good at maths, but ALevel is intense.



04242012, 03:23 PM

#16

Luke.L.
Join Date: Sep 2009
Location: Brighton, England
Posts: 21,923

Told you
I did not like the change one bit, so happy I dropped it last year.



04242012, 03:34 PM

#17

Registered User
Join Date: Oct 2005
Location: Greece
Posts: 282

Just how your mind should work on every duel :P
__________________
Visit my Ebay HERE . Thanks



04242012, 09:48 PM

#18

Pojo Veteran
Join Date: Jul 2008
Age: 25
Posts: 3,506

this is why i think yugioh should start being marketed to teenagers instead of little kids.
...
and my brain hurts now... i can understand some of it, but my forte was english, not math



04242012, 10:00 PM

#19

The Observer
Join Date: Oct 2011
Location: Argentina
Age: 20
Posts: 34,929

I... can... understand it... quite well...
Thanks Val.
*overloads and faints*
__________________
ˇAbanico de servicios!
Quote:
Originally Posted by Jazriel
You could build a man a fire, and he'll be warm for a while. You could teach a man to build a fire, and he might understand. Or you can set that man on fire and he'll be warm for the rest of his life.




04252012, 02:15 AM

#20

Dark Acceptance
Join Date: May 2011
Location: The shadow of a shadow (UK)
Age: 19
Posts: 7,186

Quote:
Originally Posted by Valafar123
Tell him not to do maths. ._.
I used to think I was good at maths, but ALevel is intense.

Fair enough, I don't find it too bad. Each to his own I guess. I'll pass that on anyway though.



04252012, 03:42 AM

#21

Murphy's Law
Join Date: Jul 2010
Age: 19
Posts: 30,036

Found a problem with my formula. Will update OP with the working version.



04252012, 03:59 AM

#22

Luke.L.
Join Date: Sep 2009
Location: Brighton, England
Posts: 21,923

You better. Now I'm on my main PC I can read it all.



04252012, 07:45 AM

#23

The Jewish PikaG!
Join Date: Jan 2006
Location: Rocky Top
Posts: 10,786

The math itself doesn't look to intense. It's just written in text form instead of symbols so it looks more complicated.
Oh the Internet... Why do you hate my math?



04252012, 09:45 AM

#24

Murphy's Law
Join Date: Jul 2010
Age: 19
Posts: 30,036

All fixed. I'll add a tutorial for the formula.
Additional Comment:
Some colour coding for good measure.
Last edited by Valafar123 : 04252012 at 09:45 AM.
Reason: Automerged Doublepost



04252012, 11:57 AM

#25

The Jewish PikaG!
Join Date: Jan 2006
Location: Rocky Top
Posts: 10,786

http://i.imgur.com/RFFic.jpg?1
That is supposed to be a summation symbol, right?



Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off





