I would like to be able to figure out what the meld potential (upper/lower boundaries as well as probability for each score) is for a given hand, ideally the solution would calculated for each suit. This is to support a web application that will let people play against AI players and/or other people. One of the weaknesses I've found in existing pinochle applications is the computer's inability to bid (guess how many points they can score) effectively.
Question Scope Reductions
- I would like to tackle the problem of the potential points during the trick phase in another question.
- Furthermore there is also the concept of passing cards to your partner in the 4 and 5 player variations. I would like to avoid that complication at this time since the cards you pass to your partner aren't random (hopefully).
Given the points above I would like the solution to be targeted at the 3 player variation where each player is dealt 15 cards, and the bid winner gets to add 3 random cards to their hand (but the bid winner still is restricted to a maximum of 15 cards melded). That being said I plan on asking additional questions that will remove those limitations above in the future.
My current plan is to just brute force through all the possible combinations, aggregate the data generated for each hand and save the results. That should give me the output I need but that will take quite a while, and maintaining all the data will require a ton of storage. I'm hoping that someone will be able to find a short cut that would allow me to calculate the distribution at runtime fairly cheaply instead.
According to the formula derived in a paper called "Using Pinochle to motivate the restricted combinations with repetitions problem" by P. S. Gorman, J. D. Kunkel, and F. J. Vasko (Aug 2010), there are ~2.25 billion unique 3 player single deck hands, and over 64 billion unique hands in double deck 4 player. (I can provide that counting formula if it would be helpful) Needless to say that is a fairly large space to brute force over.
Pinochle is played with a 48 card deck (single deck) or 80 card deck (double deck). The deck contains two aces, kings, queens, jacks, tens, nines in each suit. Double deck is the same but the nines are removed. The game has three distinct phases. First people bid for the right to declare trump. The player who bids the highest earns the right to declare trump, but if they don't earn at least that many points during the round they have their bid deducted from their previous score (before the round started). The next phase is the meld phase where players lay down combinations of cards which are worth points.
The values of the melds are (single, double, triple, quadruple):
A, K, Q, J, 10 of trump suit (run) (15, 150, 300, 450) K, Q of trump (royal marriage) (4, 8, 12, 16) K, Q of any other suit (marriage) (2, 4, 6, 8) Nine of trump (1, 2, 3, 4) A♠, A♥, A♦, A♣ (10, 100, 200, 300) K♠, K♥, K♦, K♣ (8, 80, 160, 240) Q♠, Q♥, Q♦, Q♣ (6, 60, 120, 180) J♠, J♥, J♦, J♣ (4, 40, 80, 120 Q♠, J♦ (aka pinochle) (4, 30, 60, 90)
Note: Meld point values vary based on house rules, but the essential pattern is similar
The final phase is the trick phase where players earn points by capturing other players cards (gross oversimplification but good enough for now).
*: Click header for more detailed description