Filip W.
Sweden Linköping
Euros are better with dice!

Hi all,
I've got a bit of a problem. Basically I've got a deck of cards and each card has 4 binary attributes (so either Yes or No, White or Black etc.).
If I assume an endless deck and draw two cards I can calculate the probabilities that they're similar or dissimilar:
1/16 (4C0) that they're completely different. 4/16 (4C1) that they have 1 attribute in common. 6/16 (4C2) that they have 2 attributes in common. 4/16 (4C3) that they have 3 attributes in common and 1/16 (4C4) that they have all 4 attributes in common.
However, what happens when I pull out another card? How do I calculate the probabilities that it will have some, all or none attributes in common with the other cards? And how do I calculate the probabilities if the deck isn't endless but there are a limited amount of any given card in it?
Thanks in Advance!
EDIT:
Thanks for all the replies. Here's a bit more info:
I've got a game where players draw cards and there are 16 possible cards (there would be 3 or 4 complete sets of 16 cards in a deck). I need to know what the likelihood of drawing one card, then drawing another card which has X number of matching attributes.
Then, I need to know the likelihood that a third card will match the matching attributes of the first two cards (so if the first two cards are 1101 and 1110 I want to know what the likelihood is that the third card has 11XX, 10XX, 01XX on it). And, once I know that I need to know what the probability is that the fourth card matches the matching attributes of the first three cards and so on (until it's becomes as unlikely as to make counting meaningless for this game, say less than 1%)
Thus I need to find a formula for counting the probabilites, as solving it all by hand seems very, very complex.

Rusty McFisticuffs
United States Arcata California

Re: [Math help!] How to calculate probabilities
filwi wrote: Basically I've got a deck of cards and each card has 4 binary attributes (so either Yes or No, White or Black etc.). Wait, just to make sure: do you mean there are 4 distinct cards (black yes, black no, white yes, white no) or 16 distinct cards (0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111)?

United States Plainwell Michigan
Mi cabasa esta muy verde
Et in Vantasia ego

Re: [Math help!] How to calculate probabilities
Van's Law

Key Locks
United States Indianapolis Indiana

Re: [Math help!] How to calculate probabilities
It all depends. The way you have worded the problem sounds way too vague to me. I have absolutely no idea what you mean by an "endless deck". Tell us exactly how many cards there are in the deck and what they have on them. Then we can talk.

Erik Henry
United States Houston Texas

Re: [Math help!] How to calculate probabilities
I think he means if you had a Setlike deck with just:
(1) Red or green shapes on the cards (2) One or two shapes per card (3) Shapes are either ovals or diamonds (4) Shapes are either filled or just outlined
So 16 possible cards, and in the infinite card case you can think of it as returning the card to the deck in between each draw.



Re: [Math help!] How to calculate probabilities
Leezer wrote: It all depends. The way you have worded the problem sounds way too vague to me. I have absolutely no idea what you mean by an "endless deck". Tell us exactly how many cards there are in the deck and what they have on them. Then we can talk. I gathered that the OP was sampling with replacement in the first case, and without replacement in the second; but of course in the second instance the probabilities depend on the number of each kind of card in the deck.
The OP is correct about the second card in the samplingwithreplacement scenario. The answer for the third card, however, is considerably more complex, as it involves joint similarity for three cards.

Erik Henry
United States Houston Texas

Re: [Math help!] How to calculate probabilities
Just 256 possibilities for the first two cards. You could just about do it by hand.
Or, alternatively:
If you solved it for 2 binary attributes, 3 binary attributes, 5 binary attributes, and 6 binary attributes  you could probably figure out the pattern and get the answer for 4 binary attributes.
. . . . If that helps.

Andrew Simpson
United Kingdom Leeds West Yorkshire

Re: [Math help!] How to calculate probabilities
I think this is how it works:
Assuming an endless/infinite deck, i.e. the first draw has no effect on the probability of the second draw (equivalent to returning the cards between draws):
4 bits = 16 distinct cards
2 cards drawn, probability of 2nd with:
0 matching bits 1/16 1 matching bits 4/16 2 matching bits 6/16 3 matching bits 4/16 4 matching bits 1/16
With a finite deck with N cards of each type (where N > 1) :
2 cards drawn, probability of 2nd with:
0 matching bits N / (16N1) 1 matching bits 4N / (16N1) 2 matching bits 6N / (16N1) 3 matching bits 4N / (16N1) 4 matching bits (N1) / (16N1)

Blorb Plorbst
United States Bloomington Indiana
I think we're all bozos on this bus.

Re: [Math help!] How to calculate probabilities
Odds of me answering your question:
1custom4{nil;zilch;jack;zero} > ( zilch) > ( zilch)

 [+]
 305947. CrankyPants
 1custom4{nil;zilch;jack;zero} =
 ( zilch) =
 ( zilch)
 Tue Mar 5, 2013 3:21 pm
Joe Gola
United States Redding Connecticut
and everything under the sun is in tune

Re: [Math help!] How to calculate probabilities
Your question is a little too vague—we can't tell what level of detail you want. Do you only care that a given attribute matches the corresponding attribute on at least one card, or do you want to know how many matches (0, 1 or 2)? And do you really just mean "some" when you say "some," or do you want to know the odds of 1 match on one or two cards, 2 matches on one or two cards, et cetera?
To interpret your question in the manner most conducive to my own laziness, here is the answer for the "endless deck" scenario:
case 1: 1/16 (4C0) that the first two cards are completely different.  1/1 chance all of third card's attributes will match attributes on the other two cards  no chance some but not all of third card's attributes will match attributes on the other two card  no chance third card will have no attributes in common with other two
case 2: 4/16 (4C1) that the first two cards have 1 attribute in common.  1/2 chance all of third card's attributes will match attributes on the other two cards  1/2 chance some but not all of third card's attributes will match attributes on the other two cards  no chance third card will have no attributes in common with other two
case 3: 6/16 (4C2) that the first two cards have 2 attributes in common.  1/4 chance all of third card's attributes will match attributes on the other two cards  3/4 chance some but not all of third card's attributes will match attributes on the other two cards  no chance third card will have no attributes in common with other two
case 4: 4/16 (4C3) that the first two cards have 3 attributes in common  1/8 chance all of third card's attributes will match attributes on the other two cards  7/8 chance some but not all of third card's attributes will match attributes on the other two cards  no chance third card will have no attributes in common with other two
case 5: 1/16 (4C4) that the first two cards have all 4 attributes in common.  1/16 chance all of third card's attributes will match attributes on the other two cards  14/16 chance some but not all of third card's attributes will match attributes on the other two cards  1/16 chance none of third card's attributes will match attributes on the other two cards
So, overall,
81/256 chance that all of the third card's attributes will have a matching attribute on at least one of the two previous cards
174/256 chance that some but not all of the third card's attributes have a matching attribute on at least one of the two previous cards
1/256 chance that none of the third card's attributes will match attributes on the two previous cards.

Filip W.
Sweden Linköping
Euros are better with dice!

Re: [Math help!] How to calculate probabilities
kuhrusty wrote: filwi wrote: Basically I've got a deck of cards and each card has 4 binary attributes (so either Yes or No, White or Black etc.). Wait, just to make sure: do you mean there are 4 distinct cards (black yes, black no, white yes, white no) or 16 distinct cards (0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111)?
16 distinct cards.


