2
$\begingroup$

I'm creating AI for a card game, and I run into problem calculating the probability of passing/failing the hand when AI needs to start the hand. Cards are A, K, Q, J, 10, 9, 8, 7 (with A being the strongest) and AI needs to play to not take the hand.

Assuming there are 4 cards of the suit left in the game and one is in AI's hand, I need to calculate probability that one of the other players would take the hand. Here's an example:

AI player has: J Other 2 players have: A, K, 7

If a single opponent has AK7 then AI would lose. However, if one of the players has A or K without 7, AI would survive. Now, looking at possible distribution, I have:

P1   P2   AI ---  ---  --- AK7       loses AK   7    survives A7   K    survives K7   A    survives A    7K   survives K    7A   survives 7    KA   survives      AK7  loses 

Looking at this, it seems that there is 75% chance of survival.

However, I skipped the permutations that mirror the ones from above. It should be the same, but somehow when I write them all down, it seems that chance is only 50%:

P1   P2   AI ---  ---  --- AK7       loses A7K       loses K7A       loses KA7       loses 7AK       loses 7KA       loses AK   7    survives A7   K    survives K7   A    survives KA   7    survives 7A   K    survives 7K   A    survives A    K7   survives A    7K   survives K    7A   survives K    A7   survives 7    AK   survives 7    KA   survives      AK7  loses      A7K  loses      K7A  loses      KA7  loses      7AK  loses      7KA  loses 

12 loses, 12 survivals = 50% chance. Obviously, it should be the same (shouldn't it?) and I'm missing something in one of the ways to calculate.

Which one is correct?

  • 1
    If the cards are dealt, the results are independent of the card order. Unless a rule tells the player they must play a certain card, it doesn't matter what what order the player is holding their cards, what matters is simply what they play.2012-11-02
  • 0
    The cards are dealt from a shuffled 24 card deck, with 3 suits. Each player has exactly 8 cards, but in various suit. The problem I gave above only considers a single suit. I want to calculate probability for lowest card in each suit and then play the suit where the player has the most chance of surviving. This means that other two players might have 0-3 cards each. AI only knows that they have 3 cards total, because from other 5 cards, 4 have already been played and the remaining one is in AI's hand.2012-11-02
  • 0
    What is the point of ranks? Everyone must play the same? It's a bit tricky to come up with an exact formula without all the rules for play.2012-11-02
  • 0
    Everyone must play the same suit and highest card loses.2012-11-02

2 Answers 2