210 Open Daily games
1 Open Realtime game
    Pages:   12   (2 in total)
  1. #1 / 21
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Assume no wild cards for simplicity. 


  2. #2 / 21
    Standard Member Korrun
    Rank
    Brigadier General
    Rank Posn
    #74
    Join Date
    Nov 12
    Location
    Posts
    842

    A A A A A A
    A A A A A B
    A A A A A C
    A A A A B B
    A A A A B C
    A A A A C C
    A A A B B B
    A A A B B C
    A A A B C C
    A A A C C C
    A A B B B B
    A A B B B C
    A A B B C C
    A A B C C C
    A A C C C C
    A B B B B B
    A B B B B C
    A B B B C C
    A B B C C C
    A B C C C C
    A C C C C C
    B B B B B B
    B B B B B C
    B B B B C C
    B B B C C C
    B B C C C C
    B C C C C C
    C C C C C C

    Looks like 10/28 or 36%


  3. #3 / 21
    Prime Amidon37
    Rank
    General
    Rank Posn
    #3
    Join Date
    Feb 10
    Location
    Posts
    1869

    Which makes sense.  Usually in boards that allow 6 cards you don't get a double cash- which makes wilds super valuable in those games.


  4. #4 / 21
    Brigadier General M57 M57 is offline now
    Standard Member M57
    Rank
    Brigadier General
    Rank Posn
    #73
    Join Date
    Apr 10
    Location
    Posts
    5083

    I'll bet if you add the two wilds.. (18-18-18-2 is standard, right?) ..that number jumps up to 40% or above - and I think that's conservative. Those wild cards are going to show up in more than 10% of those hands (conservatively, again), and in every case, it guarantee's you can cash two sets.

    Card Membership - putting the power of factories in your hand.

  5. #5 / 21
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Korrun wrote:

    A A A A A A
    A A A A A B
    A A A A A C
    A A A A B B
    A A A A B C
    A A A A C C
    A A A B B B
    A A A B B C
    A A A B C C
    A A A C C C
    A A B B B B
    A A B B B C
    A A B B C C
    A A B C C C
    A A C C C C
    A B B B B B
    A B B B B C
    A B B B C C
    A B B C C C
    A B C C C C
    A C C C C C
    B B B B B B
    B B B B B C
    B B B B C C
    B B B C C C
    B B C C C C
    B C C C C C
    C C C C C C

    Looks like 10/28 or 36%

    I don't think this is right.  Don't you have to count BCCCCC and CBCCCC and CCBCCC, etc. as all separate hands.  They way you list it, I think you are counting CCCCCC and BCCCCC as equally likely, but I don't think they are.

     

    Here's my attempt:

    AAA AAA

    AAA AAB

    AAA AAC

    AAA ABA

    AAA ABB

    AAA ABC

    AAA ACA

    AAA ACB

    AAA ACC

    AAA BAA

    ....

    ABANDON SHIP!  TOO MANY PERMUTATIONS! 

    I am going to try and do it in code.


  6. #6 / 21
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Wrote some code. 

    I came up with 729 possible six card permutations.

    183 of them had two sets in them.

    So 0.251028806584.  Or basically 1 in 4 chance of having 2 sets if you don't have a wild card.

     

    def isTwoSets(cards):
      counts = {}
      counts['A'] = cards.count('A')
      counts['B'] = cards.count('B')
      counts['C'] = cards.count('C')
      cv = counts.values()
      print counts
      print cv
     
      if 6 in cv:
        print "all six"
        return True
     
      if 3 == cv.count(2):
        print "Two of each"
        return True
     
      if 4 in cv and 1 in cv:
        print "4 of one + one of the each of the others"
        return True  


    def twoSetsInSixCards():
     
      cards = ('A','B','C')
      print cards
      totalCombos = 0;
      twoSetCombos = 0;
      for sixcards in itertools.product(cards,repeat=6):   
        print sixcards
        totalCombos+=1
        if isTwoSets(sixcards):
          twoSetCombos+=1
         
      print twoSetCombos, totalCombos, float(twoSetCombos)/totalCombos


  7. #7 / 21
    Brigadier General M57 M57 is offline now
    Standard Member M57
    Rank
    Brigadier General
    Rank Posn
    #73
    Join Date
    Apr 10
    Location
    Posts
    5083

    Why do you need permutations?  combinations should do the trick..

    CBCCCC is the same as BCCCCC

     

    Card Membership - putting the power of factories in your hand.

  8. #8 / 21
    Standard Member Korrun
    Rank
    Brigadier General
    Rank Posn
    #74
    Join Date
    Nov 12
    Location
    Posts
    842

    I think Ozy's right. Same reason why if you roll two dice and take the total that 7 is the most likely answer and 2 and 12 are the least likely.

    For cards if you just get one card you have:

    A B or C

    If you get a second card then it can be A B or C for each of those first cards:

    AA AB AC BA BB BC CA CB CC


  9. #9 / 21
    Standard Member Mongo
    Rank
    Colonel
    Rank Posn
    #102
    Join Date
    Jun 10
    Location
    Posts
    26

    Given any 5 cards, I think there is only 1 6th card that will allow you to cash in 2 sets (e.g. if first 5 cards are AAAAA, only another A will give you 2 sets...if you have ABCAB then only a C will give you 2 sets) - am I missing anything there?

    So, assuming the deck is given a replacement card every time one is dealt and no wild cards, the chance of getting 2 sets with 6 cards would be 1 in 3 since the first 5 cards are irrelevant (again unless I'm overlooking something there).

    Throw in wild cards and the chance of getting 2 sets goes up of course (it would be chance of no wild cards in 6 draws times 1/3 plus [1-the chance of no wild cards]).

    If the deck contains 18 of A,B and C and 2 wild then the chance of no wilds (again assuming the deck is replaced with new cards as they are dealt out) would be (54/56)^6 which is just a bit over 80%. So we would have .80396 * (1/3) + (1-.80396) = .464027

    In case it wasn't clear, having a wild card guarantees that you will have 2 sets with 6 cards (since any 5 non wilds gives one set plus 2 extra cards...add in wild and you get your second set). Adding in wild cards makes quite the difference!

    Did I miss anything or make any incorrect assumptions?


  10. #10 / 21
    Standard Member Korrun
    Rank
    Brigadier General
    Rank Posn
    #74
    Join Date
    Nov 12
    Location
    Posts
    842

    Wowy zowy... 36%... 25%... 33%...


  11. #11 / 21
    Premium Member Chele Nica
    Rank
    Lieutenant General
    Rank Posn
    #6
    Join Date
    Dec 14
    Location
    Posts
    627

    Another good example of why I gave up being a math major in college. I don't even understand all of Mongo's answer, but the first 3 paragraphs make complete sense to me, and would agree that 33% is the right answer for no wild cards.

    This of course assumes replacement card when card is dealt (as Mongo stated), otherwise, you're looking at what cards are left from the deck, and the probabilities are completely different. If you had AAAAA, the probability of getting a 6th A will be smaller than if you wanted to get a B after having ABCAC, for example


  12. #12 / 21
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    Using combinations (at which I am admittedly very rusty), I came up with 33.3% as well. It should be noted that this is calculated without replacement, assuming that the engine actually uses a "deck" of cards with 18 As, 18 Bs, and 18 Cs.

    The probability of getting two sets with no wilds is the sum of the individual probabilities of the different combinations of two sets:

    p(AAA and BBB) + p(AAA and CCC) + p(BBB and CCC) + p(AAA and ABC) + p(BBB and ABC) + p(CCC and ABC) + p(ABC and ABC) + p(AAA and AAA) + p(BBB and BBB) + p(CCC and CCC)

    Note that

    p(AAA and BBB) = p(AAA and CCC) = p(BBB and CCC)

    p(AAA and ABC) = p(BBB and ABC) = p(CCC and ABC)

    p(AAA and AAA) = p(BBB and BBB) = p(CCC and CCC)

    So we can simplify:

    3 * p(AAA and AAA) + 3 * p(AAA and BBB) + 3 * p(AAA and ABC) + p(ABC and ABC)

    If I did my combinatorics right, then:

    p(AAA and AAA) = (18 choose 6) / (54 choose 6) = 0.00071877807

    p(AAA and BBB) = (18 choose 3)^2 / (54 choose 6) = 0.02578122685

    p(AAA and ABC) = (18 choose 4) * (18 choose 1)^2 / (54 choose 6) = 0.03838748852

    p(ABC and ABC) = (18 choose 2)^3 / (54 choose 6) = 0.13867480228

    So,

    p(2 sets) = 3 * 0.00071877807 + 3 * 0.02578122685 + 3 * 0.03838748852 + 0.13867480228 = 0.3333372826.

     

    Edited Sat 16th Jan 23:03 [history]

  13. #13 / 21
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    If we add in wilds, the probability of 2 sets jumps quite a bit, to 47%. Now the probability, I think, should look like this:

    p(AAA and BBB) + p(AAA and CCC) + p(BBB and CCC) + p(AAA and ABC) + p(BBB and ABC) + p(CCC and ABC) + p(ABC and ABC) + p(AAA and AAA) + p(BBB and BBB) + p(CCC and CCC) + p(1 wild) + p(2 wilds)

    Note that having at least 1 wild in a hand of six should guarantee you two sets.

    Simplified,

    3 * p(AAA and AAA) + 3 * p(AAA and BBB) + 3 * p(AAA and ABC) + p(ABC and ABC) + p(1 wild) + p(2 wilds)

    Calculating the components,

    p(AAA and AAA) = (18 choose 6) / (56 choose 6) = 0.00057175528

    p(AAA and BBB) = (18 choose 3)^2 / (56 choose 6) = 0.02050779409

    p(AAA and ABC) = (18 choose 4) * (18 choose 1)^2 / (56 choose 6) = 0.03053550223

    p(ABC and ABC) = (18 choose 2)^3 / (56 choose 6) = 0.11030950181

    p(1 wild) = (2 choose 1) * (54 choose 5) / (56 choose 6) = 0.1948051948

    p(2 wild) = (2 choose 2) * (54 choose 4) / (56 choose 6) = 0.00974025974

    And putting it all together,

    p(2 sets) = 3 * 0.00057175528 + 3 * 0.02050779409 + 3 * 0.03053550223 + 0.11030950181 + 0.1948051948 + 0.00974025974 = 0.46970011115

     


  14. #14 / 21
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    So basically, I agree with Mongo!


  15. #15 / 21
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Mongo's post made so much sense, I decided there must be a bug in my code.  Went back and discovered I'd missed the case where you had 2 sets of three.  Added this to my check for two sets:

        if 2 == cv.count(3):
        print "two sets of three"
        return True


    And now I also get .3333 chance.

    Edited Mon 18th Jan 01:40 [history]

  16. #16 / 21
    Premium Member Yertle
    Rank
    Major General
    Rank Posn
    #21
    Join Date
    Nov 09
    Location
    Posts
    3997

    From a few years ago, there is a virtual card deck rather than a replacement card system: http://www.wargear.net/forum/showthread/1547/card_exchange

    Hugh wrote:
    Yertle wrote:
    Toto wrote:

    but I would need Tom to tell if the card drawing system takes into account the already used cards.

    I'm not tom, but yes there is a "virtual deck" according to the Card Distribution settings.  Once that deck runs out a completely new one is created to be drawn from.  At least that's the way its been described.

    This is accurate. An array is initialized to hold the values of the distribution settings. As each card is drawn, one of the array values is decremented. On the last card (when the total of the values is 1), when the drawcard function is called, the array is reset to its distribution settings.

    My original code has been changed to accomodate a non-18,18,18,2 distribution, but my guess is that it is still functionally equivalent to this. 

     

    You have been granted the title of Strategist!
    Edited Mon 18th Jan 16:31 [history]

  17. #17 / 21
    Brigadier General M57 M57 is offline now
    Standard Member M57
    Rank
    Brigadier General
    Rank Posn
    #73
    Join Date
    Apr 10
    Location
    Posts
    5083

    Mongo wrote:

    Given any 5 cards, I think there is only 1 6th card that will allow you to cash in 2 sets (e.g. if first 5 cards are AAAAA, only another A will give you 2 sets...if you have ABCAB then only a C will give you 2 sets) - am I missing anything there?

    So, assuming the deck is given a replacement card every time one is dealt and no wild cards, the chance of getting 2 sets with 6 cards would be 1 in 3 since the first 5 cards are irrelevant (again unless I'm overlooking something there).

    Did I miss anything or make any incorrect assumptions?

    Probably not - I was a musician, not a math major, so my logic is usually flawed by design. 

    However, in the case of AAAAA being drawn, aren't there  49 cards left, only 13 of which are A, which is only a 25.5% shot to make?

    Card Membership - putting the power of factories in your hand.
    Edited Mon 18th Jan 17:18 [history]

  18. #18 / 21
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    M57 wrote:

    However, in the case of AAAAA being drawn, aren't there  49 cards left, only 13 of which are A, which is only a 25.5% shot to make?

    You're asking a different question, which is a conditional probability: what is the probability of getting a second set given that the first 5 cards are AAAAA?

    It is possible to calculate the (unconditional) probability that a randomly drawn 6-card hand contains two sets using conditional probabilities like what you pose, but you would have to cover every possible initial 5-card hand and then do some fancy maths to deal with unions and intercepts... Which is why I think that Mongo's method is potentially misleading (although it appears to give the right result). The more straightforward method is to use combinations, which Ozy did by brute force code and I calculated through combinations formulas. 


  19. #19 / 21
    Prime Amidon37
    Rank
    General
    Rank Posn
    #3
    Join Date
    Feb 10
    Location
    Posts
    1869

    and Korrun's initial calculations was correct for sampling with replacement- right? 


  20. #20 / 21
    Brigadier General M57 M57 is offline now
    Standard Member M57
    Rank
    Brigadier General
    Rank Posn
    #73
    Join Date
    Apr 10
    Location
    Posts
    5083

    Kjeld wrote:
    M57 wrote:

    However, in the case of AAAAA being drawn, aren't there  49 cards left, only 13 of which are A, which is only a 25.5% shot to make?

    You're asking a different question, which is a conditional probability: what is the probability of getting a second set given that the first 5 cards are AAAAA?

    It is possible to calculate the (unconditional) probability that a randomly drawn 6-card hand contains two sets using conditional probabilities like what you pose, but you would have to cover every possible initial 5-card hand and then do some fancy maths to deal with unions and intercepts... Which is why I think that Mongo's method is potentially misleading (although it appears to give the right result). The more straightforward method is to use combinations, which Ozy did by brute force code and I calculated through combinations formulas. 

    Yeah, and I was a sucker for the Monty Hall paradox. I was responding directly to Mongo's specific example as a logical proof.

    Card Membership - putting the power of factories in your hand.

You need to log in to reply to this thread   Login | Join
 
Pages:   12   (2 in total)