Twos

Published November 10, 2022 on Chandler Swift's Blog Source


Twos is one of my favorite card games. (I’ve never been able to find reference to the game outside my friend circle, so if this is a game that’s known by other names, please let me know!)

Full rules...

Here are the rules, as I was originally taught.

Twos is played with three players. A standard deck of playing cards (no jokers) is shuffled, and each player is dealt thirteen cards. (One hand of thirteen cards is left out of play, which helps reduce the effectiveness of card counting.)

The object of the game is to be the first to run out of cards.

Each card has a distinct value. Aces and twos are high (twos being the highest card in the game, hence the name). Within each rank, hearts are worth more than diamonds, which are worth more than clubs, which are worth more than spades.

The player with the lowest valued card (generally the three of spades, unless it was in the undealt hand this round) starts the first trick.

A trick begins with the player either playing 1, 2, 3, 4 of the same rank, or a run of 3 or more (optionally of the same suit). Subsequent players need to play a higher value (using the highest-value cards to compare) of the same pattern; for example, if the first player played a three of spades and a three of diamonds, the second player could play any other pair: the remaining threes include a three of hearts, which outvalues the three of diamonds, and any other pair outvalues the threes. Or, if the first player plays a run of three ending in a six of diamonds, subsequent players would continue the trick with a run of three, ending in a six of hearts or a seven or higher. This continues until no player can (or chooses – a player can pass if they are able to but do not wish to continue) to outdo the previous player. The player who put down the highest-valued card(s) then sets up the next trick.

The one exception to following the pattern is the “bomb”, which can either consist of a multiple run (e.g. two threes, two fours, and two fives), or a four of a kind. A bomb beats any other set of cards played, except a higher-valued bomb. For example, if the first player leads with a single three of spades, and the second player immediately escalates to a two of hearts, the third player can only continue play using a bomb, since no single card can beat a two of hearts, the highest-valued card. A bomb consisting of a double run of three can be beaten by a double run of three with a higher top-valued card than in the other double run, or by a four-of-a-kind bomb. (For a discussion of higher-valued bombs, see below.)

Play continues until the first player runs out of cards; that player wins.

Käthe and Isaac and I played a few rounds of Twos last night. After Käthe called it for the night, Isaac and I tried adjusting the rules for two players. We decided to try out much larger hands, with two players each being dealt twenty cards.

This ended up being totally insane! The first round Isaac led with a full run of 13 cards: 3-4-5-6-7-8-9-10-J-Q-K-A-2, with the two of spades. I immediately countered with an equivalent run with the two of clubs. This was definitely anomalous, but not wildly so when playing with hands that large.

The largest issue we ran into was that we were seeing multiple bombs each round, and of much higher magnitudes than usual. A double run of three occurred roughly once per round; a four-of-a-kind every second or third round; and it wasn’t uncommon to see a triple run of three, or a double run of four, five, or (once) six! This led to some questions: Does a four of a kind beat a double run of three? of four? of five? Where do triple runs fall in?

Based on our intuition after playing probably twenty or so rounds with the 20-card hands, Isaac and I settled on this ordering for bomb strength, ordered from weakest to strongest:

  1. Double run of three
  2. Four-of-a-kind
  3. Double run of four
  4. Double run of five
  5. Triple run of three
  6. Double run of six

If pressed, we’d probably continue that list with

  1. Triple run of four
  2. Double run of seven
  3. Quadruple run of three
  4. Triple run of five
  5. Triple run of six
  6. Quadruple run of four

although we never ran into any of those, and we can’t say with any certainty which are most/least likely to occur.

But those were just guesses, and we were more or less making it up as we went along. To solidify these answers a bit, I wrote a short simulator in Rust that deals hands of varying sizes from a 52-card deck1, and records the frequency that a hand contains each type of bomb.

Source code (Rust)

Running through ten million hands takes about a minute on my computer. I highly suggest cargo run --release; --debug is substantially slower.

use std::collections::HashMap;

use rand::{seq::SliceRandom, thread_rng};

const HANDS_TO_TRY: u32 = 10_000_000;
const HAND_SIZE: u8 = 13; // See also: 20

fn contains_run_of(card_count_by_rank: &HashMap<u8, u8>, width: u8, length: u8) -> bool {
    for starting_rank in 1..=(13 - length + 1) {
        let mut is_run = true;
        for i in 0..length {
            if card_count_by_rank[&(starting_rank + i)] < width {
                is_run = false;
                break;
            }
        }
        if is_run {
            return true;
        }
    }
    false
}

fn check_for_bombs(hand: &[u8], hands_with_bombs: &mut HashMap<(u8, u8), u64>) {
    let mut card_count_by_rank = HashMap::new();
    for rank in 1..=13 {
        card_count_by_rank.insert(rank, 0);
    }
    for card in hand {
        card_count_by_rank
            .entry(*card)
            .and_modify(|count| *count += 1);
    }

    for width in 1..=4 {
        for length in 1..=13 {
            if contains_run_of(&card_count_by_rank, width, length) {
                hands_with_bombs
                    .entry((width, length))
                    .and_modify(|count| *count += 1);
            }
        }
    }
}

fn main() {
    // Construct a 52-card deck
    let mut deck = Vec::new();
    for _suit in 0..4 {
        for rank in 1..=13 {
            deck.push(rank);
        }
    }

    let mut hands_with_bombs = HashMap::new();
    for width in 1..=4 {
        for length in 1..=13 {
            hands_with_bombs.insert((width, length), 0);
        }
    }

    let mut rng = thread_rng();

    let hands_per_round = 52 / HAND_SIZE;

    for i in 0..(HANDS_TO_TRY / hands_per_round as u32) {
        if i * hands_per_round as u32 % 10000 == 0 {
            println!("Checking {}", i * hands_per_round as u32);
        }

        deck.shuffle(&mut rng);

        // Deal cards
        let mut hands = Vec::new();
        for i in 0..hands_per_round {
            hands.push(&deck[(HAND_SIZE * i) as usize..(HAND_SIZE * (i + 1)) as usize]);
        }

        for hand in hands {
            check_for_bombs(hand, &mut hands_with_bombs);
        }
    }

    let mut results = Vec::from_iter(hands_with_bombs.iter());
    results.sort_by(|a, b| a.1.cmp(b.1));

    for ((width, length), result) in results {
        if *result > 0 {
            println!("{}x{}: {}", width, length, result);
        }
    }
}

Given that an n×m run is a run n cards wide and m cards long (e.g. 4 4 5 5 6 6 7 7 would be a 2x4 run), in ten million hands you would expect to see this many of each of the following runs:

3x4: 3
2x6: 172
4x2: 219
1x13: 979
3x3: 1124
2x5: 7250
1x12: 10579
1x11: 46448
2x4: 106649
3x2: 126110
1x10: 145179
4x1: 342976
1x9: 367730
1x8: 813649
2x3: 917211
1x7: 1632653
1x6: 3033189
3x1: 4906188
2x2: 5164667
1x5: 5181797
1x4: 7797492
1x3: 9652373
1x2: 9998564
2x1: 9999021
1x1: 10000000

But, of course, not all of those are valid bombs. Here’s just the ones that are valid (that is, two or more wide and three or more long, plus the 4-of-a-kind bomb).

3x4: 3
2x6: 172
3x3: 1124
2x5: 7250
2x4: 106649
4x1: 342976
2x3: 917211

For 20-card hands (again, the number of hands that contain at least one of this type of bomb, out of 10 million hands):

2x10: 24
4x3: 62
3x5: 169
2x9: 931
3x4: 7829
2x8: 10502
4x2: 20085
2x7: 63317
3x3: 159321
2x6: 274643
1x13: 897647
2x5: 950825
1x12: 1405553
3x2: 1965803
1x11: 2059459
4x1: 2198049
2x4: 2767478
1x10: 2882221
1x9: 3899799
1x8: 5141079
2x3: 6482887
1x7: 6634212
1x6: 8161395
1x5: 9281048
3x1: 9567731
2x2: 9783220
1x4: 9874388
1x3: 9996418
1x2: 10000000
1x1: 10000000
2x1: 10000000

Filtered to just valid bombs:

2x10: 24
4x3: 62
3x5: 169
2x9: 931
3x4: 7829
2x8: 10502
2x7: 63317
3x3: 159321
2x6: 274643
2x5: 950825
4x1: 2198049
2x4: 2767478
2x3: 6482887

With this in mind, our original proposal stands pretty well with the numbers we found. For hands of 13 our original list was entirely correct; from most to least likely:

  1. Double run of three
  2. Four-of-a-kind
  3. Double run of four
  4. Double run of five
  5. Triple run of three
  6. Double run of six

For twenty-card hands, though, this doesn’t hold. I hadn’t considered this, but in hindsight it seems obvious: bigger hands will increase the expected length of runs (e.g. getting a 1x13 run is horribly improbable in a thirteen-card hand, but fairly likely in a twenty-card hand) more than the width of them (e.g. I’ll never see a five-of-a-kind dealt out of a standard deck, no matter how large the hands are!). So for larger hands the order changes up a bit, with a double run of four becoming more likely than a four of a kind.


  1. Another interesting problem would be drawing hands with replacement. Not that you would actually draw hands with replacement, but often we play card games like Twos with a deck made of the remains of lots of old, partially-complete decks. With sufficiently many decks, this ends up (1) alleviating a lot of the shuffling, and (2) effectively being an infinite deck to draw from. (And, of course making card counting effectively impossible!) I didn’t do the math on this, though, but if you do, please let me know what you find! ↩︎


I don't have a formal commenting system set up. If you have questions or comments about anything I've written, send me an email and I'd be delighted to hear what you have to say!