GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there anyone here interested in helping me understand some counting theory? It's a rather long problem to describe and could be responsible for causing loss of sleep, hair pulling, and obsession. I speak from personal experience.
As a teaser it's a "deck of cards" problem trying to determine probabilities for drawing certain card combinations. This is not the classic poker probability calculations. Rather, it's dealing with a game I played back in high school and college: Magic: The Gathering. I've got a renewed, nostalgic interest, and wanted to do some analysis.
So, anybody here up for a combinations/probability math problem?
How many ways can I draw an opening hand (7 cards) and have the necessary cards to play Arenson's Aura. In other words, I have to draw at least one Arenson's Aura, I have to draw at least 3 land, and at least one of those three land has to be a Plains.
I'll use C( n, r ) to signify calculating the combinations. In other words:
C( n, r ) = n! / ( r! * (n - r)! )
So, the total number of ways to draw an opening hand is C( 60, 7 ) => choose 7 cards out of 60, and order drawn is not relevant
C( 60, 7 ) = 386,206,920
Ok, so to calculate the probability, we need to calculate how many ways an opening hand can contain the cards listed above. This is where I hit a serious snag. The different methods I employ give wildly different results. First attempt:
Have to draw 1 Arenson's Aura. That can be done in C( 4, 1 ) = 4
Have to draw 1 Plain. That can be done C( 12, 1 ) = 12
Have to draw two more land. C( 19, 2 ) = 171
Have to account that the Plain in the earlier step is no longer available, which is why I use 19 instead of 20 ( total land - 1 )
The remaining 3 cards in the opening hand can be from any left in the deck. C( 56, 3 ) = 27,720
Again, 4 cards have been picked, leaving 56 to choose 3 from
Soooooo... I figured the answer would be 4 * 12 * 171 * 27,720 = 227,525,760
And that would mean you have a probability of 227,525,760 / 386,206,920 = 58.9% chance
That doesn't sit well with my common sense expectation (and I sure don't see that combination come up 1 out of every 2 opening draws). So I did what any self-respecting computer geek would do. I wrote a program to count the possible opening hands and also did it by hand. The program and the hand calculations differ (still tracking down the difference), but I trust the program more than my ability to punch numbers. Anyway, the program said there were only 50,769,368 possible opening hands that met the criteria. That gives a percentage of about 13.1% (which sits much better with me).
So, the question is, what is wrong with the method above? I haven't been able to work backward from the result, and other methods I've tried have failed miserably. Any ideas?
Last edited by Dark_Helmet; 08-30-2004 at 02:48 AM.
Hehehe... didn't know what you were signing up for did you?
I've found a method that agrees with the computer's brute force approach, but it's anything but simple. Essentially, the method I posted above was "overcounting". As an example, say I pick the first copy of Arenson's Aura in the first step, and then pick the second copy of Arenson's Aura after picking the land. That selection is no different from picking the second copy in the first step, and then picking the first copy after the lands, but both were being counted as "unique" with that method. In other words: "Bad, bad Dark_Helmet!".
This dampens my hopes of writing any sort of deck analysis tool. I had grand plans for calculating probabilities for a deck to "unlock" (hit it's special card combo). To calculate it, you have to exert some non-trivial intelligence to break up the problem. Otherwise, it's brute force, and that's not really an option. After the first few draws, the combinations become prohibitive. For example, at turn 6, you've drawn 12 cards out of a 60-card deck. That's C( 60, 12 ) = 1,399,358,844,970. Even super-fast machines will slow down trying to cycle through almost 1.5 trillion possibilities.
If you're curious (our just bored to tears), I can post how I got the same number as the computer.
i usually use a more simple approach, i tend to just give each card type a possibility out of the number of cards (i have a deck about 90 cards big, i think about 30 lands, and every creature is unique (i think every card except land i unique in that deck actually .... haven't played in a while)
anyways, instead of brute forcing the issue, why not just accept probability's and use those to determine a "good" hand from a bad one (and i think you want 8 cards, as you get 7 cards to start with, then draw one before your turn)
anyways, just in the few minutes i though and wrote on paper i got the number thats about 2% (ok, so somewhere between 2-3% I'm lazy and want to sleep so I'm not finishing the division ) plus i think i messed up, i got 4/180 for the needed cards, but you get 4 more so ill just say 7% chance of getting a overly good hand, now I'm going to bed good morning all (i hate sleeping at night)
wellp hope you solve whatever it is your trying to do ..
SciYro:
Doing a rough estimate might end up being the route I take. I have a perfectionist streak that's at odds with doing that, but my realist streak is starting to beat the living daylights out of the perfectionist.
Oh, and about the 7 versus 8 card thing. You're completely right. According to the rules, you draw one at the beginning of your first turn. The people I used to play with though did things a little different, and followed tournament-style guidelines. Each player rolls to see who "gets the option". The options are playing first or drawing first. That is, the person who plays first sacrifices their first draw. It's an attempt to make starting out a little more even. It's debatable whether it's more fair or not. While the first person to play doesn't get an 8th card (limiting their options), that also means they can last for one turn longer without having to discard. It also means that if both players have equal-sized decks and draw 1 card per turn, then the player that plays first will win if the decks are exhausted.
Geez, I need help. Apparently my analysis streak is beating the crap out of both the perfectionist and the realist streaks.
XavierP:
I didn't expect there would be many links about it. I figured this was uber-geek territory, especially since it deals with some complex concepts that I was exposed to back in college. Part of my coursework included a "Discrete Mathematics" course that dealt with counting methods, set theory, probabilities, and all sorts of other good junk.
I haven't taken a look at all the links yet. Maybe I'll find something that will "unlock" the situation for me... Thanks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.