madplaysHD/Hearthstone — pull request #1 by johndeyrup (2014-10-18 10:55:41+00:00)
Title: Update chanceOfCardDraw.py

Your algorithm does not return the correct results. If you have one card in your deck the correct result should be 1/30 not 29/30 (odds of drawing a specific card = number of specific cards in the deck/total number of cards). Also your algorithm will not even run with 1 card. Additionally it doesn't make sense to think about the game in turns the way you coded. If you want to think about in turns,you need to know if the player is first or second. If they are first they draw 3 cards on turn 0, and one card on each turn. If they are second they draw 4 cards on turn 0.

Basically your program is returning the odds of not drawing a card.

The above algorithm is a much faster way to calculate the number of cards in your deck. Your algorithm basically has much greater than >n^2 complexity whereas this algorithm has at most 17n.

It is not useful to calculate probabilities for cards amounts greater than what the game allows.