Odds of having or drawing a particular card in the early parts of a Magic the Gathering card game.

Numbers are high, due to double accounting for multiple cards drawn on same deal. I've also yet to make it a little more flexible with regard to the size of the opening hand. I'll try to fix that. For details, see this blog entry.

Note: this page is in very raw data form, meant for data analysis, not for presentation. I'll try to work on that too.

Opening hand 46.85%    (first seven cards)
Draw one: 53.67%
Draw two: 60.42%
Draw three: 67.00%
Draw four: 73.59%
Draw five: 80.09%
Draw six: 86.70%
Draw seven: 93.35%
Draw eight: 100.06%
Draw nine: 106.73%
Draw ten: 113.40%

Change Numbers:

Total Deck Size:

Cards in Deck:

Source:

License: You may use, modify, and redistribute this code, provided that you:
1) obtain my consent,
2) notify me of your improvements, and
3) give credit as such "[original] code by Tollie Williams."

Creative Commons License
odds of drawing a given card by Tollie Williams is licensed under a Creative Commons Attribution-No Derivative Works 3.0 United States License.
Permissions beyond the scope of this license may be available at http://www.tollie.org.

    $times = 30000;
    $deck = 60;
    $cards = 4;

    for ($z=0; $z < $deck; $z++) {$allTime[$z]=0;}

    for ($j=1; $j <= $times ; $j++) { 
       $cardsLeft = $cards;

       for ($i=$deck; $i > 0 ; $i--) { 
          $pick[$deck-$i] = rand(1,$i);
          if ($pick[$deck-$i] <= $cardsLeft) {
             $cardsLeft--;
             $allTime[$deck-$i]++;
          }
       }

       $l = 0;
       foreach ($allTime as $k) {
          $l++;
          if ($j == $times) {
             if ($l<=7) {$openingHand = $openingHand + $k;}
             if ($l<=8) { $plusOne = $plusOne + $k;}
             if ($l<=9) { $plusTwo = $plusTwo + $k;}
             if ($l<=10) { $plusThree = $plusThree + $k;}
             if ($l<=11) { $plusFour = $plusFour + $k;}
             if ($l<=12) { $plusFive = $plusFive + $k;}
             if ($l<=13) { $plusSix = $plusSix + $k;} 
             if ($l<=14) { $plusSeven = $plusSeven + $k;} 
             if ($l<=15) { $plusEight = $plusEight + $k;} 
             if ($l<=16) { $plusNine = $plusNine + $k;} 
             if ($l<=17) { $plusTen = $plusTen + $k;} 
          }
       }

       if ($j == $times) {
          echo "Opening hand: "; printf ("%01.2f", 100 * $openingHand / ($j)); echo "% <br />";
          echo "Draw one: "; printf ("%01.2f", 100 * $plusOne / ($j)); echo "% <br />";
          echo "Draw two: "; printf ("%01.2f", 100 * $plusTwo / ($j)); echo "% <br />";
          echo "Draw three: "; printf ("%01.2f", 100 * $plusThree / ($j)); echo "% <br />";   
          echo "Draw four: "; printf ("%01.2f", 100 * $plusFour / ($j)); echo "% <br />";   
          echo "Draw five: "; printf ("%01.2f", 100 * $plusFive / ($j)); echo "% <br />";   
          echo "Draw six: "; printf ("%01.2f", 100 * $plusSix / ($j)); echo "% <br />";   
          echo "Draw seven: "; printf ("%01.2f", 100 * $plusSeven / ($j)); echo "% <br />";   
          echo "Draw eight: "; printf ("%01.2f", 100 * $plusEight / ($j)); echo "% <br />";   
          echo "Draw nine: "; printf ("%01.2f", 100 * $plusNine / ($j)); echo "% <br />";   
          echo "Draw ten: "; printf ("%01.2f", 100 * $plusTen / ($j)); echo "% <br />";   
       }
    }