Skip to content

Instantly share code, notes, and snippets.

@vivaria
Last active September 30, 2025 14:37
Show Gist options
  • Select an option

  • Save vivaria/c395819c9a29f6e1942057e78b280490 to your computer and use it in GitHub Desktop.

Select an option

Save vivaria/c395819c9a29f6e1942057e78b280490 to your computer and use it in GitHub Desktop.
sample calculations for upstart goblin

counting opening 6-card hands that result in at least one lonefire blossom (as an example)

this is just to show that the 37-card approximation is close enough to the 40-card probabilities that it can be used in other calculations (e.g. my hand simulator: https://github.com/vivaria/hand-simulator)

obviously the actual lonefire % is much more complicated due to multiple different combos, but that's covered in the hand simulator.

# 40-card deck method w/redraws
- number of opening hands (40 choose 6):                               3,838,380
- number of 6-card hands with 1 or 2 lonefire (regardless of upstart): 1,077,699
- number of 6-card hands with 0 lonefire AND exactly 1 upstart:          973,896
    - redrawing 1 card from 34 card deck: 
        - 2/34 are lonefire
        - 2/34 are upstart (redraw 1 from 33 card deck)
            - 2/33 are lonefire
            - 1/33 is upstart (redraw 1 from 32 card deck)
                - 2/32 are lonefire
- number of 6-card hands with 0 lonefire AND exactly 2 upstart:          157,080
    - redrawing 2 cards from 34 card deck: 
        - 65/561 have lonefire
        - 33/561 have upstart (redraw 1 from 32 card deck)
            - 2/32 are lonefire
- number of 6-card hands with 0 lonefire AND exactly 3 upstart:            6,545
    - redrawing 3 cards from 34 card deck: 
        - 1,024/5,984 have lonefire
          
effective hands with lonefire: 
   1,077,699                                    # 1 or 2 lonefires (opening 6)
 +   973,896                   * (2/34)         # 1 upstart (no lone)                           -> lonefire
 +   973,896 * (2/34)          * (2/33)         # 1 upstart (no lone) -> 1 upstart              -> lonefire
 +   973,896 * (2/34) * (1/33) * (2/32)         # 1 upstart (no lone) -> 1 upstart -> 1 upstart -> lonefire
 +   157,080                   * (65/561)       # 2 upstart (no lone)                           -> lonefire
 +   157,080 * (33/561)        * (2/32)         # 2 upstart (no lone) -> 1 upstart              -> lonefire
 +     6,545                   * (1,024/5,984)  # 3 upstart (no lone)                           -> lonefire
 --------------------------------------
   1,077,699
 +    80,766 (result of above calculation, i.e. 7.1% of "1-3 upstart" openers will redraw into a lonefire)
 --------------------------------------
   1,158,465
 / 3,838,380 total hands
 --------------------------------------
   30.181092 % of hands contain lonefire blossom
# 37-card deck method (without redraws)
- number of opening hands (37 choose 6):  2,324,784
- number of 6-card hands with lonefire:     701,624

     701,624
 / 2,324,784
 -----------
   30.180180 % of hands contain lonefire blossom

So, even though the "37 card" method has a completely different denominator, the percentage to draw a given card (e.g. lonefire blossom) comes out to roughly the same amount (30.18%), making the 37-card method a close enough approximation for our purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment