To answer your first question, there are 2598960 ways to choose 5 cards out of 52 for the initial hand. On the draw there are 1, 47, 1081, 16215, 178365, or 1533939 ways to draw the replacement cards, depending on how many card the player holds. The least common denominator for these numbers is 7669695. The actual combinations are weighted to get a total of 7669695. So the total number of combinations is 2,596,960*7,669,695=19,933,230,517,200. To answer your second question video poker machines simply pick numbers at random from 1 to 52 and assign them to a card. The random number generators themselves are very complicated but the object is simple.